mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 13:03:25 +01:00
cb80ddc671
The main change is a move of the single line #include "iterators.lskel.h" from iterators/iterators.c to bpf_preload_kern.c. Which means that generated light skeleton can be used from user space or user mode driver like iterators.c or from the kernel module or the kernel itself. The direct use of light skeleton from the kernel module simplifies the code, since UMD is no longer necessary. The libbpf.a required user space and UMD. The CO-RE in the kernel and generated "loader bpf program" used by the light skeleton are capable to perform complex loading operations traditionally provided by libbpf. In addition UMD approach was launching UMD process every time bpffs has to be mounted. With light skeleton in the kernel the bpf_preload kernel module loads bpf iterators once and pins them multiple times into different bpffs mounts. Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Yonghong Song <yhs@fb.com> Acked-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20220209232001.27490-6-alexei.starovoitov@gmail.com
16 lines
339 B
C
16 lines
339 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _BPF_PRELOAD_H
|
|
#define _BPF_PRELOAD_H
|
|
|
|
struct bpf_preload_info {
|
|
char link_name[16];
|
|
struct bpf_link *link;
|
|
};
|
|
|
|
struct bpf_preload_ops {
|
|
int (*preload)(struct bpf_preload_info *);
|
|
struct module *owner;
|
|
};
|
|
extern struct bpf_preload_ops *bpf_preload_ops;
|
|
#define BPF_PRELOAD_LINKS 2
|
|
#endif
|