aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHe Zhe <zhe.he@windriver.com>2020-09-23 11:15:44 +0800
committerAnuj Mittal <anuj.mittal@intel.com>2020-09-24 08:48:45 +0800
commit7a9ee23de79a631127ed5ca3c45e08ec876eda98 (patch)
tree480aa43a71b713a5680225010967cd6606e7a85d
parent25e754eaf1ae438ccd75d1ee991d197321c1028d (diff)
downloadmeta-dpdk-7a9ee23de79a631127ed5ca3c45e08ec876eda98.tar.gz
meta-dpdk-7a9ee23de79a631127ed5ca3c45e08ec876eda98.tar.bz2
meta-dpdk-7a9ee23de79a631127ed5ca3c45e08ec876eda98.zip
dpdk: Backport to fix build failure for kernel v5.9
kernel/linux/kni/kni_dev.h:104:8: error: too many arguments to function 'get_user_pages_remote' 104 | ret = get_user_pages_remote(tsk, tsk->mm, iova, 1, | ^~~~~~~~~~~~~~~~~~~~~ Signed-off-by: He Zhe <zhe.he@windriver.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-rw-r--r--recipes-extended/dpdk/dpdk/0001-Starting-from-Linux-5.9-get_user_pages_remote-API-do.patch54
-rw-r--r--recipes-extended/dpdk/dpdk_19.11.3.bb2
2 files changed, 56 insertions, 0 deletions
diff --git a/recipes-extended/dpdk/dpdk/0001-Starting-from-Linux-5.9-get_user_pages_remote-API-do.patch b/recipes-extended/dpdk/dpdk/0001-Starting-from-Linux-5.9-get_user_pages_remote-API-do.patch
new file mode 100644
index 0000000..ad6fd93
--- /dev/null
+++ b/recipes-extended/dpdk/dpdk/0001-Starting-from-Linux-5.9-get_user_pages_remote-API-do.patch
@@ -0,0 +1,54 @@
+From 7e0102a6d29732b92c25ca4793d641ce6c98e95a Mon Sep 17 00:00:00 2001
+From: He Zhe <zhe.he@windriver.com>
+Date: Wed, 23 Sep 2020 11:00:03 +0800
+Subject: [PATCH] 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.
+
+Cc: stable@dpdk.org
+
+Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
+
+Upstream-Status: Backport [https://patches.dpdk.org/patch/75577/]
+
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+---
+ 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 9ee45dbf6..d515b2766 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 ca5f92a47..c15da311b 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;
+
+--
+2.17.1
+
diff --git a/recipes-extended/dpdk/dpdk_19.11.3.bb b/recipes-extended/dpdk/dpdk_19.11.3.bb
index 842d75d..d950ba7 100644
--- a/recipes-extended/dpdk/dpdk_19.11.3.bb
+++ b/recipes-extended/dpdk/dpdk_19.11.3.bb
@@ -12,6 +12,8 @@ LIC_FILES_CHKSUM = "file://license/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4
file://license/lgpl-2.1.txt;md5=4b54a1fd55a448865a0b32d41598759d \
file://license/bsd-3-clause.txt;md5=0f00d99239d922ffd13cabef83b33444"
+SRC_URI += "file://0001-Starting-from-Linux-5.9-get_user_pages_remote-API-do.patch"
+
do_install_append () {
# Remove the unneeded dir
rm -rf ${D}/${INSTALL_PATH}/${RTE_TARGET}/app