diff options
author | Hou Tao <houtao1@huawei.com> | 2021-10-25 14:40:22 +0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-11-01 14:10:00 -0700 |
commit | 31a645aea4f8da5bb190ce322c6e5aacaef13855 (patch) | |
tree | c1fd0b3c45638ebc5f3ebd6d860acc46257e8d5f /include/linux/bpf.h | |
parent | 36e70b9b06bf14a0fac87315f0e73d6e17e80aad (diff) | |
download | linux-stable-31a645aea4f8da5bb190ce322c6e5aacaef13855.tar.gz linux-stable-31a645aea4f8da5bb190ce322c6e5aacaef13855.tar.bz2 linux-stable-31a645aea4f8da5bb190ce322c6e5aacaef13855.zip |
bpf: Factor out a helper to prepare trampoline for struct_ops prog
Factor out a helper bpf_struct_ops_prepare_trampoline() to prepare
trampoline for BPF_PROG_TYPE_STRUCT_OPS prog. It will be used by
.test_run callback in following patch.
Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20211025064025.2567443-2-houtao1@huawei.com
Diffstat (limited to 'include/linux/bpf.h')
-rw-r--r-- | include/linux/bpf.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 6deebf8bf78f..aabd3540aaaf 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -1000,6 +1000,10 @@ bool bpf_struct_ops_get(const void *kdata); void bpf_struct_ops_put(const void *kdata); int bpf_struct_ops_map_sys_lookup_elem(struct bpf_map *map, void *key, void *value); +int bpf_struct_ops_prepare_trampoline(struct bpf_tramp_progs *tprogs, + struct bpf_prog *prog, + const struct btf_func_model *model, + void *image, void *image_end); static inline bool bpf_try_module_get(const void *data, struct module *owner) { if (owner == BPF_MODULE_OWNER) |