Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: Prepare skb extensions for reuse across scrubs
@ 2026-08-31  6:27 Jakub Sitnicki
  2026-08-31  6:27 ` [PATCH net-next 1/2] net: Make skb_ext_put_sp() idempotent Jakub Sitnicki
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jakub Sitnicki @ 2026-08-31  6:27 UTC (permalink / raw)
  To: netdev, Florian Westphal, Paolo Abeni
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Simon Horman,
	Jeremy Kerr, Matt Johnston, Steffen Klassert, Herbert Xu,
	kernel-team

Following Florian's suggestion from the discussion in [1].

The skb extension allocator retains the extension's offset after the
extension is deleted. This, in theory, allows skb_ext_add() to reuse the
existing storage instead of appending another copy when an extension is
added again.  However, it also means that we can't rely on the offset as an
indicator that the extension is present.

Make the extension cleanup safe, even when the offset is already allocated
and set, by making the individual extension put helpers idempotent, so that
they can be called multiple times.

This is preparatory work to support skb extension chunk area reuse after
skb scrubbing, which would be needed to persist BPF metadata skb extension
across scrubs [2].

[1] https://lore.kernel.org/all/ao9UV9S7rUkyQ8jv@strlen.de/
[2] https://lore.kernel.org/all/64365932-c765-472e-bf6c-b07c9ee25eaf@kernel.org/

Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
---
Jakub Sitnicki (2):
      net: Make skb_ext_put_sp() idempotent
      net: Make skb_ext_put_mctp() idempotent

 net/core/skbuff.c | 30 +++++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-09-02 14:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31  6:27 [PATCH net-next 0/2] net: Prepare skb extensions for reuse across scrubs Jakub Sitnicki
2026-08-31  6:27 ` [PATCH net-next 1/2] net: Make skb_ext_put_sp() idempotent Jakub Sitnicki
2026-09-02  0:15   ` Jakub Kicinski
2026-09-02  5:51     ` Jakub Sitnicki
2026-09-02  9:24       ` Paolo Abeni
2026-09-02 14:03         ` Florian Westphal
2026-08-31  6:27 ` [PATCH net-next 2/2] net: Make skb_ext_put_mctp() idempotent Jakub Sitnicki
2026-09-01  5:26   ` Jeremy Kerr
2026-09-02  0:36 ` [PATCH net-next 0/2] net: Prepare skb extensions for reuse across scrubs patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox