[dpdk-dev] [PATCH 1/1] ethdev: fix handling of close failure

Subsystems: library code, the rest

6 messages, 4 authors, 2021-01-27 · open the first message on its own page

[dpdk-dev] [PATCH 1/1] ethdev: fix handling of close failure

From: Thomas Monjalon <hidden>
Date: 2021-01-22 17:58:22

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 <redacted>
Signed-off-by: Thomas Monjalon <redacted>
---
 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 daf5f24f7e..89455a432e 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.30.0

Re: [dpdk-dev] [PATCH 1/1] ethdev: fix handling of close failure

From: Andrew Rybchenko <hidden>
Date: 2021-01-25 09:13:16

On 1/22/21 8:58 PM, Thomas Monjalon wrote:
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 <redacted>
Signed-off-by: Thomas Monjalon <redacted>
Acked-by: Andrew Rybchenko <redacted>

Re: [dpdk-dev] [dpdk-stable] [PATCH 1/1] ethdev: fix handling of close failure

From: Thomas Monjalon <hidden>
Date: 2021-01-25 12:37:49

25/01/2021 10:13, Andrew Rybchenko:
On 1/22/21 8:58 PM, Thomas Monjalon wrote:
quoted
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 <redacted>
Signed-off-by: Thomas Monjalon <redacted>
Acked-by: Andrew Rybchenko <redacted>
Applied

Re: [dpdk-dev] [dpdk-stable] [PATCH 1/1] ethdev: fix handling of close failure

From: Thomas Monjalon <hidden>
Date: 2021-01-25 12:39:10

25/01/2021 13:37, Thomas Monjalon:
25/01/2021 10:13, Andrew Rybchenko:
quoted
On 1/22/21 8:58 PM, Thomas Monjalon wrote:
quoted
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 <redacted>
Signed-off-by: Thomas Monjalon <redacted>
Acked-by: Andrew Rybchenko <redacted>
Applied
Sorry please ignore this wrong message, patch not applied.
(will be considered by Ferruh)

Re: [dpdk-dev] [dpdk-stable] [PATCH 1/1] ethdev: fix handling of close failure

From: Ferruh Yigit <hidden>
Date: 2021-01-27 11:44:54

On 1/25/2021 9:13 AM, Andrew Rybchenko wrote:
On 1/22/21 8:58 PM, Thomas Monjalon wrote:
quoted
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 <redacted>
Signed-off-by: Thomas Monjalon <redacted>
Acked-by: Andrew Rybchenko <redacted>
Applied to dpdk-next-net/main, thanks.

Re: [dpdk-dev] [PATCH 1/1] ethdev: fix handling of close failure

From: Burakov, Anatoly <hidden>
Date: 2021-01-25 10:51:38

On 22-Jan-21 5:58 PM, Thomas Monjalon wrote:
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 <redacted>
Signed-off-by: Thomas Monjalon <redacted>
---
Tested-by: Anatoly Burakov <redacted>

-- 
Thanks,
Anatoly
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help