aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <sthemmin@microsoft.com>2018-11-05 12:54:16 -0800
committerDamjan Marion <dmarion@me.com>2018-11-06 11:53:24 +0000
commitf286c4b9427748568036d04e8aa2408a4069dee7 (patch)
tree7a1ce3804894b3befa9865ece8c9a28f73e8058b
parentef101310f4068abc61d43c1b08165c7a2018132d (diff)
dpdk: fix device name suffix confusion with failsafe/netvsc
When netvsc or failsafe DPDK device is used, the DPDK port id does not match the VPP device instance id. The code that formats the device name was incorrectly calling DPDK device info using the VPP device instance id. This causes the VPP interface to be named "FortyGigabit0/2/0" based on mistakenly finding the PCI device information of the hidden DPDK port id for the VF device. Change-Id: I9366232f4b2087076bdcc1a58bf228007c24c084 Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-rw-r--r--src/plugins/dpdk/device/format.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c
index 579de9c5601..9124ec27df5 100644
--- a/src/plugins/dpdk/device/format.c
+++ b/src/plugins/dpdk/device/format.c
@@ -152,6 +152,7 @@ format_dpdk_device_name (u8 * s, va_list * args)
char *devname_format;
char *device_name;
u32 i = va_arg (*args, u32);
+ dpdk_device_t *xd = vec_elt_at_index (dm->devices, i);
struct rte_eth_dev_info dev_info;
struct rte_pci_device *pci_dev;
u8 *ret;
@@ -215,7 +216,6 @@ format_dpdk_device_name (u8 * s, va_list * args)
break;
case VNET_DPDK_PORT_TYPE_AF_PACKET:
- rte_eth_dev_info_get (i, &dev_info);
return format (s, "af_packet%d", dm->devices[i].af_packet_instance_num);
case VNET_DPDK_PORT_TYPE_VIRTIO_USER:
@@ -236,7 +236,7 @@ format_dpdk_device_name (u8 * s, va_list * args)
break;
}
- rte_eth_dev_info_get (i, &dev_info);
+ rte_eth_dev_info_get (xd->port_id, &dev_info);
pci_dev = dpdk_get_pci_device (&dev_info);
if (pci_dev && dm->devices[i].port_type != VNET_DPDK_PORT_TYPE_FAILSAFE)