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 002F0A0351; Mon, 17 Aug 2020 12:32:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1608A1C11B; Mon, 17 Aug 2020 12:32:54 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 14D831C0BC; Mon, 17 Aug 2020 12:32:51 +0200 (CEST) IronPort-SDR: pAkJ/xqJZ6FM60VMEvG7OAPu2yStfPSJdG9DS+2FywECVzfWHlxVHxPDrujagdOrX9NQpZZZwr 7miyX2CcAusQ== X-IronPort-AV: E=McAfee;i="6000,8403,9715"; a="152077323" X-IronPort-AV: E=Sophos;i="5.76,322,1592895600"; d="scan'208";a="152077323" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2020 03:32:50 -0700 IronPort-SDR: O7TgtInTVAqZL0CWFA+h2j6RNzSZekWqiDrGjRd58kgcM87iv1u+t2ImdIgkQjNkX1clmrmt7L Vzvq2/zDYHDA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,322,1592895600"; d="scan'208";a="296445626" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by orsmga006.jf.intel.com with ESMTP; 17 Aug 2020 03:32:49 -0700 From: Ferruh Yigit To: dev@dpdk.org Cc: Ferruh Yigit , stable@dpdk.org Date: Mon, 17 Aug 2020 11:32:47 +0100 Message-Id: <20200817103247.1564204-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200817103051.1552870-1-ferruh.yigit@intel.com> References: <20200817103051.1552870-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] 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" 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 --- 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; -- 2.25.4