- Update to LTS release version v22.11.5
* http://doc.dpdk.org/guides-22.11/rel_notes/release_22_11.html - Drop patches (included upstream): * 0001-kni-fix-build-with-Linux-6.3.patch (22.11.3) * 0001-kni-fix-build-with-Linux-6.5.patch (22.11.3) OBS-URL: https://build.opensuse.org/package/show/network/dpdk?expand=0&rev=159
This commit is contained in:
commit
e59abee416
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -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
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
69
0001-fix-cpu-compatibility.patch
Normal file
69
0001-fix-cpu-compatibility.patch
Normal file
@ -0,0 +1,69 @@
|
||||
From e2950fec9cd9c235a7847ed97b6914174857bf93 Mon Sep 17 00:00:00 2001
|
||||
From: "mvarlese@suse.de" <mvarlese@suse.de>
|
||||
Date: Wed, 29 Apr 2020 12:24:16 +0200
|
||||
Subject: [PATCH] fix cpu compatibility
|
||||
|
||||
Added 0001-fix-cpu-compatibility.patch to address issue with older CPUs (bsc#1125961, bsc#1099474)
|
||||
|
||||
Updated 2023-02-26 for version 22.11
|
||||
|
||||
diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
|
||||
index 41bc07dde7..750180cb84 100644
|
||||
--- a/drivers/bus/vdev/vdev.c
|
||||
+++ b/drivers/bus/vdev/vdev.c
|
||||
@@ -51,7 +51,11 @@ static struct vdev_custom_scans vdev_custom_scans =
|
||||
static rte_spinlock_t vdev_custom_scan_lock = RTE_SPINLOCK_INITIALIZER;
|
||||
|
||||
/* register a driver */
|
||||
-void
|
||||
+#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/eal/common/eal_common_bus.c b/lib/eal/common/eal_common_bus.c
|
||||
index deb9fb8a12..cb7bec607f 100644
|
||||
--- a/lib/eal/common/eal_common_bus.c
|
||||
+++ b/lib/eal/common/eal_common_bus.c
|
||||
@@ -22,7 +22,11 @@ rte_bus_name(const struct rte_bus *bus)
|
||||
return bus->name;
|
||||
}
|
||||
|
||||
-void
|
||||
+#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/eal/include/rte_common.h b/lib/eal/include/rte_common.h
|
||||
index 15765b408d..4291706faa 100644
|
||||
--- a/lib/eal/include/rte_common.h
|
||||
+++ b/lib/eal/include/rte_common.h
|
||||
@@ -179,8 +179,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
|
||||
|
||||
/**
|
55
0001-kni-fix-build-with-Linux-6.3.patch
Normal file
55
0001-kni-fix-build-with-Linux-6.3.patch
Normal file
@ -0,0 +1,55 @@
|
||||
From: Ferruh Yigit <ferruh.yigit@amd.com>
|
||||
Date: Fri, 14 Apr 2023 16:25:22 +0100
|
||||
Subject: kni: fix build with Linux 6.3
|
||||
Patch-mainline: yes
|
||||
Git-commit: 5f34cc454df420b9b2da8deb949fb76cba058b87
|
||||
References: kernel 6.3
|
||||
|
||||
KNI calls `get_user_pages_remote()` API which is using `FOLL_TOUCH`
|
||||
flag, but `FOLL_TOUCH` is no more in public headers since v6.3,
|
||||
causing a build error.
|
||||
|
||||
`FOLL_*` defines in Linux kernel first moved to another header [1],
|
||||
later some of them moved to memory subsystem internal header [2] for 6.3
|
||||
|
||||
`get_user_pages_remote()` already sets `FOLL_TOUCH` internally,
|
||||
no need to set this flag externally anyway, moving flag from the call
|
||||
altogether.
|
||||
|
||||
[1]
|
||||
Commit b5054174ac7c ("mm: move FOLL_* defs to mm_types.h")
|
||||
|
||||
[2]
|
||||
Commit 2c2241081f7d ("mm/gup: move private gup FOLL_ flags to internal.h")
|
||||
|
||||
Fixes: e73831dc6c26 ("kni: support userspace VA")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
|
||||
Reviewed-by: David Marchand <david.marchand@redhat.com>
|
||||
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
|
||||
---
|
||||
kernel/linux/kni/kni_dev.h | 6 ++----
|
||||
1 file changed, 2 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/kernel/linux/kni/kni_dev.h b/kernel/linux/kni/kni_dev.h
|
||||
index a2c6d9fc..21bfb689 100644
|
||||
--- a/kernel/linux/kni/kni_dev.h
|
||||
+++ b/kernel/linux/kni/kni_dev.h
|
||||
@@ -105,11 +105,9 @@ static inline phys_addr_t iova_to_phys(struct task_struct *tsk,
|
||||
|
||||
/* Read one page struct info */
|
||||
#ifdef HAVE_TSK_IN_GUP
|
||||
- ret = get_user_pages_remote(tsk, tsk->mm, iova, 1,
|
||||
- FOLL_TOUCH, &page, NULL, NULL);
|
||||
+ ret = get_user_pages_remote(tsk, tsk->mm, iova, 1, 0, &page, NULL, NULL);
|
||||
#else
|
||||
- ret = get_user_pages_remote(tsk->mm, iova, 1,
|
||||
- FOLL_TOUCH, &page, NULL, NULL);
|
||||
+ ret = get_user_pages_remote(tsk->mm, iova, 1, 0, &page, NULL, NULL);
|
||||
#endif
|
||||
if (ret < 0)
|
||||
return 0;
|
||||
--
|
||||
2.35.3
|
||||
|
50
0001-kni-fix-build-with-Linux-6.5.patch
Normal file
50
0001-kni-fix-build-with-Linux-6.5.patch
Normal file
@ -0,0 +1,50 @@
|
||||
From: Ferruh Yigit <ferruh.yigit@amd.com>
|
||||
Date: Tue, 11 Jul 2023 11:09:41 +0100
|
||||
Subject: kni: fix build with Linux 6.5
|
||||
Git-repo: https://dpdk.org/git/dpdk
|
||||
Git-commit: dd33d53b9a032d7376aa04a28a1235338e1fd78f
|
||||
Patch-mainline: yes
|
||||
References: kernel 6.5
|
||||
|
||||
The get_user_pages_remote() API has been modified in Linux kernel v6.5
|
||||
[1], "struct vm_area_struct **vmas" parameter removed from the API.
|
||||
|
||||
To fix KNI build with Linux kernel v6.5, version check added around the
|
||||
get_user_pages_remote() API.
|
||||
|
||||
[1]
|
||||
ca5e863233e8 ("mm/gup: remove vmas parameter from get_user_pages_remote()")
|
||||
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
|
||||
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
|
||||
---
|
||||
kernel/linux/kni/compat.h | 4 ++++
|
||||
kernel/linux/kni/kni_dev.h | 4 ++++
|
||||
2 files changed, 8 insertions(+)
|
||||
|
||||
--- a/kernel/linux/kni/compat.h
|
||||
+++ b/kernel/linux/kni/compat.h
|
||||
@@ -153,3 +153,7 @@
|
||||
#if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE
|
||||
#define HAVE_NETIF_RX_NI
|
||||
#endif
|
||||
+
|
||||
+#if KERNEL_VERSION(6, 5, 0) > LINUX_VERSION_CODE
|
||||
+#define HAVE_VMA_IN_GUP
|
||||
+#endif
|
||||
--- a/kernel/linux/kni/kni_dev.h
|
||||
+++ b/kernel/linux/kni/kni_dev.h
|
||||
@@ -107,7 +107,11 @@ static inline phys_addr_t iova_to_phys(s
|
||||
#ifdef HAVE_TSK_IN_GUP
|
||||
ret = get_user_pages_remote(tsk, tsk->mm, iova, 1, 0, &page, NULL, NULL);
|
||||
#else
|
||||
+ #ifdef HAVE_VMA_IN_GUP
|
||||
ret = get_user_pages_remote(tsk->mm, iova, 1, 0, &page, NULL, NULL);
|
||||
+ #else
|
||||
+ ret = get_user_pages_remote(tsk->mm, iova, 1, 0, &page, NULL);
|
||||
+ #endif
|
||||
#endif
|
||||
if (ret < 0)
|
||||
return 0;
|
36
0002-SLE15-SP3-compatibility-patch-for-kni.patch
Normal file
36
0002-SLE15-SP3-compatibility-patch-for-kni.patch
Normal file
@ -0,0 +1,36 @@
|
||||
From 430a4b50f2f7e5f21c7c2f81849588c575018501 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jaime=20Caama=C3=B1o=20Ruiz?= <jcaamano@suse.com>
|
||||
Date: Mon, 21 Sep 2020 14:50:13 +0200
|
||||
Subject: [PATCH] SLE15 SP3 compatibility patch for kni
|
||||
|
||||
Add patch to resolve build error reported in Staging:E project
|
||||
where a kernel backport (jsc#SLE-13536) introduced backward
|
||||
incompatible changes to the API that break kni module build
|
||||
* 0001-SLE15-SP3-compatibility-patch-for-kni.patch
|
||||
|
||||
Updated 2023-02-26 for version 22.11
|
||||
|
||||
diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
|
||||
index 3a86d12bbc..66d1afd944 100644
|
||||
--- a/kernel/linux/kni/compat.h
|
||||
+++ b/kernel/linux/kni/compat.h
|
||||
@@ -14,7 +14,10 @@
|
||||
#define SLE_VERSION(a, b, c) KERNEL_VERSION(a, b, c)
|
||||
#endif
|
||||
#ifdef CONFIG_SUSE_KERNEL
|
||||
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 57))
|
||||
+#if (defined(CONFIG_SUSE_VERSION) && CONFIG_SUSE_VERSION == 15 && \
|
||||
+ defined(CONFIG_SUSE_PATCHLEVEL) && CONFIG_SUSE_PATCHLEVEL == 3)
|
||||
+#define SLE_VERSION_CODE SLE_VERSION(15, 3, 0)
|
||||
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 57))
|
||||
/* SLES12SP3 is at least 4.4.57+ based */
|
||||
#define SLE_VERSION_CODE SLE_VERSION(12, 3, 0)
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 28))
|
||||
@@ -132,6 +135,7 @@
|
||||
#endif
|
||||
|
||||
#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) || \
|
||||
(defined(CONFIG_SUSE_KERNEL) && defined(HAVE_ARG_TX_QUEUE))
|
21
_constraints
Normal file
21
_constraints
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0"?>
|
||||
<constraints>
|
||||
<overwrite>
|
||||
<conditions>
|
||||
<arch>i586</arch>
|
||||
<arch>x86_64</arch>
|
||||
</conditions>
|
||||
<hardware>
|
||||
<cpu>
|
||||
<flag>mmx</flag>
|
||||
<flag>sse</flag>
|
||||
<flag>sse2</flag>
|
||||
<flag>ssse3</flag>
|
||||
<flag>sse4_2</flag>
|
||||
</cpu>
|
||||
<disk>
|
||||
<size unit="G">8</size>
|
||||
</disk>
|
||||
</hardware>
|
||||
</overwrite>
|
||||
</constraints>
|
3
_multibuild
Normal file
3
_multibuild
Normal file
@ -0,0 +1,3 @@
|
||||
<multibuild>
|
||||
<package>thunderx</package>
|
||||
</multibuild>
|
BIN
dpdk-22.11.1.tar.xz
(Stored with Git LFS)
Normal file
BIN
dpdk-22.11.1.tar.xz
(Stored with Git LFS)
Normal file
Binary file not shown.
3
dpdk-22.11.5.tar.xz
Normal file
3
dpdk-22.11.5.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:916805aee46246b81f71f831221231ef3de9c1f70223d179621980ec5d1bdf73
|
||||
size 15617920
|
1803
dpdk.changes
Normal file
1803
dpdk.changes
Normal file
File diff suppressed because it is too large
Load Diff
327
dpdk.spec
Normal file
327
dpdk.spec
Normal file
@ -0,0 +1,327 @@
|
||||
#
|
||||
# spec file for package dpdk
|
||||
#
|
||||
# Copyright (c) 2024 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/
|
||||
#
|
||||
# needssslcertforbuild
|
||||
|
||||
|
||||
%define flavor @BUILD_FLAVOR@%{nil}
|
||||
%define aarch64_machine armv8a
|
||||
%define exclusive_arch aarch64 x86_64 ppc64le
|
||||
%define name_tag %{nil}
|
||||
%define summary_tag %{nil}
|
||||
%if "%{flavor}" == "thunderx"
|
||||
%define name_tag -thunderx
|
||||
%define summary_tag (thunderx)
|
||||
%define aarch64_machine thunderx
|
||||
%define exclusive_arch aarch64
|
||||
%endif
|
||||
# http://doc.dpdk.org/guides-22.11/linux_gsg/build_dpdk.html#adjusting-build-options
|
||||
%define platform generic
|
||||
%define machine auto
|
||||
%ifarch aarch64
|
||||
%define machine %{aarch64_machine2}
|
||||
%endif
|
||||
# This is in sync with <src>/ABI_VERSION
|
||||
# TODO: automate this sync
|
||||
%define maj 23
|
||||
%define min 0
|
||||
#%%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: 22.11.5
|
||||
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: https://www.dpdk.org/
|
||||
Source: https://fast.dpdk.org/rel/dpdk-%{version}.tar.xz
|
||||
Source1: preamble
|
||||
# PATCH-FIX-OPENSUSE PATCH-FEATURE-UPSTREAM
|
||||
Patch0: 0001-fix-cpu-compatibility.patch
|
||||
Patch1: 0002-SLE15-SP3-compatibility-patch-for-kni.patch
|
||||
Patch4: kni-fix-build-with-Linux-6.8.patch
|
||||
Patch100: kni-fix-build-with-Linux-6.10.patch
|
||||
BuildRequires: binutils
|
||||
BuildRequires: doxygen
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: kernel-syms
|
||||
BuildRequires: libfdt-devel
|
||||
BuildRequires: meson >= 0.53.2
|
||||
BuildRequires: modutils
|
||||
BuildRequires: patchelf
|
||||
BuildRequires: pesign-obs-integration
|
||||
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}
|
||||
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
|
||||
The Data Plane Development Kit is a set of libraries and drivers for
|
||||
fast packet processing in the user space.
|
||||
|
||||
%package devel
|
||||
Summary: Data Plane Development Kit development files %{summary_tag}
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: %{lname} = %{version}
|
||||
Conflicts: dpdk-any-devel
|
||||
Provides: dpdk-any-devel = %{version}
|
||||
|
||||
%description devel
|
||||
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++
|
||||
Provides: %{lname}-any = %{version}
|
||||
|
||||
%description -n %{lname}
|
||||
This package contains the runtime libraries needed for 3rd party application
|
||||
to use the Data Plane Development Kit.
|
||||
|
||||
%package doc
|
||||
Summary: Data Plane Development Kit API documentation %{summary_tag}
|
||||
Group: System/Libraries
|
||||
Conflicts: dpdk-any-doc
|
||||
Provides: dpdk-any-doc = %{version}
|
||||
BuildArch: noarch
|
||||
|
||||
%description doc
|
||||
API programming documentation for the Data Plane Development Kit.
|
||||
|
||||
%if %{with tools}
|
||||
%package tools
|
||||
Summary: Tools for setting up Data Plane Development Kit environment %{summary_tag}
|
||||
Group: System/Libraries
|
||||
Requires: %{name} = %{version}
|
||||
Requires: findutils
|
||||
Requires: iproute
|
||||
Requires: kmod
|
||||
Requires: pciutils
|
||||
Conflicts: dpdk-any-tools
|
||||
Provides: dpdk-any-tools = %{version}
|
||||
|
||||
%description tools
|
||||
This package contains tools for setting up Data Plane Development Kit environment
|
||||
%endif
|
||||
|
||||
%if %{with examples}
|
||||
%package examples
|
||||
Summary: Data Plane Development Kit example applications %{summary_tag}
|
||||
Group: System/Libraries
|
||||
BuildRequires: libvirt-devel
|
||||
Conflicts: dpdk-any-examples
|
||||
Provides: dpdk-any-examples = %{version}
|
||||
|
||||
%description examples
|
||||
Example applications utilizing the Data Plane Development Kit, such
|
||||
as L2 and L3 forwarding.
|
||||
%endif
|
||||
|
||||
%package kmp
|
||||
Summary: DPDK KNI kernel module %{summary_tag}
|
||||
Group: System/Kernel
|
||||
BuildRequires: %{kernel_module_package_buildreqs}
|
||||
%suse_kernel_module_package -p %{_sourcedir}/preamble pae 64kb
|
||||
|
||||
%description kmp
|
||||
The DPDK Kernel NIC Interface (KNI) allows userspace applications access to the Linux* control plane.
|
||||
|
||||
%define sdkdir %{_datadir}/dpdk
|
||||
%define docdir %{_docdir}/dpdk
|
||||
%define incdir %{_includedir}/dpdk
|
||||
%define pmddir %{_libdir}/dpdk-pmds-%{maj}.%{min}
|
||||
|
||||
%prep
|
||||
# can't use %%{name} because of dpdk-thunderx
|
||||
%setup -n dpdk-stable-%{version}
|
||||
%if 0%{?suse_version} > 1600
|
||||
%autopatch -p1
|
||||
%else
|
||||
# grr, no fs.copyfile() in the old meson in SLE (but it has old enough kernel).
|
||||
%autopatch -p1 -M 99
|
||||
%endif
|
||||
|
||||
# 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"
|
||||
|
||||
%ifarch x86_64
|
||||
export CFLAGS="%{optflags} -U_FORTIFY_SOURCE -msse4"
|
||||
%endif
|
||||
examples="all"
|
||||
for flavor in %{flavors_to_build}; do
|
||||
%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
|
||||
|
||||
%install
|
||||
examples="%{?with_examples:all}"
|
||||
for flavor in %{flavors_to_build}; do
|
||||
%meson_install
|
||||
# Also install the example binaries
|
||||
if [ ! -z "$examples" ]; then
|
||||
for f in %{_vpath_builddir}/examples/dpdk-*; do
|
||||
bn=$(basename "$f")
|
||||
if [ -f "$f" ] ; then
|
||||
install -Dm 0755 ${f} "%{buildroot}%{_bindir}/${bn/dpdk-/dpdk_example_}"
|
||||
patchelf --remove-rpath "%{buildroot}%{_bindir}/${bn/dpdk-/dpdk_example_}"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
examples=""
|
||||
done
|
||||
|
||||
# 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
|
||||
rm -r %{buildroot}/%docdir/dpdk/html/.doctrees
|
||||
|
||||
# driver .so files often depend upon the bus drivers for their connect bus,
|
||||
# e.g. ixgbe depends on librte_bus_pci. This means that the bus drivers need
|
||||
# to be in the library path, so symlink the drivers from the main lib directory
|
||||
# Fix broken symlink created by buildtools/symlink-drivers-solibs.sh
|
||||
for f in %{buildroot}/%{pmddir}/*.so.*; do
|
||||
bn=$(basename ${f})
|
||||
ln -s %{pmddir}/${bn} %{buildroot}%{_libdir}/${bn}
|
||||
done
|
||||
|
||||
%if ! %{with tools}
|
||||
# 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
|
||||
|
||||
# Fix interpreter
|
||||
%python3_fix_shebang
|
||||
%python3_fix_shebang_path %{buildroot}%{_datadir}/%{name}/examples/ipsec-secgw/test/*
|
||||
%python3_fix_shebang_path %{buildroot}%{_datadir}/%{name}/examples/pipeline/examples/*
|
||||
|
||||
# Remove duplicates
|
||||
%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
|
||||
%post -n %{lname} -p /sbin/ldconfig
|
||||
%postun -n %{lname} -p /sbin/ldconfig
|
||||
|
||||
%files
|
||||
%{_bindir}/dpdk-dumpcap
|
||||
%{_bindir}/dpdk-pdump
|
||||
%{_bindir}/dpdk-proc-info
|
||||
%{_bindir}/dpdk-test*
|
||||
|
||||
%files -n %{lname}
|
||||
%license license/gpl-2.0.txt license/lgpl-2.1.txt license/bsd-3-clause.txt
|
||||
%{_libdir}/*.so.*
|
||||
%dir %{pmddir}
|
||||
%{pmddir}/*.so.*
|
||||
|
||||
%files devel
|
||||
#BSD
|
||||
%{incdir}/
|
||||
%{sdkdir}/
|
||||
%{pmddir}/*.so
|
||||
%{_libdir}/*.so
|
||||
%{_libdir}/pkgconfig/libdpdk*.pc
|
||||
%if %{with examples}
|
||||
%exclude %{sdkdir}/examples/
|
||||
%endif
|
||||
|
||||
%files devel-static
|
||||
#BSD
|
||||
%{_libdir}/*.a
|
||||
|
||||
%files doc
|
||||
#BSD
|
||||
%doc %docdir
|
||||
|
||||
%if %{with tools}
|
||||
%files tools
|
||||
%{_sbindir}/dpdk_nic_bind
|
||||
%{_bindir}/dpdk-*.py
|
||||
%endif
|
||||
|
||||
%if %{with examples}
|
||||
%files examples
|
||||
%{_bindir}/dpdk_example_*
|
||||
%doc %{sdkdir}/examples
|
||||
%endif
|
||||
|
||||
%changelog
|
68
kni-fix-build-with-Linux-6.10.patch
Normal file
68
kni-fix-build-with-Linux-6.10.patch
Normal file
@ -0,0 +1,68 @@
|
||||
From: Jiri Slaby <jslaby@suse.cz>
|
||||
Date: Tue, 16 Jul 2024 10:40:26 +0200
|
||||
Subject: kni: fix build with Linux 6.10
|
||||
Patch-mainline: submitted to dev@dpdk.org, <20240716084414.115852-1-jslaby@suse.cz>
|
||||
References: kernel 6.10
|
||||
|
||||
6.10 removed the "support" (it was never supported [1]) of separate
|
||||
source and build dirs for out of tree modules.
|
||||
|
||||
KNI uses "src=" hack for that purpose.
|
||||
|
||||
Instead, copy sources to the build dir and don't rely upon the
|
||||
unsupported...
|
||||
|
||||
Intended esp. for stable/22.11. It should go wherever kni is still in
|
||||
the tree.
|
||||
|
||||
[1] https://lore.kernel.org/all/CAK7LNAQ47bZpE6c6Yoz-jQS78uU611oZwU8bH+7e=p5zSyADJw@mail.gmail.com/
|
||||
|
||||
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
|
||||
---
|
||||
kernel/linux/kni/meson.build | 11 +++++++----
|
||||
1 file changed, 7 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/kernel/linux/kni/meson.build b/kernel/linux/kni/meson.build
|
||||
index 4c90069e..39ca2ade 100644
|
||||
--- a/kernel/linux/kni/meson.build
|
||||
+++ b/kernel/linux/kni/meson.build
|
||||
@@ -11,8 +11,8 @@ if run_cmd.stdout().contains('txqueue') == true
|
||||
kmod_cflags = '-DHAVE_ARG_TX_QUEUE'
|
||||
endif
|
||||
|
||||
-
|
||||
-kni_mkfile = custom_target('rte_kni_makefile',
|
||||
+kni_deps = []
|
||||
+kni_deps += custom_target('rte_kni_makefile',
|
||||
output: 'Makefile',
|
||||
command: ['touch', '@OUTPUT@'])
|
||||
|
||||
@@ -22,12 +22,15 @@ kni_sources = files(
|
||||
'Kbuild',
|
||||
)
|
||||
|
||||
+foreach file : kni_sources
|
||||
+ kni_deps += fs.copyfile(file)
|
||||
+endforeach
|
||||
+
|
||||
custom_target('rte_kni',
|
||||
input: kni_sources,
|
||||
output: 'rte_kni.ko',
|
||||
command: ['make', '-j4', '-C', kernel_build_dir,
|
||||
'M=' + meson.current_build_dir(),
|
||||
- 'src=' + meson.current_source_dir(),
|
||||
' '.join(['MODULE_CFLAGS=', kmod_cflags,'-include '])
|
||||
+ dpdk_source_root + '/config/rte_config.h' +
|
||||
' -I' + dpdk_source_root + '/lib/eal/include' +
|
||||
@@ -35,7 +38,7 @@ custom_target('rte_kni',
|
||||
' -I' + dpdk_build_root +
|
||||
' -I' + meson.current_source_dir(),
|
||||
'modules'] + cross_args,
|
||||
- depends: kni_mkfile,
|
||||
+ depends: kni_deps,
|
||||
install: install,
|
||||
install_dir: kernel_install_dir,
|
||||
build_by_default: get_option('enable_kmods'))
|
||||
--
|
||||
2.45.2
|
||||
|
45
kni-fix-build-with-Linux-6.8.patch
Normal file
45
kni-fix-build-with-Linux-6.8.patch
Normal file
@ -0,0 +1,45 @@
|
||||
From: Jiri Slaby <jslaby@suse.cz>
|
||||
Date: Tue, 12 Mar 2024 09:49:14 +0100
|
||||
Subject: kni: fix build with Linux 6.8
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Git-repo: git://dpdk.org/dpdk-stable
|
||||
Git-commit: 15658afda05f50e69805b891ebb4d2d5c1966d44
|
||||
Patch-mainline: yes
|
||||
References: kernel 6.8
|
||||
|
||||
strlcpy() was removed in commit d26270061ae6 (string: Remove strlcpy()), use
|
||||
strscpy() instead.
|
||||
|
||||
The patches fixes this:
|
||||
kernel/linux/kni/kni_net.c: In function ‘kni_get_drvinfo’:
|
||||
kernel/linux/kni/kni_net.c:835:9: error: implicit declaration of function ‘strlcpy’; did you mean ‘strscpy’?
|
||||
|
||||
Intended esp. for stable/22.11. It should go wherever kni is still in
|
||||
the tree.
|
||||
|
||||
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
|
||||
Acked-by: Luca Boccassi <bluca@debian.org>
|
||||
---
|
||||
kernel/linux/kni/kni_net.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
|
||||
index 779ee345..c115a728 100644
|
||||
--- a/kernel/linux/kni/kni_net.c
|
||||
+++ b/kernel/linux/kni/kni_net.c
|
||||
@@ -832,8 +832,8 @@ static const struct net_device_ops kni_net_netdev_ops = {
|
||||
static void kni_get_drvinfo(struct net_device *dev,
|
||||
struct ethtool_drvinfo *info)
|
||||
{
|
||||
- strlcpy(info->version, KNI_VERSION, sizeof(info->version));
|
||||
- strlcpy(info->driver, "kni", sizeof(info->driver));
|
||||
+ strscpy(info->version, KNI_VERSION, sizeof(info->version));
|
||||
+ strscpy(info->driver, "kni", sizeof(info->driver));
|
||||
}
|
||||
|
||||
static const struct ethtool_ops kni_net_ethtool_ops = {
|
||||
--
|
||||
2.45.2
|
||||
|
Loading…
Reference in New Issue
Block a user