Subject: Re: [net 13/15] net/mlx5e: MACsec, remove replay window size limitation in offload path

From: Saeed Mahameed <[email-masked]>
Date: Mon, 28 Nov 2022 21:44:57 -0800

On 28 Nov 19:35, Jakub Kicinski wrote:
>On Mon, 28 Nov 2022 15:42:19 -0800 Jacob Keller wrote:
>> > index c19581f1f733..72f8be65fa90 100644
>> > --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
>> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
>> > @@ -229,22 +229,6 @@ static int macsec_set_replay_protection(struct mlx5_macsec_obj_attrs *attrs, voi
>> >   	if (!attrs->replay_protect)
>> >   		return 0;
>> >
>> > -	switch (attrs->replay_window) {
>> > -	case 256:
>> > -		window_sz = MLX5_MACSEC_ASO_REPLAY_WIN_256BIT;
>> > -		break;
>> > -	case 128:
>> > -		window_sz = MLX5_MACSEC_ASO_REPLAY_WIN_128BIT;
>> > -		break;
>> > -	case 64:
>> > -		window_sz = MLX5_MACSEC_ASO_REPLAY_WIN_64BIT;
>> > -		break;
>> > -	case 32:
>> > -		window_sz = MLX5_MACSEC_ASO_REPLAY_WIN_32BIT;
>> > -		break;
>> > -	default:
>> > -		return -EINVAL;
>> > -	}
>>
>> What sets window_sz now? Looking at the current code wouldn't this leave
>> window_sz uninitialized and this undefined behavior of MLX5_SET? Either
>> you should just forward in attrs->replay_window and remove window_sz
>> local or drop the MLX5_SET call for setting window size?
>
>Damn it, this is a clang warning, I need to rescind the PR :/

Make sense, Jacob found two real issues and this one is critical,
but I don't know how that works for PRs, let me know when you do it so I
will add his reviewed-by tags and address the two issues when is send v2.

another option is that i am currently working on my next PR for net, I can
address those two issues there, but we won't have Jacobs reviewed-by for
the work he already done on this series :/ .. 

Thanks.