diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2020-01-10 17:20:07 +0100 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-01-10 17:20:19 +0100 |
commit | 7a2d070f91db83a1e08bf212e8f6a34d852efb7f (patch) | |
tree | 29f80d80eff2526f251e5def34a8b7eb870b0504 /tools/testing/selftests/bpf/progs/fexit_bpf2bpf.c | |
parent | f41aa387a7896c193b384c5fb531cd2cb9e00128 (diff) | |
parent | 360301a6c21be87fe881546bd5f22eccf7a165c5 (diff) | |
download | kernel_replicant_linux-7a2d070f91db83a1e08bf212e8f6a34d852efb7f.tar.gz kernel_replicant_linux-7a2d070f91db83a1e08bf212e8f6a34d852efb7f.tar.bz2 kernel_replicant_linux-7a2d070f91db83a1e08bf212e8f6a34d852efb7f.zip |
Merge branch 'bpf-global-funcs'
Alexei Starovoitov says:
====================
Introduce static vs global functions and function by function verification.
This is another step toward dynamic re-linking (or replacement) of global
functions. See patch 2 for details.
v2->v3:
- cleaned up a check spotted by Song.
- rebased and dropped patch 2 that was trying to improve BTF based on ELF.
- added one more unit test for scalar return value from global func.
v1->v2:
- addressed review comments from Song, Andrii, Yonghong
- fixed memory leak in error path
- added modified ctx check
- added more tests in patch 7
====================
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/fexit_bpf2bpf.c')
-rw-r--r-- | tools/testing/selftests/bpf/progs/fexit_bpf2bpf.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/fexit_bpf2bpf.c b/tools/testing/selftests/bpf/progs/fexit_bpf2bpf.c index 2d211ee98a1c..81d7b4aaf79e 100644 --- a/tools/testing/selftests/bpf/progs/fexit_bpf2bpf.c +++ b/tools/testing/selftests/bpf/progs/fexit_bpf2bpf.c @@ -79,4 +79,19 @@ int test_subprog2(struct args_subprog2 *ctx) test_result_subprog2 = 1; return 0; } + +__u64 test_result_subprog3 = 0; +BPF_TRACE_3("fexit/test_pkt_access_subprog3", test_subprog3, + int, val, struct sk_buff *, skb, int, ret) +{ + int len; + + __builtin_preserve_access_index(({ + len = skb->len; + })); + if (len != 74 || ret != 74 * val || val != 3) + return 0; + test_result_subprog3 = 1; + return 0; +} char _license[] SEC("license") = "GPL"; |