From patchwork Thu Oct 19 08:21:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrisious Haddad X-Patchwork-Id: 13428432 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B544ACDB482 for ; Thu, 19 Oct 2023 08:22:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232846AbjJSIWH (ORCPT ); Thu, 19 Oct 2023 04:22:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235228AbjJSIWF (ORCPT ); Thu, 19 Oct 2023 04:22:05 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02D8211F; Thu, 19 Oct 2023 01:22:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ek+00DtzTGLSaBo3IBMsJedUcwKYfgVd0E2jh9AL3ZgOOk9QGgxpDS1CP4Eo9XAvNVldOnctWHGq1jBnVkfe5Gwco5kskzFvn66KM3pwzfRW9vZ0520848aoTN4TIpPE167EhiKsELOnAWJIL5Irxo809ZYkmO2uVNGjZzqwlGUulDn9C/E5445yB+qBG/xRXTy0ngjQ4pKoaw7/YUqc3V+Noua5mhO4UaccJyQi1cHkziLlzGfvRhH2YxWLHhNzkhcJYWLKR2DvUJUjLa92VMPhBUdjArEjIvifXL6lUj8yuH5k1I9ITAcoXjY3lpQR/gOsjNj4gjFFW17RcBQVnw== 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=QT5cGa1kYFuFJ4qwnSfU9RogM8ZgzHTquc3/GC3tuu8=; b=ktLpj3fR4o+C46UhWdi3wS07oThtzYwVhCfEoeoWv6ZHGm+wwRCMD5CTP01IM01cotFL7zWmeE6+u8cuzG4awTkWFfql92SCEAebwC+WVADVOw3kXaq2Ngd3vUofzziaVk52u4t9v2pDMuMQVeapmVAW+9vojes9+O0YkajiK1Ymb49hOdOSSeFWWBTWMp6/LJ7Z/sAYK29GeFdS752+KMvTW9Lq745hAWP13tLfKhVJ/s2Dei0WS0oyZTaGXTxURp8KzAl27yVM14eCa2aC5L73sd7RriSsurGfwsZ95Z9VoNvtxA2rGwbZqneA6zz9MdqgbA74vN8sKTjVtz7G7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=ziepe.ca smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QT5cGa1kYFuFJ4qwnSfU9RogM8ZgzHTquc3/GC3tuu8=; b=Klb9AIi8WAOH+l97zgKfm5ZegnRE0QzOAK8UBkpkXY1pv/vRpaswb/7IeCBDDdBJrY/6I3HL5ra353pHjs/PmqubICI6nW3+MNMYKtjSyZMi+Kx5TD4ny+BsOTiq0lnaw2tk+dnl1QiDVmPBOQcsQjtKGY0qxGy8axbCE2wrfX2HnweWV6wAdJKYNZ37tO2D1VJ72SXWgTcTnq232BQDbg61MjP2I6KNJdXD4nxrHsXTyyk2tiRynwaOSGxLn3fPGzQFJFpIn+E3j9eFxyLtMIQyTPrSJnxIJf7RFbE4AhOhTL5Ss8GpAg/P4Vry6/NRrTHaffLtRH8N+MSgC8mIJA== Received: from SA9PR13CA0025.namprd13.prod.outlook.com (2603:10b6:806:21::30) by DM6PR12MB4516.namprd12.prod.outlook.com (2603:10b6:5:2ac::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.24; Thu, 19 Oct 2023 08:22:01 +0000 Received: from SA2PEPF00001506.namprd04.prod.outlook.com (2603:10b6:806:21:cafe::91) by SA9PR13CA0025.outlook.office365.com (2603:10b6:806:21::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.8 via Frontend Transport; Thu, 19 Oct 2023 08:22:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SA2PEPF00001506.mail.protection.outlook.com (10.167.242.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.20 via Frontend Transport; Thu, 19 Oct 2023 08:22:01 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 19 Oct 2023 01:21:53 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 19 Oct 2023 01:21:52 -0700 Received: from vdi.nvidia.com (10.127.8.11) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Thu, 19 Oct 2023 01:21:50 -0700 From: Patrisious Haddad To: , , , CC: Patrisious Haddad , , , , , , Subject: [PATCH iproute2-next 1/3] rdma: update uapi headers Date: Thu, 19 Oct 2023 11:21:36 +0300 Message-ID: <20231019082138.18889-2-phaddad@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20231019082138.18889-1-phaddad@nvidia.com> References: <20231019082138.18889-1-phaddad@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001506:EE_|DM6PR12MB4516:EE_ X-MS-Office365-Filtering-Correlation-Id: c7efe724-101b-4eaf-76eb-08dbd07c7876 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oWStwx9QEApwbbEz6dbi2NpIftQ1IX+yaVBK6lHlaMLamZ+bYsEyShryo4s1/mrEP4C9K0J+/6kdUATppTMcBTY2FFeCWnUsQfsUPIB8TYr02Hxhsn69zrK+1nOU4pPKPoSXoPCv0PCHMmQh8uDmqlEe7YVFreHdThIfqfNln63OSsEwhwIfV2eFmmVLJHf30wdLpF0zZxaBz1J3d0yQfUMlUcZihMOmjBXwYI3+g1iotZsJHcE+qwToigvEN+kfOv2anucZ8G4viQ1gLq9r3hZakVKJJlb1Am4FVuu8Io9tg80v7yrGwjtQ95kzWe61voaQIomUWY5i5us1mcYAOVnVwebQFij9JK6GNzYO58LTLyKFihdVPMxGBZKFeVv4Oom87TQjMWaubDf/0nXHgE7GdrFQ6ufwQ+o2Zn0mGS67SiD+9n8m5+cbJ8xpxMEKot3T6Rcg1ytIQNWpLHFKg0bCGsFNKkQ0DsOSgCvDrTKAAlaty+2cxMq2pD/nB8fIAmePb+C80C1n4uiwBUjknUxBADhwTjoIBi2pRBDztOysORdhaH+gC2Z9m9xk23BoqiSCBXBDpFBw9pMv6m6PXlleQZg1PxPVBPDau2VTUs4eQf+66C6CJn5UMc7xjbSOAh9lTzFVw3Iwu3YG8/oi5LV5cfrDCh9i6CW5lnQSQGq3cARRfPs6AcuGUMgn1o3syAuUw81eHAK+usJD3kcEqhwR1UUL15+vmZuzelc9IO/g6omuo099k/V1B3NM9yiu X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(136003)(376002)(39860400002)(346002)(396003)(230922051799003)(186009)(64100799003)(1800799009)(451199024)(82310400011)(46966006)(36840700001)(40470700004)(47076005)(336012)(40480700001)(426003)(356005)(7636003)(36756003)(82740400003)(1076003)(26005)(107886003)(2616005)(8936002)(4326008)(478600001)(70586007)(7696005)(8676002)(110136005)(5660300002)(70206006)(83380400001)(54906003)(2906002)(316002)(40460700003)(6666004)(4744005)(86362001)(15650500001)(41300700001)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2023 08:22:01.7202 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c7efe724-101b-4eaf-76eb-08dbd07c7876 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF00001506.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4516 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Update rdma_netlink.h file upto kernel commit 36ce80759f8c ("RDMA/core: Add support to set privileged qkey parameter") Signed-off-by: Patrisious Haddad Reviewed-by: Michael Guralnik --- rdma/include/uapi/rdma/rdma_netlink.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h index 92c528a0..3a506efa 100644 --- a/rdma/include/uapi/rdma/rdma_netlink.h +++ b/rdma/include/uapi/rdma/rdma_netlink.h @@ -554,6 +554,12 @@ enum rdma_nldev_attr { RDMA_NLDEV_ATTR_STAT_HWCOUNTER_INDEX, /* u32 */ RDMA_NLDEV_ATTR_STAT_HWCOUNTER_DYNAMIC, /* u8 */ + /* + * To enable or disable using privileged_qkey without being + * a privileged user. + */ + RDMA_NLDEV_SYS_ATTR_PRIVILEGED_QKEY_MODE, /* u8 */ + /* * Always the end */ From patchwork Thu Oct 19 08:21:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrisious Haddad X-Patchwork-Id: 13428433 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25FA5CDB482 for ; Thu, 19 Oct 2023 08:22:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235283AbjJSIWN (ORCPT ); Thu, 19 Oct 2023 04:22:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235251AbjJSIWM (ORCPT ); Thu, 19 Oct 2023 04:22:12 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2048.outbound.protection.outlook.com [40.107.243.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90249131; Thu, 19 Oct 2023 01:22:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IcaM/wtFYCWzllwnr9Ep8U+Fl0C8bzQAzhKvRzyA4Dx2SAmq2/P2pd9caVnE2Hu+0VoKBRNmp1TH1mXagsy83h27lS0tbaA2gxAhvhmKCMVhmzJ0Ns1MTHHD0Z5kY0nRBgHDep8sJaQFxZGIsPCPRoejsDWW8vjjMnHcsbR373n0ekbLNLUCT8fHVpuy/n7i1snlohCSX2V4mM9Ul+evfTQbznkdyT7k7jUlqSv5YMtPm5kii9ezgTSe6fF+GmeteT7kurLrMMCr2rSWuMzEEvEX9Cg83GcpxuIXH42yQo57a+/UNIkdzBCSrCGy4P4n4PajOgAQF4cY2kqMYSWISw== 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=o0JcVWYDTrC9zmi4M16KqWb1pcwH1V5/vKkmYydsReA=; b=muCrPZS96+hC+qxTdVL2KkPrKuxgGxbgsUVJJbqZgb65hNVc+U6EiBHUD7F/AfOMA5MmDhvynkiC28sFKRlgGLVp8MOb6mjus/4SV0vIexBWkO2xcUec4vQVXp+ftjg2sTx6Ezek71hhSODMZIoHi27EKp17hiyBt2Qam7n0EAHgR//Xr3fHy9R8GsQ+BPtVPVlw1L5sYFZdgNSTOElZfP01cOoz6nrlx8Uld24PcwE/NwD1Y2Q6E6V8Srkh1+HqG3Q8rlHrMzb8sVnZMHsRHTTPuPVDLbi7vrQU26I0ouko7PEtvLAxFe9UxQ/ohaV8SbrZcn1T6PJfB84LoG3ZJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=ziepe.ca smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o0JcVWYDTrC9zmi4M16KqWb1pcwH1V5/vKkmYydsReA=; b=PkRmtmwVCyowDiZdFL483LpAqNGK8I03oshylN0Mvv/veMjVFmEz8MNUAqoKzj7oYBcjZScxG2rU4A/YzeXE0jvg7Z2qyAROU/TL0AGqKJPddpv8LSYYod8EOdjwBWZWl6tvlfw/8mrgZ+8IPiKoSAaZ2QJtvWkxYRg2Lo+5xdn2779L3PVKjr1IUhTlwpb5/RE48vRhugBqBYXk4k7uQsLrgfdgqFBNVR0CNl9YIoWuIfyefhZUlL4PHB08EVoyXjfkjtHU9fSWmMCH2YICjo0STdXAEWm0DEP+jiGdx8qDWl8NOtNkBu0Gqixp6NoKv8/+pGygzsa/bJnh1PgKkA== Received: from SN4PR0501CA0129.namprd05.prod.outlook.com (2603:10b6:803:42::46) by BL3PR12MB6523.namprd12.prod.outlook.com (2603:10b6:208:3bf::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.34; Thu, 19 Oct 2023 08:22:07 +0000 Received: from SA2PEPF0000150A.namprd04.prod.outlook.com (2603:10b6:803:42:cafe::27) by SN4PR0501CA0129.outlook.office365.com (2603:10b6:803:42::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.7 via Frontend Transport; Thu, 19 Oct 2023 08:22:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SA2PEPF0000150A.mail.protection.outlook.com (10.167.242.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.20 via Frontend Transport; Thu, 19 Oct 2023 08:22:07 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 19 Oct 2023 01:21:56 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 19 Oct 2023 01:21:55 -0700 Received: from vdi.nvidia.com (10.127.8.11) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Thu, 19 Oct 2023 01:21:53 -0700 From: Patrisious Haddad To: , , , CC: Patrisious Haddad , , , , , , Subject: [PATCH iproute2-next 2/3] rdma: Add an option to set privileged QKEY parameter Date: Thu, 19 Oct 2023 11:21:37 +0300 Message-ID: <20231019082138.18889-3-phaddad@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20231019082138.18889-1-phaddad@nvidia.com> References: <20231019082138.18889-1-phaddad@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF0000150A:EE_|BL3PR12MB6523:EE_ X-MS-Office365-Filtering-Correlation-Id: 634f688e-3530-4186-91ad-08dbd07c7bd8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1rRt2V0UsfOAaEer23IhETVXgyWMb9c5QPz3z3JAOYJwQ8IQHqCWzWnHiiISA6WI58ZIwxuoe1WJ8DjDHdknQm+u//x1W/9Q2UsByr9/YgbPsI3lb7AmFtHkZw9zEH8rBhOw3gycy0URet6ph/29UhfAtLv3NB007po7+mjDk6ss/JXtRmE+v+AaG0sJqnR/BOE1nZwiUGg+eYGGRLhy39vSQD+KauAO/inqfeqBzTRr6Q6rYLB/pEx/U/NK6fB0KLkU9AZbQssZ+BD932aslH8vN/MA/EqDps7FdAhy+7vWkWOuvSYSHaG1obEYpTIHk8mPTWabJmavwYskLkNpPtR8kOmEokzEdLaRZ3sno5195ngOi3/8Ht1aJLR5ouVu4gMH3AgmKKivlg0ox9j9J/Hheh73D7+aVe+AgokqCLldAhHB6q+rWKjqVB8T0Ez3ehwzu9xb+GGD0eViTPA+ynZua8FUpWVCHZYmq376Gtx1YyH67554TTfD6ArmyYaRgYt66W4UCsoZ4ULxKk6GNgwfAYmZs2CLJ9lETUyfK4Lj9RYIPQRmwXnWOsfU3xq+pdOQS82CJ9fgsa8bydmxeb+irZ3nfkSbM1m4HlA3OQzH6kUkfKiZTCgF05qP9202URolFNjfV3e1e67JAqcT8THNPfa1Zfce2ekeIzFeEujeJrGAd8K71rtSLlmyiX56dhKKLpjhX6La6uzVNZ4N2JLC05SrFRSDP8AoxxYxHOFYRpiLoB9IesxN1Vap8Vfa X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(346002)(136003)(39860400002)(396003)(376002)(230922051799003)(451199024)(1800799009)(64100799003)(186009)(82310400011)(40470700004)(46966006)(36840700001)(40480700001)(86362001)(47076005)(40460700003)(26005)(70586007)(54906003)(82740400003)(316002)(36756003)(70206006)(110136005)(356005)(7636003)(83380400001)(2616005)(36860700001)(7696005)(8936002)(107886003)(336012)(1076003)(426003)(6666004)(5660300002)(41300700001)(8676002)(2906002)(478600001)(4326008);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2023 08:22:07.3963 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 634f688e-3530-4186-91ad-08dbd07c7bd8 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF0000150A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6523 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Enrich rdmatool with an option to enable or disable privileged QKEY. When enabled, non-privileged users will be allowed to specify a controlled QKEY. By default this parameter is disabled in order to comply with IB spec. According to the IB specification rel-1.6, section 3.5.3: "QKEYs with the most significant bit set are considered controlled QKEYs, and a HCA does not allow a consumer to arbitrarily specify a controlled QKEY." This allows old applications which existed before the kernel commit: 0cadb4db79e1 ("RDMA/uverbs: Restrict usage of privileged QKEYs") they can use privileged QKEYs without being a privileged user to now be able to work again without being privileged granted they turn on this parameter. rdma tool command examples and output. $ rdma system show netns shared privileged-qkey off copy-on-fork on $ rdma system set privileged-qkey on $ rdma system show netns shared privileged-qkey on copy-on-fork on Signed-off-by: Patrisious Haddad Reviewed-by: Michael Guralnik --- rdma/sys.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++-- rdma/utils.c | 1 + 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/rdma/sys.c b/rdma/sys.c index fd785b25..32ca3444 100644 --- a/rdma/sys.c +++ b/rdma/sys.c @@ -17,6 +17,11 @@ static const char *netns_modes_str[] = { "shared", }; +static const char *privileged_qkey_str[] = { + "off", + "on", +}; + static int sys_show_parse_cb(const struct nlmsghdr *nlh, void *data) { struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {}; @@ -40,6 +45,22 @@ static int sys_show_parse_cb(const struct nlmsghdr *nlh, void *data) mode_str); } + if (tb[RDMA_NLDEV_SYS_ATTR_PRIVILEGED_QKEY_MODE]) { + const char *pqkey_str; + uint8_t pqkey_mode; + + pqkey_mode = + mnl_attr_get_u8(tb[RDMA_NLDEV_SYS_ATTR_PRIVILEGED_QKEY_MODE]); + + if (pqkey_mode < ARRAY_SIZE(privileged_qkey_str)) + pqkey_str = privileged_qkey_str[pqkey_mode]; + else + pqkey_str = "unknown"; + + print_color_string(PRINT_ANY, COLOR_NONE, "privileged-qkey", + "privileged-qkey %s ", pqkey_str); + } + if (tb[RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK]) cof = mnl_attr_get_u8(tb[RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK]); @@ -67,8 +88,9 @@ static int sys_show_no_args(struct rd *rd) static int sys_show(struct rd *rd) { const struct rd_cmd cmds[] = { - { NULL, sys_show_no_args}, - { "netns", sys_show_no_args}, + { NULL, sys_show_no_args}, + { "netns", sys_show_no_args}, + { "privileged-qkey", sys_show_no_args}, { 0 } }; @@ -86,6 +108,17 @@ static int sys_set_netns_cmd(struct rd *rd, bool enable) return rd_sendrecv_msg(rd, seq); } +static int sys_set_privileged_qkey_cmd(struct rd *rd, bool enable) +{ + uint32_t seq; + + rd_prepare_msg(rd, RDMA_NLDEV_CMD_SYS_SET, + &seq, (NLM_F_REQUEST | NLM_F_ACK)); + mnl_attr_put_u8(rd->nlh, RDMA_NLDEV_SYS_ATTR_PRIVILEGED_QKEY_MODE, enable); + + return rd_sendrecv_msg(rd, seq); +} + static bool sys_valid_netns_cmd(const char *cmd) { int i; @@ -97,6 +130,17 @@ static bool sys_valid_netns_cmd(const char *cmd) return false; } +static bool sys_valid_privileged_qkey_cmd(const char *cmd) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(privileged_qkey_str); i++) { + if (!strcmp(cmd, privileged_qkey_str[i])) + return true; + } + return false; +} + static int sys_set_netns_args(struct rd *rd) { bool cmd; @@ -111,10 +155,25 @@ static int sys_set_netns_args(struct rd *rd) return sys_set_netns_cmd(rd, cmd); } +static int sys_set_privileged_qkey_args(struct rd *rd) +{ + bool cmd; + + if (rd_no_arg(rd) || !sys_valid_privileged_qkey_cmd(rd_argv(rd))) { + pr_err("valid options are: { on | off }\n"); + return -EINVAL; + } + + cmd = (strcmp(rd_argv(rd), "on") == 0) ? true : false; + + return sys_set_privileged_qkey_cmd(rd, cmd); +} + static int sys_set_help(struct rd *rd) { pr_out("Usage: %s system set [PARAM] value\n", rd->filename); pr_out(" system set netns { shared | exclusive }\n"); + pr_out(" system set privileged-qkey { on | off }\n"); return 0; } @@ -124,6 +183,7 @@ static int sys_set(struct rd *rd) { NULL, sys_set_help }, { "help", sys_set_help }, { "netns", sys_set_netns_args}, + { "privileged-qkey", sys_set_privileged_qkey_args}, { 0 } }; diff --git a/rdma/utils.c b/rdma/utils.c index 8a091c05..09985069 100644 --- a/rdma/utils.c +++ b/rdma/utils.c @@ -473,6 +473,7 @@ static const enum mnl_attr_data_type nldev_policy[RDMA_NLDEV_ATTR_MAX] = { [RDMA_NLDEV_ATTR_STAT_AUTO_MODE_MASK] = MNL_TYPE_U32, [RDMA_NLDEV_ATTR_DEV_DIM] = MNL_TYPE_U8, [RDMA_NLDEV_ATTR_RES_RAW] = MNL_TYPE_BINARY, + [RDMA_NLDEV_SYS_ATTR_PRIVILEGED_QKEY_MODE] = MNL_TYPE_U8, }; static int rd_attr_check(const struct nlattr *attr, int *typep) From patchwork Thu Oct 19 08:21:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrisious Haddad X-Patchwork-Id: 13428434 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9C35CDB465 for ; Thu, 19 Oct 2023 08:22:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344890AbjJSIWS (ORCPT ); Thu, 19 Oct 2023 04:22:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235293AbjJSIWQ (ORCPT ); Thu, 19 Oct 2023 04:22:16 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2073.outbound.protection.outlook.com [40.107.93.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2C4F13D; Thu, 19 Oct 2023 01:22:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KeP46Y6/mBi87lHCNZKVZVKOq/th7Ju+sSLEqOBZjUSD6J+Gn/fr+4u8Jk6fJS2zQjIFYUIuJhyqyq1H3jGzl5gOpB/4zknMvDL7PlYxIraIhHrgEkzSyNsHxT5k0f8qZYJnRr9p5KTvpdNdfpPnuHSZsIjz3hzQ6rFI7ArAmAA+yORPn8k+PyuTn4RQrfKSf2Ao0FxvVFgANYchHMBe5YPB7uf+b82X1AakLsSZWwAr3iJH/RIEbBeAi/vYzHHAc+TJRn/lrT3yfvd7lMDHsnjvEFAHUG9rqrQvnQVkRUC0R8vcuG4tHF02zSuyW/p9DDa2MSOW7vbZKKuUJnbWTw== 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=9c+wlIyjjSBKjSN4BGAK+jh1CNCSmYTfBY11bsOb3Cc=; b=XcH8ZDGwSM9nWchcZrzEAdgRyPx0XCPaeo4yfO/OdwtY0hs5okc4WP+WKCbRqTrg+n/xqvSs8azgqyB/9Qh9rydV85Q0LPypMiW6P4CslCZx3TwTEWrZPhdDPN5X4ss9E5GvEfe1kjKGT6OOxjfoS6fRdCHda5kIpvuGcdDMi0fJiYyBosBnBxTZFpD3ByebtfH4BqhWsUmvQTGogBIeO8GAA9q677v+D7b3+WKbyDMciH1kgmdIe/YF5VU9nikZ7DwQyRNKizfMWKiSGhmug+KtYHIEigZ0eWPH9oTbUkK6pW8ImJ602hk3Tc7wsmIdwZj52HE6ItzqxGJy0PQ4xQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=ziepe.ca smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9c+wlIyjjSBKjSN4BGAK+jh1CNCSmYTfBY11bsOb3Cc=; b=sCzFjDp0rPs2RQv6VdIw02O+wpSCvgAxFRoX8y1q1xHTqZyZJ6zLarwP9gZfXlv6Ii0GmlhPQvhvI3LKTeqrmcIbBWx40hJRFdd/F/TX7aXrO298HzqOR+Yg3M3EfgR0piBywz7bbjaPuJH+T8yn8hveLz+3Xfqz/QwjaEhQTHtWwLdnHYN17CdE4fN87iYd1imrQGUFKwhFIcCJEH4tUU8Ur2Ru3TbRbHS7OYUhhhqfxny00RAuxNChJELu3vOw3BoLkRIgow2oQzYLfM883ug84YOwJrmucz4cvYq7YdtujwrYmZXSI+sgZnUqIBdrx3PeJKChR/0mHEudwXX1Lg== Received: from BL1P222CA0025.NAMP222.PROD.OUTLOOK.COM (2603:10b6:208:2c7::30) by IA1PR12MB8408.namprd12.prod.outlook.com (2603:10b6:208:3db::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.21; Thu, 19 Oct 2023 08:22:12 +0000 Received: from BL6PEPF0001AB56.namprd02.prod.outlook.com (2603:10b6:208:2c7:cafe::f1) by BL1P222CA0025.outlook.office365.com (2603:10b6:208:2c7::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.25 via Frontend Transport; Thu, 19 Oct 2023 08:22:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by BL6PEPF0001AB56.mail.protection.outlook.com (10.167.241.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.22 via Frontend Transport; Thu, 19 Oct 2023 08:22:12 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 19 Oct 2023 01:21:59 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 19 Oct 2023 01:21:58 -0700 Received: from vdi.nvidia.com (10.127.8.11) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Thu, 19 Oct 2023 01:21:56 -0700 From: Patrisious Haddad To: , , , CC: Patrisious Haddad , , , , , , Subject: [PATCH iproute2-next 3/3] rdma: Adjust man page for rdma system set privileged_qkey command Date: Thu, 19 Oct 2023 11:21:38 +0300 Message-ID: <20231019082138.18889-4-phaddad@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20231019082138.18889-1-phaddad@nvidia.com> References: <20231019082138.18889-1-phaddad@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB56:EE_|IA1PR12MB8408:EE_ X-MS-Office365-Filtering-Correlation-Id: 10fa9d37-4c92-44db-6445-08dbd07c7efb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VTm5lnvXUTIx532CrK7oBKy2t4cirUdvEE9piliFY2F2SGi8H8RBcVOAOvbgCFEV1pgnCqhH5HxtcHq0iNj/22pndqNSiaa0o/w3l3T0PTNuJsD9NCwwnjFIcYkIaZT1n80kI35hbcdmk5Bd+vY+ROTJb4OeFoyYN/XFv1Hpj/ehZQjkXZgamd49rV3Eog07djBv2da4KpuQxjVC0/pPi+pj8eQxaLGGpGfG4vjvdKNK4i2TbqD/Ewx6F+Xp0PQ6VSHP78K5liSg2O4VTSk0QjQVIm4vDX+MUKoqTxyCQh8+Bm7RL5JbJ41isTPDzKoaVDDyKqrESdF6c3m+/kRWsXqEe3J+6jw3qxqMqMc8XIGH85o8p9CJt07XmAbnIoPmHIq8ihc3L/gZ70jUt9oKRjB3nNjA29rom79H2sWuGm3JLiny2or959Oil01D8+Lu4dFmv0JoMg/Q3rCbpIR0VmXWH6x52p26Kfwjmn/rYOOvYq9Z/qx64P0hGvR7snv4SfLCOo3rDe00NEQ+ZkiSPJ3CkLcv6B9y2gy+n4Y7gQYLeso7+Svl0r0SWzkWleoSJixwUIIL+kX+AzBi4u/E7p848xomROlLbTVsiOSoR5w2N4ykUlqo5GygXlhSsXWpFBdQFSFGhAgBWR9LSwo4JFtELISFIbiParilG9lnvtJ9Wki2qbkrEyfOK37IFo57Opbk6AMUlwfOBYV2BJxKgiNBi+rjRqUeshYxR/kq7XcKsO9EwlIoUMp4KTrigpPG X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(346002)(136003)(376002)(39860400002)(396003)(230922051799003)(451199024)(82310400011)(186009)(64100799003)(1800799009)(46966006)(40470700004)(36840700001)(40460700003)(47076005)(36860700001)(40480700001)(6666004)(7696005)(41300700001)(2906002)(2616005)(1076003)(336012)(26005)(7636003)(107886003)(356005)(36756003)(426003)(316002)(4326008)(70586007)(8936002)(110136005)(54906003)(70206006)(5660300002)(86362001)(8676002)(478600001)(82740400003)(83380400001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2023 08:22:12.5952 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 10fa9d37-4c92-44db-6445-08dbd07c7efb X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB56.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8408 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Signed-off-by: Patrisious Haddad Reviewed-by: Michael Guralnik --- man/man8/rdma-system.8 | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/man/man8/rdma-system.8 b/man/man8/rdma-system.8 index ab1d89fd..a2914eb8 100644 --- a/man/man8/rdma-system.8 +++ b/man/man8/rdma-system.8 @@ -23,16 +23,16 @@ rdma-system \- RDMA subsystem configuration .ti -8 .B rdma system set -.BR netns -.BR NEWMODE +.BR netns/privileged_qkey +.BR NEWMODE/NEWSTATE .ti -8 .B rdma system help .SH "DESCRIPTION" -.SS rdma system set - set RDMA subsystem network namespace mode +.SS rdma system set - set RDMA subsystem network namespace mode or privileged qkey mode -.SS rdma system show - display RDMA subsystem network namespace mode +.SS rdma system show - display RDMA subsystem network namespace mode and privileged qkey state .PP .I "NEWMODE" @@ -49,12 +49,21 @@ network namespaces is not needed, shared mode can be used. It is preferred to not change the subsystem mode when there is active RDMA traffic running, even though it is supported. +.PP +.I "NEWSTATE" +- specifies the new state of the privileged_qkey parameter. Either enabled or disabled. +Whereas this decides whether a non-privileged user is allowed to specify a controlled +QKEY or not, since such QKEYS are considered privileged. + +When this parameter is enabled, non-privileged users will be allowed to +specify a controlled QKEY. .SH "EXAMPLES" .PP rdma system show .RS 4 -Shows the state of RDMA subsystem network namespace mode on the system. +Shows the state of RDMA subsystem network namespace mode on the system and +the state of privileged qkey parameter. .RE .PP rdma system set netns exclusive @@ -69,6 +78,19 @@ Sets the RDMA subsystem in network namespace shared mode. In this mode RDMA devi are shared among network namespaces. .RE .PP +.PP +rdma system set privileged_qkey enabled +.RS 4 +Sets the privileged_qkey parameter to enabled. In this state non-privileged user +is allowed to specify a controlled QKEY. +.RE +.PP +rdma system set privileged_qkey disabled +.RS 4 +Sets the privileged_qkey parameter to disabled. In this state non-privileged user +is *not* allowed to specify a controlled QKEY. +.RE +.PP .SH SEE ALSO .BR rdma (8),