From: Damjan Marion Date: Thu, 7 Jun 2018 16:16:35 +0000 (+0200) Subject: dpdk: fix interface naming issue X-Git-Tag: v18.07-rc1~214 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F46%2F12946%2F3;p=vpp.git dpdk: fix interface naming issue ... introduced with dpdk 18.05 support patch Change-Id: Idf2283888f81d7652599651c0d65476e451f9343 Signed-off-by: Damjan Marion --- 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");