From aaa8275036d9c3573e915c57fe5e3366385b8b1a Mon Sep 17 00:00:00 2001 From: huangliming Date: Mon, 18 Jan 2021 09:40:19 +0000 Subject: [PATCH 1/2] fix yum update dpdk-tools conflict with dpdk-devel Signed-off-by: huangliming --- dpdk.spec | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dpdk.spec b/dpdk.spec index d6fed94..1a5ec91 100644 --- a/dpdk.spec +++ b/dpdk.spec @@ -1,6 +1,6 @@ Name: dpdk Version: 19.11 -Release: 7 +Release: 8 Packager: packaging@6wind.com URL: http://dpdk.org %global source_version 19.11 @@ -80,7 +80,7 @@ This package contains the pdump tool for capture the dpdk network packets. %patch3 -p1 %patch4 -p1 %patch5 -p1 -%patch6 -p1 +#%patch6 -p1 %patch7 -p1 %patch8 -p1 %patch9 -p1 @@ -155,6 +155,7 @@ strip -g $RPM_BUILD_ROOT/lib/modules/${namer}/extra/dpdk/rte_kni.ko %dir %{_datadir}/dpdk %{_datadir}/dpdk/usertools/*.py %{_datadir}/dpdk/usertools/*.sh +%{_sbindir}/dpdk-devbind /lib/modules/%{kern_devel_ver}/extra/dpdk/* /lib64/librte*.so* @@ -164,7 +165,6 @@ strip -g $RPM_BUILD_ROOT/lib/modules/${namer}/extra/dpdk/rte_kni.ko %{_datadir}/dpdk/buildtools %{_datadir}/dpdk/%{target} %{_datadir}/dpdk/examples -%{_sbindir}/* %{_bindir}/* %{_libdir}/* %dir /usr/include/%{name}-%{version}/ @@ -172,6 +172,8 @@ strip -g $RPM_BUILD_ROOT/lib/modules/${namer}/extra/dpdk/rte_kni.ko %dir /usr/include/dpdk/ /usr/include/dpdk/* +%exclude /usr/bin/dpdk-pdump + %files doc #%doc %{_docdir}/dpdk @@ -187,6 +189,9 @@ strip -g $RPM_BUILD_ROOT/lib/modules/${namer}/extra/dpdk/rte_kni.ko /usr/sbin/depmod %changelog +* Tue Jan 05 2021 huangliming - 19.11-8 +-fix yum update dpdk-tools conflict with dpdk-devel + * Mon Dec 28 2020 huangliming - 19.11-7 -fix CVE-2020-14374 CVE-2020-14375 -- Gitee From 00aa1e89129b484a33298bff98894503082a097e Mon Sep 17 00:00:00 2001 From: huangliming Date: Mon, 18 Jan 2021 11:36:23 +0000 Subject: [PATCH 2/2] merge branch openEuler-20.09 Signed-off-by: huangliming --- ...-SyntaxWarning-when-use-dpdk-pmdinfo.patch | 37 ++++++++++++++ dpdk.spec | 43 +++++++--------- kni-fix-build-with-Linux-5.6.patch | 48 ----------------- v2-kni-fix-build-with-Linux-5.9.patch | 51 ------------------- 4 files changed, 55 insertions(+), 124 deletions(-) create mode 100644 0001-fix-SyntaxWarning-when-use-dpdk-pmdinfo.patch delete mode 100644 kni-fix-build-with-Linux-5.6.patch delete mode 100644 v2-kni-fix-build-with-Linux-5.9.patch diff --git a/0001-fix-SyntaxWarning-when-use-dpdk-pmdinfo.patch b/0001-fix-SyntaxWarning-when-use-dpdk-pmdinfo.patch new file mode 100644 index 0000000..229bdf8 --- /dev/null +++ b/0001-fix-SyntaxWarning-when-use-dpdk-pmdinfo.patch @@ -0,0 +1,37 @@ +From 01a36309d05433defc97c81d27eccd781f1fbae3 Mon Sep 17 00:00:00 2001 +From: hubble_zhu +Date: Fri, 25 Sep 2020 10:14:09 +0800 +Subject: [PATCH] fix SyntaxWarning when use dpdk-pmdinfo + +--- + usertools/dpdk-pmdinfo.py | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/usertools/dpdk-pmdinfo.py b/usertools/dpdk-pmdinfo.py +index 069a3bf..12f2073 100755 +--- a/usertools/dpdk-pmdinfo.py ++++ b/usertools/dpdk-pmdinfo.py +@@ -539,7 +539,7 @@ def scan_for_autoload_pmds(dpdk_path): + return + + (autoload_path, scannedfile) = readelf.search_for_autoload_path() +- if (autoload_path is None or autoload_path is ""): ++ if not autoload_path: + if (raw_output is False): + print("No autoload path configured in %s" % dpdk_path) + return +@@ -561,7 +561,10 @@ def main(stream=None): + + pcifile_default = "./pci.ids" # For unknown OS's assume local file + if platform.system() == 'Linux': +- pcifile_default = "/usr/share/hwdata/pci.ids" ++ # hwdata is the legacy location, misc is supported going forward ++ pcifile_default = "/usr/share/misc/pci.ids" ++ if not os.path.exists(pcifile_default): ++ pcifile_default = "/usr/share/hwdata/pci.ids" + elif platform.system() == 'FreeBSD': + pcifile_default = "/usr/local/share/pciids/pci.ids" + if not os.path.exists(pcifile_default): +-- +2.23.0 + diff --git a/dpdk.spec b/dpdk.spec index 1a5ec91..6f67704 100644 --- a/dpdk.spec +++ b/dpdk.spec @@ -1,23 +1,22 @@ Name: dpdk Version: 19.11 -Release: 8 +Release: 6 Packager: packaging@6wind.com URL: http://dpdk.org %global source_version 19.11 -Source: https://git.dpdk.org/dpdk/snapshot/%{name}-%{version}.tar.xz +Source: %{name}-%{version}.tar.xz Patch0: CVE-2020-10725.patch Patch1: CVE-2020-10722.patch Patch2: CVE-2020-10723.patch Patch3: CVE-2020-10724.patch Patch4: CVE-2020-10726.patch -Patch5: kni-fix-build-with-Linux-5.6.patch -Patch6: v2-kni-fix-build-with-Linux-5.9.patch -Patch7: CVE-2020-14378.patch -Patch8: CVE-2020-14376-CVE-2020-14377.patch -Patch9: fix-pool-allocation.patch -Patch10: CVE-2020-14374.patch -Patch11: CVE-2020-14375.patch +Patch5: 0001-fix-SyntaxWarning-when-use-dpdk-pmdinfo.patch +Patch6: CVE-2020-14378.patch +Patch7: CVE-2020-14376-CVE-2020-14377.patch +Patch8: fix-pool-allocation.patch +Patch9: CVE-2020-14374.patch +Patch10: CVE-2020-14375.patch Summary: Data Plane Development Kit core Group: System Environment/Libraries @@ -80,12 +79,11 @@ This package contains the pdump tool for capture the dpdk network packets. %patch3 -p1 %patch4 -p1 %patch5 -p1 -#%patch6 -p1 +%patch6 -p1 %patch7 -p1 %patch8 -p1 %patch9 -p1 %patch10 -p1 -%patch11 -p1 %build namer=%{kern_devel_ver} @@ -155,7 +153,8 @@ strip -g $RPM_BUILD_ROOT/lib/modules/${namer}/extra/dpdk/rte_kni.ko %dir %{_datadir}/dpdk %{_datadir}/dpdk/usertools/*.py %{_datadir}/dpdk/usertools/*.sh -%{_sbindir}/dpdk-devbind +# test compile error +%{_sbindir}/dpdk-devbin__ /lib/modules/%{kern_devel_ver}/extra/dpdk/* /lib64/librte*.so* @@ -189,26 +188,20 @@ strip -g $RPM_BUILD_ROOT/lib/modules/${namer}/extra/dpdk/rte_kni.ko /usr/sbin/depmod %changelog -* Tue Jan 05 2021 huangliming - 19.11-8 +* Tue Jan 05 2021 huangliming - 19.11-6 -fix yum update dpdk-tools conflict with dpdk-devel -* Mon Dec 28 2020 huangliming - 19.11-7 +* Tue Dec 1 2020 chxssg - 19.11-5 -fix CVE-2020-14374 CVE-2020-14375 -* Wed Nov 25 2020 chxssg - 19.11-6 +* Wed Nov 25 2020 chxssg - 19.11-4 -fix CVE-2020-14376 CVE-2020-14377 CVE-2020-14378 -* Fri Nov 20 2020 seuzw<930zhaowei@163.com> - 19.11-5 --kni: fix build with Linux 5.6 and 5.9 +* Fri Sep 25 2020 hubble_zhu - 19.11-3 +-fix SyntaxWarning when use dpdk-pmdinfo -* Wed Sep 23 2020 hubble_zhu - 19.11-4 --update pyelftools to python3-pyelftools - -* Tue Sep 22 2020 hubble_zhu - 19.11-3 --add requires for dpdk-pmdinfo - -* Thu Sep 3 2020 zhaowei - 19.11-2 --update source URL +* Wed Sep 23 2020 hubble_zhu - 19.11-2 +-Add requires for dpdk-pmdinfo * Wed May 27 2020 chenxiang - 19.11-1 -fix CVE-2020-10722 CVE-2020-10723 CVE-2020-10724 CVE-2020-10725 diff --git a/kni-fix-build-with-Linux-5.6.patch b/kni-fix-build-with-Linux-5.6.patch deleted file mode 100644 index 1f4785a..0000000 --- a/kni-fix-build-with-Linux-5.6.patch +++ /dev/null @@ -1,48 +0,0 @@ -From: Ferruh Yigit -Date: Wed, 12 Feb 2020 17:14:24 +0000 -Message-Id: <20200212171424.695556-1-ferruh.yigit@intel.com> -Subject: [dpdk-dev] [PATCH] kni: fix build with Linux 5.6 - -With the following Linux commit a new parameter 'txqueue' has been added -to 'ndo_tx_timeout' ndo: -commit 0290bd291cc0 ("netdev: pass the stuck queue to the timeout handler") - -The change reflected to the KNI with version check. - -Signed-off-by: Ferruh Yigit -Acked-by: David Marchand ---- - kernel/linux/kni/compat.h | 4 ++++ - kernel/linux/kni/kni_net.c | 5 +++++ - 2 files changed, 9 insertions(+) - -diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h -index 7109474ec..9ee45dbf6 100644 ---- a/kernel/linux/kni/compat.h -+++ b/kernel/linux/kni/compat.h -@@ -130,3 +130,7 @@ - #if KERNEL_VERSION(4, 10, 0) <= LINUX_VERSION_CODE - #define HAVE_IOVA_TO_KVA_MAPPING_SUPPORT - #endif -+ -+#if KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE -+#define HAVE_TX_TIMEOUT_TXQUEUE -+#endif -diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c -index 97fe85be9..c82c881a2 100644 ---- a/kernel/linux/kni/kni_net.c -+++ b/kernel/linux/kni/kni_net.c -@@ -623,8 +623,13 @@ kni_net_rx(struct kni_dev *kni) - /* - * Deal with a transmit timeout. - */ -+#ifdef HAVE_TX_TIMEOUT_TXQUEUE -+static void -+kni_net_tx_timeout(struct net_device *dev, unsigned int txqueue) -+#else - static void - kni_net_tx_timeout(struct net_device *dev) -+#endif - { - pr_debug("Transmit timeout at %ld, latency %ld\n", jiffies, - jiffies - dev_trans_start(dev)); diff --git a/v2-kni-fix-build-with-Linux-5.9.patch b/v2-kni-fix-build-with-Linux-5.9.patch deleted file mode 100644 index b2ac953..0000000 --- a/v2-kni-fix-build-with-Linux-5.9.patch +++ /dev/null @@ -1,51 +0,0 @@ -From: Ferruh Yigit -Date: Mon, 17 Aug 2020 11:32:47 +0100 -Message-Id: <20200817103247.1564204-1-ferruh.yigit@intel.com> -Subject: [dpdk-dev] [PATCH v2] kni: fix build with Linux 5.9 - -Starting from Linux 5.9 'get_user_pages_remote()' API doesn't get -'struct task_struct' parameter: -commit 64019a2e467a ("mm/gup: remove task_struct pointer for all gup code") - -The change reflected to the KNI with version check. - -Signed-off-by: Ferruh Yigit ---- -v2: -* Add stable tag to request backport. ---- - kernel/linux/kni/compat.h | 4 ++++ - kernel/linux/kni/kni_dev.h | 5 +++++ - 2 files changed, 9 insertions(+) - -diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h -index 9ee45dbf6f..d515b27669 100644 ---- a/kernel/linux/kni/compat.h -+++ b/kernel/linux/kni/compat.h -@@ -134,3 +134,7 @@ - #if KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE - #define HAVE_TX_TIMEOUT_TXQUEUE - #endif -+ -+#if KERNEL_VERSION(5, 9, 0) > LINUX_VERSION_CODE -+#define HAVE_TSK_IN_GUP -+#endif -diff --git a/kernel/linux/kni/kni_dev.h b/kernel/linux/kni/kni_dev.h -index ca5f92a47b..c15da311ba 100644 ---- a/kernel/linux/kni/kni_dev.h -+++ b/kernel/linux/kni/kni_dev.h -@@ -101,8 +101,13 @@ static inline phys_addr_t iova_to_phys(struct task_struct *tsk, - offset = iova & (PAGE_SIZE - 1); - - /* 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); -+#else -+ ret = get_user_pages_remote(tsk->mm, iova, 1, -+ FOLL_TOUCH, &page, NULL, NULL); -+#endif - if (ret < 0) - return 0; - - -- Gitee