From a059a000f81a7251ffed2821f69dd96cfd94c8c7 Mon Sep 17 00:00:00 2001 From: Rui Cai Date: Fri, 11 May 2018 22:55:33 +0000 Subject: dpdk: Decoupling the meaning of xd->device_index in dpdk_plugin Prior to the change, dpdk plugin assumes xd->device_index is used both as index for internal dpdk_main->devices array and DPDK port index to call into DPDK APIs. However, when running on top of Failsafe PMDs, DPDK port index range may no longer be contiguous (as noted: http://dpdk.org/ml/archives/dev/2018-March/092375.html for related changes in DPDK). Because this, dpdk plugin can no longer iterate through all available DPDK ports with a for 0->rte_eth_dev_count() loop and the assumption of device_index no longer holds. This is part of initial effort to enable vpp running over dpdk on failsafe PMD in Microsoft Azure(3/4). Change-Id: I416fd80f2d40e12e139f8f3492814da98343eae7 Signed-off-by: Rui Cai --- src/plugins/dpdk/device/cli.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/plugins/dpdk/device/cli.c') diff --git a/src/plugins/dpdk/device/cli.c b/src/plugins/dpdk/device/cli.c index 151a6f4e9c8..25308588469 100644 --- a/src/plugins/dpdk/device/cli.c +++ b/src/plugins/dpdk/device/cli.c @@ -65,7 +65,7 @@ get_hqos (u32 hw_if_index, u32 subport_id, dpdk_device_t ** xd, hw = vnet_get_hw_interface (dm->vnet_main, hw_if_index); *xd = vec_elt_at_index (dm->devices, hw->dev_instance); - rte_eth_dev_info_get ((*xd)->device_index, &dev_info); + rte_eth_dev_info_get ((*xd)->port_id, &dev_info); if (dev_info.pci_dev) { /* bonded interface has no pci info */ vlib_pci_addr_t pci_addr; @@ -1283,7 +1283,7 @@ set_dpdk_if_hqos_pktfield (vlib_main_t * vm, unformat_input_t * input, hw = vnet_get_hw_interface (dm->vnet_main, hw_if_index); xd = vec_elt_at_index (dm->devices, hw->dev_instance); - rte_eth_dev_info_get (xd->device_index, &dev_info); + rte_eth_dev_info_get (xd->port_id, &dev_info); if (dev_info.pci_dev) { /* bonded interface has no pci info */ vlib_pci_addr_t pci_addr; @@ -1474,7 +1474,7 @@ show_dpdk_if_hqos (vlib_main_t * vm, unformat_input_t * input, hw = vnet_get_hw_interface (dm->vnet_main, hw_if_index); xd = vec_elt_at_index (dm->devices, hw->dev_instance); - rte_eth_dev_info_get (xd->device_index, &dev_info); + rte_eth_dev_info_get (xd->port_id, &dev_info); if (dev_info.pci_dev) { /* bonded interface has no pci info */ vlib_pci_addr_t pci_addr; @@ -1884,7 +1884,7 @@ show_dpdk_hqos_queue_stats (vlib_main_t * vm, unformat_input_t * input, hw = vnet_get_hw_interface (dm->vnet_main, hw_if_index); xd = vec_elt_at_index (dm->devices, hw->dev_instance); - rte_eth_dev_info_get (xd->device_index, &dev_info); + rte_eth_dev_info_get (xd->port_id, &dev_info); if (dev_info.pci_dev) { /* bonded interface has no pci info */ vlib_pci_addr_t pci_addr; -- cgit 1.2.3-korg