From: Thomas Monjalon <thomas@monjalon.net>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev@dpdk.org, Shahaf Shuler <shahafs@mellanox.com>,
Yongseok Koh <yskoh@mellanox.com>,
Andrew Rybchenko <arybchenko@solarflare.com>
Subject: Re: [dpdk-dev] [PATCH 1/2] ethdev: avoid explicit check of valid port state
Date: Thu, 18 Apr 2019 19:38:25 +0200 [thread overview]
Message-ID: <2681438.eLSQ0opes9@xps> (raw)
In-Reply-To: <3775228.0GTJhU53Hy@xps>
18/04/2019 14:47, Thomas Monjalon:
> 18/04/2019 13:50, Ferruh Yigit:
> > On 4/17/2019 11:59 PM, Thomas Monjalon wrote:
> > > Some port iterations are manually checking against RTE_ETH_DEV_UNUSED
> > > instead of using the iterators based on rte_eth_find_next().
> > >
> > > A new macro RTE_ETH_FOREACH_VALID_DEV() is introduced, but kept private
> > > because there should be no need of iterating over all devices in the API.
> > > The public iterators have additional filters for ownership, parent device
> > > or sibling ports.
> > >
> > > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > > ---
> > > +#define RTE_ETH_FOREACH_VALID_DEV(port_id) \
> > > + for (port_id = rte_eth_find_next(0); \
> > > + port_id < RTE_MAX_ETHPORTS; \
> > > + port_id = rte_eth_find_next(port_id + 1))
> > > +
> >
> > What do you think adding some documentation to the new macro, specially I think
> > documenting the difference between "RTE_ETH_FOREACH_DEV" and this one can be
> > good otherwise it may confuse people that "RTE_ETH_FOREACH_DEV" iterates on
> > invalid devices too?
>
> This one is not part of the API.
> I am not sure what I can document more than "iterating all valid ports"?
> About RTE_ETH_FOREACH_DEV, it is already documented:
> "Macro to iterate over all enabled and ownerless ethdev ports."
OK, let's add a comment to explain the difference:
/*
* Macro to iterate over all valid ports for internal usage.
* Note: RTE_ETH_FOREACH_DEV is different because filtering owned ports.
*/
next prev parent reply other threads:[~2019-04-18 17:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-17 22:59 [dpdk-dev] [PATCH 1/2] ethdev: avoid explicit check of valid port state Thomas Monjalon
2019-04-17 22:59 ` [dpdk-dev] [PATCH 2/2] ethdev: promote function for port count as stable Thomas Monjalon
2019-04-18 11:51 ` Ferruh Yigit
2019-04-18 12:34 ` Andrew Rybchenko
2019-04-18 11:50 ` [dpdk-dev] [PATCH 1/2] ethdev: avoid explicit check of valid port state Ferruh Yigit
2019-04-18 12:47 ` Thomas Monjalon
2019-04-18 17:38 ` Thomas Monjalon [this message]
2019-04-18 18:37 ` Ferruh Yigit
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=2681438.eLSQ0opes9@xps \
--to=thomas@monjalon.net \
--cc=arybchenko@solarflare.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=shahafs@mellanox.com \
--cc=yskoh@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.