Skip to content

Commit f3fa412

Browse files
AndrewAtDaynixjasowang
authored andcommitted
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 <[email protected]> Signed-off-by: Andrew Melnychenko <[email protected]> Signed-off-by: Jason Wang <[email protected]>
1 parent 8f364e3 commit f3fa412

File tree

2 files changed

+592
-0
lines changed

2 files changed

+592
-0
lines changed

tools/ebpf/Makefile.ebpf

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
OBJS = rss.bpf.o
2+
3+
LLC ?= llc
4+
CLANG ?= clang
5+
INC_FLAGS = `$(CLANG) -print-file-name=include`
6+
EXTRA_CFLAGS ?= -O2 -emit-llvm -fno-stack-protector
7+
8+
all: $(OBJS)
9+
10+
.PHONY: clean
11+
12+
clean:
13+
rm -f $(OBJS)
14+
15+
$(OBJS): %.o:%.c
16+
$(CLANG) $(INC_FLAGS) \
17+
-D__KERNEL__ -D__ASM_SYSREG_H \
18+
-I../include $(LINUXINCLUDE) \
19+
$(EXTRA_CFLAGS) -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@
20+
bpftool gen skeleton rss.bpf.o > rss.bpf.skeleton.h
21+
cp rss.bpf.skeleton.h ../../ebpf/

0 commit comments

Comments
 (0)