DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Shahaf Shuler <shahafs@mellanox.com>,
	Yongseok Koh <yskoh@mellanox.com>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 1/2] ethdev: avoid explicit check of valid port state
Date: Thu, 18 Apr 2019 14:47:11 +0200	[thread overview]
Message-ID: <3775228.0GTJhU53Hy@xps> (raw)
Message-ID: <20190418124711.vwdAM36tJn3Ha_r2ZqnwtGzC7YZ_3XbrlNwkIVZza-Q@z> (raw)
In-Reply-To: <a148b99b-e509-9be3-8358-77d780e52f8e@intel.com>

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>
> > ---
> >  drivers/net/mlx5/mlx5.c        |  9 ++-------
> >  lib/librte_ethdev/rte_ethdev.c | 25 ++++++++++++-------------
> 
> No strong opinion but should we separate patch for driver and the library,
> logically both changes RTE_ETH_DEV_UNUSED check with macros, but there is no
> dependency, I mean they are individual changes, driver patch will be valid on
> its own.

This is the same change. I removed usage of RTE_ETH_DEV_UNUSED.
By chance, it was used only in ethdev and mlx5.
I don't feel the need to split because there are usages in different files.


> > +#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."




  parent reply	other threads:[~2019-04-18 12:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-17 22:59 Thomas Monjalon
2019-04-17 22:59 ` Thomas Monjalon
2019-04-17 22:59 ` [dpdk-dev] [PATCH 2/2] ethdev: promote function for port count as stable Thomas Monjalon
2019-04-17 22:59   ` Thomas Monjalon
2019-04-18 11:51   ` Ferruh Yigit
2019-04-18 11:51     ` Ferruh Yigit
2019-04-18 12:34     ` Andrew Rybchenko
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 11:50   ` Ferruh Yigit
2019-04-18 12:47   ` Thomas Monjalon [this message]
2019-04-18 12:47     ` Thomas Monjalon
2019-04-18 17:38     ` Thomas Monjalon
2019-04-18 17:38       ` Thomas Monjalon
2019-04-18 18:37 ` Ferruh Yigit
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=3775228.0GTJhU53Hy@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 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).