From c4b428f3400775b5a49e987d330f22fcdb4c77c6eaa185512a2c70a7385596e4 Mon Sep 17 00:00:00 2001 From: Shung-Hsi Yu Date: Mon, 24 Mar 2025 12:00:39 +0000 Subject: [PATCH 1/4] Accepting request 1255161 from home:aaronpuchert:llvm-next - Add fix-clang20-build.patch to fix build with Clang 20. OBS-URL: https://build.opensuse.org/request/show/1255161 OBS-URL: https://build.opensuse.org/package/show/network/xdp-tools?expand=0&rev=17 --- .gitattributes | 23 +++++++ .gitignore | 1 + fix-clang20-build.patch | 44 +++++++++++++ xdp-tools-1.4.2.tar.gz | 3 + xdp-tools.changes | 70 ++++++++++++++++++++ xdp-tools.spec | 138 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 279 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 fix-clang20-build.patch create mode 100644 xdp-tools-1.4.2.tar.gz create mode 100644 xdp-tools.changes create mode 100644 xdp-tools.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/fix-clang20-build.patch b/fix-clang20-build.patch new file mode 100644 index 0000000..ea329ea --- /dev/null +++ b/fix-clang20-build.patch @@ -0,0 +1,44 @@ +--- xdp-tools-1.4.2/lib/common.mk ++++ xdp-tools-1.4.2/lib/common.mk +@@ -117,7 +117,7 @@ + -Wno-pointer-sign \ + -Wno-compare-distinct-pointer-types \ + -Werror \ +- -O2 -emit-llvm -c -g -o ${@:.o=.ll} $< ++ -O2 -emit-llvm -g -o ${@:.o=.ll} $< + $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll} + + $(BPF_SKEL_H): %.skel.h: %.bpf.o +--- xdp-tools-1.4.2/lib/libxdp/Makefile ++++ xdp-tools-1.4.2/lib/libxdp/Makefile +@@ -144,7 +144,7 @@ + -Wno-pointer-sign \ + -Wno-compare-distinct-pointer-types \ + -Werror \ +- -O2 -emit-llvm -c -g -o ${@:.o=.ll} $< ++ -O2 -emit-llvm -g -o ${@:.o=.ll} $< + $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll} + + .PHONY: man +--- xdp-tools-1.4.2/lib/libxdp/tests/Makefile ++++ xdp-tools-1.4.2/lib/libxdp/tests/Makefile +@@ -79,7 +79,7 @@ + -Wno-pointer-sign \ + -Wno-compare-distinct-pointer-types \ + -Werror \ +- -O2 -emit-llvm -c -g -o ${@:.o=.ll} $< ++ -O2 -emit-llvm -g -o ${@:.o=.ll} $< + $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll} + + run: all +--- xdp-tools-1.4.2/lib/util/Makefile ++++ xdp-tools-1.4.2/lib/util/Makefile +@@ -27,7 +27,7 @@ + -Wno-pointer-sign \ + -Wno-compare-distinct-pointer-types \ + -Werror \ +- -O2 -emit-llvm -c -g -o ${@:.o=.ll} $< ++ -O2 -emit-llvm -g -o ${@:.o=.ll} $< + $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll} + + $(UTIL_SKEL_H): %.skel.h: %.bpf.o diff --git a/xdp-tools-1.4.2.tar.gz b/xdp-tools-1.4.2.tar.gz new file mode 100644 index 0000000..3228398 --- /dev/null +++ b/xdp-tools-1.4.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49c2b96b2be878449a797a74ca515a63e13418cb8ea904df08f8ef9cb2ac5570 +size 340864 diff --git a/xdp-tools.changes b/xdp-tools.changes new file mode 100644 index 0000000..237e60e --- /dev/null +++ b/xdp-tools.changes @@ -0,0 +1,70 @@ +------------------------------------------------------------------- +Fri Mar 21 22:49:39 UTC 2025 - Aaron Puchert + +- Add fix-clang20-build.patch to fix build with Clang 20. + +------------------------------------------------------------------- +Tue Feb 20 16:38:14 UTC 2024 - Dominique Leuenberger + +- Remove kernel-devel Runtime dependency from libxdp1. + +------------------------------------------------------------------- +Wed Jan 31 07:45:28 UTC 2024 - Shung-Hsi Yu + +- Update to v1.4.2 + * Added support for clang-17 + * xdp-bench: Add l4-sport and l4-dport cpumap modes + * Fix xdp prog memory leak in xsk_setup_xdp_prog + +------------------------------------------------------------------- +Tue Nov 14 03:35:12 UTC 2023 - Shung-Hsi Yu + +- Update to v1.4.1 + * Detect presence of bpf_program__type(), + libbpf_program__flags(), and fix detection for btf__type_cnt() + * Correctly detect bpftool skeleton generation + * Clear xdp_frags flag before loading single prog if kernel + support is missing + * Allow creation of xsk with exclusive umem without CAP_NET_RAW + * Install BPF objects as non-executable + * xdp-loader: introduce features command + * xdp-bench: Enable the xdp_frags flag + * libxdp: don't use direct call to readelf for symbol table + comparison +- Drop patches merged upstream + * drop lib-Install-BPF-objects-as-non-executable.patch + * drop util-xdp_samples-Only-ignore-Wstringop-truncation-di.patch + +------------------------------------------------------------------- +Mon Jun 26 06:20:32 UTC 2023 - Shung-Hsi Yu + +- Do not package test files for xdp-tools + + this also means we longer get the arch-dependent-file-in-usr-share rpmlint + error, so xdp-tools.rpmlintrc can be removed + +------------------------------------------------------------------- +Sat Jun 17 12:45:34 UTC 2023 - Shung-Hsi Yu + +- Specify which group each package belong +- Add patch markup for the 2 patches in the package + +------------------------------------------------------------------- +Thu Jun 8 09:00:03 UTC 2023 - Shung-Hsi Yu + +- Use %set_build_flags macro to set the CFLAGS and LDFLAGS environment + variable +- Add util-xdp_samples-Only-ignore-Wstringop-truncation-di.patch to compile on + GCC 7 and earlier +- Add lib-Install-BPF-objects-as-non-executable.patch to prevent stripping of + BPF object files + +------------------------------------------------------------------- +Wed Jun 7 14:36:16 UTC 2023 - Shung-Hsi Yu + +- Update to v1.3.1 from v1.2.0 +- Add /usr/sbin to PATH during build so bpftool can be found + +------------------------------------------------------------------- +Wed Nov 3 07:03:52 UTC 2021 - Shung-Hsi Yu + +- Initial commit of xdp-tools diff --git a/xdp-tools.spec b/xdp-tools.spec new file mode 100644 index 0000000..4a65a8e --- /dev/null +++ b/xdp-tools.spec @@ -0,0 +1,138 @@ +# +# spec file for package xdp-tools +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define sover_major 1 +%define libname libxdp%{sover_major} + +# check_abi will fail otherwise +# See https://github.com/xdp-project/xdp-tools/issues/137 +%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects + +# workaround binutils/strip issue with BPF object, see #boo#1217108 +%define __arch_install_post export NO_BRP_STRIP_DEBUG=true +Name: xdp-tools +Version: 1.4.2 +Release: 0 +Group: Productivity/Networking/Other +Summary: Utilities and example programs for use with XDP +# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses +License: GPL-2.0-only +URL: https://github.com/xdp-project/xdp-tools +Source: https://github.com/xdp-project/xdp-tools/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +# Fixes "error: argument unused during compilation: '-c' [-Werror,-Wunused-command-line-argument]" with +# Clang 20. The command lines have both -c and -S, but should only have -S as they're producing textual IR. +Patch1: fix-clang20-build.patch +BuildRequires: bpftool +BuildRequires: clang >= 10.0.0 +BuildRequires: gcc +BuildRequires: libbpf-devel +BuildRequires: libelf-devel +BuildRequires: libpcap-devel +BuildRequires: llvm >= 10.0.0 +BuildRequires: m4 +BuildRequires: make +BuildRequires: pkg-config +BuildRequires: zlib-devel +# For README.org file, but pulls in too much dependency +#BuildRequires: emacs-nox +# Always keep xdp-tools and libxdp packages in sync +Requires: %{libname} = %{version}-%{release} + +%description +Utilities and example programs for use with XDP + +%package -n %{libname} +Group: System/Libraries +Summary: XDP helper library + +%description -n %{libname} +The libxdp package contains the libxdp library for managing XDP programs, +used by the %{name} package + +%package -n libxdp-devel +Group: Development/Libraries/C and C++ +Summary: Development files for libxdp +Requires: %{libname} = %{version}-%{release} +Requires: kernel-devel + +%description -n libxdp-devel +The libxdp-devel package contains headers used for building XDP programs using +libxdp. + +%prep +%setup -q +%autopatch -p1 + +%build +# Not Autoconf-based, so need to set environmental variables +# defined in lib/defines.mk +%set_build_flags +export LIBDIR='%{_libdir}' +export CLANG=%{_bindir}/clang +export LLC=%{_bindir}/llc +export PRODUCTION=1 +export DYNAMIC_LIBXDP=1 +export FORCE_SYSTEM_LIBBPF=1 +#export FORCE_EMACS=1 +export PATH="$PATH:/usr/sbin" # So bpftool can be found +./configure +%make_build + +%install +# ./configure does not support arguments, only environmental variables defined +# in lib/define.mk +export SBINDIR='%{_sbindir}' +export LIBDIR='%{_libdir}' +export MANDIR='%{_mandir}' +export DATADIR='%{_datadir}' +export HDRDIR='%{_includedir}/xdp' +%make_install +# Remove the static libraries +rm -f %{buildroot}%{_libdir}/libxdp.a +# Remove test file to avoid rpmlint's arch-dependent-file-in-usr-share error +rm -rf %{buildroot}%{_datadir}/xdp-tools/ + +%post -n %{libname} -p /sbin/ldconfig +%postun -n %{libname} -p /sbin/ldconfig + +%files +%{_sbindir}/xdp-filter +%{_sbindir}/xdp-loader +%{_sbindir}/xdpdump +%{_sbindir}/xdp-bench +%{_sbindir}/xdp-monitor +%{_sbindir}/xdp-trafficgen +%{_libdir}/bpf/xdpfilt_*.o +%{_libdir}/bpf/xdpdump_*.o +%{_mandir}/man8/* + +%files -n %{libname} +%dir %{_libdir}/bpf +%{_libdir}/libxdp.so.%{sover_major}* +%{_libdir}/bpf/xdp-dispatcher.o +%{_libdir}/bpf/xsk_def_xdp_prog*.o +%{_mandir}/man3/* + +%files -n libxdp-devel +%license LICENSES/* +%dir %{_includedir}/xdp +%{_includedir}/xdp/*.h +%{_libdir}/libxdp.so +%{_libdir}/pkgconfig/libxdp.pc + +%changelog -- 2.51.1 From f43fa684b1363ba4b50b62e901a8bc086b380ff3fa15287869ac4ad84fdcdff2 Mon Sep 17 00:00:00 2001 From: Shung-Hsi Yu Date: Tue, 10 Jun 2025 07:24:00 +0000 Subject: [PATCH 2/4] Update to v1.5.5 OBS-URL: https://build.opensuse.org/package/show/network/xdp-tools?expand=0&rev=19 --- .gitattributes | 23 +++++++ .gitignore | 1 + fix-clang20-build.patch | 44 +++++++++++++ xdp-tools-1.4.2.tar.gz | 3 + xdp-tools-1.5.5.tar.gz | 3 + xdp-tools.changes | 100 +++++++++++++++++++++++++++++ xdp-tools.spec | 138 ++++++++++++++++++++++++++++++++++++++++ 7 files changed, 312 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 fix-clang20-build.patch create mode 100644 xdp-tools-1.4.2.tar.gz create mode 100644 xdp-tools-1.5.5.tar.gz create mode 100644 xdp-tools.changes create mode 100644 xdp-tools.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/fix-clang20-build.patch b/fix-clang20-build.patch new file mode 100644 index 0000000..ea329ea --- /dev/null +++ b/fix-clang20-build.patch @@ -0,0 +1,44 @@ +--- xdp-tools-1.4.2/lib/common.mk ++++ xdp-tools-1.4.2/lib/common.mk +@@ -117,7 +117,7 @@ + -Wno-pointer-sign \ + -Wno-compare-distinct-pointer-types \ + -Werror \ +- -O2 -emit-llvm -c -g -o ${@:.o=.ll} $< ++ -O2 -emit-llvm -g -o ${@:.o=.ll} $< + $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll} + + $(BPF_SKEL_H): %.skel.h: %.bpf.o +--- xdp-tools-1.4.2/lib/libxdp/Makefile ++++ xdp-tools-1.4.2/lib/libxdp/Makefile +@@ -144,7 +144,7 @@ + -Wno-pointer-sign \ + -Wno-compare-distinct-pointer-types \ + -Werror \ +- -O2 -emit-llvm -c -g -o ${@:.o=.ll} $< ++ -O2 -emit-llvm -g -o ${@:.o=.ll} $< + $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll} + + .PHONY: man +--- xdp-tools-1.4.2/lib/libxdp/tests/Makefile ++++ xdp-tools-1.4.2/lib/libxdp/tests/Makefile +@@ -79,7 +79,7 @@ + -Wno-pointer-sign \ + -Wno-compare-distinct-pointer-types \ + -Werror \ +- -O2 -emit-llvm -c -g -o ${@:.o=.ll} $< ++ -O2 -emit-llvm -g -o ${@:.o=.ll} $< + $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll} + + run: all +--- xdp-tools-1.4.2/lib/util/Makefile ++++ xdp-tools-1.4.2/lib/util/Makefile +@@ -27,7 +27,7 @@ + -Wno-pointer-sign \ + -Wno-compare-distinct-pointer-types \ + -Werror \ +- -O2 -emit-llvm -c -g -o ${@:.o=.ll} $< ++ -O2 -emit-llvm -g -o ${@:.o=.ll} $< + $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll} + + $(UTIL_SKEL_H): %.skel.h: %.bpf.o diff --git a/xdp-tools-1.4.2.tar.gz b/xdp-tools-1.4.2.tar.gz new file mode 100644 index 0000000..3228398 --- /dev/null +++ b/xdp-tools-1.4.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49c2b96b2be878449a797a74ca515a63e13418cb8ea904df08f8ef9cb2ac5570 +size 340864 diff --git a/xdp-tools-1.5.5.tar.gz b/xdp-tools-1.5.5.tar.gz new file mode 100644 index 0000000..5a35327 --- /dev/null +++ b/xdp-tools-1.5.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dafa26f4b121cdb1371959ab46bc087b963867e149ee82611f015c5c6354f641 +size 355203 diff --git a/xdp-tools.changes b/xdp-tools.changes new file mode 100644 index 0000000..93a464d --- /dev/null +++ b/xdp-tools.changes @@ -0,0 +1,100 @@ +------------------------------------------------------------------- +Tue Jun 10 06:26:07 UTC 2025 - Shung-Hsi Yu + +- Update to v1.5.5 + - added xdp-forward for forwarding traffic between interfaces + - libxdp: options-based API for more flexible af_xdp umem and + socket creation + - libxdp: added support for af_xdp tx metadata + - xdp-bench: improved reliability by removing packet header + location assumptions + - xdp-bench: new program for redirect benchmarking + - xdp-trafficgen: support for specifying udp packet size + - xdp-trafficgen: probe command can now target a specific + interface + - xdp-trafficgen: auto-load dummy xdp program to ensure packet + sending + - xdp-dump: increased max supported cpus to 512 + - xdp-loader: allow loading xdp programs that modify the packet + pointer + - utils: improved pps statistics accuracy in xdp_sample + - utils: correctly print statistics summary on signal interruption + in xdp_sample + - xdp-trafficgen: fix failure to exit after packet transmission + loop + - libxdp: fix incorrect xdp_umem_reg setsockopt size + - libxdp: ensure correct error propagation by returning -errno + - utils: fix incorrect packet count calculation in xdp_sample +- Drop fix-clang20-build.patch since upstream remedy is included + since v1.5.4 + +------------------------------------------------------------------- +Fri Mar 21 22:49:39 UTC 2025 - Aaron Puchert + +- Add fix-clang20-build.patch to fix build with Clang 20. + +------------------------------------------------------------------- +Tue Feb 20 16:38:14 UTC 2024 - Dominique Leuenberger + +- Remove kernel-devel Runtime dependency from libxdp1. + +------------------------------------------------------------------- +Wed Jan 31 07:45:28 UTC 2024 - Shung-Hsi Yu + +- Update to v1.4.2 + * Added support for clang-17 + * xdp-bench: Add l4-sport and l4-dport cpumap modes + * Fix xdp prog memory leak in xsk_setup_xdp_prog + +------------------------------------------------------------------- +Tue Nov 14 03:35:12 UTC 2023 - Shung-Hsi Yu + +- Update to v1.4.1 + * Detect presence of bpf_program__type(), + libbpf_program__flags(), and fix detection for btf__type_cnt() + * Correctly detect bpftool skeleton generation + * Clear xdp_frags flag before loading single prog if kernel + support is missing + * Allow creation of xsk with exclusive umem without CAP_NET_RAW + * Install BPF objects as non-executable + * xdp-loader: introduce features command + * xdp-bench: Enable the xdp_frags flag + * libxdp: don't use direct call to readelf for symbol table + comparison +- Drop patches merged upstream + * drop lib-Install-BPF-objects-as-non-executable.patch + * drop util-xdp_samples-Only-ignore-Wstringop-truncation-di.patch + +------------------------------------------------------------------- +Mon Jun 26 06:20:32 UTC 2023 - Shung-Hsi Yu + +- Do not package test files for xdp-tools + + this also means we longer get the arch-dependent-file-in-usr-share rpmlint + error, so xdp-tools.rpmlintrc can be removed + +------------------------------------------------------------------- +Sat Jun 17 12:45:34 UTC 2023 - Shung-Hsi Yu + +- Specify which group each package belong +- Add patch markup for the 2 patches in the package + +------------------------------------------------------------------- +Thu Jun 8 09:00:03 UTC 2023 - Shung-Hsi Yu + +- Use %set_build_flags macro to set the CFLAGS and LDFLAGS environment + variable +- Add util-xdp_samples-Only-ignore-Wstringop-truncation-di.patch to compile on + GCC 7 and earlier +- Add lib-Install-BPF-objects-as-non-executable.patch to prevent stripping of + BPF object files + +------------------------------------------------------------------- +Wed Jun 7 14:36:16 UTC 2023 - Shung-Hsi Yu + +- Update to v1.3.1 from v1.2.0 +- Add /usr/sbin to PATH during build so bpftool can be found + +------------------------------------------------------------------- +Wed Nov 3 07:03:52 UTC 2021 - Shung-Hsi Yu + +- Initial commit of xdp-tools diff --git a/xdp-tools.spec b/xdp-tools.spec new file mode 100644 index 0000000..b3a84bb --- /dev/null +++ b/xdp-tools.spec @@ -0,0 +1,138 @@ +# +# spec file for package xdp-tools +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define sover_major 1 +%define libname libxdp%{sover_major} + +# check_abi will fail otherwise +# See https://github.com/xdp-project/xdp-tools/issues/137 +%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects + +# workaround binutils/strip issue with BPF object, see #boo#1217108 +%define __arch_install_post export NO_BRP_STRIP_DEBUG=true +Name: xdp-tools +Version: 1.5.5 +Release: 0 +Group: Productivity/Networking/Other +Summary: Utilities and example programs for use with XDP +# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses +License: GPL-2.0-only +URL: https://github.com/xdp-project/xdp-tools +Source: https://github.com/xdp-project/xdp-tools/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +# Fixes "error: argument unused during compilation: '-c' [-Werror,-Wunused-command-line-argument]" with +# Clang 20. The command lines have both -c and -S, but should only have -S as they're producing textual IR. +BuildRequires: bpftool +BuildRequires: clang >= 10.0.0 +BuildRequires: gcc +BuildRequires: libbpf-devel +BuildRequires: libelf-devel +BuildRequires: libpcap-devel +BuildRequires: llvm >= 10.0.0 +BuildRequires: m4 +BuildRequires: make +BuildRequires: pkg-config +BuildRequires: zlib-devel +# For README.org file, but pulls in too much dependency +#BuildRequires: emacs-nox +# Always keep xdp-tools and libxdp packages in sync +Requires: %{libname} = %{version}-%{release} + +%description +Utilities and example programs for use with XDP + +%package -n %{libname} +Group: System/Libraries +Summary: XDP helper library + +%description -n %{libname} +The libxdp package contains the libxdp library for managing XDP programs, +used by the %{name} package + +%package -n libxdp-devel +Group: Development/Libraries/C and C++ +Summary: Development files for libxdp +Requires: %{libname} = %{version}-%{release} +Requires: kernel-devel + +%description -n libxdp-devel +The libxdp-devel package contains headers used for building XDP programs using +libxdp. + +%prep +%setup -q +%autopatch -p1 + +%build +# Not Autoconf-based, so need to set environmental variables +# defined in lib/defines.mk +%set_build_flags +export LIBDIR='%{_libdir}' +export CLANG=%{_bindir}/clang +export LLC=%{_bindir}/llc +export PRODUCTION=1 +export DYNAMIC_LIBXDP=1 +export FORCE_SYSTEM_LIBBPF=1 +#export FORCE_EMACS=1 +export PATH="$PATH:/usr/sbin" # So bpftool can be found +./configure +%make_build + +%install +# ./configure does not support arguments, only environmental variables defined +# in lib/define.mk +export SBINDIR='%{_sbindir}' +export LIBDIR='%{_libdir}' +export MANDIR='%{_mandir}' +export DATADIR='%{_datadir}' +export HDRDIR='%{_includedir}/xdp' +%make_install +# Remove the static libraries +rm -f %{buildroot}%{_libdir}/libxdp.a +# Remove test file to avoid rpmlint's arch-dependent-file-in-usr-share error +rm -rf %{buildroot}%{_datadir}/xdp-tools/ + +%post -n %{libname} -p /sbin/ldconfig +%postun -n %{libname} -p /sbin/ldconfig + +%files +%{_sbindir}/xdp-filter +%{_sbindir}/xdp-loader +%{_sbindir}/xdpdump +%{_sbindir}/xdp-bench +%{_sbindir}/xdp-monitor +%{_sbindir}/xdp-trafficgen +%{_sbindir}/xdp-forward +%{_libdir}/bpf/xdpfilt_*.o +%{_libdir}/bpf/xdpdump_*.o +%{_mandir}/man8/* + +%files -n %{libname} +%dir %{_libdir}/bpf +%{_libdir}/libxdp.so.%{sover_major}* +%{_libdir}/bpf/xdp-dispatcher.o +%{_libdir}/bpf/xsk_def_xdp_prog*.o +%{_mandir}/man3/* + +%files -n libxdp-devel +%license LICENSES/* +%dir %{_includedir}/xdp +%{_includedir}/xdp/*.h +%{_libdir}/libxdp.so +%{_libdir}/pkgconfig/libxdp.pc + +%changelog -- 2.51.1 From f02b29121d4853a155149a0420aca2bfb105e3f618bf244e789d3825ae6d181c Mon Sep 17 00:00:00 2001 From: Shung-Hsi Yu Date: Tue, 14 Oct 2025 08:59:07 +0000 Subject: [PATCH 3/4] Update to v1.5.7 OBS-URL: https://build.opensuse.org/package/show/network/xdp-tools?expand=0&rev=21 --- .gitattributes | 23 +++++++ .gitignore | 1 + xdp-tools-1.5.5.tar.gz | 3 + xdp-tools-1.5.7.tar.gz | 3 + xdp-tools.changes | 114 ++++++++++++++++++++++++++++++++++ xdp-tools.spec | 138 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 282 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 xdp-tools-1.5.5.tar.gz create mode 100644 xdp-tools-1.5.7.tar.gz create mode 100644 xdp-tools.changes create mode 100644 xdp-tools.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/xdp-tools-1.5.5.tar.gz b/xdp-tools-1.5.5.tar.gz new file mode 100644 index 0000000..5a35327 --- /dev/null +++ b/xdp-tools-1.5.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dafa26f4b121cdb1371959ab46bc087b963867e149ee82611f015c5c6354f641 +size 355203 diff --git a/xdp-tools-1.5.7.tar.gz b/xdp-tools-1.5.7.tar.gz new file mode 100644 index 0000000..1d0c7bd --- /dev/null +++ b/xdp-tools-1.5.7.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eaad8fef8a3cb2d73b3c4325211376e547998b6d2c34e990c4fe59add00d8182 +size 358429 diff --git a/xdp-tools.changes b/xdp-tools.changes new file mode 100644 index 0000000..722521f --- /dev/null +++ b/xdp-tools.changes @@ -0,0 +1,114 @@ +------------------------------------------------------------------- +Tue Oct 14 08:25:39 UTC 2025 - Shung-Hsi Yu + +- Update to v1.5.7 + - xdp-filter: added support for parsing ARP and IPv6 neighbour + solicitations + - xdp-trafficgen: improved interface probing, fixed automatic + program loading, and corrected an option description + - xdp-bench: fixed the --extended switch and now correctly skips + tests when progmap support is unavailable + - libxdp: fixed build on systems with older libbpf versions and + updated documentation + - xdp_sample: removed xdp_redirect_map tracepoints + +------------------------------------------------------------------- +Tue Jun 10 06:26:07 UTC 2025 - Shung-Hsi Yu + +- Update to v1.5.5 + - added xdp-forward for forwarding traffic between interfaces + - libxdp: options-based API for more flexible af_xdp umem and + socket creation + - libxdp: added support for af_xdp tx metadata + - xdp-bench: improved reliability by removing packet header + location assumptions + - xdp-bench: new program for redirect benchmarking + - xdp-trafficgen: support for specifying udp packet size + - xdp-trafficgen: probe command can now target a specific + interface + - xdp-trafficgen: auto-load dummy xdp program to ensure packet + sending + - xdp-dump: increased max supported cpus to 512 + - xdp-loader: allow loading xdp programs that modify the packet + pointer + - utils: improved pps statistics accuracy in xdp_sample + - utils: correctly print statistics summary on signal interruption + in xdp_sample + - xdp-trafficgen: fix failure to exit after packet transmission + loop + - libxdp: fix incorrect xdp_umem_reg setsockopt size + - libxdp: ensure correct error propagation by returning -errno + - utils: fix incorrect packet count calculation in xdp_sample +- Drop fix-clang20-build.patch since upstream remedy is included + since v1.5.4 + +------------------------------------------------------------------- +Fri Mar 21 22:49:39 UTC 2025 - Aaron Puchert + +- Add fix-clang20-build.patch to fix build with Clang 20. + +------------------------------------------------------------------- +Tue Feb 20 16:38:14 UTC 2024 - Dominique Leuenberger + +- Remove kernel-devel Runtime dependency from libxdp1. + +------------------------------------------------------------------- +Wed Jan 31 07:45:28 UTC 2024 - Shung-Hsi Yu + +- Update to v1.4.2 + * Added support for clang-17 + * xdp-bench: Add l4-sport and l4-dport cpumap modes + * Fix xdp prog memory leak in xsk_setup_xdp_prog + +------------------------------------------------------------------- +Tue Nov 14 03:35:12 UTC 2023 - Shung-Hsi Yu + +- Update to v1.4.1 + * Detect presence of bpf_program__type(), + libbpf_program__flags(), and fix detection for btf__type_cnt() + * Correctly detect bpftool skeleton generation + * Clear xdp_frags flag before loading single prog if kernel + support is missing + * Allow creation of xsk with exclusive umem without CAP_NET_RAW + * Install BPF objects as non-executable + * xdp-loader: introduce features command + * xdp-bench: Enable the xdp_frags flag + * libxdp: don't use direct call to readelf for symbol table + comparison +- Drop patches merged upstream + * drop lib-Install-BPF-objects-as-non-executable.patch + * drop util-xdp_samples-Only-ignore-Wstringop-truncation-di.patch + +------------------------------------------------------------------- +Mon Jun 26 06:20:32 UTC 2023 - Shung-Hsi Yu + +- Do not package test files for xdp-tools + + this also means we longer get the arch-dependent-file-in-usr-share rpmlint + error, so xdp-tools.rpmlintrc can be removed + +------------------------------------------------------------------- +Sat Jun 17 12:45:34 UTC 2023 - Shung-Hsi Yu + +- Specify which group each package belong +- Add patch markup for the 2 patches in the package + +------------------------------------------------------------------- +Thu Jun 8 09:00:03 UTC 2023 - Shung-Hsi Yu + +- Use %set_build_flags macro to set the CFLAGS and LDFLAGS environment + variable +- Add util-xdp_samples-Only-ignore-Wstringop-truncation-di.patch to compile on + GCC 7 and earlier +- Add lib-Install-BPF-objects-as-non-executable.patch to prevent stripping of + BPF object files + +------------------------------------------------------------------- +Wed Jun 7 14:36:16 UTC 2023 - Shung-Hsi Yu + +- Update to v1.3.1 from v1.2.0 +- Add /usr/sbin to PATH during build so bpftool can be found + +------------------------------------------------------------------- +Wed Nov 3 07:03:52 UTC 2021 - Shung-Hsi Yu + +- Initial commit of xdp-tools diff --git a/xdp-tools.spec b/xdp-tools.spec new file mode 100644 index 0000000..7127f1f --- /dev/null +++ b/xdp-tools.spec @@ -0,0 +1,138 @@ +# +# spec file for package xdp-tools +# +# Copyright (c) 2025 SUSE LLC and contributors +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define sover_major 1 +%define libname libxdp%{sover_major} + +# check_abi will fail otherwise +# See https://github.com/xdp-project/xdp-tools/issues/137 +%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects + +# workaround binutils/strip issue with BPF object, see #boo#1217108 +%define __arch_install_post export NO_BRP_STRIP_DEBUG=true +Name: xdp-tools +Version: 1.5.7 +Release: 0 +Group: Productivity/Networking/Other +Summary: Utilities and example programs for use with XDP +# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses +License: GPL-2.0-only +URL: https://github.com/xdp-project/xdp-tools +Source: https://github.com/xdp-project/xdp-tools/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +# Fixes "error: argument unused during compilation: '-c' [-Werror,-Wunused-command-line-argument]" with +# Clang 20. The command lines have both -c and -S, but should only have -S as they're producing textual IR. +BuildRequires: bpftool +BuildRequires: clang >= 10.0.0 +BuildRequires: gcc +BuildRequires: libbpf-devel +BuildRequires: libelf-devel +BuildRequires: libpcap-devel +BuildRequires: llvm >= 10.0.0 +BuildRequires: m4 +BuildRequires: make +BuildRequires: pkg-config +BuildRequires: zlib-devel +# For README.org file, but pulls in too much dependency +#BuildRequires: emacs-nox +# Always keep xdp-tools and libxdp packages in sync +Requires: %{libname} = %{version}-%{release} + +%description +Utilities and example programs for use with XDP + +%package -n %{libname} +Group: System/Libraries +Summary: XDP helper library + +%description -n %{libname} +The libxdp package contains the libxdp library for managing XDP programs, +used by the %{name} package + +%package -n libxdp-devel +Group: Development/Libraries/C and C++ +Summary: Development files for libxdp +Requires: %{libname} = %{version}-%{release} +Requires: kernel-devel + +%description -n libxdp-devel +The libxdp-devel package contains headers used for building XDP programs using +libxdp. + +%prep +%setup -q +%autopatch -p1 + +%build +# Not Autoconf-based, so need to set environmental variables +# defined in lib/defines.mk +%set_build_flags +export LIBDIR='%{_libdir}' +export CLANG=%{_bindir}/clang +export LLC=%{_bindir}/llc +export PRODUCTION=1 +export DYNAMIC_LIBXDP=1 +export FORCE_SYSTEM_LIBBPF=1 +#export FORCE_EMACS=1 +export PATH="$PATH:/usr/sbin" # So bpftool can be found +./configure +%make_build + +%install +# ./configure does not support arguments, only environmental variables defined +# in lib/define.mk +export SBINDIR='%{_sbindir}' +export LIBDIR='%{_libdir}' +export MANDIR='%{_mandir}' +export DATADIR='%{_datadir}' +export HDRDIR='%{_includedir}/xdp' +%make_install +# Remove the static libraries +rm -f %{buildroot}%{_libdir}/libxdp.a +# Remove test file to avoid rpmlint's arch-dependent-file-in-usr-share error +rm -rf %{buildroot}%{_datadir}/xdp-tools/ + +%post -n %{libname} -p /sbin/ldconfig +%postun -n %{libname} -p /sbin/ldconfig + +%files +%{_sbindir}/xdp-filter +%{_sbindir}/xdp-loader +%{_sbindir}/xdpdump +%{_sbindir}/xdp-bench +%{_sbindir}/xdp-monitor +%{_sbindir}/xdp-trafficgen +%{_sbindir}/xdp-forward +%{_libdir}/bpf/xdpfilt_*.o +%{_libdir}/bpf/xdpdump_*.o +%{_mandir}/man8/* + +%files -n %{libname} +%dir %{_libdir}/bpf +%{_libdir}/libxdp.so.%{sover_major}* +%{_libdir}/bpf/xdp-dispatcher.o +%{_libdir}/bpf/xsk_def_xdp_prog*.o +%{_mandir}/man3/* + +%files -n libxdp-devel +%license LICENSES/* +%dir %{_includedir}/xdp +%{_includedir}/xdp/*.h +%{_libdir}/libxdp.so +%{_libdir}/pkgconfig/libxdp.pc + +%changelog -- 2.51.1 From 50aceceee7a1ae0c7cada1dfff73d08eaf32736b0171bac1e8cdac6b0a6b5a7d Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 30 Dec 2025 21:13:07 +0000 Subject: [PATCH 4/4] - Update to v1.5.8 - xdp-trafficgen: add support for configuring the IPv6 hop limit in UDP mode - xdp-loader: ensure feature flag output more robust against newer kernels OBS-URL: https://build.opensuse.org/package/show/network/xdp-tools?expand=0&rev=23 --- .gitattributes | 23 +++++++ .gitignore | 1 + xdp-tools-1.5.5.tar.gz | 3 + xdp-tools-1.5.7.tar.gz | 3 + xdp-tools-1.5.8.tar.gz | 3 + xdp-tools.changes | 123 ++++++++++++++++++++++++++++++++++++ xdp-tools.spec | 138 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 294 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 xdp-tools-1.5.5.tar.gz create mode 100644 xdp-tools-1.5.7.tar.gz create mode 100644 xdp-tools-1.5.8.tar.gz create mode 100644 xdp-tools.changes create mode 100644 xdp-tools.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/xdp-tools-1.5.5.tar.gz b/xdp-tools-1.5.5.tar.gz new file mode 100644 index 0000000..5a35327 --- /dev/null +++ b/xdp-tools-1.5.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dafa26f4b121cdb1371959ab46bc087b963867e149ee82611f015c5c6354f641 +size 355203 diff --git a/xdp-tools-1.5.7.tar.gz b/xdp-tools-1.5.7.tar.gz new file mode 100644 index 0000000..1d0c7bd --- /dev/null +++ b/xdp-tools-1.5.7.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eaad8fef8a3cb2d73b3c4325211376e547998b6d2c34e990c4fe59add00d8182 +size 358429 diff --git a/xdp-tools-1.5.8.tar.gz b/xdp-tools-1.5.8.tar.gz new file mode 100644 index 0000000..d801de9 --- /dev/null +++ b/xdp-tools-1.5.8.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f6eb9f2275c2431f59a80a99549b27c66832a751dd03c5993c6bc3f5c724b25 +size 1409554 diff --git a/xdp-tools.changes b/xdp-tools.changes new file mode 100644 index 0000000..77f3e29 --- /dev/null +++ b/xdp-tools.changes @@ -0,0 +1,123 @@ +------------------------------------------------------------------- +Tue Dec 23 15:19:23 UTC 2025 - Hoyeon Lee + +- Update to v1.5.8 + - xdp-trafficgen: add support for configuring the IPv6 hop limit + in UDP mode + - xdp-loader: ensure feature flag output more robust against newer + kernels + +------------------------------------------------------------------- +Tue Oct 14 08:25:39 UTC 2025 - Shung-Hsi Yu + +- Update to v1.5.7 + - xdp-filter: added support for parsing ARP and IPv6 neighbour + solicitations + - xdp-trafficgen: improved interface probing, fixed automatic + program loading, and corrected an option description + - xdp-bench: fixed the --extended switch and now correctly skips + tests when progmap support is unavailable + - libxdp: fixed build on systems with older libbpf versions and + updated documentation + - xdp_sample: removed xdp_redirect_map tracepoints + +------------------------------------------------------------------- +Tue Jun 10 06:26:07 UTC 2025 - Shung-Hsi Yu + +- Update to v1.5.5 + - added xdp-forward for forwarding traffic between interfaces + - libxdp: options-based API for more flexible af_xdp umem and + socket creation + - libxdp: added support for af_xdp tx metadata + - xdp-bench: improved reliability by removing packet header + location assumptions + - xdp-bench: new program for redirect benchmarking + - xdp-trafficgen: support for specifying udp packet size + - xdp-trafficgen: probe command can now target a specific + interface + - xdp-trafficgen: auto-load dummy xdp program to ensure packet + sending + - xdp-dump: increased max supported cpus to 512 + - xdp-loader: allow loading xdp programs that modify the packet + pointer + - utils: improved pps statistics accuracy in xdp_sample + - utils: correctly print statistics summary on signal interruption + in xdp_sample + - xdp-trafficgen: fix failure to exit after packet transmission + loop + - libxdp: fix incorrect xdp_umem_reg setsockopt size + - libxdp: ensure correct error propagation by returning -errno + - utils: fix incorrect packet count calculation in xdp_sample +- Drop fix-clang20-build.patch since upstream remedy is included + since v1.5.4 + +------------------------------------------------------------------- +Fri Mar 21 22:49:39 UTC 2025 - Aaron Puchert + +- Add fix-clang20-build.patch to fix build with Clang 20. + +------------------------------------------------------------------- +Tue Feb 20 16:38:14 UTC 2024 - Dominique Leuenberger + +- Remove kernel-devel Runtime dependency from libxdp1. + +------------------------------------------------------------------- +Wed Jan 31 07:45:28 UTC 2024 - Shung-Hsi Yu + +- Update to v1.4.2 + * Added support for clang-17 + * xdp-bench: Add l4-sport and l4-dport cpumap modes + * Fix xdp prog memory leak in xsk_setup_xdp_prog + +------------------------------------------------------------------- +Tue Nov 14 03:35:12 UTC 2023 - Shung-Hsi Yu + +- Update to v1.4.1 + * Detect presence of bpf_program__type(), + libbpf_program__flags(), and fix detection for btf__type_cnt() + * Correctly detect bpftool skeleton generation + * Clear xdp_frags flag before loading single prog if kernel + support is missing + * Allow creation of xsk with exclusive umem without CAP_NET_RAW + * Install BPF objects as non-executable + * xdp-loader: introduce features command + * xdp-bench: Enable the xdp_frags flag + * libxdp: don't use direct call to readelf for symbol table + comparison +- Drop patches merged upstream + * drop lib-Install-BPF-objects-as-non-executable.patch + * drop util-xdp_samples-Only-ignore-Wstringop-truncation-di.patch + +------------------------------------------------------------------- +Mon Jun 26 06:20:32 UTC 2023 - Shung-Hsi Yu + +- Do not package test files for xdp-tools + + this also means we longer get the arch-dependent-file-in-usr-share rpmlint + error, so xdp-tools.rpmlintrc can be removed + +------------------------------------------------------------------- +Sat Jun 17 12:45:34 UTC 2023 - Shung-Hsi Yu + +- Specify which group each package belong +- Add patch markup for the 2 patches in the package + +------------------------------------------------------------------- +Thu Jun 8 09:00:03 UTC 2023 - Shung-Hsi Yu + +- Use %set_build_flags macro to set the CFLAGS and LDFLAGS environment + variable +- Add util-xdp_samples-Only-ignore-Wstringop-truncation-di.patch to compile on + GCC 7 and earlier +- Add lib-Install-BPF-objects-as-non-executable.patch to prevent stripping of + BPF object files + +------------------------------------------------------------------- +Wed Jun 7 14:36:16 UTC 2023 - Shung-Hsi Yu + +- Update to v1.3.1 from v1.2.0 +- Add /usr/sbin to PATH during build so bpftool can be found + +------------------------------------------------------------------- +Wed Nov 3 07:03:52 UTC 2021 - Shung-Hsi Yu + +- Initial commit of xdp-tools diff --git a/xdp-tools.spec b/xdp-tools.spec new file mode 100644 index 0000000..e06ab4a --- /dev/null +++ b/xdp-tools.spec @@ -0,0 +1,138 @@ +# +# spec file for package xdp-tools +# +# Copyright (c) 2025 SUSE LLC and contributors +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define sover_major 1 +%define libname libxdp%{sover_major} + +# check_abi will fail otherwise +# See https://github.com/xdp-project/xdp-tools/issues/137 +%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects + +# workaround binutils/strip issue with BPF object, see #boo#1217108 +%define __arch_install_post export NO_BRP_STRIP_DEBUG=true +Name: xdp-tools +Version: 1.5.8 +Release: 0 +Group: Productivity/Networking/Other +Summary: Utilities and example programs for use with XDP +# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses +License: GPL-2.0-only +URL: https://github.com/xdp-project/xdp-tools +Source: https://github.com/xdp-project/xdp-tools/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +# Fixes "error: argument unused during compilation: '-c' [-Werror,-Wunused-command-line-argument]" with +# Clang 20. The command lines have both -c and -S, but should only have -S as they're producing textual IR. +BuildRequires: bpftool +BuildRequires: clang >= 10.0.0 +BuildRequires: gcc +BuildRequires: libbpf-devel +BuildRequires: libelf-devel +BuildRequires: libpcap-devel +BuildRequires: llvm >= 10.0.0 +BuildRequires: m4 +BuildRequires: make +BuildRequires: pkg-config +BuildRequires: zlib-devel +# For README.org file, but pulls in too much dependency +#BuildRequires: emacs-nox +# Always keep xdp-tools and libxdp packages in sync +Requires: %{libname} = %{version}-%{release} + +%description +Utilities and example programs for use with XDP + +%package -n %{libname} +Group: System/Libraries +Summary: XDP helper library + +%description -n %{libname} +The libxdp package contains the libxdp library for managing XDP programs, +used by the %{name} package + +%package -n libxdp-devel +Group: Development/Libraries/C and C++ +Summary: Development files for libxdp +Requires: %{libname} = %{version}-%{release} +Requires: kernel-devel + +%description -n libxdp-devel +The libxdp-devel package contains headers used for building XDP programs using +libxdp. + +%prep +%setup -q +%autopatch -p1 + +%build +# Not Autoconf-based, so need to set environmental variables +# defined in lib/defines.mk +%set_build_flags +export LIBDIR='%{_libdir}' +export CLANG=%{_bindir}/clang +export LLC=%{_bindir}/llc +export PRODUCTION=1 +export DYNAMIC_LIBXDP=1 +export FORCE_SYSTEM_LIBBPF=1 +#export FORCE_EMACS=1 +export PATH="$PATH:/usr/sbin" # So bpftool can be found +./configure +%make_build + +%install +# ./configure does not support arguments, only environmental variables defined +# in lib/define.mk +export SBINDIR='%{_sbindir}' +export LIBDIR='%{_libdir}' +export MANDIR='%{_mandir}' +export DATADIR='%{_datadir}' +export HDRDIR='%{_includedir}/xdp' +%make_install +# Remove the static libraries +rm -f %{buildroot}%{_libdir}/libxdp.a +# Remove test file to avoid rpmlint's arch-dependent-file-in-usr-share error +rm -rf %{buildroot}%{_datadir}/xdp-tools/ + +%post -n %{libname} -p /sbin/ldconfig +%postun -n %{libname} -p /sbin/ldconfig + +%files +%{_sbindir}/xdp-filter +%{_sbindir}/xdp-loader +%{_sbindir}/xdpdump +%{_sbindir}/xdp-bench +%{_sbindir}/xdp-monitor +%{_sbindir}/xdp-trafficgen +%{_sbindir}/xdp-forward +%{_libdir}/bpf/xdpfilt_*.o +%{_libdir}/bpf/xdpdump_*.o +%{_mandir}/man8/* + +%files -n %{libname} +%dir %{_libdir}/bpf +%{_libdir}/libxdp.so.%{sover_major}* +%{_libdir}/bpf/xdp-dispatcher.o +%{_libdir}/bpf/xsk_def_xdp_prog*.o +%{_mandir}/man3/* + +%files -n libxdp-devel +%license LICENSES/* +%dir %{_includedir}/xdp +%{_includedir}/xdp/*.h +%{_libdir}/libxdp.so +%{_libdir}/pkgconfig/libxdp.pc + +%changelog -- 2.51.1