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/bpf: Test accounting of tail calls when prog is NULL

Test whether tail call count is incorrectly accounted for, when the
tail call fails due to a missing BPF program.

Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Link: https://lore.kernel.org/r/20260216090802.1805655-1-hbathini@linux.ibm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Hari Bathini and committed by
Alexei Starovoitov
8ebfe65e c89b50cc

+4 -1
+4 -1
tools/testing/selftests/bpf/progs/tailcall3.c
··· 5 5 6 6 struct { 7 7 __uint(type, BPF_MAP_TYPE_PROG_ARRAY); 8 - __uint(max_entries, 1); 8 + __uint(max_entries, 2); 9 9 __uint(key_size, sizeof(__u32)); 10 10 __uint(value_size, sizeof(__u32)); 11 11 } jmp_table SEC(".maps"); ··· 23 23 SEC("tc") 24 24 int entry(struct __sk_buff *skb) 25 25 { 26 + /* prog == NULL case */ 27 + bpf_tail_call_static(skb, &jmp_table, 1); 28 + 26 29 bpf_tail_call_static(skb, &jmp_table, 0); 27 30 return 0; 28 31 }