Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests: drv-net: xdp: Fix register spill error with clang 20

On clang 20.1.8 the XDP program fails to load with a register spill error.
Since hdr_len is a __u32, the compiler decided it only needed the lower
32-bits of ctx->data, which later triggers the register spill verifier
error.

Suggested-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Dimitri Daskalakis <dimitri.daskalakis1@gmail.com>
Link: https://patch.msgid.link/20251113043102.4062150-1-dimitri.daskalakis1@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Dimitri Daskalakis and committed by
Jakub Kicinski
e1215d1d c7dc5b52

+3 -2
+3 -2
tools/testing/selftests/net/lib/xdp_native.bpf.c
··· 332 332 } 333 333 334 334 static int xdp_adjst_tail_shrnk_data(struct xdp_md *ctx, __u16 offset, 335 - __u32 hdr_len) 335 + unsigned long hdr_len) 336 336 { 337 337 char tmp_buff[MAX_ADJST_OFFSET]; 338 338 __u32 buff_pos, udp_csum = 0; ··· 422 422 { 423 423 struct udphdr *udph = NULL; 424 424 __s32 *adjust_offset, *val; 425 - __u32 key, hdr_len; 425 + unsigned long hdr_len; 426 426 void *offset_ptr; 427 + __u32 key; 427 428 __u8 tag; 428 429 int ret; 429 430