samples/bpf: Remove unmaintained XDP sample utilities
Subsystems (4)
cover samples/bpf: Remove unmaintained XDP sample utilities
The samples/bpf directory in the kernel tree started out as a way of showcasing different aspects of BPF functionality by writing small utility programs for each feature. However, as the BPF subsystem has matured, the preferred way of including userspace code with a feature has become the BPF selftests, which also have the benefit of being consistently run as part of the BPF CI system.
As a result of this shift, the utilities in samples/bpf have seen little love, and have slowly bitrotted. There have been sporadic cleanup patches over the years, but it's clear that the utilities are far from maintained.
For XDP in particular, some of the utilities have been used as benchmarking aids when implementing new kernel features, which seems to be the main reason they have stuck around; any updates the utilities have seen have been targeted at this use case. However, as the BPF subsystem as a whole has moved on, it has become increasingly difficult to incorporate new features into these utilities because they predate most of the modern BPF features (such as kfuncs and BTF).
Rather than try to update these utilities and keep maintaining them in the kernel tree, we have ported the useful features of the utilities to the xdp-tools package. In the porting process we also updated the utilities to take advantage of modern BPF features, integrated them with libxdp, and polished the user interface.
As these utilities are standalone tools, maintaining them out of tree is simpler, and we plan to keep maintaining them in the xdp-tools repo. To direct users of these utilities to the right place, this series removes the utilities from samples/bpf, leaving in place only a couple of utilities whose functionality have not yet been ported to xdp-tools.
The xdp-tools repository is located on Github at the following URL:
https://github.com/xdp-project/xdp-tools
Toke Høiland-Jørgensen (6):
samples/bpf: Remove the xdp_monitor utility
samples/bpf: Remove the xdp_redirect* utilities
samples/bpf: Remove the xdp_rxq_info utility
samples/bpf: Remove the xdp1 and xdp2 utilities
samples/bpf: Remove the xdp_sample_pkts utility
samples/bpf: Cleanup .gitignore
samples/bpf/.gitignore | 12 - samples/bpf/Makefile | 48 +- samples/bpf/xdp1_kern.c | 100 ---- samples/bpf/xdp1_user.c | 166 ------ samples/bpf/xdp2_kern.c | 125 ----- samples/bpf/xdp_monitor.bpf.c | 8 - samples/bpf/xdp_monitor_user.c | 118 ----- samples/bpf/xdp_redirect.bpf.c | 49 -- samples/bpf/xdp_redirect_cpu.bpf.c | 539 ------------------- samples/bpf/xdp_redirect_cpu_user.c | 559 -------------------- samples/bpf/xdp_redirect_map.bpf.c | 97 ---- samples/bpf/xdp_redirect_map_multi.bpf.c | 77 --- samples/bpf/xdp_redirect_map_multi_user.c | 232 -------- samples/bpf/xdp_redirect_map_user.c | 228 -------- samples/bpf/xdp_redirect_user.c | 172 ------ samples/bpf/xdp_rxq_info_kern.c | 140 ----- samples/bpf/xdp_rxq_info_user.c | 614 ---------------------- samples/bpf/xdp_sample_pkts_kern.c | 57 -- samples/bpf/xdp_sample_pkts_user.c | 196 ------- 19 files changed, 1 insertion(+), 3536 deletions(-) delete mode 100644 samples/bpf/xdp1_kern.c delete mode 100644 samples/bpf/xdp1_user.c delete mode 100644 samples/bpf/xdp2_kern.c delete mode 100644 samples/bpf/xdp_monitor.bpf.c delete mode 100644 samples/bpf/xdp_monitor_user.c delete mode 100644 samples/bpf/xdp_redirect.bpf.c delete mode 100644 samples/bpf/xdp_redirect_cpu.bpf.c delete mode 100644 samples/bpf/xdp_redirect_cpu_user.c delete mode 100644 samples/bpf/xdp_redirect_map.bpf.c delete mode 100644 samples/bpf/xdp_redirect_map_multi.bpf.c delete mode 100644 samples/bpf/xdp_redirect_map_multi_user.c delete mode 100644 samples/bpf/xdp_redirect_map_user.c delete mode 100644 samples/bpf/xdp_redirect_user.c delete mode 100644 samples/bpf/xdp_rxq_info_kern.c delete mode 100644 samples/bpf/xdp_rxq_info_user.c delete mode 100644 samples/bpf/xdp_sample_pkts_kern.c delete mode 100644 samples/bpf/xdp_sample_pkts_user.c
Signature · 1 line
2.41.0
PATCH 1/6 samples/bpf: Remove the xdp_monitor utility
This utility has been ported to xdp-tools. Remove the unmaintained version in samples.
--- samples/bpf/Makefile | 8 +-- samples/bpf/xdp_monitor.bpf.c | 8 --- samples/bpf/xdp_monitor_user.c | 118 --------------------------------- 3 files changed, 1 insertion(+), 133 deletions(-) delete mode 100644 samples/bpf/xdp_monitor.bpf.c delete mode 100644 samples/bpf/xdp_monitor_user.c
samples/bpf/Makefile +1 -7
@@ -55,7 +55,6 @@ tprogs-y += xdp_redirect_cpu tprogs-y += xdp_redirect_map_multi tprogs-y += xdp_redirect_map tprogs-y += xdp_redirect -tprogs-y += xdp_monitor # Libbpf dependencies LIBBPF_SRC = $(TOOLS_PATH)/lib/bpf
@@ -116,7 +115,6 @@ xdp_redirect_map_multi-objs := xdp_redirect_map_multi_user.o $(XDP_SAMPLE) xdp_redirect_cpu-objs := xdp_redirect_cpu_user.o $(XDP_SAMPLE) xdp_redirect_map-objs := xdp_redirect_map_user.o $(XDP_SAMPLE) xdp_redirect-objs := xdp_redirect_user.o $(XDP_SAMPLE) -xdp_monitor-objs := xdp_monitor_user.o $(XDP_SAMPLE) xdp_router_ipv4-objs := xdp_router_ipv4_user.o $(XDP_SAMPLE) # Tell kbuild to always build the programs
@@ -207,7 +205,6 @@ TPROGS_LDFLAGS := -L$(SYSROOT)/usr/lib endif TPROGS_LDLIBS += $(LIBBPF) -lelf -lz -TPROGLDLIBS_xdp_monitor += -lm TPROGLDLIBS_xdp_redirect += -lm TPROGLDLIBS_xdp_redirect_cpu += -lm TPROGLDLIBS_xdp_redirect_map += -lm
@@ -330,7 +327,6 @@ $(obj)/xdp_redirect_cpu_user.o: $(obj)/xdp_redirect_cpu.skel.h $(obj)/xdp_redirect_map_multi_user.o: $(obj)/xdp_redirect_map_multi.skel.h $(obj)/xdp_redirect_map_user.o: $(obj)/xdp_redirect_map.skel.h $(obj)/xdp_redirect_user.o: $(obj)/xdp_redirect.skel.h -$(obj)/xdp_monitor_user.o: $(obj)/xdp_monitor.skel.h $(obj)/xdp_router_ipv4_user.o: $(obj)/xdp_router_ipv4.skel.h $(obj)/tracex5.bpf.o: $(obj)/syscall_nrs.h
@@ -387,7 +383,6 @@ $(obj)/xdp_redirect_cpu.bpf.o: $(obj)/xdp_sample.bpf.o $(obj)/xdp_redirect_map_multi.bpf.o: $(obj)/xdp_sample.bpf.o $(obj)/xdp_redirect_map.bpf.o: $(obj)/xdp_sample.bpf.o $(obj)/xdp_redirect.bpf.o: $(obj)/xdp_sample.bpf.o -$(obj)/xdp_monitor.bpf.o: $(obj)/xdp_sample.bpf.o $(obj)/xdp_router_ipv4.bpf.o: $(obj)/xdp_sample.bpf.o $(obj)/%.bpf.o: $(src)/%.bpf.c $(obj)/vmlinux.h $(src)/xdp_sample.bpf.h $(src)/xdp_sample_shared.h
@@ -399,7 +394,7 @@ $(obj)/%.bpf.o: $(src)/%.bpf.c $(obj)/vmlinux.h $(src)/xdp_sample.bpf.h $(src)/x -c $(filter %.bpf.c,$^) -o $@ LINKED_SKELS := xdp_redirect_cpu.skel.h xdp_redirect_map_multi.skel.h \ - xdp_redirect_map.skel.h xdp_redirect.skel.h xdp_monitor.skel.h \ + xdp_redirect_map.skel.h xdp_redirect.skel.h \ xdp_router_ipv4.skel.h clean-files += $(LINKED_SKELS)
@@ -407,7 +402,6 @@ xdp_redirect_cpu.skel.h-deps := xdp_redirect_cpu.bpf.o xdp_sample.bpf.o xdp_redirect_map_multi.skel.h-deps := xdp_redirect_map_multi.bpf.o xdp_sample.bpf.o xdp_redirect_map.skel.h-deps := xdp_redirect_map.bpf.o xdp_sample.bpf.o xdp_redirect.skel.h-deps := xdp_redirect.bpf.o xdp_sample.bpf.o -xdp_monitor.skel.h-deps := xdp_monitor.bpf.o xdp_sample.bpf.o xdp_router_ipv4.skel.h-deps := xdp_router_ipv4.bpf.o xdp_sample.bpf.o LINKED_BPF_SRCS := $(patsubst %.bpf.o,%.bpf.c,$(foreach skel,$(LINKED_SKELS),$($(skel)-deps)))
samples/bpf/xdp_monitor.bpf.c deleted +0 -8
@@ -1,8 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* Copyright(c) 2017-2018 Jesper Dangaard Brouer, Red Hat Inc. -* -* XDP monitor tool, based on tracepoints -*/ -#include "xdp_sample.bpf.h" - -char _license[] SEC("license") = "GPL";
samples/bpf/xdp_monitor_user.c deleted +0 -118
118 lines not on this page · raw message
Signature · 1 line
2.41.0
PATCH 4/6 samples/bpf: Remove the xdp1 and xdp2 utilities
In reply to Toke Høiland-JørgensenThe functionality of these utilities have been incorporated into the xdp-bench utility in xdp-tools. Remove the unmaintained versions in samples.
--- samples/bpf/Makefile | 7 -- samples/bpf/xdp1_kern.c | 100 ------------------------ samples/bpf/xdp1_user.c | 166 ---------------------------------------- samples/bpf/xdp2_kern.c | 125 ------------------------------ 4 files changed, 398 deletions(-) delete mode 100644 samples/bpf/xdp1_kern.c delete mode 100644 samples/bpf/xdp1_user.c delete mode 100644 samples/bpf/xdp2_kern.c
samples/bpf/Makefile +0 -7
@@ -30,8 +30,6 @@ tprogs-y += test_cgrp2_array_pin tprogs-y += test_cgrp2_attach tprogs-y += test_cgrp2_sock tprogs-y += test_cgrp2_sock2 -tprogs-y += xdp1 -tprogs-y += xdp2 tprogs-y += xdp_router_ipv4 tprogs-y += test_current_task_under_cgroup tprogs-y += trace_event
@@ -83,9 +81,6 @@ test_cgrp2_array_pin-objs := test_cgrp2_array_pin.o test_cgrp2_attach-objs := test_cgrp2_attach.o test_cgrp2_sock-objs := test_cgrp2_sock.o test_cgrp2_sock2-objs := test_cgrp2_sock2.o -xdp1-objs := xdp1_user.o -# reuse xdp1 source intentionally -xdp2-objs := xdp1_user.o test_current_task_under_cgroup-objs := $(CGROUP_HELPERS) \ test_current_task_under_cgroup_user.o trace_event-objs := trace_event_user.o $(TRACE_HELPERS)
@@ -132,8 +127,6 @@ always-y += test_overhead_raw_tp.bpf.o always-y += test_overhead_kprobe.bpf.o always-y += parse_varlen.o parse_simple.o parse_ldabs.o always-y += test_cgrp2_tc.bpf.o -always-y += xdp1_kern.o -always-y += xdp2_kern.o always-y += test_current_task_under_cgroup.bpf.o always-y += trace_event_kern.o always-y += sampleip_kern.o
samples/bpf/xdp1_kern.c deleted +0 -100
100 lines not on this page · raw message
samples/bpf/xdp1_user.c deleted +0 -166
166 lines not on this page · raw message
samples/bpf/xdp2_kern.c deleted +0 -125
125 lines not on this page · raw message
Signature · 1 line
2.41.0
PATCH 5/6 samples/bpf: Remove the xdp_sample_pkts utility
In reply to Toke Høiland-JørgensenThe functionality of this utility is covered by the xdpdump utility in xdp-tools. Remove the unmaintained version in samples.
--- samples/bpf/Makefile | 3 - samples/bpf/xdp_sample_pkts_kern.c | 57 --------- samples/bpf/xdp_sample_pkts_user.c | 196 ----------------------------- 3 files changed, 256 deletions(-) delete mode 100644 samples/bpf/xdp_sample_pkts_kern.c delete mode 100644 samples/bpf/xdp_sample_pkts_user.c
samples/bpf/Makefile +0 -3
@@ -44,7 +44,6 @@ tprogs-y += cpustat tprogs-y += xdp_adjust_tail tprogs-y += xdp_fwd tprogs-y += task_fd_query -tprogs-y += xdp_sample_pkts tprogs-y += ibumad tprogs-y += hbm
@@ -95,7 +94,6 @@ cpustat-objs := cpustat_user.o xdp_adjust_tail-objs := xdp_adjust_tail_user.o xdp_fwd-objs := xdp_fwd_user.o task_fd_query-objs := task_fd_query_user.o $(TRACE_HELPERS) -xdp_sample_pkts-objs := xdp_sample_pkts_user.o ibumad-objs := ibumad_user.o hbm-objs := hbm.o $(CGROUP_HELPERS)
@@ -148,7 +146,6 @@ always-y += cpustat_kern.o always-y += xdp_adjust_tail_kern.o always-y += xdp_fwd_kern.o always-y += task_fd_query_kern.o -always-y += xdp_sample_pkts_kern.o always-y += ibumad_kern.o always-y += hbm_out_kern.o always-y += hbm_edt_kern.o
samples/bpf/xdp_sample_pkts_kern.c deleted +0 -57
57 lines not on this page · raw message
samples/bpf/xdp_sample_pkts_user.c deleted +0 -196
196 lines not on this page · raw message
Signature · 1 line
2.41.0
PATCH 2/6 samples/bpf: Remove the xdp_redirect* utilities
In reply to Toke Høiland-JørgensenThese utilities have all been ported to xdp-tools as functions of the xdp-bench utility. Remove the unmaintained versions in the tree.
--- samples/bpf/Makefile | 29 +- samples/bpf/xdp_redirect.bpf.c | 49 -- samples/bpf/xdp_redirect_cpu.bpf.c | 539 --------------------- samples/bpf/xdp_redirect_cpu_user.c | 559 ---------------------- samples/bpf/xdp_redirect_map.bpf.c | 97 ---- samples/bpf/xdp_redirect_map_multi.bpf.c | 77 --- samples/bpf/xdp_redirect_map_multi_user.c | 232 --------- samples/bpf/xdp_redirect_map_user.c | 228 --------- samples/bpf/xdp_redirect_user.c | 172 ------- 9 files changed, 1 insertion(+), 1981 deletions(-) delete mode 100644 samples/bpf/xdp_redirect.bpf.c delete mode 100644 samples/bpf/xdp_redirect_cpu.bpf.c delete mode 100644 samples/bpf/xdp_redirect_cpu_user.c delete mode 100644 samples/bpf/xdp_redirect_map.bpf.c delete mode 100644 samples/bpf/xdp_redirect_map_multi.bpf.c delete mode 100644 samples/bpf/xdp_redirect_map_multi_user.c delete mode 100644 samples/bpf/xdp_redirect_map_user.c delete mode 100644 samples/bpf/xdp_redirect_user.c
samples/bpf/Makefile +1 -28
@@ -51,11 +51,6 @@ tprogs-y += xdp_sample_pkts tprogs-y += ibumad tprogs-y += hbm -tprogs-y += xdp_redirect_cpu -tprogs-y += xdp_redirect_map_multi -tprogs-y += xdp_redirect_map -tprogs-y += xdp_redirect - # Libbpf dependencies LIBBPF_SRC = $(TOOLS_PATH)/lib/bpf LIBBPF_OUTPUT = $(abspath $(BPF_SAMPLES_PATH))/libbpf
@@ -111,10 +106,6 @@ xdp_sample_pkts-objs := xdp_sample_pkts_user.o ibumad-objs := ibumad_user.o hbm-objs := hbm.o $(CGROUP_HELPERS) -xdp_redirect_map_multi-objs := xdp_redirect_map_multi_user.o $(XDP_SAMPLE) -xdp_redirect_cpu-objs := xdp_redirect_cpu_user.o $(XDP_SAMPLE) -xdp_redirect_map-objs := xdp_redirect_map_user.o $(XDP_SAMPLE) -xdp_redirect-objs := xdp_redirect_user.o $(XDP_SAMPLE) xdp_router_ipv4-objs := xdp_router_ipv4_user.o $(XDP_SAMPLE) # Tell kbuild to always build the programs
@@ -205,10 +196,6 @@ TPROGS_LDFLAGS := -L$(SYSROOT)/usr/lib endif TPROGS_LDLIBS += $(LIBBPF) -lelf -lz -TPROGLDLIBS_xdp_redirect += -lm -TPROGLDLIBS_xdp_redirect_cpu += -lm -TPROGLDLIBS_xdp_redirect_map += -lm -TPROGLDLIBS_xdp_redirect_map_multi += -lm TPROGLDLIBS_xdp_router_ipv4 += -lm -pthread TPROGLDLIBS_tracex4 += -lrt TPROGLDLIBS_trace_output += -lrt
@@ -323,10 +310,6 @@ $(obj)/$(TRACE_HELPERS) $(obj)/$(CGROUP_HELPERS) $(obj)/$(XDP_SAMPLE): | libbpf_ .PHONY: libbpf_hdrs -$(obj)/xdp_redirect_cpu_user.o: $(obj)/xdp_redirect_cpu.skel.h -$(obj)/xdp_redirect_map_multi_user.o: $(obj)/xdp_redirect_map_multi.skel.h -$(obj)/xdp_redirect_map_user.o: $(obj)/xdp_redirect_map.skel.h -$(obj)/xdp_redirect_user.o: $(obj)/xdp_redirect.skel.h $(obj)/xdp_router_ipv4_user.o: $(obj)/xdp_router_ipv4.skel.h $(obj)/tracex5.bpf.o: $(obj)/syscall_nrs.h
@@ -379,10 +362,6 @@ endef CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG)) -$(obj)/xdp_redirect_cpu.bpf.o: $(obj)/xdp_sample.bpf.o -$(obj)/xdp_redirect_map_multi.bpf.o: $(obj)/xdp_sample.bpf.o -$(obj)/xdp_redirect_map.bpf.o: $(obj)/xdp_sample.bpf.o -$(obj)/xdp_redirect.bpf.o: $(obj)/xdp_sample.bpf.o $(obj)/xdp_router_ipv4.bpf.o: $(obj)/xdp_sample.bpf.o $(obj)/%.bpf.o: $(src)/%.bpf.c $(obj)/vmlinux.h $(src)/xdp_sample.bpf.h $(src)/xdp_sample_shared.h
@@ -393,15 +372,9 @@ $(obj)/%.bpf.o: $(src)/%.bpf.c $(obj)/vmlinux.h $(src)/xdp_sample.bpf.h $(src)/x -I$(LIBBPF_INCLUDE) $(CLANG_SYS_INCLUDES) \ -c $(filter %.bpf.c,$^) -o $@ -LINKED_SKELS := xdp_redirect_cpu.skel.h xdp_redirect_map_multi.skel.h \ - xdp_redirect_map.skel.h xdp_redirect.skel.h \ - xdp_router_ipv4.skel.h +LINKED_SKELS := xdp_router_ipv4.skel.h clean-files += $(LINKED_SKELS) -xdp_redirect_cpu.skel.h-deps := xdp_redirect_cpu.bpf.o xdp_sample.bpf.o -xdp_redirect_map_multi.skel.h-deps := xdp_redirect_map_multi.bpf.o xdp_sample.bpf.o -xdp_redirect_map.skel.h-deps := xdp_redirect_map.bpf.o xdp_sample.bpf.o -xdp_redirect.skel.h-deps := xdp_redirect.bpf.o xdp_sample.bpf.o xdp_router_ipv4.skel.h-deps := xdp_router_ipv4.bpf.o xdp_sample.bpf.o LINKED_BPF_SRCS := $(patsubst %.bpf.o,%.bpf.c,$(foreach skel,$(LINKED_SKELS),$($(skel)-deps)))
samples/bpf/xdp_redirect.bpf.c deleted +0 -49
49 lines not on this page · raw message
samples/bpf/xdp_redirect_cpu.bpf.c deleted +0 -539
539 lines not on this page · raw message
samples/bpf/xdp_redirect_cpu_user.c deleted +0 -559
559 lines not on this page · raw message
samples/bpf/xdp_redirect_map.bpf.c deleted +0 -97
97 lines not on this page · raw message
samples/bpf/xdp_redirect_map_multi.bpf.c deleted +0 -77
77 lines not on this page · raw message
samples/bpf/xdp_redirect_map_multi_user.c deleted +0 -232
232 lines not on this page · raw message
samples/bpf/xdp_redirect_map_user.c deleted +0 -228
228 lines not on this page · raw message
samples/bpf/xdp_redirect_user.c deleted +0 -172
172 lines not on this page · raw message
Signature · 1 line
2.41.0
PATCH 3/6 samples/bpf: Remove the xdp_rxq_info utility
In reply to Toke Høiland-JørgensenThe functionality of this utility has been incorporated into the xdp-bench utility in xdp-tools. Remove the unmaintained version in samples.
--- samples/bpf/Makefile | 3 - samples/bpf/xdp_rxq_info_kern.c | 140 -------- samples/bpf/xdp_rxq_info_user.c | 614 -------------------------------- 3 files changed, 757 deletions(-) delete mode 100644 samples/bpf/xdp_rxq_info_kern.c delete mode 100644 samples/bpf/xdp_rxq_info_user.c
samples/bpf/Makefile +0 -3
@@ -41,7 +41,6 @@ tprogs-y += lwt_len_hist tprogs-y += xdp_tx_iptunnel tprogs-y += test_map_in_map tprogs-y += per_socket_stats_example -tprogs-y += xdp_rxq_info tprogs-y += syscall_tp tprogs-y += cpustat tprogs-y += xdp_adjust_tail
@@ -96,7 +95,6 @@ lwt_len_hist-objs := lwt_len_hist_user.o xdp_tx_iptunnel-objs := xdp_tx_iptunnel_user.o test_map_in_map-objs := test_map_in_map_user.o per_socket_stats_example-objs := cookie_uid_helper_example.o -xdp_rxq_info-objs := xdp_rxq_info_user.o syscall_tp-objs := syscall_tp_user.o cpustat-objs := cpustat_user.o xdp_adjust_tail-objs := xdp_adjust_tail_user.o
@@ -151,7 +149,6 @@ always-y += tcp_clamp_kern.o always-y += tcp_basertt_kern.o always-y += tcp_tos_reflect_kern.o always-y += tcp_dumpstats_kern.o -always-y += xdp_rxq_info_kern.o always-y += xdp2skb_meta_kern.o always-y += syscall_tp_kern.o always-y += cpustat_kern.o
samples/bpf/xdp_rxq_info_kern.c deleted +0 -140
140 lines not on this page · raw message
samples/bpf/xdp_rxq_info_user.c deleted +0 -614
614 lines not on this page · raw message
Signature · 1 line
2.41.0
PATCH 6/6 samples/bpf: Cleanup .gitignore
In reply to Toke Høiland-JørgensenRemove no longer present XDP utilities from .gitignore. Apart from the recently removed XDP utilities this also includes the previously removed xdpsock and xsk utilities.
--- samples/bpf/.gitignore | 12 ------------ 1 file changed, 12 deletions(-)
samples/bpf/.gitignore +0 -12
@@ -37,22 +37,10 @@ tracex4 tracex5 tracex6 tracex7 -xdp1 -xdp2 xdp_adjust_tail xdp_fwd -xdp_monitor -xdp_redirect -xdp_redirect_cpu -xdp_redirect_map -xdp_redirect_map_multi xdp_router_ipv4 -xdp_rxq_info -xdp_sample_pkts xdp_tx_iptunnel -xdpsock -xdpsock_ctrl_proc -xsk_fwd testfile.img hbm_out.log iperf.*
Signature · 1 line
2.41.0
Jesper Dangaard Brouer
maintainerRe: [PATCH bpf-next 4/6] samples/bpf: Remove the xdp1 and xdp2 utilities
In reply to Toke Høiland-JørgensenQuoted 4 lines · Toke Høiland-Jørgensen
The functionality of these utilities have been incorporated into the xdp-bench utility in xdp-tools. Remove the unmaintained versions in samples.
I think it will be worth our time if we give some examples of how the removed utility translates to some given xdp-bench commands. There is not a 1-1 mapping.
XDP driver changes need to be verified on physical NIC hardware, so these utilities are still being run by QA. I know Red Hat, Intel and Linaro QA people are using these utilities. It will save us time if we can reference a commit message instead of repeatable describing this. E.g. for Intel is it often contingent workers that adds a tested-by (that all need to update their knowledge).
Red Hat is in the process of moving our QA to use xdp-bench / xdp-tools.
Want to mention LNST team are also adding xdp-bench (+pktgen) support:
- https://github.com/LNST-project/lnst/pull/310
--Jesper
Quoted 10 lines
Signed-off-by Toke Høiland-Jørgensen <[email protected]>--- samples/bpf/Makefile | 7 -- samples/bpf/xdp1_kern.c | 100 ------------------------ samples/bpf/xdp1_user.c | 166 ---------------------------------------- samples/bpf/xdp2_kern.c | 125 ------------------------------ 4 files changed, 398 deletions(-)delete mode 100644
samples/bpf/xdp1_kern.c
delete mode 100644samples/bpf/xdp1_user.c
delete mode 100644samples/bpf/xdp2_kern.c
Re: [PATCH bpf-next 4/6] samples/bpf: Remove the xdp1 and xdp2 utilities
Quoted 10 lines · Jesper Dangaard Brouer
Quoted 4 lines · Toke Høiland-Jørgensen
The functionality of these utilities have been incorporated into the xdp-bench utility in xdp-tools. Remove the unmaintained versions in samples.
I think it will be worth our time if we give some examples of how the removed utility translates to some given xdp-bench commands. There is not a 1-1 mapping.
Quoted 6 lines
XDP driver changes need to be verified on physical NIC hardware, so these utilities are still being run by QA. I know Red Hat, Intel and Linaro QA people are using these utilities. It will save us time if we can reference a commit message instead of repeatable describing this. E.g. for Intel is it often contingent workers that adds a tested-by (that all need to update their knowledge).
I did think about putting that in the commit message for these, but I figured it was too obscure a place to put it, compared to (for instance) putting it into the xdp-bench man page.
If you prefer to have it in the commit message as well, I can respin adding it - WDYT?
-Toke
Re: [PATCH bpf-next 4/6] samples/bpf: Remove the xdp1 and xdp2 utilities
Quoted 19 lines · Toke Høiland-Jørgensen
Quoted 10 lines · Jesper Dangaard Brouer
Quoted 4 lines · Toke Høiland-Jørgensen
The functionality of these utilities have been incorporated into the xdp-bench utility in xdp-tools. Remove the unmaintained versions in samples.
I think it will be worth our time if we give some examples of how the removed utility translates to some given xdp-bench commands. There is not a 1-1 mapping.
Quoted 6 lines
XDP driver changes need to be verified on physical NIC hardware, so these utilities are still being run by QA. I know Red Hat, Intel and Linaro QA people are using these utilities. It will save us time if we can reference a commit message instead of repeatable describing this. E.g. for Intel is it often contingent workers that adds a tested-by (that all need to update their knowledge).
Quoted 7 lines
I did think about putting that in the commit message for these, but I figured it was too obscure a place to put it, compared to (for instance) putting it into the xdp-bench man page.
If you prefer to have it in the commit message as well, I can respin adding it - WDYT?
It is super nice that xdp-bench already have a man page, but I was actually looking at this and it was a bit overwhelming (520 lines) explaining every possible option.
I really think its worth giving examples in the commit, to ease the transition to this new tool.
--Jesper
p.s. man page is generated from the readme [1]:
[1]
https://github.com/xdp-project/xdp-tools/blob/master/xdp-bench/README.org
Re: [PATCH bpf-next 4/6] samples/bpf: Remove the xdp1 and xdp2 utilities
Quoted 24 lines · Jesper Dangaard Brouer
Quoted 23 lines · Toke Høiland-Jørgensen
Quoted 10 lines · Jesper Dangaard Brouer
Quoted 4 lines · Toke Høiland-Jørgensen
The functionality of these utilities have been incorporated into the xdp-bench utility in xdp-tools. Remove the unmaintained versions in samples.
I think it will be worth our time if we give some examples of how the removed utility translates to some given xdp-bench commands. There is not a 1-1 mapping.
Quoted 6 lines
XDP driver changes need to be verified on physical NIC hardware, so these utilities are still being run by QA. I know Red Hat, Intel and Linaro QA people are using these utilities. It will save us time if we can reference a commit message instead of repeatable describing this. E.g. for Intel is it often contingent workers that adds a tested-by (that all need to update their knowledge).
I did think about putting that in the commit message for these, but I figured it was too obscure a place to put it, compared to (for instance) putting it into the xdp-bench man page.
Quoted 7 lines
Quoted 3 lines
If you prefer to have it in the commit message as well, I can respin adding it - WDYT?
It is super nice that xdp-bench already have a man page, but I was actually looking at this and it was a bit overwhelming (520 lines) explaining every possible option.
Haha, I think that's the first time I've had anyone complain that I write too *much* documentation ;)
Quoted 2 lines
I really think its worth giving examples in the commit, to ease the transition to this new tool.
OK, I'll respin tomorrow with some examples in the commit messages...
-Toke
Quoted 30 lines · Toke Høiland-Jørgensen
The
samples/bpfdirectory in the kernel tree started out as a way of showcasing different aspects of BPF functionality by writing small utility programs for each feature. However, as the BPF subsystem has matured, the preferred way of including userspace code with a feature has become the BPF selftests, which also have the benefit of being consistently run as part of the BPF CI system.As a result of this shift, the utilities in
samples/bpfhave seen little love, and have slowly bitrotted. There have been sporadic cleanup patches over the years, but it's clear that the utilities are far from maintained.For XDP in particular, some of the utilities have been used as benchmarking aids when implementing new kernel features, which seems to be the main reason they have stuck around; any updates the utilities have seen have been targeted at this use case. However, as the BPF subsystem as a whole has moved on, it has become increasingly difficult to incorporate new features into these utilities because they predate most of the modern BPF features (such as kfuncs and BTF).
Rather than try to update these utilities and keep maintaining them in the kernel tree, we have ported the useful features of the utilities to the xdp-tools package. In the porting process we also updated the utilities to take advantage of modern BPF features, integrated them with libxdp, and polished the user interface.
As these utilities are standalone tools, maintaining them out of tree is simpler, and we plan to keep maintaining them in the xdp-tools repo. To direct users of these utilities to the right place, this series removes the utilities from
samples/bpf, leaving in place only a couple of utilities whose functionality have not yet been ported to xdp-tools.
Quoted 3 lines
The xdp-tools repository is located on Github at the following URL:
Could you add this link with details to samples/bpf/README.rst, so that folks know where to look for them?
Other than that the set makes sense to me.