mbox series

[bpf-next,v3,0/7] samples/bpf: Remove unmaintained XDP sample utilities

Message ID 20230824102255.1561885-1-toke@redhat.com (mailing list archive)
Headers show
Series samples/bpf: Remove unmaintained XDP sample utilities | expand

Message

Toke Høiland-Jørgensen Aug. 24, 2023, 10:22 a.m. UTC
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

The commits in the series removes one utility each, explaining how the
equivalent functionality can be obtained with xdp-tools.

v2:
- Add equivalent xdp-tools commands for each removed utility
v3:
- Add link to xdp-tools in the README

Toke Høiland-Jørgensen (7):
  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: Add note to README about the XDP utilities moved to
    xdp-tools

 samples/bpf/.gitignore                    |  12 -
 samples/bpf/Makefile                      |  48 +-
 samples/bpf/README.rst                    |   6 +
 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 -------
 20 files changed, 7 insertions(+), 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

Comments

patchwork-bot+netdevbpf@kernel.org Aug. 24, 2023, 3:50 p.m. UTC | #1
Hello:

This series was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Thu, 24 Aug 2023 12:22:43 +0200 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [bpf-next,v3,1/7] samples/bpf: Remove the xdp_monitor utility
    https://git.kernel.org/bpf/bpf-next/c/e7c9e73d0822
  - [bpf-next,v3,2/7] samples/bpf: Remove the xdp_redirect* utilities
    https://git.kernel.org/bpf/bpf-next/c/91dda69b08de
  - [bpf-next,v3,3/7] samples/bpf: Remove the xdp_rxq_info utility
    https://git.kernel.org/bpf/bpf-next/c/0e445e115f8f
  - [bpf-next,v3,4/7] samples/bpf: Remove the xdp1 and xdp2 utilities
    https://git.kernel.org/bpf/bpf-next/c/eaca21d6eee9
  - [bpf-next,v3,5/7] samples/bpf: Remove the xdp_sample_pkts utility
    https://git.kernel.org/bpf/bpf-next/c/cced0699cbf1
  - [bpf-next,v3,6/7] samples/bpf: Cleanup .gitignore
    https://git.kernel.org/bpf/bpf-next/c/91b965136d53
  - [bpf-next,v3,7/7] samples/bpf: Add note to README about the XDP utilities moved to xdp-tools
    https://git.kernel.org/bpf/bpf-next/c/5a9fd0f778eb

You are awesome, thank you!