DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [Bug 624] Port close results in "invalid port_id" log message
@ 2021-01-22 17:02 bugzilla
  2021-01-31  9:19 ` bugzilla
  0 siblings, 1 reply; 2+ messages in thread
From: bugzilla @ 2021-01-22 17:02 UTC (permalink / raw)
  To: dev

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@dpdk.org
          Reporter: anatoly.burakov@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@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@monjalon.net>
    Reviewed-by: Liron Himi <lironh@marvell.com>
    Acked-by: Stephen Hemminger <stephen@networkplumber.org>
    Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
    Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
```

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [dpdk-dev] [Bug 624] Port close results in "invalid port_id" log message
  2021-01-22 17:02 [dpdk-dev] [Bug 624] Port close results in "invalid port_id" log message bugzilla
@ 2021-01-31  9:19 ` bugzilla
  0 siblings, 0 replies; 2+ messages in thread
From: bugzilla @ 2021-01-31  9:19 UTC (permalink / raw)
  To: dev

https://bugs.dpdk.org/show_bug.cgi?id=624

Thomas Monjalon (thomas@monjalon.net) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|IN_PROGRESS                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Thomas Monjalon (thomas@monjalon.net) ---
Resolved in http://git.dpdk.org/dpdk/commit/?id=a6f34f9100

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-31  9:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-22 17:02 [dpdk-dev] [Bug 624] Port close results in "invalid port_id" log message bugzilla
2021-01-31  9:19 ` bugzilla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).