[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221128193553.0e694508@kernel.org>
Date: Mon, 28 Nov 2022 19:35:53 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Saeed Mahameed <saeed@...nel.org>
Cc: Jacob Keller <jacob.e.keller@...el.com>,
"David S. Miller" <davem@...emloft.net>,
Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>,
Saeed Mahameed <saeedm@...dia.com>, <netdev@...r.kernel.org>,
Tariq Toukan <tariqt@...dia.com>,
Emeel Hakim <ehakim@...dia.com>, Raed Salem <raeds@...dia.com>
Subject: Re: [net 13/15] net/mlx5e: MACsec, remove replay window size
limitation in offload path
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 :/
Powered by blists - more mailing lists