DPDK patches and discussions
 help / color / mirror / Atom feed
From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [dpdk-dev] [Bug 624] Port close results in "invalid port_id" log message
Date: Fri, 22 Jan 2021 17:02:18 +0000	[thread overview]
Message-ID: <bug-624-3@http.bugs.dpdk.org/> (raw)

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.

             reply	other threads:[~2021-01-22 17:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22 17:02 bugzilla [this message]
2021-01-31  9:19 ` bugzilla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-624-3@http.bugs.dpdk.org/ \
    --to=bugzilla@dpdk.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).