aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/test_global_func3.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2023-02-15 20:59:53 -0800
committerDaniel Borkmann <daniel@iogearbox.net>2023-02-17 21:20:44 +0100
commit95ebb376176c52382293e05e63f142114a5e40ef (patch)
tree17b8bedca1f8aa7ab08816ef2f6fede6108a38fe /tools/testing/selftests/bpf/progs/test_global_func3.c
parentbpf: Fix global subprog context argument resolution logic (diff)
downloadlinux-95ebb376176c52382293e05e63f142114a5e40ef.tar.xz
linux-95ebb376176c52382293e05e63f142114a5e40ef.zip
selftests/bpf: Convert test_global_funcs test to test_loader framework
Convert 17 test_global_funcs subtests into test_loader framework for easier maintenance and more declarative way to define expected failures/successes. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Stanislav Fomichev <sdf@google.com> Link: https://lore.kernel.org/bpf/20230216045954.3002473-3-andrii@kernel.org
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_global_func3.c')
-rw-r--r--tools/testing/selftests/bpf/progs/test_global_func3.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_global_func3.c b/tools/testing/selftests/bpf/progs/test_global_func3.c
index 01bf8275dfd6..142b682d3c2f 100644
--- a/tools/testing/selftests/bpf/progs/test_global_func3.c
+++ b/tools/testing/selftests/bpf/progs/test_global_func3.c
@@ -3,6 +3,7 @@
#include <stddef.h>
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
+#include "bpf_misc.h"
__attribute__ ((noinline))
int f1(struct __sk_buff *skb)
@@ -46,20 +47,15 @@ int f7(struct __sk_buff *skb)
return f6(skb);
}
-#ifndef NO_FN8
__attribute__ ((noinline))
int f8(struct __sk_buff *skb)
{
return f7(skb);
}
-#endif
SEC("tc")
-int test_cls(struct __sk_buff *skb)
+__failure __msg("the call stack of 8 frames")
+int global_func3(struct __sk_buff *skb)
{
-#ifndef NO_FN8
return f8(skb);
-#else
- return f7(skb);
-#endif
}