From 13302cd5bd63bb789b613f019a1b3c155d62964a Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Mon, 1 Apr 2019 04:27:00 +0200 Subject: [PATCH] app/testpmd: use port sibling iterator in device cleanup When removing a rte_device on a port-based request, all the sibling ports must be marked as closed. The iterator loop can be simplified by using the dedicated macro. Signed-off-by: Thomas Monjalon Reviewed-by: Ferruh Yigit Tested-by: Viacheslav Ovsiienko --- app/test-pmd/testpmd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 40c873b972..aeaa74c989 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2370,9 +2370,7 @@ detach_port_device(portid_t port_id) return; } - for (sibling = 0; sibling < RTE_MAX_ETHPORTS; sibling++) { - if (rte_eth_devices[sibling].device != dev) - continue; + RTE_ETH_FOREACH_DEV_SIBLING(sibling, port_id) { /* reset mapping between old ports and removed device */ rte_eth_devices[sibling].device = NULL; if (ports[sibling].port_status != RTE_PORT_CLOSED) { -- 2.20.1