diff options
author | Martin KaFai Lau <kafai@fb.com> | 2021-03-24 18:52:52 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-03-26 20:41:52 -0700 |
commit | 7bd1590d4eba1583f6ee85e8cfe556505f761e19 (patch) | |
tree | 81b9cba9579d98af8e9bc27622a8e16e0905848f /include/linux/bpf.h | |
parent | 78e60bbbe8e8f614b6a453d8a780d9e6f77749a8 (diff) | |
download | linux-stable-7bd1590d4eba1583f6ee85e8cfe556505f761e19.tar.gz linux-stable-7bd1590d4eba1583f6ee85e8cfe556505f761e19.tar.bz2 linux-stable-7bd1590d4eba1583f6ee85e8cfe556505f761e19.zip |
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
Diffstat (limited to 'include/linux/bpf.h')
-rw-r--r-- | include/linux/bpf.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index b5b7967e3ff3..9fdd839b418c 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -1532,6 +1532,7 @@ int bpf_prog_test_run_raw_tp(struct bpf_prog *prog, int bpf_prog_test_run_sk_lookup(struct bpf_prog *prog, const union bpf_attr *kattr, union bpf_attr __user *uattr); +bool bpf_prog_test_check_kfunc_call(u32 kfunc_id); bool btf_ctx_access(int off, int size, enum bpf_access_type type, const struct bpf_prog *prog, struct bpf_insn_access_aux *info); @@ -1731,6 +1732,11 @@ static inline int bpf_prog_test_run_sk_lookup(struct bpf_prog *prog, return -ENOTSUPP; } +static inline bool bpf_prog_test_check_kfunc_call(u32 kfunc_id) +{ + return false; +} + static inline void bpf_map_put(struct bpf_map *map) { } |