Subject: Re: [PATCH net v2] ethtool: Fix context creation with no parameters

From: Jakub Kicinski <[email-masked]>
Date: Thu, 8 Aug 2024 08:59:51 -0700

I'll make some minor modifications when applying..

On Wed, 7 Aug 2024 20:33:52 +0300 Gal Pressman wrote:
>  	if ((rxfh.indir_size &&
>  	     rxfh.indir_size != ETH_RXFH_INDIR_NO_CHANGE &&
>  	     rxfh.indir_size != dev_indir_size) ||
> -	    (rxfh.key_size && (rxfh.key_size != dev_key_size)) ||
> -	    (rxfh.indir_size == ETH_RXFH_INDIR_NO_CHANGE &&
> +	    (rxfh.key_size && (rxfh.key_size != dev_key_size)))

We should take this opportunity to remove the pointless brackets
around key size comparison. Same clause for indir is not bracketed.

> +		return -EINVAL;
> +
> +	/* Must request at least one change: indir size, hash key, function
> +	 * or input transformation.
> +	 * There's no need for any of it in case of context creation.
> +	 */
> +	if (!create && (rxfh.indir_size == ETH_RXFH_INDIR_NO_CHANGE &&
>  	     rxfh.key_size == 0 && rxfh.hfunc == ETH_RSS_HASH_NO_CHANGE &&

And here if (!create should probably be on a line of its own.
Otherwise continuation lines don't align with the opening bracket.