[RFC PATCH] net/bonding: reject control operations in secondary

Stephen Hemminger stephen at networkplumber.org
Thu Jul 23 01:10:30 CEST 2026


On Wed,  8 Jul 2026 12:42:04 -0500
Weijun Pan <wpan3636 at gmail.com> wrote:

> +static int
> +bond_ethdev_primary_only(const char *op)
> +{
> +	if (rte_eal_process_type() != RTE_PROC_SECONDARY)
> +		return 0;
> +
> +	RTE_BOND_LOG(ERR, "%s not supported in secondary process", op);
> +	return -ENOTSUP;
> +}
> +

Minor nit, the function returns 0 or -ENOTSUP but then caller
always ends up just checking for 0. It might look cleaner as boolean
function or wrap the whole thing as a macro like ethdev does.


More information about the dev mailing list