public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/5] bpf: Add tunnel decapsulation and GSO state updates per new flags
@ 2026-03-17 12:14 Nick Hudson
  2026-03-17 12:14 ` [PATCH v1 1/5] bpf: name the enum for BPF_FUNC_skb_adjust_room flags Nick Hudson
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Nick Hudson @ 2026-03-17 12:14 UTC (permalink / raw)
  To: bpf; +Cc: Willem de Bruijn, Nick Hudson

This patch series enables BPF programs to properly handle GSO state when
decapsulating tunneled packets by adding selective GSO flag clearing.

New decapsulation flags:

- BPF_F_ADJ_ROOM_DECAP_L4_UDP: Clear UDP tunnel GSO flags
 (SKB_GSO_UDP_TUNNEL, SKB_GSO_UDP_TUNNEL_CSUM)
- BPF_F_ADJ_ROOM_DECAP_L4_GRE: Clear GRE tunnel GSO flags
 (SKB_GSO_GRE, SKB_GSO_GRE_CSUM)
- BPF_F_ADJ_ROOM_DECAP_IPXIP4: Clear SKB_GSO_IPXIP4 flag for
 IPv4-in-IPv4 (IPIP) and IPv6-in-IPv4 (SIT) tunnels
- BPF_F_ADJ_ROOM_DECAP_IPXIP6: Clear SKB_GSO_IPXIP6 flag for
 IPv6-in-IPv6 and IPv4-in-IPv6 tunnels

The existing anonymous enum for BPF_FUNC_skb_adjust_room flags is
renamed to enum bpf_adj_room_flags to enable CO-RE (Compile Once -
Run Everywhere) lookups in BPF programs.

Usage example (decapsulating UDP tunnel with IPv4 inner packet):

 bpf_skb_adjust_room(skb, -hdr_len, BPF_ADJ_ROOM_NET,
                     BPF_F_ADJ_ROOM_DECAP_L3_IPV4 |
                     BPF_F_ADJ_ROOM_DECAP_L4_UDP);

Nick Hudson (5):
  bpf: name the enum for BPF_FUNC_skb_adjust_room flags
  bpf: add BPF_F_ADJ_ROOM_DECAP_* flags for tunnel decapsulation
  bpf: add helper masks for ADJ_ROOM decap flags
  bpf: add guard rails for new DECAP flags
  bpf: clear decap tunnel GSO state in skb_adjust_room

 include/uapi/linux/bpf.h       |  36 ++++++++++-
 net/core/filter.c              | 109 ++++++++++++++++++++++++++++-----
 tools/include/uapi/linux/bpf.h |  36 ++++++++++-
 3 files changed, 158 insertions(+), 23 deletions(-)

-- 
2.34.1


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

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

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-17 12:14 [PATCH v1 0/5] bpf: Add tunnel decapsulation and GSO state updates per new flags Nick Hudson
2026-03-17 12:14 ` [PATCH v1 1/5] bpf: name the enum for BPF_FUNC_skb_adjust_room flags Nick Hudson
2026-03-17 12:14 ` [PATCH v1 2/5] bpf: add BPF_F_ADJ_ROOM_DECAP_* flags for tunnel decapsulation Nick Hudson
2026-03-17 12:14 ` [PATCH v1 3/5] bpf: add helper masks for ADJ_ROOM decap flags Nick Hudson
2026-03-17 13:27   ` Willem de Bruijn
2026-03-17 13:47     ` Hudson, Nick
2026-03-17 14:01       ` Willem de Bruijn
2026-03-17 12:14 ` [PATCH v1 4/5] bpf: add guard rails for new DECAP flags Nick Hudson
2026-03-17 13:30   ` Willem de Bruijn
2026-03-17 12:14 ` [PATCH v1 5/5] bpf: clear decap tunnel GSO state in skb_adjust_room Nick Hudson
2026-03-17 13:02   ` bot+bpf-ci

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