[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251124-skb-meta-safeproof-netdevs-rx-only-v1-8-8978f5054417@cloudflare.com>
Date: Mon, 24 Nov 2025 17:28:44 +0100
From: Jakub Sitnicki <jakub@...udflare.com>
To: bpf@...r.kernel.org
Cc: netdev@...r.kernel.org, kernel-team@...udflare.com,
Martin KaFai Lau <martin.lau@...ux.dev>
Subject: [PATCH RFC bpf-next 08/15] xsk: Call skb_metadata_set when
skb->data points at metadata end
Prepare to track skb metadata location independently of MAC header offset.
Following changes will make skb_metadata_set() record where metadata ends
relative to skb->head. Hence the helper must be called when skb->data
already points past the metadata area.
Adjust AF_XDP to pull from skb->data before calling skb_metadata_set().
Signed-off-by: Jakub Sitnicki <jakub@...udflare.com>
---
net/core/xdp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/xdp.c b/net/core/xdp.c
index 9100e160113a..e86ac1d6ad6d 100644
--- a/net/core/xdp.c
+++ b/net/core/xdp.c
@@ -768,8 +768,8 @@ struct sk_buff *xdp_build_skb_from_zc(struct xdp_buff *xdp)
metalen = xdp->data - xdp->data_meta;
if (metalen > 0) {
- skb_metadata_set(skb, metalen);
__skb_pull(skb, metalen);
+ skb_metadata_set(skb, metalen);
}
skb_record_rx_queue(skb, rxq->queue_index);
--
2.43.0
Powered by blists - more mailing lists