summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorHari Bathini <hbathini@linux.ibm.com>2026-02-16 12:08:02 +0300
committerAlexei Starovoitov <ast@kernel.org>2026-02-25 04:09:27 +0300
commit8ebfe65e22d5016c0ef2f7b5831117202493f794 (patch)
tree2e1f7bacde4e1ce01e57e145116768b7002be79d /tools/testing
parentc89b50cc6b9f3df4e21e5b9c10dcdfe830200c72 (diff)
downloadlinux-8ebfe65e22d5016c0ef2f7b5831117202493f794.tar.xz
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>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/bpf/progs/tailcall3.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/progs/tailcall3.c b/tools/testing/selftests/bpf/progs/tailcall3.c
index f60bcd7b8d4b..204f19c30a3e 100644
--- a/tools/testing/selftests/bpf/progs/tailcall3.c
+++ b/tools/testing/selftests/bpf/progs/tailcall3.c
@@ -5,7 +5,7 @@
struct {
__uint(type, BPF_MAP_TYPE_PROG_ARRAY);
- __uint(max_entries, 1);
+ __uint(max_entries, 2);
__uint(key_size, sizeof(__u32));
__uint(value_size, sizeof(__u32));
} jmp_table SEC(".maps");
@@ -23,6 +23,9 @@ int classifier_0(struct __sk_buff *skb)
SEC("tc")
int entry(struct __sk_buff *skb)
{
+ /* prog == NULL case */
+ bpf_tail_call_static(skb, &jmp_table, 1);
+
bpf_tail_call_static(skb, &jmp_table, 0);
return 0;
}