Skip to content

Commit 79ccf45

Browse files
kkdwvdAlexei Starovoitov
authored andcommitted
samples: bpf: Convert xdp_redirect_cpu_kern.o to XDP samples helper
Similar to xdp_monitor_kern, a lot of these BPF programs have been reimplemented properly consolidating missing features from other XDP samples. Hence, drop the unneeded code and rename to .bpf.c suffix. Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20210821002010.845777-18-memxor@gmail.com
1 parent b926c55 commit 79ccf45

2 files changed

Lines changed: 105 additions & 293 deletions

File tree

‎samples/bpf/Makefile‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ always-y += tcp_tos_reflect_kern.o
165165
always-y += tcp_dumpstats_kern.o
166166
always-y += xdp_redirect_map_kern.o
167167
always-y += xdp_redirect_map_multi_kern.o
168-
always-y += xdp_redirect_cpu_kern.o
169168
always-y += xdp_rxq_info_kern.o
170169
always-y += xdp2skb_meta_kern.o
171170
always-y += syscall_tp_kern.o
@@ -356,6 +355,7 @@ endef
356355

357356
CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG))
358357

358+
$(obj)/xdp_redirect_cpu.bpf.o: $(obj)/xdp_sample.bpf.o
359359
$(obj)/xdp_redirect.bpf.o: $(obj)/xdp_sample.bpf.o
360360
$(obj)/xdp_monitor.bpf.o: $(obj)/xdp_sample.bpf.o
361361

@@ -367,9 +367,10 @@ $(obj)/%.bpf.o: $(src)/%.bpf.c $(obj)/vmlinux.h $(src)/xdp_sample.bpf.h $(src)/x
367367
-I$(srctree)/tools/lib $(CLANG_SYS_INCLUDES) \
368368
-c $(filter %.bpf.c,$^) -o $@
369369

370-
LINKED_SKELS := xdp_redirect.skel.h xdp_monitor.skel.h
370+
LINKED_SKELS := xdp_redirect_cpu.skel.h xdp_redirect.skel.h xdp_monitor.skel.h
371371
clean-files += $(LINKED_SKELS)
372372

373+
xdp_redirect_cpu.skel.h-deps := xdp_redirect_cpu.bpf.o xdp_sample.bpf.o
373374
xdp_redirect.skel.h-deps := xdp_redirect.bpf.o xdp_sample.bpf.o
374375
xdp_monitor.skel.h-deps := xdp_monitor.bpf.o xdp_sample.bpf.o
375376

0 commit comments

Comments
 (0)