net/mlx5e: Ensure that IPsec sequence packet number starts from 1
authorLeon Romanovsky <leonro@nvidia.com>
Wed, 20 Sep 2023 07:07:13 +0000 (10:07 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 5 Dec 2023 06:11:51 +0000 (22:11 -0800)
commit3d42c8cc67a8fcbff0181f9ed6d03d353edcee07
tree1e3779b7fbb3a891c90fc7599ebd6f3ca9e71470
parenta5e400a985df8041ed4659ed1462aa9134318130
net/mlx5e: Ensure that IPsec sequence packet number starts from 1

According to RFC4303, section "3.3.3. Sequence Number Generation",
the first packet sent using a given SA will contain a sequence
number of 1.

However if user didn't set seq/oseq, the HW used zero as first sequence
packet number. Such misconfiguration causes to drop of first packet
if replay window protection was enabled in SA.

To fix it, set sequence number to be at least 1.

Fixes: 7db21ef4566e ("net/mlx5e: Set IPsec replay sequence numbers")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c