DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: <dev@dpdk.org>
Cc: <thomas@monjalon.net>, <arybchenko@solarflare.com>,
	<ferruh.yigit@intel.com>, <linuxarm@huawei.com>,
	<vattunuru@marvell.com>
Subject: [dpdk-dev] [PATCH] kni: fix build with Linux 5.9
Date: Wed, 9 Sep 2020 19:59:45 +0800	[thread overview]
Message-ID: <1599652785-42385-1-git-send-email-humin29@huawei.com> (raw)

Build error seen with Linux kernel 5.9.

Build error:
kernel/linux/kni/kni_dev.h:104:30:
	error: passing argument 1 of ‘get_user_pages_remote’ from
	incompatible pointer type [-Werror=incompatible-pointer-types]
	ret = get_user_pages_remote(tsk, tsk->mm, iova, 1,

get_user_pages_remote() is changed in Linux kernel version 5.9 and
remove a parameter, struct task_struct *tsk:
Linux Commit 64019a2e467a ("mm/gup: remove task_struct pointer
for all gup code")

get_user_pages_remote() parameter updated with compile time Linux
kernel version check.

Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 kernel/linux/kni/kni_dev.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/linux/kni/kni_dev.h b/kernel/linux/kni/kni_dev.h
index ca5f92a..192c3d9 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 */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
+	ret = get_user_pages_remote(tsk->mm, iova, 1,
+				    FOLL_TOUCH, &page, NULL, NULL);
+#else
 	ret = get_user_pages_remote(tsk, tsk->mm, iova, 1,
 				    FOLL_TOUCH, &page, NULL, NULL);
+#endif /* >= 5.9.0 */
 	if (ret < 0)
 		return 0;
 
-- 
2.7.4


             reply	other threads:[~2020-09-09 12:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09 11:59 Min Hu (Connor) [this message]
2020-09-09 12:53 ` Ferruh Yigit
  -- strict thread matches above, loose matches on Subject: below --
2020-08-17 10:30 Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1599652785-42385-1-git-send-email-humin29@huawei.com \
    --to=humin29@huawei.com \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=linuxarm@huawei.com \
    --cc=thomas@monjalon.net \
    --cc=vattunuru@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).