[dpdk-dev] [PATCH v3 6/7] app/proc-info: provide way to request info on owned ports

Thomas Monjalon thomas at monjalon.net
Tue Jul 21 19:08:57 CEST 2020


21/07/2020 19:05, Stephen Hemminger:
> On Fri, 17 Jul 2020 17:01:00 +0200
> Thomas Monjalon <thomas at monjalon.net> wrote:
> > 15/07/2020 23:22, Stephen Hemminger:
> > > +	/* 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 #

By default, owned ports are not displayed at all.
How are we supposed to find them?

> > > +	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?

Comments in the code I mean.

> > > +		/* 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.

OK

> > > +
> > > +		if (!rte_eth_dev_is_valid_port(i))
> > > +			continue;  





More information about the dev mailing list