From 3bbc2aaf7b81ecee9ea4063a5d3199f7c0b208ca Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Wed, 6 Oct 2021 06:15:10 -0400 Subject: [PATCH] import xdp-tools-1.2.0-1.el8 --- .gitignore | 2 +- .xdp-tools.metadata | 2 +- .../xdp-tools-1.1.1-fix-libxdp-man-page.patch | 42 ------------------- ...dp-tools-1.1.1-xdp-filter-load-check.patch | 30 ------------- SPECS/xdp-tools.spec | 19 ++++++--- 5 files changed, 15 insertions(+), 80 deletions(-) delete mode 100644 SOURCES/xdp-tools-1.1.1-fix-libxdp-man-page.patch delete mode 100644 SOURCES/xdp-tools-1.1.1-xdp-filter-load-check.patch diff --git a/.gitignore b/.gitignore index 351d4b7..f59867d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/xdp-tools-1.1.1.tar.gz +SOURCES/xdp-tools-1.2.0.tar.gz diff --git a/.xdp-tools.metadata b/.xdp-tools.metadata index 43fba5a..28cf659 100644 --- a/.xdp-tools.metadata +++ b/.xdp-tools.metadata @@ -1 +1 @@ -cce9f7c3a5275a78056a88cf940413cce1e4776b SOURCES/xdp-tools-1.1.1.tar.gz +4ea7e4c19f85d5c95730da9d101ba668f7af1a15 SOURCES/xdp-tools-1.2.0.tar.gz diff --git a/SOURCES/xdp-tools-1.1.1-fix-libxdp-man-page.patch b/SOURCES/xdp-tools-1.1.1-fix-libxdp-man-page.patch deleted file mode 100644 index d094545..0000000 --- a/SOURCES/xdp-tools-1.1.1-fix-libxdp-man-page.patch +++ /dev/null @@ -1,42 +0,0 @@ -commit 98a7fdb7c820a8474c9a6d836f4551eac050bd54 -Author: Toke Høiland-Jørgensen -Date: Wed Feb 10 16:28:57 2021 +0100 - - libxdp/README: Update documentation with support for incremental attach - - Seems I forgot to update the libxdp documentation when adding support for - incrementally attaching multiple programs. Fix that oversight and note the - limitations in terms of kernel versions and dispatcher compatibility. - - Signed-off-by: Toke Høiland-Jørgensen - -diff --git a/lib/libxdp/README.org b/lib/libxdp/README.org -index 5a930813c7d9..045348bb1d9a 100644 ---- a/lib/libxdp/README.org -+++ b/lib/libxdp/README.org -@@ -76,13 +76,18 @@ metadata* section below). Because the loading process involves modifying the - attach type of the program, the attach functions only work with =struct - xdp_program= objects that have not yet been loaded into the kernel. - --Due to limitations in the kernel support, it is currently not possible to attach --another program to an already-attached list of programs. As such, the only way --to actually run multiple programs on a single interface is to attach them all at --the same time with =xdp_program__attach_multi()=. It is expected that this --restriction will be lifted in an upcoming kernel version, after which --=xdp_program__attach()= will simply add the program being loaded into the --existing chain of programs running on the interface. -+When using the attach functions to attach to an interface that already has an -+XDP program loaded, libxdp will attempt to add the program to the list of loaded -+programs. However, this may fail, either due to missing kernel support, or -+because the already-attached program was not loaded using a dispatcher -+compatible with libxdp. If the kernel support for incremental attach (merged in -+kernel 5.10) is missing, the only way to actually run multiple programs on a -+single interface is to attach them all at the same time with -+=xdp_program__attach_multi()=. If the existing program is not an XDP dispatcher, -+that program will have to be detached from the interface before libxdp can -+attach a new one. This can be done by calling =xdp_program__detach()= with a -+reference to the loaded program; but note that this will of course break any -+application relying on that other XDP program to be present. - - * Program metadata - diff --git a/SOURCES/xdp-tools-1.1.1-xdp-filter-load-check.patch b/SOURCES/xdp-tools-1.1.1-xdp-filter-load-check.patch deleted file mode 100644 index 0eb0ec3..0000000 --- a/SOURCES/xdp-tools-1.1.1-xdp-filter-load-check.patch +++ /dev/null @@ -1,30 +0,0 @@ -commit 5fb355a7c9a1fdd5842c4b9dbd5e48ba6b767921 -Author: Toke Høiland-Jørgensen -Date: Wed Feb 10 16:59:08 2021 +0100 - - xdp-filter: Check whether we have already been loaded - - Now that we can attach multiple programs to an interface, xdp-filter will - happily load itself multiple times on the same interface. Fix that by - checking if it's already loaded before attempting a new load. - - Signed-off-by: Toke Høiland-Jørgensen - -diff --git a/xdp-filter/xdp-filter.c b/xdp-filter/xdp-filter.c -index 08cfd722e169..895dbd5750b2 100644 ---- a/xdp-filter/xdp-filter.c -+++ b/xdp-filter/xdp-filter.c -@@ -268,6 +268,13 @@ int do_load(const void *cfg, const char *pin_root_path) - } - features |= opt->policy_mode; - -+ err = get_pinned_program(&opt->iface, pin_root_path, NULL, &p); -+ if (!err) { -+ pr_warn("xdp-filter is already loaded on %s\n", opt->iface.ifname); -+ xdp_program__close(p); -+ return EXIT_FAILURE; -+ } -+ - print_flags(featbuf, sizeof(featbuf), print_features, features); - pr_debug("Looking for eBPF program with features %s\n", featbuf); - diff --git a/SPECS/xdp-tools.spec b/SPECS/xdp-tools.spec index 644d370..b995a9c 100644 --- a/SPECS/xdp-tools.spec +++ b/SPECS/xdp-tools.spec @@ -1,14 +1,12 @@ Name: xdp-tools -Version: 1.1.1 -Release: 2%{?dist} +Version: 1.2.0 +Release: 1%{?dist} Summary: Utilities and example programs for use with XDP -%global _soversion 1.1.0 +%global _soversion 1.2.0 License: GPLv2 URL: https://github.com/xdp-project/%{name} Source0: https://github.com/xdp-project/%{name}/releases/download/v%{version}/xdp-tools-%{version}.tar.gz -Patch0: xdp-tools-1.1.1-fix-libxdp-man-page.patch -Patch1: xdp-tools-1.1.1-xdp-filter-load-check.patch BuildRequires: libbpf-devel BuildRequires: elfutils-libelf-devel @@ -89,6 +87,7 @@ export DATADIR='%{_datadir}' export HDRDIR='%{_includedir}/xdp' make install V=1 cd $DESTDIR/$LIBDIR && ln -vs libxdp.so.%{_soversion} libxdp.so.1.0.0 +cd $DESTDIR/$LIBDIR && ln -vs libxdp.so.%{_soversion} libxdp.so.1.1.0 %files %{_sbindir}/xdp-filter @@ -97,13 +96,15 @@ cd $DESTDIR/$LIBDIR && ln -vs libxdp.so.%{_soversion} libxdp.so.1.0.0 %{_mandir}/man8/* %{_libdir}/bpf/xdpfilt_*.o %{_libdir}/bpf/xdpdump_*.o +%{_libdir}/bpf/xsk_def_xdp_prog*.o %{_datadir}/xdp-tools/ -%license LICENSE +%license LICENSES/* %files -n libxdp %{_libdir}/libxdp.so.1 %{_libdir}/libxdp.so.%{_soversion} %{_libdir}/libxdp.so.1.0.0 +%{_libdir}/libxdp.so.1.1.0 %{_libdir}/bpf/xdp-dispatcher.o %{_mandir}/man3/* @@ -116,6 +117,12 @@ cd $DESTDIR/$LIBDIR && ln -vs libxdp.so.%{_soversion} libxdp.so.1.0.0 %{_libdir}/pkgconfig/libxdp.pc %changelog +* Wed Jul 7 2021 Toke Høiland-Jørgensen 1.2.0-1 +- Upstream version bump + +* Wed Feb 10 2021 Toke Høiland-Jørgensen 1.1.1-2 +- Fix depedency and patch two issues fixed upstream + * Wed Feb 3 2021 Toke Høiland-Jørgensen 1.1.1-1 - Upstream version bump