Skip to contentSkip to conversation

ethdev: fix handling of close failure

PATCH Applied Thomas Monjalon 4 participants 6 messages Jan 22, 2021 – Jan 27, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ethdev: fix handling of close failure

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")
---
 lib/librte_ethdev/rte_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_ethdev/rte_ethdev.c +1 -1
index daf5f24f7e..89455a432e 100644
@@ -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
Signature · 1 line
2.30.0
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Thomas Monjalon

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.

Quoted 6 lines

Bugzilla ID: 624

Fixes 8a5a0aad5d3e ("ethdev: allow close function to return an error")
author Applied
#2 lore raw

25/01/2021 10:13, Andrew Rybchenko:

Quoted 9 lines · Thomas Monjalon
Quoted 8 lines

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.

Quoted 8 lines
Quoted 6 lines

Bugzilla ID: 624

Fixes 8a5a0aad5d3e ("ethdev: allow close function to return an error")

Applied

#3 lore raw

25/01/2021 13:37, Thomas Monjalon:

Quoted 14 lines

25/01/2021 10:13, Andrew Rybchenko:

Quoted 13 lines · Thomas Monjalon
Quoted 12 lines

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")
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Applied

Sorry please ignore this wrong message, patch not applied. (will be considered by Ferruh)

Applied
#4 lore raw
In reply to Andrew Rybchenko
Quoted 9 lines · Andrew Rybchenko
Quoted 8 lines · Thomas Monjalon

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.

Quoted 9 lines
Quoted 6 lines

Bugzilla ID: 624

Fixes 8a5a0aad5d3e ("ethdev: allow close function to return an error")

Applied to dpdk-next-net/main, thanks.

Tested-by on v1 1/1
#5 lore raw
In reply to Thomas Monjalon
Quoted 8 lines · Thomas Monjalon

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.

Quoted 7 lines

Bugzilla ID: 624

Fixes 8a5a0aad5d3e ("ethdev: allow close function to return an error")

---

Signature · 2 lines
Thanks,
Anatoly