DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Gaëtan Rivet" <grive@u256.net>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org, Chas Williams <chas3@att.com>,
	Liron Himi <lironh@marvell.com>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [dpdk-dev] [PATCH v1] ethdev: add rte_device to port_id function
Date: Sun, 19 Apr 2020 21:36:35 +0200	[thread overview]
Message-ID: <20200419193635.tpltb5qldsmxngh7@u256.net> (raw)
In-Reply-To: <20200417134435.53da1af8@hermes.lan>

On 17/04/20 13:44 -0700, Stephen Hemminger wrote:
> On Fri, 17 Apr 2020 18:48:37 +0200
> Gaetan Rivet <grive@u256.net> wrote:
> 
> > +/**
> > + * Find the owned ethdev port id of an `rte_device`.
> > + *
> > + * @param dev
> > + *   An `rte_device`.
> > + * @param owner
> > + *   An owner id. Use `RTE_ETH_DEV_NO_OWNER` for ownerless ports.
> > + *
> > + * @return
> > + *   The port id of an `rte_device` if it is owned by `owner`.
> > + *   `RTE_MAX_ETHPORTS` otherwise.
> > + */
> > +__rte_experimental
> > +uint16_t rte_eth_port_from_dev_owned_by(const struct rte_device *dev,
> > +					const uint64_t owner);
> > +
> 
> Ok, but why introduce API with no users?
> Also a device could in theory be owned multiple times by the same owner.
> For example if two NIC's from same vendor were used in bonding.

I'm not sure what you mean by a device being owned multiple times by the
same owner. However if that's what you are referencing, the issue here
is of course the multiple ports spawning from a single device.

I forgot about this edge-case, so this API is incorrect. This also means
that my "fix" for bonding is incorrect.

The current API, RTE_ETH_FOREACH_DEV_OF(), does not offer an owner-aware
version. If the ownership model is bound to continue as it is, it should
probably offer a variant. The problem is that port iterators in ethdev
are already too many, I don't know how a user could make sense of it.

Thanks for the comment Stephen, this patch should be dropped.
-- 
Gaëtan

      reply	other threads:[~2020-04-19 19:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-17 16:48 Gaetan Rivet
2020-04-17 20:44 ` Stephen Hemminger
2020-04-19 19:36   ` Gaëtan Rivet [this message]

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=20200419193635.tpltb5qldsmxngh7@u256.net \
    --to=grive@u256.net \
    --cc=arybchenko@solarflare.com \
    --cc=chas3@att.com \
    --cc=dev@dpdk.org \
    --cc=lironh@marvell.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /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).