|
Thomas Bogendoerfer |
908326 |
From: Raed Salem <raeds@nvidia.com>
|
|
Thomas Bogendoerfer |
908326 |
Date: Tue, 8 Nov 2022 14:30:33 +0200
|
|
Thomas Bogendoerfer |
908326 |
Subject: net/mlx5e: MACsec, fix Tx SA active field update
|
|
Thomas Bogendoerfer |
908326 |
Patch-mainline: v6.1-rc8
|
|
Thomas Bogendoerfer |
908326 |
Git-commit: 7c5578e29963c35bb14d08b15df77a0c11f71fc5
|
|
Thomas Bogendoerfer |
908326 |
References: jsc#PED-1549
|
|
Thomas Bogendoerfer |
908326 |
|
|
Thomas Bogendoerfer |
908326 |
Currently during update Tx security association (SA) flow, the Tx SA
|
|
Thomas Bogendoerfer |
908326 |
active state is updated only if the Tx SA in question is the same SA
|
|
Thomas Bogendoerfer |
908326 |
that the MACsec interface is using for Tx,in consequence when the
|
|
Thomas Bogendoerfer |
908326 |
MACsec interface chose to work with this Tx SA later, where this SA
|
|
Thomas Bogendoerfer |
908326 |
for example should have been updated to active state and it was not,
|
|
Thomas Bogendoerfer |
908326 |
the relevant Tx SA HW context won't be installed, hence the MACSec
|
|
Thomas Bogendoerfer |
908326 |
flow won't be offloaded.
|
|
Thomas Bogendoerfer |
908326 |
|
|
Thomas Bogendoerfer |
908326 |
Fix by update Tx SA active state as part of update flow regardless
|
|
Thomas Bogendoerfer |
908326 |
whether the SA in question is the same Tx SA used by the MACsec
|
|
Thomas Bogendoerfer |
908326 |
interface.
|
|
Thomas Bogendoerfer |
908326 |
|
|
Thomas Bogendoerfer |
908326 |
Fixes: 8ff0ac5be144 ("net/mlx5: Add MACsec offload Tx command support")
|
|
Thomas Bogendoerfer |
908326 |
Signed-off-by: Raed Salem <raeds@nvidia.com>
|
|
Thomas Bogendoerfer |
908326 |
Reviewed-by: Emeel Hakim <ehakim@nvidia.com>
|
|
Thomas Bogendoerfer |
908326 |
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
|
|
Thomas Bogendoerfer |
908326 |
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
|
|
Thomas Bogendoerfer |
908326 |
---
|
|
Thomas Bogendoerfer |
908326 |
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c | 3 +--
|
|
Thomas Bogendoerfer |
908326 |
1 file changed, 1 insertion(+), 2 deletions(-)
|
|
Thomas Bogendoerfer |
908326 |
|
|
Thomas Bogendoerfer |
908326 |
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
|
|
Thomas Bogendoerfer |
908326 |
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
|
|
Thomas Bogendoerfer |
908326 |
@@ -618,6 +618,7 @@ static int mlx5e_macsec_upd_txsa(struct
|
|
Thomas Bogendoerfer |
908326 |
if (tx_sa->active == ctx_tx_sa->active)
|
|
Thomas Bogendoerfer |
908326 |
goto out;
|
|
Thomas Bogendoerfer |
908326 |
|
|
Thomas Bogendoerfer |
908326 |
+ tx_sa->active = ctx_tx_sa->active;
|
|
Thomas Bogendoerfer |
908326 |
if (tx_sa->assoc_num != tx_sc->encoding_sa)
|
|
Thomas Bogendoerfer |
908326 |
goto out;
|
|
Thomas Bogendoerfer |
908326 |
|
|
Thomas Bogendoerfer |
908326 |
@@ -633,8 +634,6 @@ static int mlx5e_macsec_upd_txsa(struct
|
|
Thomas Bogendoerfer |
908326 |
|
|
Thomas Bogendoerfer |
908326 |
mlx5e_macsec_cleanup_sa(macsec, tx_sa, true);
|
|
Thomas Bogendoerfer |
908326 |
}
|
|
Thomas Bogendoerfer |
908326 |
-
|
|
Thomas Bogendoerfer |
908326 |
- tx_sa->active = ctx_tx_sa->active;
|
|
Thomas Bogendoerfer |
908326 |
out:
|
|
Thomas Bogendoerfer |
908326 |
mutex_unlock(&macsec->lock);
|
|
Thomas Bogendoerfer |
908326 |
|