net/mlx5e: Tidy up IPsec NAT-T SA discovery
authorLeon Romanovsky <leonro@nvidia.com>
Sun, 12 Nov 2023 11:50:00 +0000 (13:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2023 16:01:44 +0000 (17:01 +0100)
commit1a0d0e97a750f883b0f4ae6938346092bc41fcdb
tree2c5c3df5aaedeca01da5604602de6d6c9a8d667e
parent20af7afcd8b85a4cb413072d631bf9a6469eee3a
net/mlx5e: Tidy up IPsec NAT-T SA discovery

[ Upstream commit c2bf84f1d1a1595dcc45fe867f0e02b331993fee ]

IPsec NAT-T packets are UDP encapsulated packets over ESP normal ones.
In case they arrive to RX, the SPI and ESP are located in inner header,
while the check was performed on outer header instead.

That wrong check caused to the situation where received rekeying request
was missed and caused to rekey timeout, which "compensated" this failure
by completing rekeying.

Fixes: d65954934937 ("net/mlx5e: Support IPsec NAT-T functionality")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
include/linux/mlx5/mlx5_ifc.h