[PATCH v2 0/5] bpf: skb_adjust_room helper refactor and tunnel decap flags
From: Nick Hudson <hidden>
Date: 2026-03-18 13:42:50
Also in:
bpf
This series refactors the bpf_skb_adjust_room() helper to support tunnel decapsulation with L4 and IPXIP modes, in addition to the existing L3 decapsulation support. The changes are structured as follows: 1. Name the enum for BPF_FUNC_skb_adjust_room flags 2. Add new BPF_F_ADJ_ROOM_DECAP_* flags for L4 and IPXIP decap modes 3. Introduce helper masks to simplify validation logic 4. Enable the new decap flags and add guard rails for invalid combinations 5. Clear tunnel GSO state when decapsulating in skb_adjust_room These patches enable BPF programs to efficiently decapsulate various tunnel encapsulation formats and properly handle GSO state transitions. Changes v1 -> v2: - Patch 3: Decap flag acceptance intentionally remains L3-only while adding the helper masks. - Patch 4: Decap with L4/IPXIP support enabled with guard rails. 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 flags and encap validation bpf: allow new DECAP flags and add guard rails bpf: clear decap tunnel GSO state in skb_adjust_room include/uapi/linux/bpf.h | 36 ++++++++++- net/core/filter.c | 107 +++++++++++++++++++++++++++------ tools/include/uapi/linux/bpf.h | 36 ++++++++++- 3 files changed, 156 insertions(+), 23 deletions(-) -- 2.34.1