diff options
Diffstat (limited to 'recipes-extended/dpdk/dpdk/0001-Starting-from-Linux-5.9-get_user_pages_remote-API-do.patch')
-rw-r--r-- | recipes-extended/dpdk/dpdk/0001-Starting-from-Linux-5.9-get_user_pages_remote-API-do.patch | 54 |
1 files changed, 54 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 @@ | |||
1 | From 7e0102a6d29732b92c25ca4793d641ce6c98e95a Mon Sep 17 00:00:00 2001 | ||
2 | From: He Zhe <zhe.he@windriver.com> | ||
3 | Date: Wed, 23 Sep 2020 11:00:03 +0800 | ||
4 | Subject: [PATCH] Starting from Linux 5.9 'get_user_pages_remote()' API doesn't | ||
5 | get 'struct task_struct' parameter: commit 64019a2e467a ("mm/gup: remove | ||
6 | task_struct pointer for all gup code") | ||
7 | |||
8 | The change reflected to the KNI with version check. | ||
9 | |||
10 | Cc: stable@dpdk.org | ||
11 | |||
12 | Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> | ||
13 | |||
14 | Upstream-Status: Backport [https://patches.dpdk.org/patch/75577/] | ||
15 | |||
16 | Signed-off-by: He Zhe <zhe.he@windriver.com> | ||
17 | --- | ||
18 | kernel/linux/kni/compat.h | 4 ++++ | ||
19 | kernel/linux/kni/kni_dev.h | 5 +++++ | ||
20 | 2 files changed, 9 insertions(+) | ||
21 | |||
22 | diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h | ||
23 | index 9ee45dbf6..d515b2766 100644 | ||
24 | --- a/kernel/linux/kni/compat.h | ||
25 | +++ b/kernel/linux/kni/compat.h | ||
26 | @@ -134,3 +134,7 @@ | ||
27 | #if KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE | ||
28 | #define HAVE_TX_TIMEOUT_TXQUEUE | ||
29 | #endif | ||
30 | + | ||
31 | +#if KERNEL_VERSION(5, 9, 0) > LINUX_VERSION_CODE | ||
32 | +#define HAVE_TSK_IN_GUP | ||
33 | +#endif | ||
34 | diff --git a/kernel/linux/kni/kni_dev.h b/kernel/linux/kni/kni_dev.h | ||
35 | index ca5f92a47..c15da311b 100644 | ||
36 | --- a/kernel/linux/kni/kni_dev.h | ||
37 | +++ b/kernel/linux/kni/kni_dev.h | ||
38 | @@ -101,8 +101,13 @@ static inline phys_addr_t iova_to_phys(struct task_struct *tsk, | ||
39 | offset = iova & (PAGE_SIZE - 1); | ||
40 | |||
41 | /* Read one page struct info */ | ||
42 | +#ifdef HAVE_TSK_IN_GUP | ||
43 | ret = get_user_pages_remote(tsk, tsk->mm, iova, 1, | ||
44 | FOLL_TOUCH, &page, NULL, NULL); | ||
45 | +#else | ||
46 | + ret = get_user_pages_remote(tsk->mm, iova, 1, | ||
47 | + FOLL_TOUCH, &page, NULL, NULL); | ||
48 | +#endif | ||
49 | if (ret < 0) | ||
50 | return 0; | ||
51 | |||
52 | -- | ||
53 | 2.17.1 | ||
54 | |||