[dpdk-dev] [Bug 624] Port close results in "invalid port_id" log message
bugzilla at dpdk.org
bugzilla at dpdk.org
Fri Jan 22 18:02:18 CET 2021
https://bugs.dpdk.org/show_bug.cgi?id=624
Bug ID: 624
Summary: Port close results in "invalid port_id" log message
Product: DPDK
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: ethdev
Assignee: dev at dpdk.org
Reporter: anatoly.burakov at intel.com
Target Milestone: ---
Closing port leads to an EAL error log message:
```
int
rte_eth_dev_close(uint16_t port_id)
{
struct rte_eth_dev *dev;
int firsterr, binerr;
int *lasterr = &firsterr;
RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
dev = &rte_eth_devices[port_id];
RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_close, -ENOTSUP);
*lasterr = (*dev->dev_ops->dev_close)(dev);
if (*lasterr != 0)
lasterr = &binerr;
rte_ethdev_trace_close(port_id);
*lasterr = rte_eth_dev_release_port(dev);
return eth_err(port_id, firsterr);
}
```
eth_err() is called after rte_dev_release_port(), so the port_id is no longer
valid at that stage. The eth_err() itself calls rte_eth_dev_is_removed(), which
in turn calls RTE_ETH_VALID_PORTID_OR_ERR_RET(), which outputs a log message on
invalid port_id.
Offending commit seems to be:
```
commit 8a5a0aad5d3e4f4f75ca81932eb247de94765685
Author: Thomas Monjalon <thomas at monjalon.net>
Date: Fri Oct 16 15:32:59 2020 +0200
ethdev: allow close function to return an error
The API function rte_eth_dev_close() was returning void.
The return type is changed to int for notifying of errors.
If an error happens during a close operation,
the status of the port is undefined,
a maximum of resources having been freed.
Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
Reviewed-by: Liron Himi <lironh at marvell.com>
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
```
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the dev
mailing list