Compare commits

...

No commits in common. "imports/c9-beta/xdp-tools-1.4.0-1.el9" and "c8" have entirely different histories.

4 changed files with 23 additions and 162 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/xdp-tools-1.4.0.tar.gz
SOURCES/xdp-tools-1.2.10.tar.gz

View File

@ -1 +1 @@
52041558a7e1060d255c9d8a023bdd586c20973e SOURCES/xdp-tools-1.4.0.tar.gz
f0ea44bb9e7d53f7a1b83ede05984ee5ca27c0a7 SOURCES/xdp-tools-1.2.10.tar.gz

View File

@ -1,117 +0,0 @@
From 7760d84998f1fd042b3842f598296efe264fc385 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke@redhat.com>
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 <toke@redhat.com>
---
Makefile | 8 +++++++-
configure | 9 +++++----
lib/testing/test-tool.c | 4 ++++
lib/util/util.mk | 13 +++++++++++--
4 files changed, 27 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 c32790cc361d..4bdb66b8b761 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 skeleton.*name' > /dev/null; then
+ if command -v $BPFTOOL &>/dev/null && $BPFTOOL gen help 2>&1 | grep 'gen skeleton.*name' > /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 3dd5270af95f..95f76cb36573 100644
--- a/lib/testing/test-tool.c
+++ b/lib/testing/test-tool.c
@@ -205,10 +205,14 @@ 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;
case PROBE_XDP_LOAD_BYTES:
+#ifdef HAVE_BPFTOOL
res = sample_probe_xdp_load_bytes();
+#endif
break;
default:
return EXIT_FAILURE;
diff --git a/lib/util/util.mk b/lib/util/util.mk
index 2b6a2e08af3b..6c9ebaf00f77 100644
--- a/lib/util/util.mk
+++ b/lib/util/util.mk
@@ -1,2 +1,11 @@
-UTIL_OBJS := params.o logging.o util.o stats.o xpcapng.o xdp_sample.o
-UTIL_BPF_OBJS := xdp_sample.bpf.o xdp_load_bytes.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 xdp_load_bytes.bpf.o
+endif
+
--
2.41.0

View File

@ -1,13 +1,12 @@
Name: xdp-tools
Version: 1.4.0
Version: 1.2.10
Release: 1%{?dist}
Summary: Utilities and example programs for use with XDP
%global _soversion 1.4.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.4.0-configure-Don-t-fail-on-missing-bpftool.patch
BuildRequires: libbpf-devel
BuildRequires: elfutils-libelf-devel
@ -22,10 +21,6 @@ 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}
@ -33,6 +28,9 @@ Requires: libxdp = %{version}-%{release}
# disable the debug package to avoid rpmbuild error'ing out because of this
%global debug_package %{nil}
%global _hardened_build 1
# strip barfs on BPF files, override it as a workaround
%global __brp_strip_lto %{_bindir}/true
%global __brp_strip %{_bindir}/true
%description
Utilities and example programs for use with XDP
@ -40,6 +38,7 @@ Utilities and example programs for use with XDP
%package -n libxdp
Summary: XDP helper library
Requires: kernel-headers
Requires: libbpf >= 0.2.0-1
%package -n libxdp-devel
Summary: Development files for libxdp
@ -89,16 +88,13 @@ export MANDIR='%{_mandir}'
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
%{_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
@ -108,6 +104,8 @@ make install V=1
%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
%{_libdir}/bpf/xsk_def_xdp_prog*.o
%{_mandir}/man3/*
@ -122,50 +120,27 @@ make install V=1
%{_libdir}/pkgconfig/libxdp.pc
%changelog
* Thu Jul 6 2023 Toke Høiland-Jørgensen <toke@redhat.com> 1.4.0-1
* Wed Feb 8 2023 Toke Høiland-Jørgensen <toke@redhat.com> 1.2.10-1
- Upstream version bump
* Thu Feb 23 2023 Toke Høiland-Jørgensen <toke@redhat.com> 1.3.1-1
- Upstream version bump
* Thu Feb 9 2023 Toke Høiland-Jørgensen <toke@redhat.com> 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 <toke@redhat.com> 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 <toke@redhat.com> 1.2.9-1
* Fri Jan 20 2023 Toke Høiland-Jørgensen <toke@redhat.com> 1.2.9-1
- Upstream version bump
* Tue Aug 16 2022 Toke Høiland-Jørgensen <toke@redhat.com> 1.2.6-1
- Upstream version bump
* Thu Feb 17 2022 Toke Høiland-Jørgensen <toke@redhat.com> 1.2.3-1
- Upstream version bump
* Mon Jan 31 2022 Toke Høiland-Jørgensen <toke@redhat.com> 1.2.2-1
- Upstream version bump
* Thu Jan 13 2022 Toke Høiland-Jørgensen <toke@redhat.com> 1.2.1-1
- Upstream version bump
* Thu Aug 19 2021 Toke Høiland-Jørgensen <toke@redhat.com> 1.2.0-1
* Wed Jul 7 2021 Toke Høiland-Jørgensen <toke@redhat.com> 1.2.0-1
- Upstream version bump
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1.1.1-3
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.1.1-2
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Wed Feb 10 2021 Toke Høiland-Jørgensen <toke@redhat.com> 1.1.1-2
- Fix depedency and patch two issues fixed upstream
* Wed Feb 3 2021 Toke Høiland-Jørgensen <toke@redhat.com> 1.1.1-1
- Upstream version bump
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Jan 4 2021 Toke Høiland-Jørgensen <toke@redhat.com> 1.1.0-1
- Upstream version bump
@ -175,9 +150,6 @@ make install V=1
* Tue Aug 18 2020 Toke Høiland-Jørgensen <toke@redhat.com> 1.0.0-1
- Upstream version bump
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0~beta3-0.2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jul 15 2020 Eelco Chaudron <echaudro@redhat.com> 1.0.0~beta3-0.1
- Upstream version bump
@ -187,6 +159,12 @@ make install V=1
* Mon Jun 15 2020 Toke Høiland-Jørgensen <toke@redhat.com> 1.0.0~beta1-0.1
- Upstream version bump
* Tue May 12 2020 Toke Høiland-Jørgensen <toke@redhat.com> 0.0.3-3
- Add CI gating config file
* Mon May 11 2020 Toke Høiland-Jørgensen <toke@redhat.com> 0.0.3-2
- Fix build error due to missing _GNU_SOURCE define
* Mon Apr 6 2020 Toke Høiland-Jørgensen <toke@redhat.com> 0.0.3-1
- Upstream update, add libxdp sub-packages