Subject: Re: [PATCH net-next] taprio: validate TCA_TAPRIO_ATTR_FLAGS through policy instead of open-coding

From: Jakub Kicinski <[email-masked]>
Date: Mon, 22 Jan 2024 17:24:38 -0800

On Mon, 22 Jan 2024 20:07:38 +0100 Alessandro Marcolini wrote:
> +	__u32 taprio_flags;

nit: s/__u32/u32/ the __u32 version is only for include/uapi/ files

> -	q->flags = err;
> +	/* txtime-assist and full offload are mutually exclusive */
> +	if ((taprio_flags & TCA_TAPRIO_ATTR_FLAG_TXTIME_ASSIST) &&
> +	    (taprio_flags & TCA_TAPRIO_ATTR_FLAG_FULL_OFFLOAD)) {
> +		NL_SET_ERR_MSG_MOD(extack, "TXTIME_ASSIST and FULL_OFFLOAD are mutually exclusive");

Maybe use NL_SET_ERR_MSG_ATTR()? There seems to be no
NL_SET_ERR_MSG_ATTR_MOD() which is probably for the best.
The _MOD() prefix is a crutch, IMHO, pointing to the erroneous
attributes is much better, now that we have YNL and can actually
interpret the offsets.
-- 
pw-bot: cr