Skip to content

Commit 594a116

Browse files
kkdwvdAlexei Starovoitov
authored andcommitted
samples: bpf: Convert xdp_redirect_map_multi to XDP samples helper
Use the libbpf skeleton facility and other utilities provided by XDP samples helper. Also adapt to change of type of mac address map, so that no resizing is required. Add a new flag for sample mask that skips priting the from_device->to_device heading for each line, as xdp_redirect_map_multi may have two devices but the flow of data may be bidirectional, so the output would be confusing. 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-23-memxor@gmail.com
1 parent a29b3ca commit 594a116

4 files changed

Lines changed: 153 additions & 220 deletions

File tree

‎samples/bpf/Makefile‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ tprogs-y += lwt_len_hist
3939
tprogs-y += xdp_tx_iptunnel
4040
tprogs-y += test_map_in_map
4141
tprogs-y += per_socket_stats_example
42-
tprogs-y += xdp_redirect_map_multi
4342
tprogs-y += xdp_rxq_info
4443
tprogs-y += syscall_tp
4544
tprogs-y += cpustat
@@ -54,6 +53,7 @@ tprogs-y += ibumad
5453
tprogs-y += hbm
5554

5655
tprogs-y += xdp_redirect_cpu
56+
tprogs-y += xdp_redirect_map_multi
5757
tprogs-y += xdp_redirect_map
5858
tprogs-y += xdp_redirect
5959
tprogs-y += xdp_monitor
@@ -100,7 +100,6 @@ lwt_len_hist-objs := lwt_len_hist_user.o
100100
xdp_tx_iptunnel-objs := xdp_tx_iptunnel_user.o
101101
test_map_in_map-objs := test_map_in_map_user.o
102102
per_socket_stats_example-objs := cookie_uid_helper_example.o
103-
xdp_redirect_map_multi-objs := xdp_redirect_map_multi_user.o
104103
xdp_rxq_info-objs := xdp_rxq_info_user.o
105104
syscall_tp-objs := syscall_tp_user.o
106105
cpustat-objs := cpustat_user.o
@@ -114,6 +113,7 @@ xdp_sample_pkts-objs := xdp_sample_pkts_user.o
114113
ibumad-objs := ibumad_user.o
115114
hbm-objs := hbm.o $(CGROUP_HELPERS)
116115

116+
xdp_redirect_map_multi-objs := xdp_redirect_map_multi_user.o $(XDP_SAMPLE)
117117
xdp_redirect_cpu-objs := xdp_redirect_cpu_user.o $(XDP_SAMPLE)
118118
xdp_redirect_map-objs := xdp_redirect_map_user.o $(XDP_SAMPLE)
119119
xdp_redirect-objs := xdp_redirect_user.o $(XDP_SAMPLE)
@@ -310,6 +310,7 @@ $(BPF_SAMPLES_PATH)/*.c: verify_target_bpf $(LIBBPF)
310310
$(src)/*.c: verify_target_bpf $(LIBBPF)
311311

312312
$(obj)/xdp_redirect_cpu_user.o: $(obj)/xdp_redirect_cpu.skel.h
313+
$(obj)/xdp_redirect_map_multi_user.o: $(obj)/xdp_redirect_map_multi.skel.h
313314
$(obj)/xdp_redirect_map_user.o: $(obj)/xdp_redirect_map.skel.h
314315
$(obj)/xdp_redirect_user.o: $(obj)/xdp_redirect.skel.h
315316
$(obj)/xdp_monitor_user.o: $(obj)/xdp_monitor.skel.h

0 commit comments

Comments
 (0)