net/virtio: fix incorrect cast of void *
[dpdk.git] / drivers / net / i40e / i40e_ethdev.c
index f40c463..811cc9f 100644 (file)
@@ -43,6 +43,7 @@
 #include <rte_eal.h>
 #include <rte_string_fns.h>
 #include <rte_pci.h>
+#include <rte_bus_pci.h>
 #include <rte_ether.h>
 #include <rte_ethdev.h>
 #include <rte_ethdev_pci.h>
@@ -276,7 +277,7 @@ static int i40e_vlan_filter_set(struct rte_eth_dev *dev,
 static int i40e_vlan_tpid_set(struct rte_eth_dev *dev,
                              enum rte_vlan_type vlan_type,
                              uint16_t tpid);
-static void i40e_vlan_offload_set(struct rte_eth_dev *dev, int mask);
+static int i40e_vlan_offload_set(struct rte_eth_dev *dev, int mask);
 static void i40e_vlan_strip_queue_set(struct rte_eth_dev *dev,
                                      uint16_t queue,
                                      int on);
@@ -1100,7 +1101,6 @@ eth_i40e_dev_init(struct rte_eth_dev *dev)
        intr_handle = &pci_dev->intr_handle;
 
        rte_eth_copy_pci_info(dev, pci_dev);
-       dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
        pf->adapter = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
        pf->adapter->eth_dev = dev;
@@ -3221,7 +3221,7 @@ i40e_vlan_tpid_set(struct rte_eth_dev *dev,
        return ret;
 }
 
-static void
+static int
 i40e_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 {
        struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
@@ -3254,6 +3254,8 @@ i40e_vlan_offload_set(struct rte_eth_dev *dev, int mask)
                else
                        i40e_vsi_config_double_vlan(vsi, FALSE);
        }
+
+       return 0;
 }
 
 static void
@@ -3840,7 +3842,7 @@ i40e_allocate_dma_mem_d(__attribute__((unused)) struct i40e_hw *hw,
 
        mem->size = size;
        mem->va = mz->addr;
-       mem->pa = mz->phys_addr;
+       mem->pa = mz->iova;
        mem->zone = (const void *)mz;
        PMD_DRV_LOG(DEBUG,
                "memzone %s allocated with physical address: %"PRIu64,
@@ -5314,7 +5316,11 @@ i40e_dev_init_vlan(struct rte_eth_dev *dev)
 
        /* Apply vlan offload setting */
        mask = ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK;
-       i40e_vlan_offload_set(dev, mask);
+       ret = i40e_vlan_offload_set(dev, mask);
+       if (ret) {
+               PMD_DRV_LOG(INFO, "Failed to update vlan offload");
+               return ret;
+       }
 
        /* Apply double-vlan setting, not implemented yet */
 
@@ -9347,7 +9353,7 @@ i40e_pctype_to_flowtype(const struct i40e_adapter *adapter,
 
 /* For both X710 and XL710 */
 #define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE_1     0x10000200
-#define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE_2     0x20000200
+#define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE_2     0x203F0200
 #define I40E_GL_SWR_PRI_JOIN_MAP_0             0x26CE00
 
 #define I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x011f0200
@@ -11070,7 +11076,7 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
        struct rte_pmd_i40e_ptype_info *ptype;
        uint32_t buff_size;
        uint8_t proto_id;
-       char name[16];
+       char name[RTE_PMD_I40E_DDP_NAME_SIZE];
        uint32_t i, j, n;
        bool inner_ip;
        int ret;
@@ -11131,30 +11137,32 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
                                        ptype_mapping[i].sw_ptype |=
                                                RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
                                        inner_ip = true;
-                               } else if (!strncmp(name, "IPV4", 4) &&
+                               } else if (!strncmp(name, "IPV4FRAG", 8) &&
                                           inner_ip) {
                                        ptype_mapping[i].sw_ptype |=
                                            RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN;
-                               } else if (!strncmp(name, "IPV6", 4) &&
-                                          !inner_ip) {
+                                       ptype_mapping[i].sw_ptype |=
+                                               RTE_PTYPE_INNER_L4_FRAG;
+                               } else if (!strncmp(name, "IPV4", 4) &&
+                                          inner_ip)
+                                       ptype_mapping[i].sw_ptype |=
+                                           RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN;
+                               else if (!strncmp(name, "IPV6", 4) &&
+                                        !inner_ip) {
                                        ptype_mapping[i].sw_ptype |=
                                                RTE_PTYPE_L3_IPV6_EXT_UNKNOWN;
                                        inner_ip = true;
-                               } else if (!strncmp(name, "IPV6", 4) &&
+                               } else if (!strncmp(name, "IPV6FRAG", 8) &&
                                           inner_ip) {
                                        ptype_mapping[i].sw_ptype |=
                                            RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN;
-                               } else if (!strncmp(name, "IPV4FRAG", 8)) {
-                                       ptype_mapping[i].sw_ptype |=
-                                           RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN;
                                        ptype_mapping[i].sw_ptype |=
                                                RTE_PTYPE_INNER_L4_FRAG;
-                               } else if (!strncmp(name, "IPV6FRAG", 8)) {
+                               } else if (!strncmp(name, "IPV6", 4) &&
+                                          inner_ip)
                                        ptype_mapping[i].sw_ptype |=
                                            RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN;
-                                       ptype_mapping[i].sw_ptype |=
-                                               RTE_PTYPE_INNER_L4_FRAG;
-                               } else if (!strncmp(name, "GTPC", 4))
+                               else if (!strncmp(name, "GTPC", 4))
                                        ptype_mapping[i].sw_ptype |=
                                                RTE_PTYPE_TUNNEL_GTPC;
                                else if (!strncmp(name, "GTPU", 4))