Re: [PATCH v6 6/6] selftests/bpf: tc_tunnel - validate decap GSO and encapsulation state

Martin KaFai Lau <[email protected]> Thu, 21 May 2026 08:49:11 -0700
Newsgroups dev.linux.lists.sashiko,org.kernel.vger.bpf
Message-ID <[email protected]>
On Tue, May 19, 2026 at 10:52:12AM +0000, Hudson, Nick wrote:
> 
> 
> > On May 5, 2026, at 5:14 AM, [email protected] wrote:
> > 
> > !-------------------------------------------------------------------|
> >  This Message Is From an External Sender
> >  This message came from outside your organization.
> > |-------------------------------------------------------------------!
> > 
> > Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
> > - [High] Pointer arithmetic `kskb->head + kskb->end` causes build failures and runtime logic errors on 32-bit kernels.
> > - [Medium] Missing kernel feature causes test to fail instead of skip, breaking CI on older kernels.
> > --
> > 
> > commit f73fb4725baa7b601a1b82c32e5095c6b4294f5c
> > Author: Nick Hudson <[email protected]>
> > 
> > selftests/bpf: tc_tunnel - validate decap GSO and encapsulation state
> > 
> > This commit enhances the tc_tunnel selftest to validate post-decap tunnel
> > state for both GSO and non-GSO packets, and checks IPXIP decap for IPIP/SIT
> > paths.
> > 
> >> diff --git a/tools/testing/selftests/bpf/progs/test_tc_tunnel.c b/tools/testing/selftests/bpf/progs/test_tc_tunnel.c
> >> index 7376df405a6b..853bca962910 100644
> >> --- a/tools/testing/selftests/bpf/progs/test_tc_tunnel.c
> >> +++ b/tools/testing/selftests/bpf/progs/test_tc_tunnel.c
> > [ ... ]
> >> @@ -621,6 +645,11 @@ static int decap_internal(struct __sk_buff *skb, int off, int len, char proto)
> >> break;
> >> case IPPROTO_GRE:
> >> olen += sizeof(struct gre_hdr);
> >> + if (!bpf_core_enum_value_exists(enum bpf_adj_room_flags,
> >> + BPF_F_ADJ_ROOM_DECAP_L4_GRE))
> >> + return TC_ACT_SHOT;
> > 
> > If the kernel is missing support for these new decapsulation flags, will
> > returning TC_ACT_SHOT cause the test harness to time out and fail the test?
> > 
> > Since selftests often run on older kernels, should missing features gracefully
> > skip the test instead of failing it to prevent false positives and CI
> > breakages on stable or LTS branches?
> 
> The current TC_ACT_SHOT fallback prevents silent passes, but it does cause affected subtests to fail on kernels without the new decap flags. We should move feature gating to prog_tests and skip unsupported subtests there, so older kernels report SKIP instead of FAIL while preserving strict checks when the feature exists.

imo, it is fine to stay as-is and fail early instead of skip.
The new test added to the -next is targeting the new feature
of the upstream kernel. The new test is not supposed to be backported
alone without backporting the kernel changes.