net/mlx5e: Fix MACsec update SecY
authorEmeel Hakim <ehakim@nvidia.com>
Sun, 30 Oct 2022 09:52:42 +0000 (11:52 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 22 Nov 2022 02:14:35 +0000 (18:14 -0800)
Currently updating SecY destroys and re-creates RX SA objects,
the re-created RX SA objects are not identical to the destroyed
objects and it disagree on the encryption enabled property which
holds the value false after recreation, this value is not
supported with offload which leads to no traffic after an update.
Fix by recreating an identical objects.

Fixes: 5a39816a75e5 ("net/mlx5e: Add MACsec offload SecY support")
Signed-off-by: Emeel Hakim <ehakim@nvidia.com>
Reviewed-by: Raed Salem <raeds@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c

index 8f8a735a4501c8651a675f600b463de853776909..4f96c69c6cc489f655771f4d8b224dd26841a314 100644 (file)
@@ -1155,7 +1155,7 @@ static int macsec_upd_secy_hw_address(struct macsec_context *ctx,
                                continue;
 
                        if (rx_sa->active) {
-                               err = mlx5e_macsec_init_sa(ctx, rx_sa, false, false);
+                               err = mlx5e_macsec_init_sa(ctx, rx_sa, true, false);
                                if (err)
                                        goto out;
                        }