Skip to content

Commit

Permalink
ethdev: fix close failure handling
Browse files Browse the repository at this point in the history
[ upstream commit a6f34f9 ]

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: 8a5a0aa ("ethdev: allow close function to return an error")

Reported-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
  • Loading branch information
tmonjalo authored and bluca committed Feb 4, 2021
1 parent 10b11c2 commit 732bdcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/librte_ethdev/rte_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 732bdcc

Please sign in to comment.