aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-06-07 18:16:35 +0200
committerDamjan Marion <dmarion@me.com>2018-06-07 18:44:09 +0000
commita6cca8323c6dd2bafd45bcb0c27731d34833cf6b (patch)
tree8e067fc5385264835f8ba7035c089e128cffe633 /src
parent535939c38104ec0d3a504e1d1f9ba57b141bb4c5 (diff)
dpdk: fix interface naming issue
... introduced with dpdk 18.05 support patch Change-Id: Idf2283888f81d7652599651c0d65476e451f9343 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/dpdk/device/init.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index 5bdb493d086..b5eb9de444f 100644
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -315,9 +315,16 @@ dpdk_lib_init (dpdk_main_t * dm)
if (pci_dev)
{
struct rte_eth_dev_info di = { 0 };
+ struct rte_pci_device *next_pci_dev;
rte_eth_dev_info_get (i + 1, &di);
- if (pci_dev && pci_addr.as_u32 != last_pci_addr.as_u32 &&
- memcmp (&pci_dev->addr, &pci_dev->addr,
+#if RTE_VERSION < RTE_VERSION_NUM(18, 5, 0, 0)
+ next_pci_dev = di.pci_dev;
+#else
+ next_pci_dev = di.device ? RTE_DEV_TO_PCI (di.device) : 0;
+#endif
+ if (pci_dev && next_pci_dev &&
+ pci_addr.as_u32 != last_pci_addr.as_u32 &&
+ memcmp (&pci_dev->addr, &next_pci_dev->addr,
sizeof (struct rte_pci_addr)) == 0)
{
xd->interface_name_suffix = format (0, "0");