From ed812458641e8805e98a5bb399248745bae5d6b7 Mon Sep 17 00:00:00 2001 From: "Alexander Popovsky (apopovsk)" Date: Fri, 17 Mar 2017 12:08:16 -0700 Subject: Fix bonded ethernet PMD name for DPDK 17.02 In DPDK 17.02 bonded PMD name is changed from rte_bond_pmd to net_bonding. Change-Id: I1a57a16b0ae68b5fa56a561a4f75981112228572 Signed-off-by: Alexander Popovsky (apopovsk) --- src/plugins/dpdk/device/dpdk.h | 21 +++++++++++++++++++++ src/plugins/dpdk/device/init.c | 10 +++------- 2 files changed, 24 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h index 84f86ae28dd..6328d115b42 100644 --- a/src/plugins/dpdk/device/dpdk.h +++ b/src/plugins/dpdk/device/dpdk.h @@ -66,6 +66,26 @@ extern vnet_device_class_t dpdk_device_class; extern vlib_node_registration_t dpdk_input_node; extern vlib_node_registration_t handoff_dispatch_node; +#if RTE_VERSION >= RTE_VERSION_NUM(17, 2, 0, 0) +#define foreach_dpdk_pmd \ + _ ("net_thunderx", THUNDERX) \ + _ ("net_e1000_em", E1000EM) \ + _ ("net_e1000_igb", IGB) \ + _ ("net_e1000_igb_vf", IGBVF) \ + _ ("net_ixgbe", IXGBE) \ + _ ("net_ixgbe_vf", IXGBEVF) \ + _ ("net_i40e", I40E) \ + _ ("net_i40e_vf", I40EVF) \ + _ ("net_virtio", VIRTIO) \ + _ ("net_enic", ENIC) \ + _ ("net_vmxnet3", VMXNET3) \ + _ ("AF_PACKET PMD", AF_PACKET) \ + _ ("net_bonding", BOND) \ + _ ("net_fm10k", FM10K) \ + _ ("net_cxgbe", CXGBE) \ + _ ("net_mlx5", MLX5) \ + _ ("net_dpaa2", DPAA2) +#else #define foreach_dpdk_pmd \ _ ("net_thunderx", THUNDERX) \ _ ("net_e1000_em", E1000EM) \ @@ -84,6 +104,7 @@ extern vlib_node_registration_t handoff_dispatch_node; _ ("net_cxgbe", CXGBE) \ _ ("net_mlx5", MLX5) \ _ ("net_dpaa2", DPAA2) +#endif typedef enum { diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c index 110d74571b5..ca9053264dc 100755 --- a/src/plugins/dpdk/device/init.c +++ b/src/plugins/dpdk/device/init.c @@ -1872,13 +1872,9 @@ dpdk_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f) { for (i = 0; i < nports; i++) { - struct rte_eth_dev_info dev_info; - rte_eth_dev_info_get (i, &dev_info); - if (!dev_info.driver_name) - dev_info.driver_name = dev_info.pci_dev->driver->driver.name; - - ASSERT (dev_info.driver_name); - if (strncmp (dev_info.driver_name, "rte_bond_pmd", 12) == 0) + xd = &dm->devices[i]; + ASSERT (i == xd->device_index); + if (xd->pmd == VNET_DPDK_PMD_BOND) { u8 addr[6]; u8 slink[16]; -- cgit 1.2.3-korg