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

Stephen Hemminger stephen at networkplumber.org
Wed Nov 5 20:20:39 CET 2025


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?





More information about the dev mailing list