Skip to content

[ciqlts9_6] Multiple patches tested (6 commits) - #1546

Open
ciq-kernel-automation[bot] wants to merge 6 commits into
ciqlts9_6from
{bmastbergen_bpf_skb_adjust_room}_ciqlts9_6
Open

[ciqlts9_6] Multiple patches tested (6 commits)#1546
ciq-kernel-automation[bot] wants to merge 6 commits into
ciqlts9_6from
{bmastbergen_bpf_skb_adjust_room}_ciqlts9_6

Conversation

@ciq-kernel-automation

@ciq-kernel-automation ciq-kernel-automation Bot 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 -
commit-source https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=5e4bcad6171d4baf426e49a39580cdb79254ea36
bpf: refactor masks for ADJ_ROOM flags and encap validation

commit-author Nick Hudson <nhudson@akamai.com>
commit -
commit-source https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=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 -
commit-source https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=da199070bc6209bf5db970f8f84c7db4210fe511
bpf: allow new DECAP flags and add guard rails

commit-author Nick Hudson <nhudson@akamai.com>
commit -
commit-source https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=3a39c214fd2c3dd8266649e7f9f85ca1439eb738
bpf: clear decap state on skb_adjust_room shrink path

commit-author Nick Hudson <nhudson@akamai.com>
commit -
commit-source https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=ec20dee2f2c4796c0f7c0a7d8a3a3e8a9e9da7a4
selftests/bpf: tc_tunnel - pass decap flags for tunnel type

commit-author Nick Hudson <nhudson@akamai.com>
commit -
commit-source https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=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:
  - CO-RE enum existence checks (bpf_core_enum_value_exists). The
    test_tc_tunnel.sh runner loads BPF via iproute2's legacy tc loader,
    which does not process CO-RE relocations.
  - 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 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
  but does not validate post-decap skb state.

Test Results

✅ Build Stage

Architecture Build Time Total Time
x86_64 33m 2s 34m 6s
aarch64 19m 26s 20m 13s

✅ Boot Verification

✅ Kernel Selftests

Architecture Passed Failed Compared Against Status
x86_64 206 43 ciqlts9_6 ⚠️ No baseline available
aarch64 154 45 ciqlts9_6 ⚠️ No baseline available

✅ LTP Results

Architecture Passed Failed Compared Against Status
x86_64 1453 82 ciqlts9_6 ⚠️ No baseline available
aarch64 1426 83 ciqlts9_6 ⚠️ No baseline available

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

@ciq-kernel-automation ciq-kernel-automation Bot 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
commit-author Nick Hudson <nhudson@akamai.com>
commit -
commit-source https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=5e4bcad6171d4baf426e49a39580cdb79254ea36

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>
	Signed-off-by: Max Tottenham <mtottenh@akamai.com>
	Co-developed-by: Anna Glasgall <aglasgal@akamai.com>
	Signed-off-by: Anna Glasgall <aglasgal@akamai.com>
	Signed-off-by: Nick Hudson <nhudson@akamai.com>
	Reviewed-by: Willem de Bruijn <willemb@google.com>
	Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
commit-author Nick Hudson <nhudson@akamai.com>
commit -
commit-source https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=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.

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>
	Signed-off-by: Max Tottenham <mtottenh@akamai.com>
	Co-developed-by: Anna Glasgall <aglasgal@akamai.com>
	Signed-off-by: Anna Glasgall <aglasgal@akamai.com>
	Signed-off-by: Nick Hudson <nhudson@akamai.com>
	Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
commit-author Nick Hudson <nhudson@akamai.com>
commit -
commit-source https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=da199070bc6209bf5db970f8f84c7db4210fe511

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>
	Signed-off-by: Max Tottenham <mtottenh@akamai.com>
	Co-developed-by: Anna Glasgall <aglasgal@akamai.com>
	Signed-off-by: Anna Glasgall <aglasgal@akamai.com>
	Signed-off-by: Nick Hudson <nhudson@akamai.com>
	Reviewed-by: Willem de Bruijn <willemb@google.com>
	Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
commit-author Nick Hudson <nhudson@akamai.com>
commit -
commit-source https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=3a39c214fd2c3dd8266649e7f9f85ca1439eb738

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>
	Signed-off-by: Max Tottenham <mtottenh@akamai.com>
	Co-developed-by: Anna Glasgall <aglasgal@akamai.com>
	Signed-off-by: Anna Glasgall <aglasgal@akamai.com>
	Signed-off-by: Nick Hudson <nhudson@akamai.com>
	Reviewed-by: Willem de Bruijn <willemb@google.com>
	Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
commit-author Nick Hudson <nhudson@akamai.com>
commit -
commit-source https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=ec20dee2f2c4796c0f7c0a7d8a3a3e8a9e9da7a4

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>
	Signed-off-by: Max Tottenham <mtottenh@akamai.com>
	Co-developed-by: Anna Glasgall <aglasgal@akamai.com>
	Signed-off-by: Anna Glasgall <aglasgal@akamai.com>
	Signed-off-by: Nick Hudson <nhudson@akamai.com>
	Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
commit-author Nick Hudson <nhudson@akamai.com>
commit -
commit-source https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=adb771973026efe54627bcbe927e7205d04d6c68
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:
  - CO-RE enum existence checks (bpf_core_enum_value_exists). The
    test_tc_tunnel.sh runner loads BPF via iproute2's legacy tc loader,
    which does not process CO-RE relocations.
  - 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 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
  but does not validate post-decap skb state.

Pass the new BPF_F_ADJ_ROOM_DECAP_* flags through the decap path so
the kernel clears the correct GSO and encapsulation state when removing
tunnel headers.

	Signed-off-by: Nick Hudson <nhudson@akamai.com>
	Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
@bmastbergen
bmastbergen force-pushed the {bmastbergen_bpf_skb_adjust_room}_ciqlts9_6 branch from 76ecd9a to cab8954 Compare August 21, 2026 13:28
@github-actions

Copy link
Copy Markdown

🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/32487725765

@github-actions

Copy link
Copy Markdown

Validation checks completed successfully View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/32487725765

@bmastbergen

Copy link
Copy Markdown
Collaborator

Test results:

Test: BPF_F_ADJ_ROOM_DECAP_* GSO state verification
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: 6.18 kernel ==

=== 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)

=== Results: 3 passed, 0 failed ===

== Results: 5.14 kernel ==

=== building checker ===
  checker built OK
=== loading checker kprobe ===
  attached to ip_rcv

=== BPF decap flags GSO test ===
  kernel: 5.14.0-bmastbergen_bpf_skb_adjust_room_ciqlts9_6-cab895457f4+

--- GSO path (64KB, TSO on) ---
  ipip     (DECAP_IPXIP4)                           PASS (14 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 (13 pkts, GSO clean)

--- non-GSO baseline (100B) ---
  ipip 100B                                         PASS (5 pkts, GSO clean)
  gre  100B                                         SKIP (checker saw 0 pkts)

=== 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.
- gso_type=0x1 (SKB_GSO_TCPV4) is the only GSO bit that should
  remain after tunnel decapsulation. The tunnel-specific bits
  (SKB_GSO_IPXIP4, SKB_GSO_GRE, etc.) are confirmed cleared.
- SKIP on GRE: the BPF GRE encap/decap requires packet-level GRE
  header construction that doesn't complete the round trip through
  a plain veth pair without a kernel tunnel device. The IPIP/SIT
  tunnel types exercise the core DECAP_IPXIP4 flag path which is
  the primary GSO cleanup codepath.
- Sample trace output showing the checker reading skb state:

    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)

test-decap-gso.sh

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

Labels

created-by-kernelci Tag 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.

1 participant