]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: selftests: Add kfunc_call test
authorMartin KaFai Lau <kafai@fb.com>
Thu, 25 Mar 2021 01:52:52 +0000 (18:52 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 27 Mar 2021 03:41:52 +0000 (20:41 -0700)
commit48d14196b635913df3fbe763bf8bd10df9a26798
tree81b9cba9579d98af8e9bc27622a8e16e0905848f
parent8bf18313e6201dfc078947252db51644ac4b0471
bpf: selftests: Add kfunc_call test

This patch adds a few kernel function bpf_kfunc_call_test*() for the
selftest's test_run purpose.  They will be allowed for tc_cls prog.

The selftest calling the kernel function bpf_kfunc_call_test*()
is also added in this patch.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210325015252.1551395-1-kafai@fb.com
include/linux/bpf.h
net/bpf/test_run.c
net/core/filter.c
tools/testing/selftests/bpf/prog_tests/kfunc_call.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/kfunc_call_test.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/kfunc_call_test_subprog.c [new file with mode: 0644]