net/mlx5e: MACsec, fix RX data path 16 RX security channel limit
authorRaed Salem <raeds@nvidia.com>
Thu, 27 Oct 2022 12:47:17 +0000 (15:47 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 24 Nov 2022 08:03:21 +0000 (00:03 -0800)
commit813115c4669d74cdf6fc253c5a1768d1202073c3
tree30ae4be085b7393e1608d9811d3b36933ba6e922
parent406e6db7fcaf2a47f6ac8bef47057305c6bc8b0e
net/mlx5e: MACsec, fix RX data path 16 RX security channel limit

Currently the data path metadata flow id mask wrongly limits the
number of different RX security channels (SC) to 16, whereas in
adding RX SC the limit is "2^16 - 1" this cause an overlap in
metadata flow id once more than 16 RX SCs is added, this corrupts
MACsec RX offloaded flow handling.

Fix by using the correct mask, while at it improve code to use this
mask when adding the Rx rule and improve visibility of such errors
by adding debug massage.

Fixes: b7c9400cbc48 ("net/mlx5e: Implement MACsec Rx data path using MACsec skb_metadata_dst")
Signed-off-by: Raed Salem <raeds@nvidia.com>
Reviewed-by: Emeel Hakim <ehakim@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.h
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c