diff options
author | Andrew Melnychenko <andrew@daynix.com> | 2021-05-14 14:48:31 +0300 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2021-06-04 15:25:46 +0800 |
commit | f3fa412de28ae3cb31d38811d30a77e4e20456cc (patch) | |
tree | 06c6058905d66627f94aabb77c373d75cb9d7615 /tools/ebpf/Makefile.ebpf | |
parent | 8f364e344c3e71d4cc4e683d21241f6c36d62a5e (diff) |
ebpf: Added eBPF RSS program.
RSS program and Makefile to build it.
The bpftool used to generate '.h' file.
The data in that file may be loaded by libbpf.
EBPF compilation is not required for building qemu.
You can use Makefile if you need to regenerate rss.bpf.skeleton.h.
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'tools/ebpf/Makefile.ebpf')
-rwxr-xr-x | tools/ebpf/Makefile.ebpf | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/ebpf/Makefile.ebpf b/tools/ebpf/Makefile.ebpf new file mode 100755 index 0000000000..8f327ae3b8 --- /dev/null +++ b/tools/ebpf/Makefile.ebpf @@ -0,0 +1,21 @@ +OBJS = rss.bpf.o + +LLC ?= llc +CLANG ?= clang +INC_FLAGS = `$(CLANG) -print-file-name=include` +EXTRA_CFLAGS ?= -O2 -emit-llvm -fno-stack-protector + +all: $(OBJS) + +.PHONY: clean + +clean: + rm -f $(OBJS) + +$(OBJS): %.o:%.c + $(CLANG) $(INC_FLAGS) \ + -D__KERNEL__ -D__ASM_SYSREG_H \ + -I../include $(LINUXINCLUDE) \ + $(EXTRA_CFLAGS) -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@ + bpftool gen skeleton rss.bpf.o > rss.bpf.skeleton.h + cp rss.bpf.skeleton.h ../../ebpf/ |