Thread (26 messages) 26 messages, 4 authors, 2026-01-22

Re: [net-next,V5,11/15] net/mlx5: Expose a function to clear a vport's parent

flat view

From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-01-22 03:42:29
Also in: linux-doc, linux-rdma, lkml

On Wed, 21 Jan 2026 19:40:01 -0800 Jakub Kicinski wrote:
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.

For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
net/mlx5e: Skip ESN replay window setup for IPsec crypto offload

This patch fixes a WARN_ON being triggered for crypto offload by adding
a check to skip the replay window setup when the offload type is not
XFRM_DEV_OFFLOAD_PACKET.
quoted
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
index a8fb4bec369c..63aa23f5c49e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
@@ -430,7 +430,8 @@ void mlx5e_ipsec_build_accel_xfrm_attrs(struct mlx5e_ipsec_sa_entry *sa_entry,
 		attrs->replay_esn.esn = sa_entry->esn_state.esn;
 		attrs->replay_esn.esn_msb = sa_entry->esn_state.esn_msb;
 		attrs->replay_esn.overlap = sa_entry->esn_state.overlap;
-		if (attrs->dir == XFRM_DEV_OFFLOAD_OUT)
+		if (attrs->dir == XFRM_DEV_OFFLOAD_OUT ||
+		    attrs->type != XFRM_DEV_OFFLOAD_PACKET)
 			goto skip_replay_window;  
At this point in mlx5e_ipsec_build_accel_xfrm_attrs(), attrs->type has not
been initialized yet. The function starts with memset(attrs, 0, ...) which
sets attrs->type to 0 (XFRM_DEV_OFFLOAD_UNSPECIFIED).

The assignment attrs->type = x->xso.type happens later after the
skip_replay_window label. This means the condition attrs->type !=
XFRM_DEV_OFFLOAD_PACKET evaluates as 0 != 2 which is always true.

As a result, the replay window setup will be skipped for all inbound
configurations, not just crypto offload. Should this check use x->xso.type
instead of attrs->type, or should attrs->type be assigned earlier in the
function before this check?
Herm, something misfired here, this is a review for the series of fixes
posted on the same day, not for the rate scheduling.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help