[PATCH v3 1/2] ethdev: make representor parameter more explicit

Thomas Monjalon thomas at monjalon.net
Wed Nov 5 22:17:55 CET 2025


05/11/2025 20:20, Stephen Hemminger:
> Looks good as is, a couple of minor observations.
> 
> > +	/* pfX... or (pfX)... */
> > +	if ((str[0] == 'p' && str[1] == 'f') ||
> > +	    (str[0] == '(' && str[1] == 'p' && str[2] == 'f')) {
> 
> This is correct but seem like it is getting verbose.
> If there are more cases than this looking for prefix, might be
> useful to have helper function.
> 
> Looks like devargs could use some better pattern matching,
> lots of string handling already in this code.
> String processing in C is often an error trap.
> 
> > +		if (str != NULL && str[0] == ')') {
> > +			str++; /* advance past ")" */
> > +			eth_da->flags =
> > +				RTE_ETH_DEVARG_IGNORE_PF_REPRESENTOR;
> 
> Can't that go on one line, max line length in DPDK is 100.
> Is there a case where there could be multiple devargs flags?

It is the first flag.
I would prefer this flag to be named RTE_ETH_DEVARG_REPRESENTOR_IGNORE_PF.




More information about the dev mailing list