Re: [PATCH net v4] xfrm: propagate -EINPROGRESS from validate_xmit_xfrm()
From: Sabrina Dubroca <sd@queasysnail.net>
Date: 2026-06-04 11:29:58
2026-06-03, 08:46:59 +0200, Petr Wozniak wrote:
quoted hunk ↗ jump to hunk
+/* Returns the skb on success, NULL if dropped, or ERR_PTR(-EINPROGRESS) + * if stolen by async xfrm crypto (delivered via xfrm_dev_resume()). + */ static struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device *dev, bool *again) { netdev_features_t features;@@ -4078,7 +4081,6 @@ static struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *dev, bool *again) { struct sk_buff *next, *head = NULL, *tail; -
nit: no, that blank line needs to stay
quoted hunk ↗ jump to hunk
for (; skb != NULL; skb = next) { next = skb->next; skb_mark_not_on_list(skb);@@ -4087,7 +4089,7 @@ struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *d skb->prev = skb; skb = validate_xmit_skb(skb, dev, again); - if (!skb) + if (IS_ERR_OR_NULL(skb)) continue; if (!head)
[...]
quoted hunk ↗ jump to hunk
diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c index 550457e4c..bb0c0fafa 100644 --- a/net/xfrm/xfrm_device.c +++ b/net/xfrm/xfrm_device.c@@ -182,7 +182,7 @@ struct sk_buff *validate_xmit_xfrm(struct sk_buff *skb, netdev_features_t featur err = x->type_offload->xmit(x, skb, esp_features); if (err) { if (err == -EINPROGRESS) - return NULL; + return ERR_PTR(-EINPROGRESS); XFRM_INC_STATS(xs_net(x), LINUX_MIB_XFRMOUTSTATEPROTOERROR); kfree_skb(skb);
Could you please explain why you're ignoring my comment about the 2nd x->type_offload->xmit() call in this function? Thanks, -- Sabrina