ethdev: move bypass functions to ixgbe PMD
[dpdk.git] / drivers / net / ixgbe / ixgbe_ethdev.c
index 8a0c0a7..504e951 100644 (file)
@@ -183,18 +183,19 @@ static int ixgbe_dev_xstats_get(struct rte_eth_dev *dev,
 static int ixgbevf_dev_xstats_get(struct rte_eth_dev *dev,
                                  struct rte_eth_xstat *xstats, unsigned n);
 static int
-ixgbe_dev_xstats_get_by_ids(struct rte_eth_dev *dev, uint64_t *ids,
+ixgbe_dev_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
                uint64_t *values, unsigned int n);
 static void ixgbe_dev_stats_reset(struct rte_eth_dev *dev);
 static void ixgbe_dev_xstats_reset(struct rte_eth_dev *dev);
-static int ixgbe_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
-       struct rte_eth_xstat_name *xstats_names, __rte_unused unsigned limit);
-static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
-       struct rte_eth_xstat_name *xstats_names, __rte_unused unsigned limit);
-static int ixgbe_dev_xstats_get_names_by_ids(
-       __rte_unused struct rte_eth_dev *dev,
+static int ixgbe_dev_xstats_get_names(struct rte_eth_dev *dev,
        struct rte_eth_xstat_name *xstats_names,
-       uint64_t *ids,
+       unsigned int size);
+static int ixgbevf_dev_xstats_get_names(struct rte_eth_dev *dev,
+       struct rte_eth_xstat_name *xstats_names, unsigned limit);
+static int ixgbe_dev_xstats_get_names_by_id(
+       struct rte_eth_dev *dev,
+       struct rte_eth_xstat_name *xstats_names,
+       const uint64_t *ids,
        unsigned int limit);
 static int ixgbe_dev_queue_stats_mapping_set(struct rte_eth_dev *eth_dev,
                                             uint16_t queue_id,
@@ -247,8 +248,8 @@ static int ixgbe_dev_interrupt_action(struct rte_eth_dev *dev,
                                      struct rte_intr_handle *handle);
 static void ixgbe_dev_interrupt_handler(void *param);
 static void ixgbe_dev_interrupt_delayed_handler(void *param);
-static void ixgbe_add_rar(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
-               uint32_t index, uint32_t pool);
+static int ixgbe_add_rar(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
+                        uint32_t index, uint32_t pool);
 static void ixgbe_remove_rar(struct rte_eth_dev *dev, uint32_t index);
 static void ixgbe_set_default_mac_addr(struct rte_eth_dev *dev,
                                           struct ether_addr *mac_addr);
@@ -304,9 +305,9 @@ static void ixgbe_configure_msix(struct rte_eth_dev *dev);
 static int ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
                uint16_t queue_idx, uint16_t tx_rate);
 
-static void ixgbevf_add_mac_addr(struct rte_eth_dev *dev,
-                                struct ether_addr *mac_addr,
-                                uint32_t index, uint32_t pool);
+static int ixgbevf_add_mac_addr(struct rte_eth_dev *dev,
+                               struct ether_addr *mac_addr,
+                               uint32_t index, uint32_t pool);
 static void ixgbevf_remove_mac_addr(struct rte_eth_dev *dev, uint32_t index);
 static void ixgbevf_set_default_mac_addr(struct rte_eth_dev *dev,
                                             struct ether_addr *mac_addr);
@@ -480,7 +481,7 @@ static const struct rte_pci_id pci_id_ixgbe_map[] = {
        { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_1G_T_L) },
        { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KX4) },
        { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KR) },
-#ifdef RTE_NIC_BYPASS
+#ifdef RTE_LIBRTE_IXGBE_BYPASS
        { RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_BYPASS) },
 #endif
        { .vendor_id = 0, /* sentinel */ },
@@ -531,11 +532,11 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = {
        .link_update          = ixgbe_dev_link_update,
        .stats_get            = ixgbe_dev_stats_get,
        .xstats_get           = ixgbe_dev_xstats_get,
-       .xstats_get_by_ids    = ixgbe_dev_xstats_get_by_ids,
+       .xstats_get_by_id     = ixgbe_dev_xstats_get_by_id,
        .stats_reset          = ixgbe_dev_stats_reset,
        .xstats_reset         = ixgbe_dev_xstats_reset,
        .xstats_get_names     = ixgbe_dev_xstats_get_names,
-       .xstats_get_names_by_ids = ixgbe_dev_xstats_get_names_by_ids,
+       .xstats_get_names_by_id = ixgbe_dev_xstats_get_names_by_id,
        .queue_stats_mapping_set = ixgbe_dev_queue_stats_mapping_set,
        .fw_version_get       = ixgbe_fw_version_get,
        .dev_infos_get        = ixgbe_dev_info_get,
@@ -574,17 +575,6 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = {
        .set_queue_rate_limit = ixgbe_set_queue_rate_limit,
        .reta_update          = ixgbe_dev_rss_reta_update,
        .reta_query           = ixgbe_dev_rss_reta_query,
-#ifdef RTE_NIC_BYPASS
-       .bypass_init          = ixgbe_bypass_init,
-       .bypass_state_set     = ixgbe_bypass_state_store,
-       .bypass_state_show    = ixgbe_bypass_state_show,
-       .bypass_event_set     = ixgbe_bypass_event_store,
-       .bypass_event_show    = ixgbe_bypass_event_show,
-       .bypass_wd_timeout_set  = ixgbe_bypass_wd_timeout_store,
-       .bypass_wd_timeout_show = ixgbe_bypass_wd_timeout_show,
-       .bypass_ver_show      = ixgbe_bypass_ver_show,
-       .bypass_wd_reset      = ixgbe_bypass_wd_reset,
-#endif /* RTE_NIC_BYPASS */
        .rss_hash_update      = ixgbe_dev_rss_hash_update,
        .rss_hash_conf_get    = ixgbe_dev_rss_hash_conf_get,
        .filter_ctrl          = ixgbe_dev_filter_ctrl,
@@ -1130,7 +1120,7 @@ ixgbe_swfw_lock_reset(struct ixgbe_hw *hw)
 static int
 eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)
 {
-       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(eth_dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
        struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
        struct ixgbe_hw *hw =
                IXGBE_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
@@ -1189,11 +1179,11 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)
        hw->allow_unsupported_sfp = 1;
 
        /* Initialize the shared code (base driver) */
-#ifdef RTE_NIC_BYPASS
+#ifdef RTE_LIBRTE_IXGBE_BYPASS
        diag = ixgbe_bypass_init_shared_code(hw);
 #else
        diag = ixgbe_init_shared_code(hw);
-#endif /* RTE_NIC_BYPASS */
+#endif /* RTE_LIBRTE_IXGBE_BYPASS */
 
        if (diag != IXGBE_SUCCESS) {
                PMD_INIT_LOG(ERR, "Shared code init failed: %d", diag);
@@ -1226,11 +1216,11 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)
                return -EIO;
        }
 
-#ifdef RTE_NIC_BYPASS
+#ifdef RTE_LIBRTE_IXGBE_BYPASS
        diag = ixgbe_bypass_init_hw(hw);
 #else
        diag = ixgbe_init_hw(hw);
-#endif /* RTE_NIC_BYPASS */
+#endif /* RTE_LIBRTE_IXGBE_BYPASS */
 
        /*
         * Devices with copper phys will fail to initialise if ixgbe_init_hw()
@@ -1364,7 +1354,7 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)
 static int
 eth_ixgbe_dev_uninit(struct rte_eth_dev *eth_dev)
 {
-       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(eth_dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
        struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
        struct ixgbe_hw *hw;
 
@@ -1597,7 +1587,7 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)
 {
        int diag;
        uint32_t tc, tcs;
-       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(eth_dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
        struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
        struct ixgbe_hw *hw =
                IXGBE_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
@@ -1746,7 +1736,7 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)
 static int
 eth_ixgbevf_dev_uninit(struct rte_eth_dev *eth_dev)
 {
-       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(eth_dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
        struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
        struct ixgbe_hw *hw;
 
@@ -2175,7 +2165,7 @@ ixgbe_vmdq_vlan_hw_filter_enable(struct rte_eth_dev *dev)
 static int
 ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)
 {
-       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 
        switch (nb_rx_q) {
        case 1:
@@ -2424,7 +2414,7 @@ ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
        uint16_t total_rate = 0;
        struct rte_pci_device *pci_dev;
 
-       pci_dev = IXGBE_DEV_TO_PCI(dev);
+       pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        rte_eth_link_get_nowait(dev->data->port_id, &link);
 
        if (vf >= pci_dev->max_vfs)
@@ -2495,7 +2485,7 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
                IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
        struct ixgbe_vf_info *vfinfo =
                *IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private);
-       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
        uint32_t intr_vector = 0;
        int err, link_up = 0, negotiate = 0;
@@ -2713,7 +2703,7 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
                IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
        struct ixgbe_vf_info *vfinfo =
                *IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private);
-       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
        int vf;
 
@@ -2773,7 +2763,7 @@ ixgbe_dev_set_link_up(struct rte_eth_dev *dev)
        struct ixgbe_hw *hw =
                IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
        if (hw->mac.type == ixgbe_mac_82599EB) {
-#ifdef RTE_NIC_BYPASS
+#ifdef RTE_LIBRTE_IXGBE_BYPASS
                if (hw->device_id == IXGBE_DEV_ID_82599_BYPASS) {
                        /* Not suported in bypass mode */
                        PMD_INIT_LOG(ERR, "Set link up is not supported "
@@ -2803,7 +2793,7 @@ ixgbe_dev_set_link_down(struct rte_eth_dev *dev)
        struct ixgbe_hw *hw =
                IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
        if (hw->mac.type == ixgbe_mac_82599EB) {
-#ifdef RTE_NIC_BYPASS
+#ifdef RTE_LIBRTE_IXGBE_BYPASS
                if (hw->device_id == IXGBE_DEV_ID_82599_BYPASS) {
                        /* Not suported in bypass mode */
                        PMD_INIT_LOG(ERR, "Set link down is not supported "
@@ -3137,7 +3127,7 @@ ixgbe_xstats_calc_num(void) {
 }
 
 static int ixgbe_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
-       struct rte_eth_xstat_name *xstats_names, __rte_unused unsigned limit)
+       struct rte_eth_xstat_name *xstats_names, __rte_unused unsigned int size)
 {
        const unsigned cnt_stats = ixgbe_xstats_calc_num();
        unsigned stat, i, count;
@@ -3192,10 +3182,10 @@ static int ixgbe_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
        return cnt_stats;
 }
 
-static int ixgbe_dev_xstats_get_names_by_ids(
-       __rte_unused struct rte_eth_dev *dev,
+static int ixgbe_dev_xstats_get_names_by_id(
+       struct rte_eth_dev *dev,
        struct rte_eth_xstat_name *xstats_names,
-       uint64_t *ids,
+       const uint64_t *ids,
        unsigned int limit)
 {
        if (!ids) {
@@ -3256,7 +3246,7 @@ static int ixgbe_dev_xstats_get_names_by_ids(
        uint16_t size = ixgbe_xstats_calc_num();
        struct rte_eth_xstat_name xstats_names_copy[size];
 
-       ixgbe_dev_xstats_get_names_by_ids(dev, xstats_names_copy, NULL,
+       ixgbe_dev_xstats_get_names_by_id(dev, xstats_names_copy, NULL,
                        size);
 
        for (i = 0; i < limit; i++) {
@@ -3361,7 +3351,7 @@ ixgbe_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 }
 
 static int
-ixgbe_dev_xstats_get_by_ids(struct rte_eth_dev *dev, uint64_t *ids,
+ixgbe_dev_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
                uint64_t *values, unsigned int n)
 {
        if (!ids) {
@@ -3439,7 +3429,7 @@ ixgbe_dev_xstats_get_by_ids(struct rte_eth_dev *dev, uint64_t *ids,
        uint16_t size = ixgbe_xstats_calc_num();
        uint64_t values_copy[size];
 
-       ixgbe_dev_xstats_get_by_ids(dev, NULL, values_copy, size);
+       ixgbe_dev_xstats_get_by_id(dev, NULL, values_copy, size);
 
        for (i = 0; i < n; i++) {
                if (ids[i] >= size) {
@@ -3581,7 +3571,7 @@ ixgbe_fw_version_get(struct rte_eth_dev *dev, char *fw_version, size_t fw_size)
 static void
 ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 {
-       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
        struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
 
@@ -3723,7 +3713,7 @@ static void
 ixgbevf_dev_info_get(struct rte_eth_dev *dev,
                     struct rte_eth_dev_info *dev_info)
 {
-       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
        dev_info->pci_dev = pci_dev;
@@ -3798,7 +3788,7 @@ ixgbe_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
        hw->mac.get_link_status = true;
 
        if ((intr->flags & IXGBE_FLAG_NEED_LINK_CONFIG) &&
-               hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) {
+               ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) {
                speed = hw->phy.autoneg_advertised;
                if (!speed)
                        ixgbe_get_link_capabilities(hw, &speed, &autoneg);
@@ -4034,7 +4024,7 @@ ixgbe_dev_interrupt_get_status(struct rte_eth_dev *dev)
 static void
 ixgbe_dev_link_status_print(struct rte_eth_dev *dev)
 {
-       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        struct rte_eth_link link;
 
        memset(&link, 0, sizeof(link));
@@ -4106,14 +4096,15 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev,
                        timeout = IXGBE_LINK_DOWN_CHECK_TIMEOUT;
 
                ixgbe_dev_link_status_print(dev);
-               intr->mask_original = intr->mask;
-               /* only disable lsc interrupt */
-               intr->mask &= ~IXGBE_EIMS_LSC;
                if (rte_eal_alarm_set(timeout * 1000,
                                      ixgbe_dev_interrupt_delayed_handler, (void *)dev) < 0)
                        PMD_DRV_LOG(ERR, "Error setting alarm");
-               else
-                       intr->mask = intr->mask_original;
+               else {
+                       /* remember original mask */
+                       intr->mask_original = intr->mask;
+                       /* only disable lsc interrupt */
+                       intr->mask &= ~IXGBE_EIMS_LSC;
+               }
        }
 
        PMD_DRV_LOG(DEBUG, "enable intr immediately");
@@ -4141,7 +4132,7 @@ static void
 ixgbe_dev_interrupt_delayed_handler(void *param)
 {
        struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
-       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
        struct ixgbe_interrupt *intr =
                IXGBE_DEV_PRIVATE_TO_INTR(dev->data->dev_private);
@@ -4636,14 +4627,15 @@ ixgbe_dev_rss_reta_query(struct rte_eth_dev *dev,
        return 0;
 }
 
-static void
+static int
 ixgbe_add_rar(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
                                uint32_t index, uint32_t pool)
 {
        struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
        uint32_t enable_addr = 1;
 
-       ixgbe_set_rar(hw, index, mac_addr->addr_bytes, pool, enable_addr);
+       return ixgbe_set_rar(hw, index, mac_addr->addr_bytes,
+                            pool, enable_addr);
 }
 
 static void
@@ -4657,9 +4649,11 @@ ixgbe_remove_rar(struct rte_eth_dev *dev, uint32_t index)
 static void
 ixgbe_set_default_mac_addr(struct rte_eth_dev *dev, struct ether_addr *addr)
 {
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
+
        ixgbe_remove_rar(dev, 0);
 
-       ixgbe_add_rar(dev, addr, 0, 0);
+       ixgbe_add_rar(dev, addr, 0, pci_dev->max_vfs);
 }
 
 static bool
@@ -4685,6 +4679,7 @@ ixgbe_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
        struct ixgbe_hw *hw;
        struct rte_eth_dev_info dev_info;
        uint32_t frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
+       struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode;
 
        ixgbe_dev_info_get(dev, &dev_info);
 
@@ -4695,7 +4690,7 @@ ixgbe_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
        /* refuse mtu that requires the support of scattered packets when this
         * feature has not been enabled before.
         */
-       if (!dev->data->scattered_rx &&
+       if (!rx_conf->enable_scatter &&
            (frame_size + 2 * IXGBE_VLAN_TAG_SIZE >
             dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM))
                return -EINVAL;
@@ -4793,7 +4788,7 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
        struct ixgbe_hw *hw =
                IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
        uint32_t intr_vector = 0;
-       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
 
        int err, mask = 0;
@@ -4857,7 +4852,7 @@ static void
 ixgbevf_dev_stop(struct rte_eth_dev *dev)
 {
        struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
 
        PMD_INIT_FUNC_TRACE();
@@ -5330,7 +5325,7 @@ ixgbe_mirror_rule_reset(struct rte_eth_dev *dev, uint8_t rule_id)
 static int
 ixgbevf_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
 {
-       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
        uint32_t mask;
        struct ixgbe_hw *hw =
@@ -5364,7 +5359,7 @@ ixgbevf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id)
 static int
 ixgbe_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
 {
-       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
        uint32_t mask;
        struct ixgbe_hw *hw =
@@ -5489,7 +5484,7 @@ ixgbe_set_ivar_map(struct ixgbe_hw *hw, int8_t direction,
 static void
 ixgbevf_configure_msix(struct rte_eth_dev *dev)
 {
-       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
        struct ixgbe_hw *hw =
                IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -5523,7 +5518,7 @@ ixgbevf_configure_msix(struct rte_eth_dev *dev)
 static void
 ixgbe_configure_msix(struct rte_eth_dev *dev)
 {
-       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
        struct ixgbe_hw *hw =
                IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -5639,7 +5634,7 @@ static int ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
        return 0;
 }
 
-static void
+static int
 ixgbevf_add_mac_addr(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
                     __attribute__((unused)) uint32_t index,
                     __attribute__((unused)) uint32_t pool)
@@ -5653,11 +5648,19 @@ ixgbevf_add_mac_addr(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
         * set of PF resources used to store VF MAC addresses.
         */
        if (memcmp(hw->mac.perm_addr, mac_addr, sizeof(struct ether_addr)) == 0)
-               return;
+               return -1;
        diag = ixgbevf_set_uc_addr_vf(hw, 2, mac_addr->addr_bytes);
-       if (diag == 0)
-               return;
-       PMD_DRV_LOG(ERR, "Unable to add MAC address - diag=%d", diag);
+       if (diag != 0)
+               PMD_DRV_LOG(ERR, "Unable to add MAC address "
+                           "%02x:%02x:%02x:%02x:%02x:%02x - diag=%d",
+                           mac_addr->addr_bytes[0],
+                           mac_addr->addr_bytes[1],
+                           mac_addr->addr_bytes[2],
+                           mac_addr->addr_bytes[3],
+                           mac_addr->addr_bytes[4],
+                           mac_addr->addr_bytes[5],
+                           diag);
+       return diag;
 }
 
 static void
@@ -5953,6 +5956,7 @@ ixgbevf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
 {
        struct ixgbe_hw *hw;
        uint32_t max_frame = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
+       struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode;
 
        hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
@@ -5962,7 +5966,7 @@ ixgbevf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
        /* refuse mtu that requires the support of scattered packets when this
         * feature has not been enabled before.
         */
-       if (!dev->data->scattered_rx &&
+       if (!rx_conf->enable_scatter &&
            (max_frame + 2 * IXGBE_VLAN_TAG_SIZE >
             dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM))
                return -EINVAL;
@@ -7516,7 +7520,7 @@ ixgbe_e_tag_insertion_en_dis(struct rte_eth_dev *dev,
                             struct rte_eth_l2_tunnel_conf *l2_tunnel,
                             bool en)
 {
-       struct rte_pci_device *pci_dev = IXGBE_DEV_TO_PCI(dev);
+       struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        int ret = 0;
        uint32_t vmtir, vmvir;
        struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -7851,7 +7855,7 @@ ixgbevf_dev_allmulticast_disable(struct rte_eth_dev *dev)
 {
        struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
-       hw->mac.ops.update_xcast_mode(hw, IXGBEVF_XCAST_MODE_NONE);
+       hw->mac.ops.update_xcast_mode(hw, IXGBEVF_XCAST_MODE_MULTI);
 }
 
 static void ixgbevf_mbx_process(struct rte_eth_dev *dev)
@@ -8133,7 +8137,7 @@ ixgbe_clear_all_l2_tn_filter(struct rte_eth_dev *dev)
 
 RTE_PMD_REGISTER_PCI(net_ixgbe, rte_ixgbe_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_ixgbe, pci_id_ixgbe_map);
-RTE_PMD_REGISTER_KMOD_DEP(net_ixgbe, "* igb_uio | uio_pci_generic | vfio");
+RTE_PMD_REGISTER_KMOD_DEP(net_ixgbe, "* igb_uio | uio_pci_generic | vfio-pci");
 RTE_PMD_REGISTER_PCI(net_ixgbe_vf, rte_ixgbevf_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_ixgbe_vf, pci_id_ixgbevf_map);
-RTE_PMD_REGISTER_KMOD_DEP(net_ixgbe_vf, "* igb_uio | vfio");
+RTE_PMD_REGISTER_KMOD_DEP(net_ixgbe_vf, "* igb_uio | vfio-pci");