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)
commit7bd1590d4eba1583f6ee85e8cfe556505f761e19
tree81b9cba9579d98af8e9bc27622a8e16e0905848f
parent78e60bbbe8e8f614b6a453d8a780d9e6f77749a8
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]