]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: macsec: use update_pn flag instead of PN comparation
authorRadu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com>
Thu, 5 Oct 2023 18:06:36 +0000 (21:06 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Oct 2023 21:08:53 +0000 (23:08 +0200)
commit89be6ad344f7632554aa444e1798a763281ea5e6
tree45113e4c00461b325ff976d46809a8f979155c5f
parenta698195f3a6033bf1efa7ae165d44352296cf1b0
net/mlx5e: macsec: use update_pn flag instead of PN comparation

[ Upstream commit fde2f2d7f23d39f2fc699ba6d91ac3f4a2e637ca ]

When updating the SA, use the new update_pn flags instead of comparing the
new PN with the initial one.

Comparing the initial PN value with the new value will allow the user
to update the SA using the initial PN value as a parameter like this:
$ ip macsec add macsec0 tx sa 0 pn 1 on key 00 \
ead3664f508eb06c40ac7104cdae4ce5
$ ip macsec set macsec0 tx sa 0 pn 1 off

Fixes: 8ff0ac5be144 ("net/mlx5: Add MACsec offload Tx command support")
Fixes: aae3454e4d4c ("net/mlx5e: Add MACsec offload Rx command support")
Signed-off-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c