Skip to content

[ciq-6.18.y] Multiple patches tested (6 commits) - #1545

Open
ciq-kernel-automation[bot] wants to merge 6 commits into
ciq-6.18.yfrom
{bmastbergen_bpf_skb_adjust_room}_ciq-6.18.y
Open

[ciq-6.18.y] Multiple patches tested (6 commits)#1545
ciq-kernel-automation[bot] wants to merge 6 commits into
ciq-6.18.yfrom
{bmastbergen_bpf_skb_adjust_room}_ciq-6.18.y

Conversation

@ciq-kernel-automation

@ciq-kernel-automationciq-kernel-automationBot commented Aug 20, 2026

Copy link
Copy Markdown

Summary

This PR has been automatically created after successful completion of all CI stages.

Commit Message(s)

bpf: Name the enum for BPF_FUNC_skb_adjust_room flags
commit-author Nick Hudson <nhudson@akamai.com>
commit 5e4bcad6171d4baf426e49a39580cdb79254ea36
bpf: Refactor masks for ADJ_ROOM flags and encap validation
commit-author Nick Hudson <nhudson@akamai.com>
commit 7b2ea1151e04d3506030db8734c48c5c2bec1392
upstream-diff |
applied with line offset fuzz due to absence of bool decap
variable (present in bpf-next, not in this tree). Code changes
are identical to upstream.
bpf: Add BPF_F_ADJ_ROOM_DECAP_* flags for tunnel decapsulation
commit-author Nick Hudson <nhudson@akamai.com>
commit da199070bc6209bf5db970f8f84c7db4210fe511
bpf: Allow new DECAP flags and add guard rails
commit-author Nick Hudson <nhudson@akamai.com>
commit 3a39c214fd2c3dd8266649e7f9f85ca1439eb738
bpf: Clear decap state on skb_adjust_room shrink path
commit-author Nick Hudson <nhudson@akamai.com>
commit ec20dee2f2c4796c0f7c0a7d8a3a3e8a9e9da7a4
selftests/bpf: tc_tunnel - validate decap GSO and encapsulation state
commit-author Nick Hudson <nhudson@akamai.com>
commit adb771973026efe54627bcbe927e7205d04d6c68
upstream-diff |
The upstream patch targets bpf-next where the BPF program has been
converted to use vmlinux.h (commit 86433db93256) and the test runner
has been migrated from a shell script to a C-based test_progs harness
(commit 8517b1abe5ea). This tree has neither of those prerequisites,
so the following upstream changes were dropped:
- Post-decap GSO gso_type and skb->encapsulation validation
via bpf_cast_to_kern_ctx/bpf_core_cast into skb_shared_info.
These require vmlinux.h to access kernel-internal structs
(sk_buff, skb_shared_info) and SKB_GSO_* constants.
- TSO disable removal from prog_tests/test_tc_tunnel.c (file absent;
this tree still uses test_tc_tunnel.sh).
The CO-RE enum existence checks, functional flag-passing changes
(DECAP_L4_GRE, DECAP_L4_UDP, DECAP_IPXIP4, DECAP_IPXIP6), and
ipxip_flag parameter plumbing through decap_internal/decap_ipv4/
decap_ipv6 are applied as in upstream. The test exercises the new
kernel flag acceptance path and will fail to load on kernels lacking
the new enum values, but does not validate post-decap skb state.

Test Results

✅ Build Stage

ArchitectureBuild TimeTotal Time
x86_6437m 40s38m 27s
aarch6423m 44s24m 20s

✅ Boot Verification

✅ Kernel Selftests

ArchitecturePassedFailedCompared AgainstStatus
x86_6444763ciq-6.18.y⚠️ No baseline available
aarch6437856ciq-6.18.y⚠️ No baseline available

✅ LTP Results

ArchitecturePassedFailedCompared AgainstStatus
x86_64147882ciq-6.18.y⚠️ No baseline available
aarch64145282ciq-6.18.y⚠️ No baseline available

🤖 This PR was automatically generated by GitHub Actions
Run ID: 32773041301

@ciq-kernel-automationciq-kernel-automationBot added the created-by-kernelci Tag PRs that were automatically created when a user branch was pushed to the repo (kernelCI) label Aug 20, 2026
@bmastbergen

Copy link
Copy Markdown
Collaborator

Test results:

Test: BPF_F_ADJ_ROOM_DECAP_* GSO state verification
Host: VM running patched 6.18 kernel
Date: 2026-08-21
== Method ==
A kprobe BPF checker program hooks ip_rcv() and reads the real
sk_buff fields (skb->encapsulation and skb_shinfo(skb)->gso_type)
after tc ingress processing (where the BPF decap program runs)
but before TCP delivery. This directly verifies that the kernel
cleared the tunnel GSO bits and encapsulation flag, rather than
just checking whether traffic flows.
The test sends 64KB payloads with TSO enabled to trigger GSO
segmentation, then verifies that no tunnel GSO bits (SKB_GSO_GRE,
SKB_GSO_IPXIP4, SKB_GSO_UDP_TUNNEL, etc.) remain set after
bpf_skb_adjust_room() with the new DECAP flags.
== Results ==
=== building checker ===
checker built OK
=== loading checker kprobe ===
attached to ip_rcv
=== BPF decap flags GSO test ===
kernel: 6.18.43-bmastbergen_bpf_skb_adjust_room_ciq-6.18.y-eb2f26ded6+
--- GSO path (64KB, TSO on) ---
ipip (DECAP_IPXIP4) PASS (13 pkts, GSO clean)
gre (DECAP_L4_GRE+IPXIP4) SKIP (checker saw 0 pkts)
gre+eth (DECAP_L4_GRE+IPXIP4) SKIP (checker saw 0 pkts)
sit (DECAP_IPXIP4) PASS (12 pkts, GSO clean)
--- non-GSO baseline (100B) ---
ipip 100B PASS (5 pkts, GSO clean)
gre 100B SKIP (checker saw 0 pkts)
--- trace log ---
(no trace output)
=== Results: 3 passed, 0 failed ===
== Notes ==
- PASS means the kprobe checker confirmed gso_type has no tunnel
bits set and skb->encapsulation == 0 after BPF decap.
- SKIP on GRE: the existing test_tc_tunnel BPF encap/decap programs
use section-name-based loading via tc (not skeleton), and the GRE
tunnel path requires both encap and decap to properly handshake
through a veth pair. The IPIP/SIT tunnel types exercise the core
DECAP_IPXIP4 flag path which is the primary GSO cleanup codepath.
- The "trace log" section is empty because the trace buffer is
cleared between subtests. Sample trace output from earlier runs:
nc-14804 [006] ..s31 934.159609: bpf_trace_printk: CHECKER: gso_type=0x1 encap=0 CLEAN (GOOD)
nc-14804 [006] ..s31 934.159699: bpf_trace_printk: CHECKER: gso_type=0x1 encap=0 CLEAN (GOOD)
gso_type=0x1 is SKB_GSO_TCPV4 (the only GSO bit that should
remain after tunnel decapsulation).

test-decap-gso-618.sh

@PlaidCat

Copy link
Copy Markdown
Collaborator

Still need to review this BUT its been merged upstream as well.

@bmastbergen
bmastbergenforce-pushed the {bmastbergen_bpf_skb_adjust_room}_ciq-6.18.y branch from eb2f26d to 3985545CompareAugust 24, 2026 15:19
@bmastbergen

Copy link
Copy Markdown
Collaborator

Still need to review this BUT its been merged upstream as well.

Commit headers updated with upstream shas. Thanks!

@PlaidCat
PlaidCat requested a review from a teamAugust 24, 2026 17:10

@PlaidCatPlaidCat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Unless we want to fix up the signed-off-by: Brett and not indent it.
and
selftests/bpf: tc_tunnel - pass decap flags for tunnel type commit message differs significantly from upstream
adb7719

@PlaidCat
PlaidCat requested a review from a teamAugust 24, 2026 17:29
@PlaidCat

Copy link
Copy Markdown
Collaborator

I guess in Commit 2 and Commit 5 we're also missing the reviewed-by that is present in the upstream commits

@PlaidCatPlaidCat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops

@PlaidCat
PlaidCat requested a review from a teamAugust 24, 2026 18:09
commit-author Nick Hudson <nhudson@akamai.com>
commit 5e4bcad
The existing anonymous enum for BPF_FUNC_skb_adjust_room flags is
named to enum bpf_adj_room_flags to enable CO-RE (Compile Once -
Run Everywhere) lookups in BPF programs.
Co-developed-by: Max Tottenham <mtottenh@akamai.com>
Co-developed-by: Anna Glasgall <aglasgal@akamai.com>
Signed-off-by: Max Tottenham <mtottenh@akamai.com>
Signed-off-by: Anna Glasgall <aglasgal@akamai.com>
Signed-off-by: Nick Hudson <nhudson@akamai.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/bpf/20260812083115.73100-2-nhudson@akamai.com
(cherry picked from commit 5e4bcad)
Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
commit-author Nick Hudson <nhudson@akamai.com>
commit 7b2ea11
upstream-diff |
applied with line offset fuzz due to absence of bool decap
variable (present in bpf-next, not in this tree). Code changes
are identical to upstream.
Refactor the helper masks for bpf_skb_adjust_room() flags to simplify
validation logic and introduce:
- BPF_F_ADJ_ROOM_ENCAP_MASK
- BPF_F_ADJ_ROOM_DECAP_MASK
Refactor existing validation checks in bpf_skb_net_shrink() and
bpf_skb_adjust_room() to use the new masks (no behavior change).
This is in preparation for supporting the new decap flags.
Co-developed-by: Max Tottenham <mtottenh@akamai.com>
Co-developed-by: Anna Glasgall <aglasgal@akamai.com>
Signed-off-by: Max Tottenham <mtottenh@akamai.com>
Signed-off-by: Anna Glasgall <aglasgal@akamai.com>
Signed-off-by: Nick Hudson <nhudson@akamai.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/bpf/20260812083115.73100-3-nhudson@akamai.com
(cherry picked from commit 7b2ea11)
Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
commit-author Nick Hudson <nhudson@akamai.com>
commit da19907
Add new bpf_skb_adjust_room() decapsulation flags:
- BPF_F_ADJ_ROOM_DECAP_L4_GRE
- BPF_F_ADJ_ROOM_DECAP_L4_UDP
- BPF_F_ADJ_ROOM_DECAP_IPXIP4
- BPF_F_ADJ_ROOM_DECAP_IPXIP6
These flags let BPF programs describe which tunnel layer is being
removed, so later changes can update tunnel-related GSO state
accordingly during decapsulation.
This patch only introduces the UAPI flag definitions and helper
documentation.
Co-developed-by: Max Tottenham <mtottenh@akamai.com>
Co-developed-by: Anna Glasgall <aglasgal@akamai.com>
Signed-off-by: Max Tottenham <mtottenh@akamai.com>
Signed-off-by: Anna Glasgall <aglasgal@akamai.com>
Signed-off-by: Nick Hudson <nhudson@akamai.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/bpf/20260812083115.73100-4-nhudson@akamai.com
(cherry picked from commit da19907)
Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
commit-author Nick Hudson <nhudson@akamai.com>
commit 3a39c21
Add checks to require shrink-only decap, reject conflicting decap flag
combinations, and verify removed length is sufficient for claimed header
decapsulation.
Co-developed-by: Max Tottenham <mtottenh@akamai.com>
Co-developed-by: Anna Glasgall <aglasgal@akamai.com>
Signed-off-by: Max Tottenham <mtottenh@akamai.com>
Signed-off-by: Anna Glasgall <aglasgal@akamai.com>
Signed-off-by: Nick Hudson <nhudson@akamai.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/bpf/20260812083115.73100-5-nhudson@akamai.com
(cherry picked from commit 3a39c21)
Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
commit-author Nick Hudson <nhudson@akamai.com>
commit ec20dee
On shrink in bpf_skb_adjust_room(), apply decapsulation state updates
according to BPF_F_ADJ_ROOM_DECAP_* flags.
For GSO skbs, clear only the tunnel gso_type bits that correspond to
the requested decap layer:
- DECAP_L4_UDP: SKB_GSO_UDP_TUNNEL{,_CSUM}
- DECAP_L4_GRE: SKB_GSO_GRE{,_CSUM}
- DECAP_IPXIP4: SKB_GSO_IPXIP4
- DECAP_IPXIP6: SKB_GSO_IPXIP6
Then clear skb->encapsulation only if no tunnel GSO bits remain, keeping
encapsulation set for cases such as ESP-in-UDP where tunnel state remains.
For non-GSO skbs, there are no tunnel GSO bits to consult, so clear
skb->encapsulation directly when DECAP_L4_* or DECAP_IPXIP_* flags are set.
This keeps decap state handling consistent between GSO and non-GSO packets.
Co-developed-by: Max Tottenham <mtottenh@akamai.com>
Co-developed-by: Anna Glasgall <aglasgal@akamai.com>
Signed-off-by: Max Tottenham <mtottenh@akamai.com>
Signed-off-by: Anna Glasgall <aglasgal@akamai.com>
Signed-off-by: Nick Hudson <nhudson@akamai.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/bpf/20260812083115.73100-6-nhudson@akamai.com
(cherry picked from commit ec20dee)
Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
commit-author Nick Hudson <nhudson@akamai.com>
commit adb7719
upstream-diff |
The upstream patch targets bpf-next where the BPF program has been
converted to use vmlinux.h (commit 86433db) and the test runner
has been migrated from a shell script to a C-based test_progs harness
(commit 8517b1a). This tree has neither of those prerequisites,
so the following upstream changes were dropped:
- Post-decap GSO gso_type and skb->encapsulation validation
via bpf_cast_to_kern_ctx/bpf_core_cast into skb_shared_info.
These require vmlinux.h to access kernel-internal structs
(sk_buff, skb_shared_info) and SKB_GSO_* constants.
- TSO disable removal from prog_tests/test_tc_tunnel.c (file absent;
this tree still uses test_tc_tunnel.sh).
The CO-RE enum existence checks, functional flag-passing changes
(DECAP_L4_GRE, DECAP_L4_UDP, DECAP_IPXIP4, DECAP_IPXIP6), and
ipxip_flag parameter plumbing through decap_internal/decap_ipv4/
decap_ipv6 are applied as in upstream. The test exercises the new
kernel flag acceptance path and will fail to load on kernels lacking
the new enum values, but does not validate post-decap skb state.
tc_tunnel only partially validated decap state and missed some tunnel
cases. In particular, IPXIP decap checks were not exercised for
IPIP/SIT paths, and non-GSO decap encapsulation state was not
verified.
Tighten the test by:
- setting DECAP_IPXIP4/6 flags for IPIP/SIT/IP6 decap paths based on
the outer tunnel header family;
- requiring needed DECAP enum values via CO-RE enum existence checks
so missing kernel support fails fast;
- validating post-decap tunnel state for both GSO and non-GSO packets:
expected gso_type bits must be cleared and skb->encapsulation must
match remaining tunnel flags;
- removing forced TSO disable in the test harness so GSO validation is
exercised.
This improves coverage for decap tunnel-state regressions and ensures
sit_none/ipip-style paths are checked correctly.
Signed-off-by: Nick Hudson <nhudson@akamai.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20260812083115.73100-7-nhudson@akamai.com
(cherry picked from commit adb7719)
Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
@bmastbergen
bmastbergenforce-pushed the {bmastbergen_bpf_skb_adjust_room}_ciq-6.18.y branch from 3985545 to 86dc0d0CompareAugust 24, 2026 20:17
@bmastbergen

Copy link
Copy Markdown
Collaborator

I guess in Commit 2 and Commit 5 we're also missing the reviewed-by that is present in the upstream commits

Ah yea, I just updated the commit line, but didn't think about the fact that the upstream commits might be different in other ways. Updated all commits to be in sync with the upstream commits, plus our headers and trailers.

@kerneltoastkerneltoast left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I iterated with Claude (Feeble 5) reviewing this. Nothing that's a blocker in this PR. Here's the feedback written by Claude:


The upstream-diff note on 192a27a ("bpf: Refactor masks for ADJ_ROOM flags and encap validation") attributes the missing bool decap context line to bpf-next, but that line actually comes from 699f47e ("net: Clear the dst when performing encap / decap"), which has been in mainline since v7.1. Preferably backport 699f47e as a prerequisite, since it's a small filter.c-only patch and with it the patched functions come out byte-identical to upstream; otherwise correct the note.

The four bpf_core_enum_value_exists() checks kept in test_tc_tunnel.c here were dropped on #1546, whose note cites iproute2's legacy tc loader. Both ciq-6.18.y and ciqlts9_6 carry byte-identical copies of test_tc_tunnel.sh and load the program the same way, so whichever rationale is right applies to both PRs; see the comment on #1546 for the suggested resolution.

The kprobe checker results above cover the DECAP_IPXIP4 paths (ipip and sit), but every GRE row is a SKIP and there are no UDP or IPXIP6 rows, so the new L4 decap handling never got exercised: the guard-rail length math for GRE/UDP headers and the SKB_GSO_GRE*/SKB_GSO_UDP_TUNNEL* clearing in the shrink path. Worth closing that gap before this ships, even if it takes extending the test-decap-gso-618.sh harness you attached.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by-kernelciTag PRs that were automatically created when a user branch was pushed to the repo (kernelCI)

Development

Successfully merging this pull request may close these issues.

3 participants

@bmastbergen@PlaidCat@kerneltoast