From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2AFE242E46 for ; Tue, 11 Jul 2023 12:09:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1F0754114A; Tue, 11 Jul 2023 12:09:59 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2089.outbound.protection.outlook.com [40.107.220.89]) by mails.dpdk.org (Postfix) with ESMTP id E9DDC4003C; Tue, 11 Jul 2023 12:09:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e9xvxrw1Mt6PLvbDF0gA7023eYH26WkKW1a52LayP+tss48qEW9xYRrDjWIlPphGVzEwqnf2VqzeogNjdZHQNPsFYqjDo7deycDaaZ2bKpASQK46kAHtLAo4MK4AkvGqai3ngwZVUGyy3N1PQcXWU8zbcfm9dPaqiaF3ES8gRFsqjl2fG2qegWSRalK51gi7be9TKERT5K9t+D+hqZGpM1xnfqzybmm0bEdjIlmQf+9Be7xoLExHQM+BQfEtwagLpbMrru4RMIHqhT0vT0S1qAxqpKa4gDu+U8YDU/B9OYydUa+UBTQBPuFoPtGfx6/COtgi5mpKgs/Qxgwz+hvyHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=X9WREfanS5V06Ff1IaJrf7lYRxuzFOrypzzqynmrLHI=; b=UoafDO8WJtVZ1dVaQMXsooPRDnolls8rDDdhg1J2PHOS0kg4B7QZif82RYGkPXGf9KuAzxr+bznfExzR3DTBhTs40MvhLE5tpQceiBj5K5T35VaVoce5zeztcLfdjKorAQ96R9NrKSueAV+A7JcndQj6VBaGzXpbvkyT+UgtYwsujglxl3Igyk7OZIRQ4bhPcJXPkCJTRgTuGvK+LeaBC1rHnQuw+AD+8fq0qngcM9mU2XfrrVsk8Id8QU8KQ1+HMezrdCU7Hbcms5BikjAhXU1cBymsyqR2BO4CjmXN4n6XD2ARAa7Rg39uZXjgOsc4yHBIpOvMGpM2hYiz+WYCag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=X9WREfanS5V06Ff1IaJrf7lYRxuzFOrypzzqynmrLHI=; b=3WjKNG+SyUpFZcG4IzCm5mpw3CExNqObOBxLMTZRzZQXRIZKUI0hC9gF88TCf62pafCD+e4sne9Gb8N6FW9e0A7/1WmIdBkImBZWLs3kMwWZLd6aCU3jlQ/DB+d9Wl/mT1uJf6+Lx6RAzd3jJNnySuCpv1TVUTdXNV1k17fUTSo= Received: from BN9PR03CA0428.namprd03.prod.outlook.com (2603:10b6:408:113::13) by MN2PR12MB4551.namprd12.prod.outlook.com (2603:10b6:208:263::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Tue, 11 Jul 2023 10:09:54 +0000 Received: from BN8NAM11FT049.eop-nam11.prod.protection.outlook.com (2603:10b6:408:113:cafe::43) by BN9PR03CA0428.outlook.office365.com (2603:10b6:408:113::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32 via Frontend Transport; Tue, 11 Jul 2023 10:09:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT049.mail.protection.outlook.com (10.13.177.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6588.20 via Frontend Transport; Tue, 11 Jul 2023 10:09:54 +0000 Received: from telcodpdk.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 11 Jul 2023 05:09:53 -0500 From: Ferruh Yigit To: CC: Thomas Monjalon , David Marchand , Subject: [PATCH] kni: fix build with Linux 6.5 Date: Tue, 11 Jul 2023 11:09:41 +0100 Message-ID: <20230711100941.2082191-1-ferruh.yigit@amd.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT049:EE_|MN2PR12MB4551:EE_ X-MS-Office365-Filtering-Correlation-Id: bdec6927-8096-4a6e-ed0d-08db81f6f921 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OjMBUU/jSwDmvCJa7Jjxj3Xk6vw7fXrJVbZW6NMk1SLvUeAjNicva9ksE6gu2dijsO33mAp7IHsJbhD5GrHQNNBAFaQKerSCCEx/D6cxzkJ+b7lCDgyR7J+XbeP1R5iLpXs+t9dMun2c8QudNvu7AYNNsktsUwecrtSeUICbQzgO5rz0y6IZJm47ll1689678wrZI8/Anlpkv2T12DNE+8Ut2tPxV6Fd0iGqWZKxgYrOgkNDHdBTkcTMTEwvrMnX42PZ7mdmBG/B15NcHY/stIbeTkQQbQtWx/AOoCGJyUg17j+wqc9Gufkiy5vf4/caDnwEhr22jUEX7e8L+EA/xdEKoQOZMXYBNWKrVkRONPXWwqEsUgXMosPK3LpJ0L42lEQi89ipWNkdHONek88xpmfokCTitOeKEJUXHvWuqgDXHbeB9KAtWkBYhJ955VDFDcQUnQeSJt6Zaqfq/EYCqevVCMyNhX66q2Da6tV4H20Cmg9ZDM6EN1c2NK1ncpzpyTRrSWf36v6OfGtNQB2cvjg8hrPOxtqMd47hpXZTEWThYqa19IZD7fgS7WHQv0CluV8YroqAXGQ4wUYHRpVdMgshExawYnbBmvsNyz1g74fR9QSDC3zJEzzmxCYuhTA5YgKhun36ItRGjnlFpaN/Bu5w0RmmCWXNxfYLBeM/UpJFksuuwV7T3rm4YBfYrB3wf0hcVVSW8yEhDD539Dv+5GplkSSA+g/o1zoWLWhJZJJbPSCNSeI+Iw5A5iVP4YaZQslEKdW8kHo3nB0QFOSSyA== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(346002)(136003)(376002)(396003)(451199021)(40470700004)(36840700001)(46966006)(336012)(426003)(36860700001)(41300700001)(1076003)(26005)(47076005)(186003)(16526019)(2616005)(478600001)(81166007)(356005)(82740400003)(54906003)(6666004)(7696005)(40460700003)(4326008)(6916009)(44832011)(40480700001)(70206006)(70586007)(316002)(86362001)(82310400005)(8936002)(5660300002)(8676002)(2906002)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 10:09:54.2245 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bdec6927-8096-4a6e-ed0d-08db81f6f921 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT049.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4551 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org The get_user_pages_remote() API has been modified in Linux kernel v6.5 [1], "struct vm_area_struct **vmas" parameter removed from the API. To fix KNI build with Linux kernel v6.5, version check added around the get_user_pages_remote() API. [1] ca5e863233e8 ("mm/gup: remove vmas parameter from get_user_pages_remote()") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit --- kernel/linux/kni/compat.h | 4 ++++ kernel/linux/kni/kni_dev.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h index 7aa6cd9fca75..8beb67046577 100644 --- a/kernel/linux/kni/compat.h +++ b/kernel/linux/kni/compat.h @@ -151,3 +151,7 @@ RHEL_RELEASE_VERSION(9, 1) <= RHEL_RELEASE_CODE)) #define HAVE_NETIF_RX_NI #endif + +#if KERNEL_VERSION(6, 5, 0) > LINUX_VERSION_CODE +#define HAVE_VMA_IN_GUP +#endif diff --git a/kernel/linux/kni/kni_dev.h b/kernel/linux/kni/kni_dev.h index 21bfb6890e30..975379825b2d 100644 --- a/kernel/linux/kni/kni_dev.h +++ b/kernel/linux/kni/kni_dev.h @@ -107,7 +107,11 @@ static inline phys_addr_t iova_to_phys(struct task_struct *tsk, #ifdef HAVE_TSK_IN_GUP ret = get_user_pages_remote(tsk, tsk->mm, iova, 1, 0, &page, NULL, NULL); #else + #ifdef HAVE_VMA_IN_GUP ret = get_user_pages_remote(tsk->mm, iova, 1, 0, &page, NULL, NULL); + #else + ret = get_user_pages_remote(tsk->mm, iova, 1, 0, &page, NULL); + #endif #endif if (ret < 0) return 0; -- 2.34.1