this l4lb demo is a comprehensive test case for LLVM codegen and kernel verifier. It's using fully inlined jhash(), complex packet parsing and multiple map lookups of different types to stress llvm and verifier. The map sizes, map population and test vectors are artificial to exercise different paths through the bpf program. Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
33 lines
714 B
Makefile
33 lines
714 B
Makefile
LIBDIR := ../../../lib
|
|
BPFDIR := $(LIBDIR)/bpf
|
|
|
|
CFLAGS += -Wall -O2 -I../../../include/uapi -I$(LIBDIR) -I../../../include
|
|
LDLIBS += -lcap -lelf
|
|
|
|
TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map test_progs
|
|
|
|
TEST_GEN_FILES = test_pkt_access.o test_xdp.o test_l4lb.o
|
|
|
|
TEST_PROGS := test_kmod.sh
|
|
|
|
include ../lib.mk
|
|
|
|
BPFOBJ := $(OUTPUT)/libbpf.a
|
|
|
|
$(TEST_GEN_PROGS): $(BPFOBJ)
|
|
|
|
.PHONY: force
|
|
|
|
# force a rebuild of BPFOBJ when its dependencies are updated
|
|
force:
|
|
|
|
$(BPFOBJ): force
|
|
$(MAKE) -C $(BPFDIR) OUTPUT=$(OUTPUT)/
|
|
|
|
CLANG ?= clang
|
|
|
|
%.o: %.c
|
|
$(CLANG) -I../../../include/uapi -I../../../../samples/bpf/ \
|
|
-D__x86_64__ -Wno-compare-distinct-pointer-types \
|
|
-O2 -target bpf -c $< -o $@
|