From f286c4b9427748568036d04e8aa2408a4069dee7 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 5 Nov 2018 12:54:16 -0800 Subject: [PATCH] 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 --- src/plugins/dpdk/device/format.c | 4 ++-- 1 file 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) -- 2.16.6