From: Stephen Hemminger <stephen@networkplumber.org>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Matan Azrad <matan@mellanox.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] ethdev: fix rte_eth_dev_owner_unset
Date: Fri, 24 Aug 2018 07:42:36 -0700 [thread overview]
Message-ID: <20180824074236.7f979884@xeon-e3> (raw)
In-Reply-To: <fc0f9714-1928-9c3a-dd89-7d7f1e97726d@intel.com>
On Fri, 24 Aug 2018 14:55:56 +0100
Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> On 8/14/2018 8:46 PM, Matan Azrad wrote:
> > Hi Stephen
> >
> > From: Stephen Hemminger
> >> On Tue, 14 Aug 2018 05:52:20 +0000
> >> Matan Azrad <matan@mellanox.com> wrote:
> >>
> >>> Hi Stephen
> >>>
> >>> From: Stephen Hemminger
> >>>> The rte_eth_dev_owner_unset function is unusable because it always
> >>>> returns -EINVAL. This is because the magic (unowned) value is
> >>>> flagged as not valid.
> >>>>
> >>>
> >>> It's OK to raise an error when you do unset for unowned device.
> >>> It means that unset owner should be called for owned device.
> >>>
> >>
> >> Original code was broken. The following would always fail.
> >>
> >> rte_eth_dev_owner_new(&owner.id);
> >> sprintf(owner.name, "example");
> >> rte_eth_dev_owner_set(port_id, &owner);
> >> rte_eth_dev_owner_unset(port_id, owner.id);
> >>
> >> That is because of:
> >> rte_eth_dev_owner_unset(port_id, owner_id)
> >> _rte_eth_dev_owner_set(port_id, owner_id, &new_owner)
> >> << new_owner.id == RTE_ETH_DEV_NO_OWNER (0)
> >>
> >>
> >> if (!rte_eth_is_valid_owner_id(new_owner->id) && <<
> >> new_owner->id == RTE_ETH_DEV_NO_OWNER (which is flagged as invalid)
> >> !rte_eth_is_valid_owner_id(old_owner_id))
> >> return -EINVAL;
> >>
> >
> > But both should be invalid the new owner and the old owner(&&) to raise an EINVAL error.
> >
> > In the aforementioned check above the old owner should be valid.
>
> It looks rte_eth_dev_owner_unset() works, updating patch as rejected.
>
The issue was the incorrect log message, addressed in later patches.
next prev parent reply other threads:[~2018-08-24 14:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-14 0:19 Stephen Hemminger
2018-08-14 5:52 ` Matan Azrad
2018-08-14 16:55 ` Stephen Hemminger
2018-08-14 19:46 ` Matan Azrad
2018-08-24 13:55 ` Ferruh Yigit
2018-08-24 14:42 ` Stephen Hemminger [this message]
2018-08-16 22:44 ` [dpdk-dev] [PATCH 0/2] ethdev: minor ownership changes Stephen Hemminger
2018-08-16 22:44 ` [dpdk-dev] [PATCH 1/2] ethdev: silence error message on rte_eth_dev_owner_unset Stephen Hemminger
2018-08-21 10:04 ` Matan Azrad
2018-08-21 15:45 ` [dpdk-dev] [PATCH v3] " Stephen Hemminger
2018-08-21 15:53 ` Matan Azrad
2018-08-27 13:01 ` Ferruh Yigit
2018-08-16 22:44 ` [dpdk-dev] [PATCH 2/2] ethdev: make rte_eth_is_valid_owner_id return bool Stephen Hemminger
2018-08-21 10:20 ` Matan Azrad
2018-08-21 15:06 ` Stephen Hemminger
2018-08-21 15:48 ` Matan Azrad
2018-08-21 18:31 ` Stephen Hemminger
2018-08-26 7:49 ` Matan Azrad
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=20180824074236.7f979884@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=matan@mellanox.com \
/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).