From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B8C2AA04B1; Wed, 9 Sep 2020 14:02:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ED77F1BF8D; Wed, 9 Sep 2020 14:02:16 +0200 (CEST) Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by dpdk.org (Postfix) with ESMTP id CDBDB255 for ; Wed, 9 Sep 2020 14:02:14 +0200 (CEST) Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 71EBE32ECDA4BD2977B0; Wed, 9 Sep 2020 20:02:13 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Wed, 9 Sep 2020 20:02:04 +0800 From: "Min Hu (Connor)" To: CC: , , , , Date: Wed, 9 Sep 2020 19:59:45 +0800 Message-ID: <1599652785-42385-1-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH] kni: fix build with Linux 5.9 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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) Reviewed-by: Wei Hu (Xavier) --- 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