diff options
author | Damjan Marion <damarion@cisco.com> | 2018-11-06 12:56:47 +0100 |
---|---|---|
committer | Marco Varlese <marco.varlese@suse.de> | 2018-11-06 13:50:30 +0000 |
commit | 55c6c4a422f34365b2c32ad0a107a058aa64fd8d (patch) | |
tree | 3ad2c61f79b6523f359e5a8508e11e3358bb1be3 /src/plugins/dpdk/device | |
parent | dcb0c1aae89a8b542f734b89e33505852ab3d6da (diff) |
dpdk: format_dpdk_device_name cleanup
Change-Id: I49a5029d256df8f749ee30d19ff7473147b6516f
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/device')
-rw-r--r-- | src/plugins/dpdk/device/format.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c index 9124ec27df5..ef15055094a 100644 --- a/src/plugins/dpdk/device/format.c +++ b/src/plugins/dpdk/device/format.c @@ -162,7 +162,7 @@ format_dpdk_device_name (u8 * s, va_list * args) else devname_format = "%s%x/%x/%x"; - switch (dm->devices[i].port_type) + switch (xd->port_type) { case VNET_DPDK_PORT_TYPE_ETH_1G: device_name = "GigabitEthernet"; @@ -205,7 +205,7 @@ format_dpdk_device_name (u8 * s, va_list * args) break; case VNET_DPDK_PORT_TYPE_ETH_BOND: - return format (s, "BondEthernet%d", dm->devices[i].bond_instance_num); + return format (s, "BondEthernet%d", xd->bond_instance_num); case VNET_DPDK_PORT_TYPE_ETH_SWITCH: device_name = "EthernetSwitch"; @@ -216,7 +216,7 @@ format_dpdk_device_name (u8 * s, va_list * args) break; case VNET_DPDK_PORT_TYPE_AF_PACKET: - return format (s, "af_packet%d", dm->devices[i].af_packet_instance_num); + return format (s, "af_packet%d", xd->af_packet_instance_num); case VNET_DPDK_PORT_TYPE_VIRTIO_USER: device_name = "VirtioUser"; @@ -239,14 +239,14 @@ format_dpdk_device_name (u8 * s, va_list * args) 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) + if (pci_dev && xd->port_type != VNET_DPDK_PORT_TYPE_FAILSAFE) ret = format (s, devname_format, device_name, pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function); else - ret = format (s, "%s%d", device_name, dm->devices[i].port_id); + ret = format (s, "%s%d", device_name, xd->port_id); - if (dm->devices[i].interface_name_suffix) - return format (ret, "/%s", dm->devices[i].interface_name_suffix); + if (xd->interface_name_suffix) + return format (ret, "/%s", xd->interface_name_suffix); return ret; } |