From: Stephen Hemminger <stephen@networkplumber.org>
To: Matan Azrad <matan@mellanox.com>
Cc: "anatoly.burakov@intel.com" <anatoly.burakov@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>,
Stephen Hemminger <sthemmin@microsoft.com>
Subject: Re: [dpdk-dev] [PATCH v2] examples/client_server_mp: check port ownership
Date: Mon, 8 Jul 2019 07:49:06 -0700 [thread overview]
Message-ID: <20190708074906.301917f7@hermes.lan> (raw)
In-Reply-To: <AM0PR0502MB4019EC04E8A16FF36D48EA59D2F60@AM0PR0502MB4019.eurprd05.prod.outlook.com>
On Mon, 8 Jul 2019 06:37:14 +0000
Matan Azrad <matan@mellanox.com> wrote:
> Hi Stephen
>
> From: Stephen Hemminger
> > Sent: Sunday, July 7, 2019 7:47 PM
> > To: Matan Azrad <matan@mellanox.com>
> > Cc: anatoly.burakov@intel.com; dev@dpdk.org; Stephen Hemminger
> > <sthemmin@microsoft.com>
> > Subject: Re: [dpdk-dev] [PATCH v2] examples/client_server_mp: check port
> > ownership
> >
> > On Sun, 7 Jul 2019 05:44:55 +0000
> > Matan Azrad <matan@mellanox.com> wrote:
> >
> > > > + for (count = 0; pm != 0; pm >>= 1, ++count) {
> > > > + struct rte_eth_dev_owner owner;
> > > > +
> > > > + if ((pm & 0x1) == 0)
> > > > + continue;
> > > > +
> > > > + if (count >= max_ports) {
> > > > + printf("WARNING: requested port %u not present -
> > > > ignoring\n",
> > > > + count);
> > > > + continue;
> > > > + }
> > > > + if (rte_eth_dev_owner_get(count, &owner) < 0) {
> > > > + printf("ERROR: can not find port %u owner\n",
> > > > count);
> > >
> > > What if some entity will take ownership later?
> > > If you want the app will be ownership aware:
> > > if you sure that you want this port to be owned by this application
> > you need to take ownership on it.
> > > else:
> > > the port is hidden by RTE_ETH_FOREACH_DEV if it is owned by some entity.
> > > see how it was done in testpmd function: port_id_is_invalid().
> >
> > There are no mysterious entities in DPDK.
> > The only thing that can happen later is hotplug, and that will not change state
> > of existing port.
> > This model is used for all applications. The application does not take
> > ownership, only device drivers do.
>
> A long discussions were done on it.
> There is an application model to take ownership as I wrote you above.
> You chose in the second option - not to be ownership aware.
>
> From docs:
> "10.4.2. Port Ownership
> The Ethernet devices ports can be owned by a single DPDK entity (application, library, PMD, process, etc). The ownership mechanism is controlled by ethdev APIs and allows to set/remove/get a port owner by DPDK entities. Allowing this should prevent any multiple management of Ethernet port by different entities.
>
> Note
>
> It is the DPDK entity responsibility to set the port owner before using it and to manage the port usage synchronization between different threads or processes."
>
> > The whole portmask as command-line parameter is a bad user experience
> > now, but that is a different problem.
>
> I think, this is the problem you should solve here.
No other application is doing this: testpmd, l3fwd, ... why do you think
this application is different. Plus you would be putting a new requirement on
all the user applications. That would be a user hostile change.
next prev parent reply other threads:[~2019-07-08 14:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-29 22:43 [dpdk-dev] [PATCH] " Stephen Hemminger
2019-06-03 22:28 ` [dpdk-dev] [PATCH v2] " Stephen Hemminger
2019-07-04 20:48 ` Thomas Monjalon
2019-07-07 5:44 ` Matan Azrad
2019-07-07 16:47 ` Stephen Hemminger
2019-07-08 6:37 ` Matan Azrad
2019-07-08 14:49 ` Stephen Hemminger [this message]
2019-07-09 5:40 ` 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=20190708074906.301917f7@hermes.lan \
--to=stephen@networkplumber.org \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=matan@mellanox.com \
--cc=sthemmin@microsoft.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).