net/mlx5e: MACsec, fix mlx5e_macsec_update_rxsa bail condition and functionality
authorRaed Salem <raeds@nvidia.com>
Mon, 31 Oct 2022 07:24:06 +0000 (09:24 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 24 Nov 2022 08:03:22 +0000 (00:03 -0800)
commitceb51b273ec0b1a32de8a167c28a602bb3d290a1
tree5a40289f5dfdd5bdfa862c8e811ad377486e00cf
parenteead5ea2fce4196139f399a5727602c3747e1370
net/mlx5e: MACsec, fix mlx5e_macsec_update_rxsa bail condition and functionality

Fix update Rx SA wrong bail condition, naturally update functionality
needs to check that something changed otherwise bailout currently the
active state check does just the opposite, furthermore unlike deactivate
path which remove the macsec rules to deactivate the offload, the
activation path does not include the counter part installation of the
macsec rules.

Fix by using correct bailout condition and when Rx SA changes state to
active then add the relevant macsec rules.

While at it, refine function name to reflect more precisely its role.

Fixes: aae3454e4d4c ("net/mlx5e: Add MACsec offload Rx command support")
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