diff --git a/0001-build-try-to-get-kernel-version-from-kernel-source.patch b/0001-build-try-to-get-kernel-version-from-kernel-source.patch new file mode 100644 index 0000000..8442abb --- /dev/null +++ b/0001-build-try-to-get-kernel-version-from-kernel-source.patch @@ -0,0 +1,42 @@ +From 4034cebe2d0c36d8762fb4c06ba216b17f308e22 Mon Sep 17 00:00:00 2001 +From: Ferdinand Thiessen +Date: Sat, 26 Feb 2022 22:14:14 +0100 +Subject: [PATCH] build: try to get kernel version from kernel source + +When building the kernel modules, try to get the kernel +version from the kernel sources first. This fixes the +kernel modules installation directory if the target kernel +version differs from the host kernel version, like for +CI build or when packaging for linux distributions. + +Signed-off-by: Ferdinand Thiessen +--- + kernel/linux/meson.build | 18 ++++++++++++------ + 1 file changed, 12 insertions(+), 6 deletions(-) + +diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build +index d8fb20c1c3..78f28ffb0c 100644 +--- a/kernel/linux/meson.build ++++ b/kernel/linux/meson.build +@@ -11,7 +11,17 @@ + + if not meson.is_cross_build() + # native build +- kernel_version = run_command('uname', '-r').stdout().strip() ++ kernel_version = '' ++ if kernel_source_dir != '' ++ # Try kernel makefile first ++ r = run_command('make', '-s', '-C', kernel_source_dir, 'kernelrelease', check: false) ++ if r.returncode() == 0 ++ kernel_version = r.stdout().strip() ++ endif ++ endif ++ if kernel_version == '' ++ kernel_version = run_command('uname', '-r').stdout().strip() ++ endif + kernel_install_dir = '/lib/modules/' + kernel_version + '/extra/dpdk' + if kernel_build_dir == '' + # use default path for native builds +-- +2.35.1 + diff --git a/0001-fix-cpu-compatibility.patch b/0001-fix-cpu-compatibility.patch deleted file mode 100644 index 6d6a1fd..0000000 --- a/0001-fix-cpu-compatibility.patch +++ /dev/null @@ -1,73 +0,0 @@ -From e2950fec9cd9c235a7847ed97b6914174857bf93 Mon Sep 17 00:00:00 2001 -From: "mvarlese@suse.de" -Date: Wed, 29 Apr 2020 12:24:16 +0200 -Subject: [PATCH] fix cpu compatibility - ---- - drivers/bus/vdev/vdev.c | 4 ++++ - lib/librte_eal/common/eal_common_bus.c | 5 ++++- - lib/librte_eal/common/include/rte_common.h | 14 +++++++++++++- - 3 files changed, 21 insertions(+), 2 deletions(-) - -diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c -index a89ea2353..cf8e8dca6 100644 ---- a/drivers/bus/vdev/vdev.c -+++ b/drivers/bus/vdev/vdev.c -@@ -55,7 +55,11 @@ static struct vdev_custom_scans vdev_custom_scans = - static rte_spinlock_t vdev_custom_scan_lock = RTE_SPINLOCK_INITIALIZER; - - /* register a driver */ -+#if defined(__x86_64__) || defined(__i386__) -+void __attribute__((target ("sse2"))) -+#else - void -+#endif - rte_vdev_register(struct rte_vdev_driver *driver) - { - TAILQ_INSERT_TAIL(&vdev_driver_list, driver, next); -diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c -index baa5b532a..58f3fdbaa 100644 ---- a/lib/librte_eal/common/eal_common_bus.c -+++ b/lib/librte_eal/common/eal_common_bus.c -@@ -15,8 +15,11 @@ - - static struct rte_bus_list rte_bus_list = - TAILQ_HEAD_INITIALIZER(rte_bus_list); -- -+#if defined(__x86_64__) || defined(__i386__) -+void __attribute__((target ("sse2"))) -+#else - void -+#endif - rte_bus_register(struct rte_bus *bus) - { - RTE_VERIFY(bus); -diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h -index c35283807..8f4f98ed4 100644 ---- a/lib/librte_eal/common/include/rte_common.h -+++ b/lib/librte_eal/common/include/rte_common.h -@@ -107,8 +107,20 @@ typedef uint16_t unaligned_uint16_t; - * Lowest number is the first to run. - */ - #ifndef RTE_INIT_PRIO /* Allow to override from EAL */ -+#if defined(__x86_64__) || defined(__i386__) - #define RTE_INIT_PRIO(func, prio) \ --static void __attribute__((constructor(RTE_PRIO(prio)), used)) func(void) -+static void \ -+ __attribute__((constructor(RTE_PRIO(prio)), used)) \ -+ __attribute__((target ("sse2"))) \ -+ __attribute__((target ("no-sse3"))) \ -+ __attribute__((target ("no-sse4"))) \ -+ func(void) -+#else -+#define RTE_INIT_PRIO(func, prio) \ -+static void \ -+ __attribute__((constructor(RTE_PRIO(prio)), used)) \ -+ func(void) -+#endif - #endif - - /** --- -2.16.4 - diff --git a/0001-SLE15-SP3-compatibility-patch-for-kni.patch b/0002-SLE15-SP3-compatibility-patch-for-kni.patch similarity index 71% rename from 0001-SLE15-SP3-compatibility-patch-for-kni.patch rename to 0002-SLE15-SP3-compatibility-patch-for-kni.patch index 487910f..ef5a81d 100644 --- a/0001-SLE15-SP3-compatibility-patch-for-kni.patch +++ b/0002-SLE15-SP3-compatibility-patch-for-kni.patch @@ -3,11 +3,11 @@ From: =?UTF-8?q?Jaime=20Caama=C3=B1o=20Ruiz?= Date: Mon, 21 Sep 2020 14:50:13 +0200 Subject: [PATCH] SLE15 SP3 compatibility patch for kni -Updated 2021-05-14 +Updated 2022-02-25 for version 21.11 -diff -Nur dpdk-stable-19.11.8/kernel/linux/kni/compat.h new/kernel/linux/kni/compat.h ---- dpdk-stable-19.11.8/kernel/linux/kni/compat.h 2021-04-16 10:13:47.000000000 +0200 -+++ new/kernel/linux/kni/compat.h 2021-05-14 14:19:13.576601634 +0200 +diff -Nur dpdk-21.11/kernel/linux/kni/compat.h new/kernel/linux/kni/compat.h +--- dpdk-21.11/kernel/linux/kni/compat.h 2021-11-26 18:58:21.000000000 +0100 ++++ new/kernel/linux/kni/compat.h 2022-02-25 18:08:52.638000134 +0100 @@ -14,7 +14,10 @@ #define SLE_VERSION(a, b, c) KERNEL_VERSION(a, b, c) #endif @@ -26,5 +26,5 @@ diff -Nur dpdk-stable-19.11.8/kernel/linux/kni/compat.h new/kernel/linux/kni/com #if KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE || \ + (SLE_VERSION_CODE && SLE_VERSION_CODE == SLE_VERSION(15, 3, 0)) || \ (defined(RHEL_RELEASE_CODE) && \ - RHEL_RELEASE_VERSION(8, 3) <= RHEL_RELEASE_CODE) - #define HAVE_TX_TIMEOUT_TXQUEUE + RHEL_RELEASE_VERSION(8, 3) <= RHEL_RELEASE_CODE) || \ + (defined(CONFIG_SUSE_KERNEL) && defined(HAVE_ARG_TX_QUEUE)) diff --git a/_constraints b/_constraints index 3dfc243..8373beb 100644 --- a/_constraints +++ b/_constraints @@ -11,8 +11,11 @@ sse sse2 ssse3 - + sse4_2 + + 6 + diff --git a/dpdk-19.11.8.tar.xz b/dpdk-19.11.8.tar.xz deleted file mode 100644 index 6f70e03..0000000 --- a/dpdk-19.11.8.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4ec0f2fb563a533cabd3e6ec4110a412c63eb7da1aa1ccdb802ab65d166f4efa -size 12449904 diff --git a/dpdk-21.11.tar.xz b/dpdk-21.11.tar.xz new file mode 100644 index 0000000..201d1d3 --- /dev/null +++ b/dpdk-21.11.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3246e3ed68ee2b369a5d8be2c06cf108a669e157f4d41c5bcbbb216bf5abd3a1 +size 15102516 diff --git a/dpdk.changes b/dpdk.changes index 20eef3c..9c1ee1b 100644 --- a/dpdk.changes +++ b/dpdk.changes @@ -1,3 +1,238 @@ +------------------------------------------------------------------- +Sat Feb 26 17:45:33 UTC 2022 - Ferdinand Thiessen + +- Update to LTS version 21.11. + 21.11 should be supported for at least two years, the new major + ABI version is 22. New Features: + * General + * hugetlbfs subdirectories + * AddressSanitizer (ASan) integration for debug + * mempool flag for non-IO usages + * device class for DMA accelerators and drivers for + * HiSilicon, Intel DSA, Intel IOAT, Marvell CNXK and NXP DPAA + * device class for GPU devices and driver for NVIDIA CUDA + * Toeplitz hash using Galois Fields New Instructions (GFNI) + * Networking + * MTU handling rework + * get all MAC addresses of a port + * RSS based on L3/L4 checksum fields + * flow match on L2TPv2 and PPP + * flow flex parser for custom header + * control delivery of HW Rx metadata + * transfer flows API rework + * shared Rx queue + * driver for NXP ENETFEC + * vDPA driver for Xilinx devices + * virtio RSS + * vhost power monitor wakeup + * testpmd multi-process + * pcapng library and dumpcap tool + * API/ABI + * API namespace improvements and cleanups + * API internals hidden + * flags check for future ABI compatibility + * More details in the release notes: + https://doc.dpdk.org/guides/rel_notes/release_21_11.html +- Update to LTS version 20.11.0, new features: + * General + * mbuf dynamic area increased from 16 to 36 bytes + * ring zero cop + * SIMD bitwidth limit API + * moved igb_uio to dpdk-kmods/linux + * removed Python 2 support + * removed Make support, meson + pkg-config files are + now used to build applications + * Networking + * FEC AP + * Rx buffer split + * thread safety in flow API + * shared action in flow API + * flow sampling and mirroring + * tunnel offload API + * multi-port hairpin + * Solarflare EF100 architecture + * Wangxun txgbe driver + * vhost-vDPA backend in virtio-user + * removed vhost dequeue zero-copy + * removed legacy ethdev filtering + * SWX pipeline aligned with P4 + * Baseband + * Intel ACC100 driver + * Cryptography + * raw datapath API + * Broadcom BCMFS symmetric crypto driver + * RegEx + * Marvell OCTEON TX2 regex driver + * Others + * Intel DLB/DLB2 drivers + * Intel DSA support in IOAT driver + * Full changes and more details in the release notes: + https://doc.dpdk.org/guides/rel_notes/release_20_11.html +- Rebased 0002-SLE15-SP3-compatibility-patch-for-kni.patch +- Drop outdated 0001-fix-cpu-compatibility.patch +- Drop outdated 0003-dpdk-fallthrough-comment-fixes.patch +- Added 0001-build-try-to-get-kernel-version-from-kernel-source.patch + Allow host system to have a different kernel than the target + system, fixes kernel module installation path for such case. + Submitted upstream 2022-02-26 +- Added fix-buildsystem-python36.patch for Leap as the buildsystem + uses python syntax introduced with python37, but Leap still + sticks with 3.6, so this backports it for the old python version. + +------------------------------------------------------------------- +Mon Oct 25 13:41:49 UTC 2021 - Stefan Weiberg + +- - Update LTS version to maintenance release 19.11.10 + * app/crypto-perf: fix out-of-place mempool allocation + * app/test: fix IPv6 header initialization + * app/testpmd: change port link speed without stopping all + * app/testpmd: fix help string for port reset + * app/testpmd: fix IPv4 checksum + * app/testpmd: fix MAC address after port reset + * app/testpmd: fix offloads for newly attached port + * app/testpmd: fix Tx checksum calculation for tunnel + * bitmap: fix buffer overrun in bitmap init + * bus: clarify log for non-NUMA-aware devices + * bus/dpaa: fix freeing in FMAN interface destructor + * common/mlx5: fix compatibility with OFED port query API + * common/mlx5: fix Netlink port name padding in probing + * common/mlx5: use new port query API if available + * cryptodev: fix freeing after device release + * crypto/mvsam: fix AES-GCM session parameters + * crypto/mvsam: fix capabilities + * crypto/mvsam: fix options parsing + * crypto/mvsam: fix session data reset + * crypto/octeontx: fix freeing after device release + * crypto/qat: fix Arm build with special memcpy + * devtools: fix file listing in maintainers check + * distributor: fix 128-bit write alignment + * doc: add limitation for ConnectX-4 with L2 in mlx5 guide + * doc: announce common prefix for ethdev + * doc: fix default burst size in testpmd + * doc: fix spelling + * drivers/net: fix memzone allocations for DMA memory + * ethdev: fix doc of flow action + * eventdev: fix event port setup in tx adapter + * flow_classify: fix leaking rules on delete + * (github-cpaelzer-stable/19.11) telemetry: fix race in telemetry control thread creation + * ipc: stop mp control thread on cleanup + * kni: fix crash on userspace VA for segmented packets + * kni: fix mbuf allocation for kernel side use + * mempool/octeontx2: fix shift calculation + * net/bnxt: check access to possible null pointer + * net/bnxt: cleanup code + * net/bnxt: clear cached statistics + * net/bnxt: detect bad opaque in Rx completion + * net/bnxt: fix auto-negotiation on Whitney+ + * net/bnxt: fix check for PTP support in FW + * net/bnxt: fix error handling in VNIC prepare + * net/bnxt: fix error messages in VNIC prepare + * net/bnxt: fix missing barriers in completion handling + * net/bnxt: fix nested lock during bonding + * net/bnxt: fix ring and context memory allocation + * net/bnxt: fix Rx burst size constraint + * net/bnxt: fix Rx interrupt setting + * net/bnxt: fix scalar Tx completion handling + * net/bnxt: fix Tx descriptor status implementation + * net/bnxt: fix typo in log message + * net/bnxt: improve probing log message + * net/bnxt: invoke device removal event on recovery failure + * net/bnxt: remove unnecessary code + * net/bnxt: remove unnecessary comment + * net/bnxt: set flow error after tunnel redirection free + * net/bnxt: set flow error when free filter not available + * net/bnxt: use common function to free VNIC resource + * net/bnxt: workaround spurious zero stats in Thor + * net/bonding: check flow setting + * net/bonding: fix error message on flow verify + * net/ena: enable multi-segment in Tx offload flags + * net/ena: trigger reset on Tx prepare failure + * net/hinic/base: fix LRO + * net/hinic: increase protection of the VLAN + * net/hns3: fix delay for waiting to stop Rx/Tx + * net/hns3: fix filter parsing comment + * net/hns3: fix Tx prepare after stop + * net/hns3: fix VLAN strip log + * net/hns3: increase VF reset retry maximum + * net/i40e: fix descriptor scan on Arm + * net/i40e: fix multi-process shared data + * net/iavf: fix RSS key access out of bound + * net/iavf: fix Tx threshold check + * net/ice/base: fix first profile mask + * net/ice/base: revert change of first profile mask + * net/ice: fix default RSS key generation + * net/ice: fix memzone leak when firmware is missing + * net/ixgbe: fix flow entry access after freeing + * net/mlx5: fix incorrect r/w lock usage in DMA unmap + * net/mlx5: fix IPIP multi-tunnel validation + * net/mlx5: fix match MPLS over GRE with key + * net/mlx5: fix MPLS RSS expansion + * net/mlx5: fix overflow in mempool argument + * net/mlx5: fix representor interrupt handler + * net/mlx5: fix RoCE LAG bond device probing + * net/mlx5: fix RSS flow item expansion for GRE key + * net/mlx5: fix Rx/Tx queue checks + * net/mlx5: fix switchdev mode recognition + * net/mlx5: fix typo in vectorized Rx comments + * net/mlx5: limit implicit MPLS RSS expansion over GRE + * net/mlx5: limit inner RSS expansion for MPLS + * net/mlx5: remove redundant operations in NEON Rx + * net/mlx5: remove unsupported flow item MPLS over IP + * net/mlx5: workaround drop action with old kernel + * net/mvpp2: fix configured state dependency + * net/mvpp2: fix port speed overflow + * net/octeontx2: fix default MCAM allocation size + * net/octeontx2: fix flow creation limit on CN98xx + * net/octeontx2: use runtime LSO format indices + * net/octeontx/base: fix debug build with clang + * net/pfe: remove unnecessary null check + * net/sfc: fix MAC stats lock in xstats query by ID + * net/sfc: fix MAC stats update for stopped device + * net/sfc: fix reading adapter state without locking + * net/sfc: fix xstats query by ID according to ethdev + * net/sfc: fix xstats query by unsorted list of IDs + * net/softnic: fix connection memory leak + * net/softnic: fix memory leak as profile is freed + * net/virtio: fix aarch32 build + * net/virtio: fix refill order in packed ring datapath + * net/virtio: report maximum MTU in device info + * power: fix namespace for internal struct + * rib: fix max depth IPv6 lookup + * test/crypto: fix mbuf reset after null check + * test/crypto: fix mempool size for session-less + * test/crypto: fix typo in AES case + * test/crypto: fix typo in ESN case + * test/mbuf: fix virtual address conversion + * tests/eal: fix memory leak + * vhost/crypto: check request pointer before dereference + * vhost: fix crash on reconnect + * vhost: fix missing guest pages table NUMA realloc + * vhost: fix missing memory table NUMA realloc + * vhost: utilize dynamic memory allocator + * Changes from 19.11.9: + https://doc.dpdk.org/guides-19.11/rel_notes/release_19_11.html#id25 +- rename + 0001-SLE15-SP3-compatibility-patch-for-kni.patch + to + 0002-SLE15-SP3-compatibility-patch-for-kni.patch +- rename + dpdk-fallthrough-comment-fixes.patch + to + 0003-dpdk-fallthrough-comment-fixes.patch + +------------------------------------------------------------------- +Mon Sep 13 16:46:30 CEST 2021 - tiwai@suse.de + +- Fix build error with SLE15-SP4 kernel (bsc#1190362): + dpdk-fallthrough-comment-fixes.patch + +------------------------------------------------------------------- +Thu Sep 2 15:42:14 UTC 2021 - Guillaume GARDET + +- Add BuildRequires kernel-syms and modutils for proper + dependencies to be inserted in the resulting binary RPM, as + pointed by rpmlint + ------------------------------------------------------------------- Thu Jul 22 06:00:37 UTC 2021 - Steve Kowalik diff --git a/dpdk.spec b/dpdk.spec index b9987f3..d9a3a74 100644 --- a/dpdk.spec +++ b/dpdk.spec @@ -1,7 +1,7 @@ # # spec file # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,64 +18,76 @@ %define flavor @BUILD_FLAVOR@%{nil} -%define aarch64_machine2 armv8a +%define aarch64_machine armv8a %define exclusive_arch aarch64 x86_64 ppc64le + %define name_tag %{nil} %define summary_tag %{nil} -%if "%flavor" == "thunderx" +%if "%{flavor}" == "thunderx" %define name_tag -thunderx %define summary_tag (thunderx) -%define aarch64_machine2 thunderx +%define aarch64_machine thunderx %define exclusive_arch aarch64 %endif -%define machine native -%define machine2 default -%ifarch x86_64 -%define machine native -%define target x86_64-%{machine}-linuxapp-gcc -%endif + +# http://doc.dpdk.org/guides-21.11/linux_gsg/build_dpdk.html#adjusting-build-options +%define platform generic +%define machine auto %ifarch aarch64 -%define machine2 %aarch64_machine2 -%define target arm64-%{machine2}-linuxapp-gcc -%endif -%ifarch ppc64le -%define machine2 power8 -%define target ppc_64-%{machine2}-linuxapp-gcc +%define machine %{aarch64_machine2} %endif # This is in sync with /ABI_VERSION # TODO: automate this sync -%define maj 20 +%define maj 22 %define min 0 -%define lname libdpdk-%{maj}_%{min} -%bcond_without shared +#%%define lname libdpdk-%%{maj}_%%{min} +%define lname libdpdk-%{maj} # Add option to build without examples %bcond_without examples # Add option to build without tools %bcond_without tools +# Name: dpdk%{name_tag} -Version: 19.11.8 +Version: 21.11 Release: 0 Summary: Set of libraries and drivers for fast packet processing License: BSD-3-Clause AND GPL-2.0-only AND LGPL-2.1-only Group: System/Libraries -URL: http://dpdk.org -Source: http://fast.dpdk.org/rel/dpdk-%{version}.tar.xz +URL: https://www.dpdk.org/ +Source: https://fast.dpdk.org/rel/dpdk-%{version}.tar.xz Source1: preamble -Patch1: 0001-fix-cpu-compatibility.patch -Patch2: 0001-SLE15-SP3-compatibility-patch-for-kni.patch +# PATCH-FIX-OPENSUSE PATCH-FEATURE-UPSTREAM +Patch0: 0001-build-try-to-get-kernel-version-from-kernel-source.patch +Patch1: 0002-SLE15-SP3-compatibility-patch-for-kni.patch +# PATCH-FIX-OPENSUSE fix-buildsystem-python36.patch -- Fix building with python36 +Patch2: fix-buildsystem-python36.patch +BuildRequires: binutils BuildRequires: doxygen BuildRequires: fdupes -BuildRequires: libelf-devel -BuildRequires: libmnl-devel -BuildRequires: libnuma-devel -BuildRequires: libpcap-devel +BuildRequires: kernel-syms +BuildRequires: libfdt-devel +BuildRequires: meson >= 0.49.2 +BuildRequires: modutils BuildRequires: pesign-obs-integration -BuildRequires: zlib-devel +BuildRequires: pkgconfig +BuildRequires: python3 +BuildRequires: python3-Sphinx +BuildRequires: python3-pyelftools >= 0.22 +BuildRequires: rdma-core-devel +BuildRequires: pkgconfig(jansson) +BuildRequires: pkgconfig(libcrypto) +BuildRequires: pkgconfig(libelf) +BuildRequires: pkgconfig(libmnl) +BuildRequires: pkgconfig(libpcap) +BuildRequires: pkgconfig(numa) +BuildRequires: pkgconfig(zlib) Conflicts: dpdk-any Provides: dpdk-any = %{version} -ExclusiveArch: %exclusive_arch -%if 0%{?sle_version} >= 120400 -BuildRequires: rdma-core-devel +Obsoletes: dpdk-kmp-trace < %{version} +ExclusiveArch: %{exclusive_arch} +%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150400 +# https://bugzilla.opensuse.org/show_bug.cgi?id=1196511 +BuildRequires: pkgconfig(libbpf) %endif %description @@ -93,6 +105,15 @@ Provides: dpdk-any-devel = %{version} This package contains the headers and other files needed for developing applications with the Data Plane Development Kit. +%package devel-static +Summary: Data Plane Development Kit static development files %{summary_tag} +Group: Development/Libraries/C and C++ +Requires: %{name}-devel = %{version} + +%description devel-static +This package contains the static library files needed for developing +applications with the Data Plane Development Kit. + %package -n %{lname} Summary: Data Plane Development Kit runtime libraries %{summary_tag} Group: Development/Libraries/C and C++ @@ -157,192 +178,85 @@ The DPDK Kernel NIC Interface (KNI) allows userspace applications access to the %define pmddir %{_libdir}/dpdk-pmds-%{maj}.%{min} %prep -# can't use %{name} because of dpdk-thunderx -%setup -q -n dpdk-stable-%{version} -%patch1 -p1 -z .init -%patch2 -p1 -z .init +# can't use %%{name} because of dpdk-thunderx +%autosetup -p1 -n dpdk-%{version} -# This fixes CROSS compilation (broken) in the mk file for ThunderX -sed -i '/^CROSS /s/^/#/' mk/machine/thunderx/rte.vars.mk +# Skip not supported examples +sed -i "/performance-thread/d" examples/meson.build # Verify ABI [ "$(cat ABI_VERSION)" = "%{maj}.%{min}" ] || exit 1 %build +%define _vpath_builddir "build-%{_target_cpu}-$flavor" -cp mk/machine/armv8a/rte.vars.mk mk/machine/thunderx - -# set up a method for modifying the resulting .config file -function setconf() { - if grep -q ^$1= $3/.config; then - sed -i "s:^$1=.*$:$1=$2:g" $3/.config - else - echo $1=$2 >> $3/.config - fi -} - -function setdefaultconf() -{ - # Remove the below once upstream fixes the DPAA for NXP ARM - setconf CONFIG_RTE_LIBRTE_DPAA_BUS n $1 - setconf CONFIG_RTE_LIBRTE_DPAA_MEMPOOL n $1 - setconf CONFIG_RTE_LIBRTE_DPAA_PMD n $1 - setconf CONFIG_RTE_LIBRTE_PMD_CAAM_JR n $1 - setconf CONFIG_RTE_LIBRTE_PMD_DPAA_SEC n $1 - setconf CONFIG_RTE_LIBRTE_PMD_DPAA_EVENTDEV n $1 - %ifarch aarch64 - setconf CONFIG_RTE_LIBRTE_PFE_PMD n $1 - %endif - - setconf CONFIG_RTE_MACHINE '"%{machine2}"' $1 - # Disable experimental features - setconf CONFIG_RTE_NEXT_ABI n $1 - - # Enable automatic driver loading from this path - setconf CONFIG_RTE_EAL_PMD_PATH '"%{pmddir}"' $1 - - setconf CONFIG_RTE_LIBRTE_BNX2X_PMD y $1 - setconf CONFIG_RTE_LIBRTE_BNX2X_MF_SUPPORT y $1 - setconf CONFIG_RTE_LIBRTE_PMD_PCAP y $1 - setconf CONFIG_RTE_LIBRTE_VHOST_NUMA y $1 -%if 0%{?sle_version} >= 120400 - setconf CONFIG_RTE_LIBRTE_MLX5_PMD y $1 - setconf CONFIG_RTE_LIBRTE_MLX4_PMD y $1 +%ifarch x86_64 +export CFLAGS="%{optflags} -msse4" %endif - setconf CONFIG_RTE_EAL_IGB_UIO n $1 - setconf CONFIG_RTE_KNI_KMOD n $1 - - %if %{with shared} - setconf CONFIG_RTE_BUILD_SHARED_LIB y $1 - %endif - - %ifarch aarch64 ppc64le - setconf CONFIG_RTE_LIBRTE_DISTRIBUTOR n $1 - %endif - %ifarch ppc64le - setconf CONFIG_RTE_LIBRTE_PMD_RING n $1 - setconf CONFIG_RTE_LIBRTE_IXGBE_PMD n $1 - setconf CONFIG_RTE_LIBRTE_POWER n $1 - %endif -} -# In case dpdk-devel is installed, we should ignore its hints about the SDK directories -unset RTE_SDK RTE_INCLUDE RTE_TARGET - -export EXTRA_CFLAGS="%{optflags} -Wformat -fPIC -U_FORTIFY_SOURCE" - -# DPDK defaults to using builder-specific compiler flags. However, -# the config has been changed by specifying CONFIG_RTE_MACHINE=default -# in order to build for a more generic host. NOTE: It is possible that -# the compiler flags used still won't work for all Fedora-supported -# machines, but runtime checks in DPDK will catch those situations. - -make V=1 O=%{target} T=%{target} %{?_smp_mflags} config -setdefaultconf %{target} - -export EXTRA_CFLAGS='-DVERSION=\"%{version}\"' +examples="all" for flavor in %{flavors_to_build}; do - export RTE_KERNELDIR=%{_prefix}/src/linux-obj/%{_target_cpu}/$flavor - make V=1 O=%{target}-$flavor T=%{target} %{?_smp_mflags} config - setdefaultconf %{target}-$flavor - setconf CONFIG_RTE_EAL_IGB_UIO y %{target}-$flavor - setconf CONFIG_RTE_KNI_KMOD y %{target}-$flavor - cd %{target}-$flavor - make V=1 %{?_smp_mflags} - cd - + %meson --includedir=%{incdir} \ + -Ddefault_library=shared \ + -Denable_docs=true \ + -Db_lto=true \ + %if %{with examples} + -Dexamples="$examples" \ + %endif + -Dplatform="%{platform}" \ + -Dcpu_instruction_set=%{machine} \ + -Denable_kmods=true \ + -Ddrivers_install_subdir=%{pmddir} \ + -Dkernel_dir="%{_prefix}/src/linux-obj/%{_target_cpu}/$flavor" + %meson_build + # Make sure examples are only built once + examples="" done -make V=1 O=%{target} %{?_smp_mflags} -make V=1 O=%{target} %{?_smp_mflags} doc-api-html - -%if %{with examples} -make V=1 O=%{target}/examples T=%{target} %{?_smp_mflags} examples -%endif - %install -# export needed for kmp package -export EXTRA_CFLAGS='-DVERSION=\"%{version}\"' -export INSTALL_MOD_PATH=%{buildroot} -export INSTALL_MOD_DIR=updates -export BRP_PESIGN_FILES="*.ko" - +examples="%{?with_examples:all}" for flavor in %{flavors_to_build}; do - cd %{target}-$flavor - export RTE_KERNELDIR=%{_prefix}/src/linux-obj/%{_target_cpu}/$flavor - dir=%{_prefix}/src/linux-obj/%{_target_cpu}/$flavor - krel=$(make -s -C "$dir" kernelrelease) - mkdir -p %{buildroot}/lib/modules/$krel/extra/dpdk/ - #make install expects same kernel for build and target, lets copy it manually - install -m644 ../%{target}-$flavor/kmod/*.ko %{buildroot}/lib/modules/$krel/extra/dpdk/ - cd - + %meson_install + # Also install the example binaries + if [ ! -z "$examples" ]; then + for f in %{_vpath_builddir}/examples/dpdk-*; do + bn=$(basename "$f") + [ -f "$f" ] && install -Dm 0755 ${f} "%{buildroot}%{_bindir}/${bn/dpdk-/dpdk_example_}" + done + fi + examples="" done -# In case dpdk-devel is installed -unset RTE_SDK RTE_INCLUDE RTE_TARGET -%make_install O=%{target} prefix=%{_usr} libdir=%{_libdir} +# Fix Kernel modules on Factory (/usr merge) +%if 0%{?suse_version} > 1550 +mkdir -p %{buildroot}%{_prefix}/lib +mv %{buildroot}/lib/modules %{buildroot}%{_prefix}/lib +%endif + +# Fix documentation +mkdir -p %{buildroot}%{docdir} +mv %{buildroot}%{_datadir}/doc/dpdk %{buildroot}%{docdir} %if ! %{with tools} -rm -rf %{buildroot}%{sdkdir}/usertools/ -rm -rf %{buildroot}%{_sbindir}/dpdk_nic_bind +# Remove tools if not needed +for tool in dpdk-devbind.py dpdk-pmdinfo.py dpdk-telemetry.py dpdk-hugepages.py; do + rm -rf "%{buildroot}%{_bindir}/$tool" +done +%else +# Add compatibility symlink +mkdir -p %{buildroot}%{_sbindir} +ln -s %{_bindir}/dpdk-devbind.py %{buildroot}%{_sbindir}/dpdk_nic_bind %endif -rm -f %{buildroot}%{sdkdir}/usertools/setup.sh -#TODO pip elftools has issues to fix -rm -rf %{buildroot}%{_bindir}/dpdk-pmdinfo - -%if %{with examples} -find %{target}/examples/ -name "*.map" | xargs rm -f -for f in %{target}/examples/*/%{target}/app/*; do - bn=`basename ${f}` - cp -p ${f} %{buildroot}%{_bindir}/dpdk_example_${bn} -done -%endif - -# Create a driver directory with symlinks to all pmds -mkdir -p %{buildroot}/%{pmddir} -for f in %{buildroot}/%{_libdir}/*_pmd_*.so.*; do - bn=$(basename ${f}) - ln -s ../${bn} %{buildroot}%{pmddir}/${bn} -done -#mempool is a driver now from 16.07 -mkdir -p %{buildroot}/%{pmddir} -for f in %{buildroot}/%{_libdir}/*_mempool_*.so.*; do - bn=$(basename ${f}) - ln -s ../${bn} %{buildroot}%{pmddir}/${bn} -done - -# Setup RTE_SDK environment as expected by apps etc -mkdir -p %{buildroot}/%{_sysconfdir}/profile.d -cat << EOF > %{buildroot}/%{_sysconfdir}/profile.d/dpdk-sdk-%{_arch}.sh -if [ -z "\${RTE_SDK}" ]; then - export RTE_SDK="%{sdkdir}" - export RTE_TARGET="%{target}" - export RTE_INCLUDE="%{incdir}" -fi -EOF - -cat << EOF > %{buildroot}/%{_sysconfdir}/profile.d/dpdk-sdk-%{_arch}.csh -if ( ! \${?RTE_SDK} ) then - setenv RTE_SDK "%{sdkdir}" - setenv RTE_TARGET "%{target}" - setenv RTE_INCLUDE "%{incdir}" -endif -EOF - -# Fixup target machine mismatch -sed -i -e 's:-%{machine}-:-%{machine2}-:g' %{buildroot}/%{_sysconfdir}/profile.d/dpdk-sdk* - -#doc -mkdir %{buildroot}%{_docdir}/ -mv %{buildroot}%{_datadir}/doc/dpdk %{buildroot}%{_docdir}/ - -ln -s %{_bindir}/dpdk-procinfo %{buildroot}%{_bindir}/dpdk_proc_info -ln -s %{_sbindir}/dpdk-devbind %{buildroot}%{_sbindir}/dpdk_nic_bind # Fix interpreter find %{buildroot} -name "*.py" -exec sed -i 's|python$|python3|' \{\} + find %{buildroot} -name "*.py" -exec sed -i 's|env python|python|' \{\} + # Remove duplicates -%fdupes %{buildroot}/%{_prefix} +%fdupes %{buildroot}/%{docdir} +%fdupes %{buildroot}/%{sdkdir}/examples + +# Fix broken symlink (yes with * in its name) +rm -v "%{buildroot}%{_libdir}/librte_*.so*" %post devel -p /sbin/ldconfig %postun devel -p /sbin/ldconfig @@ -350,60 +264,44 @@ find %{buildroot} -name "*.py" -exec sed -i 's|env python|python|' \{\} + %postun -n %{lname} -p /sbin/ldconfig %files -%defattr(-,root,root) -# BSD -%{_bindir}/testpmd -%{_bindir}/testbbdev -%{_bindir}/testsad -%{_bindir}/dpdk-procinfo -%{_bindir}/dpdk_proc_info +%{_bindir}/dpdk-dumpcap %{_bindir}/dpdk-pdump +%{_bindir}/dpdk-proc-info +%{_bindir}/dpdk-test* %files -n %{lname} -%defattr(-,root,root) -%if %{with shared} +%license license/gpl-2.0.txt license/lgpl-2.1.txt license/bsd-3-clause.txt %{_libdir}/*.so.* -%{pmddir} -%endif - -%files doc -%defattr(-,root,root) -#BSD -%docdir -%doc license/gpl-2.0.txt license/lgpl-2.1.txt +%dir %{pmddir} +%{pmddir}/*.so.* %files devel -%defattr(-,root,root) #BSD %{incdir}/ -%{sdkdir} -%if %{with tools} -%exclude %{sdkdir}/usertools/ -%endif +%{sdkdir}/ +%{pmddir}/*.so +%{_libdir}/*.so +%{_libdir}/pkgconfig/libdpdk*.pc %if %{with examples} %exclude %{sdkdir}/examples/ %endif -%{_sysconfdir}/profile.d/dpdk-sdk-*.* -%if ! %{with shared} + +%files devel-static +#BSD %{_libdir}/*.a -%else -%{_libdir}/*.so -%endif + +%files doc +#BSD +%doc %docdir %if %{with tools} %files tools -%defattr(-,root,root) -%{sdkdir}/usertools/ -%{_sbindir}/dpdk-devbind %{_sbindir}/dpdk_nic_bind -%{_bindir}/dpdk-test-eventdev -%{_bindir}/dpdk-test-compress-perf -%{_bindir}/dpdk-test-crypto-perf +%{_bindir}/dpdk-*.py %endif %if %{with examples} %files examples -%defattr(-,root,root) %{_bindir}/dpdk_example_* %doc %{sdkdir}/examples %endif diff --git a/fix-buildsystem-python36.patch b/fix-buildsystem-python36.patch new file mode 100644 index 0000000..8ab357e --- /dev/null +++ b/fix-buildsystem-python36.patch @@ -0,0 +1,12 @@ +diff -Nur dpdk-21.11/buildtools/binutils-avx512-check.py new/buildtools/binutils-avx512-check.py +--- dpdk-21.11/buildtools/binutils-avx512-check.py 2021-11-26 18:58:21.000000000 +0100 ++++ new/buildtools/binutils-avx512-check.py 2022-02-26 18:44:13.325608971 +0100 +@@ -15,7 +15,7 @@ + src = '__asm__("vpgatherqq {}");'.format(gather_params).encode('utf-8') + subprocess.run(cc + ['-c', '-xc', '-o', obj.name, '-'], input=src, check=True) + asm = subprocess.run([objdump, '-d', '--no-show-raw-insn', obj.name], +- capture_output=True, check=True).stdout.decode('utf-8') ++ stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True).stdout.decode('utf-8') + if gather_params not in asm: + print('vpgatherqq displacement error with as') + sys.exit(1)