From: Viacheslav Ovsiienko Date: Fri, 12 Apr 2019 15:48:11 +0000 (+0000) Subject: app/testpmd: fix port detach cleanup X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7ca262b886c71e24a315323fdfa5872b05db0fca;p=dpdk.git app/testpmd: fix port detach cleanup At port detach routine after calling the rte_dev_remove() testpmd performs some cleanup, checking the statuses of remaining ports and closes the appropriate ones. The port scanning is based on the new sibling iterator which uses the invalid (already closed) port for reference. This patch replaces the foreach iterator and uses the device object for reference. It is worth to note this cleanup is not needed for some drivers (at least for mlx5 and probably for others) and is preserved due to possible compatibility issues. Fixes: 13302cd5bd63 ("app/testpmd: use port sibling iterator in device cleanup") Signed-off-by: Viacheslav Ovsiienko Acked-by: Yongseok Koh Acked-by: Thomas Monjalon --- diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index d01165f3cd..6fbfd29dd1 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2434,8 +2434,7 @@ detach_port_device(portid_t port_id) TESTPMD_LOG(ERR, "Failed to detach device %s\n", dev->name); return; } - - RTE_ETH_FOREACH_DEV_SIBLING(sibling, port_id) { + RTE_ETH_FOREACH_DEV_OF(sibling, dev) { /* reset mapping between old ports and removed device */ rte_eth_devices[sibling].device = NULL; if (ports[sibling].port_status != RTE_PORT_CLOSED) {