Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: bpf: extend sub-register mode compilation to all bpf object files

At the moment, we only do extra sub-register mode compilation on bpf object
files used by "test_progs". These object files are really loaded and
executed.

This patch further extends sub-register mode compilation to all bpf object
files, even those without corresponding runtime tests. Because this could
help testing LLVM sub-register code-gen, kernel bpf selftest has much more
C testcases with reasonable size and complexity compared with LLVM
testsuite which only contains unit tests.

There were some file duplication inside BPF_OBJ_FILES_DUAL_COMPILE which
is removed now.

Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Jiong Wang and committed by
Alexei Starovoitov
4836b463 1727a9dc

+7 -13
+7 -13
tools/testing/selftests/bpf/Makefile
··· 36 36 get_cgroup_id_kern.o socket_cookie_prog.o test_select_reuseport_kern.o \ 37 37 test_skb_cgroup_id_kern.o bpf_flow.o netcnt_prog.o test_xdp_vlan.o \ 38 38 xdp_dummy.o test_map_in_map.o test_spin_lock.o test_map_lock.o \ 39 - test_sock_fields_kern.o 40 - 41 - # Objects are built with default compilation flags and with sub-register 42 - # code-gen enabled. 43 - BPF_OBJ_FILES_DUAL_COMPILE = \ 44 - test_pkt_access.o test_pkt_access.o test_xdp.o test_adjust_tail.o \ 45 - test_l4lb.o test_l4lb_noinline.o test_xdp_noinline.o test_tcp_estats.o \ 39 + test_pkt_access.o test_xdp.o test_adjust_tail.o test_l4lb.o \ 40 + test_l4lb_noinline.o test_xdp_noinline.o test_tcp_estats.o \ 46 41 test_obj_id.o test_pkt_md_access.o test_tracepoint.o \ 47 - test_stacktrace_map.o test_stacktrace_map.o test_stacktrace_build_id.o \ 48 - test_stacktrace_build_id.o test_get_stack_rawtp.o \ 49 - test_get_stack_rawtp.o test_tracepoint.o test_sk_lookup_kern.o \ 50 - test_queue_map.o test_stack_map.o 42 + test_stacktrace_map.o test_stacktrace_build_id.o \ 43 + test_get_stack_rawtp.o test_sk_lookup_kern.o test_queue_map.o \ 44 + test_stack_map.o test_sock_fields_kern.o 51 45 52 - TEST_GEN_FILES = $(BPF_OBJ_FILES) $(BPF_OBJ_FILES_DUAL_COMPILE) 46 + TEST_GEN_FILES = $(BPF_OBJ_FILES) 53 47 54 48 # Also test sub-register code-gen if LLVM + kernel both has eBPF v3 processor 55 49 # support which is the first version to contain both ALU32 and JMP32 ··· 53 59 $(LLC) -mattr=+alu32 -mcpu=probe 2>&1 | \ 54 60 grep 'if w') 55 61 ifneq ($(SUBREG_CODEGEN),) 56 - TEST_GEN_FILES += $(patsubst %.o,alu32/%.o, $(BPF_OBJ_FILES_DUAL_COMPILE)) 62 + TEST_GEN_FILES += $(patsubst %.o,alu32/%.o, $(BPF_OBJ_FILES)) 57 63 endif 58 64 59 65 # Order correspond to 'make run_tests' order