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 <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
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) {