From a8332826c658685cab0c4803c05ceae61f73a43d Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Thu, 4 Jan 2018 17:01:10 +0100 Subject: [PATCH] ethdev: free detached port by the dedicated function In the port detach function, use the function to free an ethdev port instead of changing its state directly. Signed-off-by: Matan Azrad Acked-by: Thomas Monjalon --- lib/librte_ether/rte_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 533bb5e11d..780b1d6176 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -408,7 +408,7 @@ rte_eth_dev_detach(uint16_t port_id, char *name) if (ret < 0) goto err; - rte_eth_devices[port_id].state = RTE_ETH_DEV_UNUSED; + rte_eth_dev_release_port(&rte_eth_devices[port_id]); return 0; err: -- 2.20.1