pci: make device id tables const
[dpdk.git] / lib / librte_pmd_ixgbe / ixgbe_ethdev.c
index 92d75db..366aa45 100644 (file)
@@ -297,7 +297,7 @@ static int ixgbevf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu);
 /*
  * The set of PCI devices this driver supports
  */
-static struct rte_pci_id pci_id_ixgbe_map[] = {
+static const struct rte_pci_id pci_id_ixgbe_map[] = {
 
 #define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
 #include "rte_pci_dev_ids.h"
@@ -309,7 +309,7 @@ static struct rte_pci_id pci_id_ixgbe_map[] = {
 /*
  * The set of PCI devices this driver supports (for 82599 VF)
  */
-static struct rte_pci_id pci_id_ixgbevf_map[] = {
+static const struct rte_pci_id pci_id_ixgbevf_map[] = {
 
 #define RTE_PCI_DEV_ID_DECL_IXGBEVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
 #include "rte_pci_dev_ids.h"
@@ -317,7 +317,7 @@ static struct rte_pci_id pci_id_ixgbevf_map[] = {
 
 };
 
-static struct eth_dev_ops ixgbe_eth_dev_ops = {
+static const struct eth_dev_ops ixgbe_eth_dev_ops = {
        .dev_configure        = ixgbe_dev_configure,
        .dev_start            = ixgbe_dev_start,
        .dev_stop             = ixgbe_dev_stop,
@@ -387,8 +387,7 @@ static struct eth_dev_ops ixgbe_eth_dev_ops = {
  * dev_ops for virtual function, bare necessities for basic vf
  * operation have been implemented
  */
-static struct eth_dev_ops ixgbevf_eth_dev_ops = {
-
+static const struct eth_dev_ops ixgbevf_eth_dev_ops = {
        .dev_configure        = ixgbevf_dev_configure,
        .dev_start            = ixgbevf_dev_start,
        .dev_stop             = ixgbevf_dev_stop,
@@ -1645,6 +1644,7 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
 
        /* Clear stored conf */
        dev->data->scattered_rx = 0;
+       dev->data->lro = 0;
 
        /* Clear recorded link status */
        memset(&link, 0, sizeof(link));
@@ -2013,6 +2013,16 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
                DEV_RX_OFFLOAD_IPV4_CKSUM |
                DEV_RX_OFFLOAD_UDP_CKSUM  |
                DEV_RX_OFFLOAD_TCP_CKSUM;
+
+       /*
+        * RSC is only supported by 82599 and x540 PF devices in a non-SR-IOV
+        * mode.
+        */
+       if ((hw->mac.type == ixgbe_mac_82599EB ||
+            hw->mac.type == ixgbe_mac_X540) &&
+           !RTE_ETH_DEV_SRIOV(dev).active)
+               dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_TCP_LRO;
+
        dev_info->tx_offload_capa =
                DEV_TX_OFFLOAD_VLAN_INSERT |
                DEV_TX_OFFLOAD_IPV4_CKSUM  |
@@ -3882,10 +3892,10 @@ ixgbe_add_5tuple_filter(struct rte_eth_dev *dev,
        ftqf |= IXGBE_FTQF_POOL_MASK_EN;
        ftqf |= IXGBE_FTQF_QUEUE_ENABLE;
 
-       IXGBE_WRITE_REG(hw, IXGBE_DAQF(idx), filter->filter_info.dst_ip);
-       IXGBE_WRITE_REG(hw, IXGBE_SAQF(idx), filter->filter_info.src_ip);
-       IXGBE_WRITE_REG(hw, IXGBE_SDPQF(idx), sdpqf);
-       IXGBE_WRITE_REG(hw, IXGBE_FTQF(idx), ftqf);
+       IXGBE_WRITE_REG(hw, IXGBE_DAQF(i), filter->filter_info.dst_ip);
+       IXGBE_WRITE_REG(hw, IXGBE_SAQF(i), filter->filter_info.src_ip);
+       IXGBE_WRITE_REG(hw, IXGBE_SDPQF(i), sdpqf);
+       IXGBE_WRITE_REG(hw, IXGBE_FTQF(i), ftqf);
 
        l34timir |= IXGBE_L34T_IMIR_RESERVE;
        l34timir |= (uint32_t)(filter->queue <<