History

bpf: Convert bpf_preload.ko to use light skeleton.

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.

Alexei Starovoitov committed 4 years ago

Commit cb80ddc1 parent d7beb3d9 files · +70 −247Browse files

Showing the changes to kernel/bpf/preload/Makefile (1 of 9 files). Show all

Unified · Split

kernel/bpf/preload/Makefile+2−12
@@ -3,16 +3,6 @@ · 2 unmodified lines
3LIBBPF_SRCS = $(srctree)/tools/lib/bpf/3LIBBPF_SRCS = $(srctree)/tools/lib/bpf/
4LIBBPF_INCLUDE = $(LIBBPF_SRCS)/..4LIBBPF_INCLUDE = $(LIBBPF_SRCS)/..
5 5
6userccflags += -I $(srctree)/tools/include/ -I $(srctree)/tools/include/uapi \
7 -I $(LIBBPF_INCLUDE) -Wno-unused-result
8
9userprogs := bpf_preload_umd
10
11bpf_preload_umd-objs := iterators/iterators.o
12
13$(obj)/bpf_preload_umd:
14
15$(obj)/bpf_preload_umd_blob.o: $(obj)/bpf_preload_umd
16
17obj-$(CONFIG_BPF_PRELOAD_UMD) += bpf_preload.o6obj-$(CONFIG_BPF_PRELOAD_UMD) += bpf_preload.o
18bpf_preload-objs += bpf_preload_kern.o bpf_preload_umd_blob.o7CFLAGS_bpf_preload_kern.o += -I $(LIBBPF_INCLUDE)
8bpf_preload-objs += bpf_preload_kern.o

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t