Subject: Re: [PATCH net 1/2] iavf: fix FDIR rule fields masks validation

From: Leon Romanovsky <[email-masked]>
Date: Thu, 17 Aug 2023 14:27:38 +0300

On Wed, Aug 16, 2023 at 12:33:07PM -0700, Tony Nguyen wrote:
> From: Piotr Gardocki <[email-masked]>
> 
> Return an error if a field's mask is neither full nor empty. When a mask
> is only partial the field is not being used for rule programming but it
> gives a wrong impression it is used. Fix by returning an error on any
> partial mask to make it clear they are not supported.
> The ip_ver assignment is moved earlier in code to allow using it in
> iavf_validate_fdir_fltr_masks.
> 
> Fixes: 527691bf0682 ("iavf: Support IPv4 Flow Director filters")
> Fixes: e90cbc257a6f ("iavf: Support IPv6 Flow Director filters")
> Signed-off-by: Piotr Gardocki <[email-masked]>
> Tested-by: Rafal Romanowski <[email-masked]>
> Signed-off-by: Tony Nguyen <[email-masked]>
> ---
>  .../net/ethernet/intel/iavf/iavf_ethtool.c    | 10 +++
>  drivers/net/ethernet/intel/iavf/iavf_fdir.c   | 77 ++++++++++++++++++-
>  drivers/net/ethernet/intel/iavf/iavf_fdir.h   |  2 +
>  3 files changed, 85 insertions(+), 4 deletions(-)

<...>

> +static const struct in6_addr ipv6_addr_zero_mask = {
> +	.in6_u = {
> +		.u6_addr8 = {
> +			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
> +		}
> +	}
> +};
> +

Static variables are zeroed by default, there is no need in direct assignment of 0s.

Thanks,
Reviewed-by: Leon Romanovsky <[email-masked]>