]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
net/mlx5e: Fix MACsec state loss upon state update in offload path
authorEmeel Hakim <ehakim@nvidia.com>
Mon, 13 Mar 2023 15:03:03 +0000 (17:03 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Sat, 2 Mar 2024 07:02:26 +0000 (23:02 -0800)
commita71f2147b64941efee156bfda54fd6461d0f95df
tree9eec5f86e91fadff0bc90ac0361c20a7a29039e8
parentdd238b702064b21d25b4fc39a19699319746d655
net/mlx5e: Fix MACsec state loss upon state update in offload path

The packet number attribute of the SA is incremented by the device rather
than the software stack when enabling hardware offload. Because the packet
number attribute is managed by the hardware, the software has no insight
into the value of the packet number attribute actually written by the
device.

Previously when MACsec offload was enabled, the hardware object for
handling the offload was destroyed when the SA was disabled. Re-enabling
the SA would lead to a new hardware object being instantiated. This new
hardware object would not have any recollection of the correct packet
number for the SA. Instead, destroy the flow steering rule when
deactivating the SA and recreate it upon reactivation, preserving the
original hardware object.

Fixes: 8ff0ac5be144 ("net/mlx5: Add MACsec offload Tx command support")
Signed-off-by: Emeel Hakim <ehakim@nvidia.com>
Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Reviewed-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c