From a6f34f91008ec200e492459bc79b62c04a88e918 Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Fri, 22 Jan 2021 18:58:04 +0100 Subject: [PATCH] ethdev: fix close failure handling If a failure happens when closing a port, it was unnecessarily failing again in the function eth_err(), because of a check against HW removal cause. Indeed there is a big chance the port is released at this point. Given the port is in the middle (or at the end) of a close process, checking the error cause by accessing the port is a non-sense. The error check is replaced by a simple return in the close function. Bugzilla ID: 624 Fixes: 8a5a0aad5d3e ("ethdev: allow close function to return an error") Cc: stable@dpdk.org Reported-by: Anatoly Burakov Signed-off-by: Thomas Monjalon Acked-by: Andrew Rybchenko Tested-by: Anatoly Burakov --- lib/librte_ethdev/rte_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index f40df65e34..6f514c388b 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -1820,7 +1820,7 @@ rte_eth_dev_close(uint16_t port_id) rte_ethdev_trace_close(port_id); *lasterr = rte_eth_dev_release_port(dev); - return eth_err(port_id, firsterr); + return firsterr; } int -- 2.20.1