Re: [PATCH ipsec v2 5/7] net/mlx5e: Use the packet sequence number for the IPsec IV
From: Tariq Toukan
Date: Thu Nov 12 2026 - 07:13:12 EST
On 08/11/2026 16:26, Jérémy Jean wrote:
mlx5e_ipsec_set_iv_esn() may decrement xo->seq.hi for a GSO skb basedAcked-by: Tariq Toukan <tariqt@xxxxxxxxxx>
on the SA's current output counter. The metadata already contains the
high word for the first packet, so this can produce the wrong IV.
For a three-segment GSO skb starting at (H, 0), oseq is 2 and
oseq - gso_segs wraps to 0xffffffff. The helper then uses (H-1, 0)
for the IV instead of (H, 0). This can create a situation where GCM
reuses a nonce.
Remove the high-word adjustment. mlx5e_ipsec_set_iv_esn() then becomes
identical to mlx5e_ipsec_set_iv(), so delete it. Since there is no
longer an alternate IV implementation to select, remove the per-SA
callback and call the common helper directly for outbound crypto
offload.
Fixes: cb01008390bb ("net/mlx5: IPSec, Add support for ESN")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Jérémy Jean <Jeremy.Jean@xxxxxxxxxxxxxxxxx>
---
Changes in v2:
- Simplifications in the code (removal of mlx5e_ipsec_set_esn_ops and
set_iv_op function pointer), thanks to Tariq Toukan.