21/07/2020 19:05, Stephen Hemminger:
> On Fri, 17 Jul 2020 17:01:00 +0200
> Thomas Monjalon <tho...@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;  



Reply via email to