From 5205a917128e3eaa8d0ae61a123657e96b3a6b51 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 9 May 2023 05:34:19 +0000 Subject: [PATCH] import xdp-tools-1.3.1-1.el9 --- .gitignore | 2 +- .xdp-tools.metadata | 2 +- ...figure-Don-t-fail-on-missing-bpftool.patch | 111 ++++++++++++++++++ SPECS/xdp-tools.spec | 27 ++++- 4 files changed, 138 insertions(+), 4 deletions(-) create mode 100644 SOURCES/xdp-tools-configure-Don-t-fail-on-missing-bpftool.patch diff --git a/.gitignore b/.gitignore index 35057ed..f9cb0d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/xdp-tools-1.2.6.tar.gz +SOURCES/xdp-tools-1.3.1.tar.gz diff --git a/.xdp-tools.metadata b/.xdp-tools.metadata index 74d69bb..7e3af25 100644 --- a/.xdp-tools.metadata +++ b/.xdp-tools.metadata @@ -1 +1 @@ -5d71cebf2dd5da7934d5d672349c7ee711682de1 SOURCES/xdp-tools-1.2.6.tar.gz +be41c30e4da3e58dcb2cf00b794adc68cb7e0b3a SOURCES/xdp-tools-1.3.1.tar.gz diff --git a/SOURCES/xdp-tools-configure-Don-t-fail-on-missing-bpftool.patch b/SOURCES/xdp-tools-configure-Don-t-fail-on-missing-bpftool.patch new file mode 100644 index 0000000..e16a927 --- /dev/null +++ b/SOURCES/xdp-tools-configure-Don-t-fail-on-missing-bpftool.patch @@ -0,0 +1,111 @@ +From 06f6eb8596cd4feb52f4c3aed7aa0e2d8b3353a7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= +Date: Thu, 9 Feb 2023 17:57:41 +0100 +Subject: [PATCH] configure: Don't fail on missing bpftool +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Instead of bailing out of configure if bpftool is not found, just disable +compilation of the tools that require it (i.e., xdp-bench, xdp-monitor and +xdp-trafficgen which use BPF skeletons). + +Signed-off-by: Toke Høiland-Jørgensen +--- + Makefile | 8 +++++++- + configure | 9 +++++---- + lib/testing/test-tool.c | 2 ++ + lib/util/util.mk | 12 ++++++++++-- + 4 files changed, 24 insertions(+), 7 deletions(-) + +diff --git a/Makefile b/Makefile +index 5c22e854db8d..d5dc21fb076c 100644 +--- a/Makefile ++++ b/Makefile +@@ -14,8 +14,14 @@ MAKEFLAGS += --no-print-directory + endif + + include version.mk ++include config.mk ++ ++UTILS := xdp-filter xdp-loader xdp-dump ++ ++ifneq ($(BPFTOOL),) ++UTILS += xdp-bench xdp-monitor xdp-trafficgen ++endif + +-UTILS := xdp-filter xdp-loader xdp-dump xdp-bench xdp-monitor xdp-trafficgen + SUBDIRS := lib $(UTILS) + .PHONY: check_submodule help clobber distclean clean install test libxdp $(SUBDIRS) + +diff --git a/configure b/configure +index 016c5bbd682e..581cd77d996f 100755 +--- a/configure ++++ b/configure +@@ -71,7 +71,7 @@ check_toolchain() + CLANG=$(find_tool clang "$CLANG") + LLC=$(find_tool llc "$LLC") + +- for TOOL in $PKG_CONFIG $CC $LD $OBJCOPY $CLANG $LLC $M4 $BPFTOOL; do ++ for TOOL in $PKG_CONFIG $CC $LD $OBJCOPY $CLANG $LLC $M4; do + if [ ! $(command -v ${TOOL} 2>/dev/null) ]; then + echo "*** ERROR: Cannot find tool ${TOOL}" ; + exit 1; +@@ -108,12 +108,12 @@ check_toolchain() + exit 1 + fi + +- if $BPFTOOL gen help 2>&1 | grep 'gen help' > /dev/null; then ++ if command -v $BPFTOOL &>/dev/null && $BPFTOOL gen help 2>&1 | grep 'gen help' > /dev/null; then + bpftool_version=$($BPFTOOL version | head -n 1) + echo "using $bpftool_version" + else +- echo "bpftool doesn't support skeleton generation" +- exit 1 ++ echo "bpftool not found or doesn't support skeleton generation; not building all tools" ++ BPFTOOL= + fi + + if [ -z "$ARCH_INCLUDES" ]; then +@@ -134,6 +134,7 @@ check_toolchain() + echo "EMACS:=${EMACS}" >>$CONFIG + echo "ARCH_INCLUDES:=$ARCH_INCLUDES" >> $CONFIG + echo "BPFTOOL:=${BPFTOOL}" >> $CONFIG ++ [ -n "$BPFTOOL" ] && echo "HAVE_FEATURES+=BPFTOOL" >>"$CONFIG" + } + + check_zlib() +diff --git a/lib/testing/test-tool.c b/lib/testing/test-tool.c +index 7e2a82890f68..30acb835f9c3 100644 +--- a/lib/testing/test-tool.c ++++ b/lib/testing/test-tool.c +@@ -212,7 +212,9 @@ int do_probe(const void *cfg, __unused const char *pin_root_path) + + switch (opt->action) { + case PROBE_CPUMAP_PROGRAM: ++#ifdef HAVE_BPFTOOL + res = sample_probe_cpumap_compat(); ++#endif + break; + default: + return EXIT_FAILURE; +diff --git a/lib/util/util.mk b/lib/util/util.mk +index 7fc3b4345c34..7059cdd5e7dc 100644 +--- a/lib/util/util.mk ++++ b/lib/util/util.mk +@@ -1,2 +1,10 @@ +-UTIL_OBJS := params.o logging.o util.o stats.o xpcapng.o xdp_sample.o +-UTIL_BPF_OBJS := xdp_sample.bpf.o ++LIB_DIR ?= .. ++include $(LIB_DIR)/defines.mk ++ ++UTIL_OBJS := params.o logging.o util.o stats.o xpcapng.o ++UTIL_BPF_OBJS := ++ ++ifneq ($(BPFTOOL),) ++UTIL_OBJS += xdp_sample.o ++UTIL_BPF_OBJS += xdp_sample.bpf.o ++endif +-- +2.39.1 + diff --git a/SPECS/xdp-tools.spec b/SPECS/xdp-tools.spec index 55a9c32..d3b17ef 100644 --- a/SPECS/xdp-tools.spec +++ b/SPECS/xdp-tools.spec @@ -1,12 +1,13 @@ Name: xdp-tools -Version: 1.2.6 +Version: 1.3.1 Release: 1%{?dist} Summary: Utilities and example programs for use with XDP -%global _soversion 1.2.0 +%global _soversion 1.3.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-configure-Don-t-fail-on-missing-bpftool.patch BuildRequires: libbpf-devel BuildRequires: elfutils-libelf-devel @@ -21,6 +22,10 @@ BuildRequires: m4 BuildRequires: emacs-nox BuildRequires: wireshark-cli +%ifnarch i686 +BuildRequires: bpftool +%endif + # Always keep xdp-tools and libxdp packages in sync Requires: libxdp = %{version}-%{release} @@ -89,6 +94,11 @@ make install V=1 %{_sbindir}/xdp-filter %{_sbindir}/xdp-loader %{_sbindir}/xdpdump +%ifnarch i686 +%{_sbindir}/xdp-bench +%{_sbindir}/xdp-monitor +%{_sbindir}/xdp-trafficgen +%endif %{_mandir}/man8/* %{_libdir}/bpf/xdpfilt_*.o %{_libdir}/bpf/xdpdump_*.o @@ -112,6 +122,19 @@ make install V=1 %{_libdir}/pkgconfig/libxdp.pc %changelog +* Thu Feb 23 2023 Toke Høiland-Jørgensen 1.3.1-1 +- Upstream version bump + +* Thu Feb 9 2023 Toke Høiland-Jørgensen 1.3.0-2 +- Restore building on i686, by patching the build to exclude the bits that require bpftool + +* Tue Feb 7 2023 Toke Høiland-Jørgensen 1.3.0-1 +- Upstream version bump +- Don't build on i686 (because of missing bpftool) + +* Thu Feb 2 2023 Toke Høiland-Jørgensen 1.2.9-1 +- Upstream version bump + * Tue Aug 16 2022 Toke Høiland-Jørgensen 1.2.6-1 - Upstream version bump