[dpdk-dev] [PATCH v3 6/7] app/proc-info: provide way to request info on owned ports
Stephen Hemminger
stephen at networkplumber.org
Tue Jul 21 19:05:21 CEST 2020
On Fri, 17 Jul 2020 17:01:00 +0200
Thomas Monjalon <thomas at monjalon.net> wrote:
> 15/07/2020 23:22, Stephen Hemminger:
> > --- a/app/proc-info/Makefile
> > +++ b/app/proc-info/Makefile
> > +CFLAGS += -DALLOW_EXPERIMENTAL_API
>
> not needed in app/
>
> > +CFLAGS += -O3
> > CFLAGS += $(WERROR_FLAGS)
> > +CFLAGS += -Wno-deprecated-declarations
>
> Which deprecated function is used?
> We must not use deprecated functions.
Fixing.
>
> > + /* If no port mask was specified, one will be provided */
>
> Would be nice to help the user by printing a port mask
> of owned and unowned ports.
Not needed, since each display already has the port #
>
> > + if (enabled_port_mask == 0) {
> > + RTE_ETH_FOREACH_DEV(i) {
> > + enabled_port_mask |= 1u << i;
> > }
> > }
> >
> > + for (port_mask = enabled_port_mask; port_mask != 0;
> > + port_mask &= ~(1u << i)) {
>
> Please would be good to help drunk or sleepy readers with few comments.
ok?
>
> > + /* ffs() first bit is 1 not 0 */
> > + i = ffs(port_mask) - 1;
> > +
> > + if (i >= RTE_MAX_ETHPORTS)
> > + break;
>
> This check is already done in rte_eth_dev_is_valid_port().
Want to stop early if port is out of range,
but continue if hits a port that is owned.
>
> > +
> > + if (!rte_eth_dev_is_valid_port(i))
> > + continue;
>
>
>
More information about the dev
mailing list