From patchwork Mon Oct 23 11:22:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrisious Haddad X-Patchwork-Id: 13432764 X-Patchwork-Delegate: dsahern@gmail.com Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AEAE8156C2 for ; Mon, 23 Oct 2023 11:22:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="tCKADiI3" Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2040.outbound.protection.outlook.com [40.107.94.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AD87DC; Mon, 23 Oct 2023 04:22:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M5y4tlGsg/+yLFzwVqrSiOTWJmFH+S019+ng2VT8bZ/y/tHyMK3qeanO8KrfaF05J3hzNjweFb5hwXmqJkMAAoUsyx8PEhLlDlYlQVTjhUmB8be4HYtQN5o2nRCUfWggfxV2Hkxb2RgPQ0Iq6/ip1U2qjBvNZ2ULEzpfGgCsdKBnHAYknJN75Jwvi7BbuQAGj36likPqMoUsGVA6N7kpyVy3a33N33LWoyxReeZs/4TkFElNR41m/F5nUTHsB14G9goUA3VUSXNLg9F540+g+53mHVapUjAxpmGdLgt2JUVDaDLVM9ydfpdzvwVLSm4vBFolQb4SEka4z5+DE1NyIA== 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=ib/rqb4Tcb8K3EJyLIRENzXbjhqkuzifngSNkbSQgDrH97CeqOLVx6X8gEfuf06nex/6gjcVqGHlT/D+JdlFzVAwHCaUWROdVHe/R8tSZvfqEfbKj7OKh4fFgFrJDyogrEuk33OrtOkKUNJfk9eVbknIdnXZ/qpW/EKN5im+KR75WlVWbmkU7zus//m45x10szDz9YX72N7yos/SJBTJ4jO6nMDOwycEwrYozxOPA9meQfY7RTiUEoAxpg6TBBDCIK8CuyAlI4c974vq7ekKW4K1ZixY8kHdL8rBRs80zbyUKRIUSwMchNCC3ecRf/vBkPVP+WZgKHdKUxrpiDATdA== 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=tCKADiI3PailqbfxRil4q8gNjzrVg9LOJt6h8C1rLqsFCzqzYMXy3u2pUtEcx+UYsBXgKzw/550gogcXMNSa0F/I5zqdviaBgel4iDj1nElbYgoCZlafvZvPO3mTQK9YzAjLS5NrrbXIkxdiZ6OhZnLGKewXRPzRE5U0PmD6Vc9d/P0wv5yz04rMBrAMSfju3E3NohvxQa0GJwIfbPbgPB2I5wQrQp2fkqsLSDJVCNIgfHgJMIkfCmAAU0l/DJ4GorAA8LzDFJ+bgzPv1rJrt9CSjb20bEE5eG4Aeew5KMAcjrG4dx6FzdglI3hTTqXRENXkx8Wsh7WdI5+xBcGjYQ== Received: from MN2PR22CA0002.namprd22.prod.outlook.com (2603:10b6:208:238::7) by MN6PR12MB8543.namprd12.prod.outlook.com (2603:10b6:208:47b::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.24; Mon, 23 Oct 2023 11:22:45 +0000 Received: from MN1PEPF0000ECDA.namprd02.prod.outlook.com (2603:10b6:208:238:cafe::eb) by MN2PR22CA0002.outlook.office365.com (2603:10b6:208:238::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.33 via Frontend Transport; Mon, 23 Oct 2023 11:22:45 +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 MN1PEPF0000ECDA.mail.protection.outlook.com (10.167.242.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.15 via Frontend Transport; Mon, 23 Oct 2023 11:22:45 +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; Mon, 23 Oct 2023 04:22:29 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) 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; Mon, 23 Oct 2023 04:22:29 -0700 Received: from vdi.nvidia.com (10.127.8.11) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Mon, 23 Oct 2023 04:22:26 -0700 From: Patrisious Haddad To: , , , CC: Patrisious Haddad , , , , , , Subject: [PATCH v2 iproute2-next 1/3] rdma: update uapi headers Date: Mon, 23 Oct 2023 14:22:15 +0300 Message-ID: <20231023112217.3439-2-phaddad@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20231023112217.3439-1-phaddad@nvidia.com> References: <20231023112217.3439-1-phaddad@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECDA:EE_|MN6PR12MB8543:EE_ X-MS-Office365-Filtering-Correlation-Id: 85e122a1-3db8-40db-e804-08dbd3ba6185 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NzCAF6bI08tlsAP2dUZDrdAKsplzs48XevEnSzLZfLaThYoVJGGl3F7Pp61qf6IGxV9SksI2iFELL7/hPAL6ZuyJRdbLWjD5TldqDnV506GCVGIM2MVd1wUVo6YHf/ibZhnhTpZWtKclCCRgIU1bX5rcM/y4bXemP6AVM0rerwOgDlMeRYo+4+VNSoGpkmsPwtx66w3Djwq6V2EUUimliwB/IU2wrMJHvONyYJVWHNw30GwPcsiSEni1GQ4awbpid/VB7Aqcd7BU4qSQV1Z4wtfmnNJJVauRJ8Jl80g9olf9RNQ5GhhtsEQPqIoogDpd5hagpzi3KopQw4FmafOjFdf2bH0DUDL/eWvzoSupkK8nOcrd7YvcJ5FfhEZl+9CIEgdLCqIRfzAmcxwTZau3zCLDRYS+unWZ+NamCwCdOwyIzCI6pv6x8oMWHsLogRFjr2AMhhKXsgCQDpU/2N7O96IT9NI75/kfab1PPrcvvkyL4/LXNgDku7RNu6xb4pqZJNW4ZPKMbUFCvmPqbhYw/jvS1VFz9UKUKyEKwM+Q7XbS+8LgLyHDkUHVUMZ9sSVWiy4Y7KOCL1EORK8fgo7EvALalSFeu4W3Qw3kHPtRWAx+sBIKz/k9KbZO4SpW5uLrTYFLMGRg06Br+3Xfa3HkfnPJyzHVFs6KIfzlJt6L85QsyLndTkvk3EExMv0KCmzHFCME8JrdehZNDmWC1s3Npg3rIUr/MtjImTZjKB9rIrAAdUJ8Z3Bqfq7hIbcVz1tn 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)(396003)(376002)(39860400002)(136003)(346002)(230922051799003)(82310400011)(1800799009)(64100799003)(186009)(451199024)(36840700001)(46966006)(40470700004)(40480700001)(8936002)(41300700001)(356005)(40460700003)(82740400003)(7636003)(426003)(1076003)(2616005)(336012)(107886003)(478600001)(8676002)(70206006)(86362001)(4326008)(2906002)(15650500001)(4744005)(316002)(36756003)(70586007)(54906003)(110136005)(5660300002)(6666004)(7696005)(26005)(36860700001)(47076005)(83380400001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2023 11:22:45.4725 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 85e122a1-3db8-40db-e804-08dbd3ba6185 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: MN1PEPF0000ECDA.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR12MB8543 X-Patchwork-Delegate: dsahern@gmail.com 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 Mon Oct 23 11:22:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrisious Haddad X-Patchwork-Id: 13432765 X-Patchwork-Delegate: dsahern@gmail.com Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7883515AD9 for ; Mon, 23 Oct 2023 11:22:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="tCzxT2CY" Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2042.outbound.protection.outlook.com [40.107.94.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C55F5C1; Mon, 23 Oct 2023 04:22:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i8yM1vFZiCtW91GqMecub3Xb2fwusJilQDGdab/D1ob0VYZCWag3YkFBi9tFyXA7I41S2tej4b77q0LZ8Wxi/aO5vmxFRoS9/NNTeu0HTHgV0soohiEsKEqPDWLM3nqsOcce0FsI3WZMfcvoKSHhN1g0ZCqkEsYjLDn1L3p2mCjOp0EBI85kFhZ01JldiP8HLfvGgkuCUl/M4XWh8StJD+OI5Y3McaVWrSSDgNymHku5e6wL0gVY1iHUb1stAoM4nBMqrt22UAUjbSxLi/Q5kN/QfNbZ9WJzKiYF9nR9YakWf4+tjKvKVlwjW90/xTpBRkObxmHa6qAgldOFHmRz9Q== 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=ng4jSeCnrCkMrkdGCTowupl+jWtncI/eOWAiQ+2tss0=; b=BiT3k0IC/lvXKLdWQdvV11O1F+jSs+Ho4rV0LXm+eFeR56TyZsEw1g3iC8Sbj6fthrfvdrpH89EdSA1etH5fbLQe3gUSOV7vdKjsegKRylyMULQn10anl4MUKRElD07luQrRYpGKr70tmtjcfgZLg06MZTM2BOG7INt+sl0td5NcHqE0YaF328g5tFWfS2Ha++972XiIluxm34av+DHgL6huzLzOQ0KhT0d73fVL6eUyUwcaHHYbAL7BY19YC3SLQ8cops//c4qQ2Q87mudbh19uFaoY/+AmtCIfSjSgBOzwcFt+5Fb5lLZ61nQ9Vh/kmrd9eiI5DRF37E65P7ecSA== 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=ng4jSeCnrCkMrkdGCTowupl+jWtncI/eOWAiQ+2tss0=; b=tCzxT2CYlIelXYt4fDkrMLzV5tC9wtirxyS6ZUn+RA32sJQZF9YMosTVs/SNS58kA373hHR98FM88LHeeU1z3pIrSn76b2bHdBXiKlGGwWW1j6whyph2JoS4qBacoe+YnGNMugjKGguh5ofzEbPmcUiS0gzIluAOjIPePE9aKoGnDNXaiTWTmTMku5pH6Odt0FVyDHNgougq2QuJTSZ4Un6Sx/6uq+U8IokEiPf7Psqcy3m64+B7gdqMQVLV8h+Kl8XZi11nrhRur4bhHEd8OLXOpIGpJCR+/DNeAE2UzgQESJElApN28qjFBmHUaQakuNWB3FnfR0oqy6d/A4t5Gg== Received: from MW4PR03CA0102.namprd03.prod.outlook.com (2603:10b6:303:b7::17) by MW3PR12MB4442.namprd12.prod.outlook.com (2603:10b6:303:55::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.33; Mon, 23 Oct 2023 11:22:50 +0000 Received: from CO1PEPF000044F6.namprd21.prod.outlook.com (2603:10b6:303:b7:cafe::93) by MW4PR03CA0102.outlook.office365.com (2603:10b6:303:b7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.33 via Frontend Transport; Mon, 23 Oct 2023 11:22:50 +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 CO1PEPF000044F6.mail.protection.outlook.com (10.167.241.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.0 via Frontend Transport; Mon, 23 Oct 2023 11:22:49 +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; Mon, 23 Oct 2023 04:22:37 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) 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; Mon, 23 Oct 2023 04:22:32 -0700 Received: from vdi.nvidia.com (10.127.8.11) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Mon, 23 Oct 2023 04:22:29 -0700 From: Patrisious Haddad To: , , , CC: Patrisious Haddad , , , , , , Subject: [PATCH v2 iproute2-next 2/3] rdma: Add an option to set privileged QKEY parameter Date: Mon, 23 Oct 2023 14:22:16 +0300 Message-ID: <20231023112217.3439-3-phaddad@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20231023112217.3439-1-phaddad@nvidia.com> References: <20231023112217.3439-1-phaddad@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044F6:EE_|MW3PR12MB4442:EE_ X-MS-Office365-Filtering-Correlation-Id: aab064c2-2b63-4693-932c-08dbd3ba6422 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: L+fNEKv2VjI11ViCcGjb4I4wQ3N1y8mcst7e+L20DlLW+EuCCbPto+5E6z8vyje94YyP02Hz4HfgER7PSRDwEPzXWfTvwHoSWOETNJWULKte1s2PQcc1Hw4Md8FwigXag7a/J4WCUpMzep904nnx90mWNHJahiNYY7wG9uwTp3/5RnxWoabb2sHWtLlMvH7qx5olPjUM9lt5QKxbLYKvDOeBEgqlDDklsyk/v3tZV7KmZlRn+FumVgRdGJBazsDsEsKdZaS+r2ql/vXCCO+XviPbTwtRWiyIplt6/nzMlUho2ZKb5eGjPTLFdmruHBbPheMoE9v5rOCtratOs3TyyNjUpyIZeTk1H7CZCA82fueLBjflrkYxkq6NLz2c8YzmiTzkZw64d7k2jkM1aT0olvQbyufqRLw/33qsIJ2zCz1+1Qjc7KCREi+LxULwxeVlGU0XfSuiXSW+HALvDDkMX+iNUaGIJpjsFhDZrIvH73s1q/B7nNTKOTa8EyRNDesAlQqjf+WEWmxiM7/zp9ivpZjrTD1S8SblUH07MBW2tcnkPe/lNdsoixBDKqhIw38tqS9WMUBZ0LCHF4JafWrhT29h8WvsH+FrOrXXtxH6VlepChI/BWYXBr+jKVOsVnIYx5ZXcaoAPcqEN848b2D58jzijjpaCrYjfYTck+V5T2Pu59dn9Z/T2haR/rkqXWQmk7D1pDKdZ82W15gM21wTbytuLNQNSR1/WydPp2j8FSGPuoOQItK8hOciLC42OKw3 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)(396003)(39860400002)(376002)(136003)(230922051799003)(1800799009)(186009)(451199024)(82310400011)(64100799003)(46966006)(40470700004)(36840700001)(2906002)(41300700001)(110136005)(356005)(316002)(70586007)(54906003)(2616005)(82740400003)(70206006)(7696005)(7636003)(107886003)(1076003)(6666004)(478600001)(40480700001)(47076005)(426003)(336012)(83380400001)(40460700003)(36756003)(86362001)(5660300002)(4326008)(8936002)(8676002)(36860700001)(26005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2023 11:22:49.8859 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aab064c2-2b63-4693-932c-08dbd3ba6422 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: CO1PEPF000044F6.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4442 X-Patchwork-Delegate: dsahern@gmail.com 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 Reviewed-by: Petr Machata --- rdma/sys.c | 46 ++++++++++++++++++++++++++++++++++++++++++++-- rdma/utils.c | 1 + 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/rdma/sys.c b/rdma/sys.c index fd785b25..db34cb41 100644 --- a/rdma/sys.c +++ b/rdma/sys.c @@ -40,6 +40,17 @@ static int sys_show_parse_cb(const struct nlmsghdr *nlh, void *data) mode_str); } + if (tb[RDMA_NLDEV_SYS_ATTR_PRIVILEGED_QKEY_MODE]) { + uint8_t pqkey_mode; + + pqkey_mode = + mnl_attr_get_u8(tb[RDMA_NLDEV_SYS_ATTR_PRIVILEGED_QKEY_MODE]); + + print_color_on_off(PRINT_ANY, COLOR_NONE, "privileged-qkey", + "privileged-qkey %s ", pqkey_mode); + + } + if (tb[RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK]) cof = mnl_attr_get_u8(tb[RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK]); @@ -67,8 +78,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 +98,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; @@ -111,10 +134,28 @@ 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; + int ret; + + if (rd_no_arg(rd)) { + pr_err("valid options are: { on | off }\n"); + return -EINVAL; + } + + cmd = parse_on_off("privileged-qkey", rd_argv(rd), &ret); + if (ret) + return -EINVAL; + + 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 +165,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 Mon Oct 23 11:22:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrisious Haddad X-Patchwork-Id: 13432766 X-Patchwork-Delegate: dsahern@gmail.com Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 26B747FE for ; Mon, 23 Oct 2023 11:23:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="EY25mp0F" Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2040.outbound.protection.outlook.com [40.107.244.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C30C2D6E; Mon, 23 Oct 2023 04:22:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z7V58lLrTUOvtohS+GwXoKt02wmrnYdujZVtxrnCxbNKTqc4zceKv0S9vlfBsYPYIjV74E+DIOwxhVGNsv7lZ3424tfgigZ0HHMJpCc1ojmUi97/K7Aesgf4AAjGeom1sG6zdkJS7Tyv5hRGzQz/G9T5shRKfV5UgcAC9tPHCd5qf9QrwWefQCYXr+AbYR3sqHdBG9Ubu9LN877oZ1Hslcvkn6vsxSwtpv4on8T4TZnetHQjtrcqQUIlJWOCdvSl4yBFFls5/e0o7SI5gbZIOAeYiwSrbYKfqTxY9hnkSpcrtvo3I8mm5mj7y5kvB0yqdemswYAsD8e85gFlJ9stDA== 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=gdu6ukU/p3J83qIYio5T1dhI0hEj5AzBKXK0/9r8ZNwuTB9RpPonm1v+MpBG1DOJ9xsH3PIm3sDqnjChXUylJiXSeWnhu/akOKyuT09ykJWHmMBdnrRHLgG9/ntX8akO4iv2uvam61SlaIQdLgep618ymMzvqM8E19A5CLypWo/VL4qC0BvFxlQqf7ZYyUbIo3Bo5XE+2PXnCphBmXxWTfjEodl7qHzRWF8WSVxnQDZcYTen7A76tX2g1kerZfJQ2wJuXWBjZ0FlKVGDnqa37qWJouYwonHM+UcCZKhoetgvIotMFpKacGujKpkRU2Tatqr5OJMAnDKD2k6l2bbKvw== 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=9c+wlIyjjSBKjSN4BGAK+jh1CNCSmYTfBY11bsOb3Cc=; b=EY25mp0FFWvSjyxlzFYZoArEVtTGSiCmNgcWR4w66DfEOP7iK2NKGhFDP3s9Gbq/7lGEEiyabeiVvKiiEnjNmYQyw2+sa8LrWQewJeYVpECYCcB8GdqHXggkcBIfJaQuSRFcUwVr8pXxgd/LNWrbahGpTcTg2+Ok/a2Tzc5JBut+mok0TZhluOGkLwCXt7eTM3LNa4JeCl8B0/jOynzs1hztjBomGPW+mNfVWDSTQXSDXPa6aQn0qoLDWIWwCUV9PuAOKLWCr2+2LoXdW7qal4cT8YyHIZfMmrdmOs5PqIa6Y04VSHvoJ7b0iyoUiwUrFJ/P6Hj3ry2zwnN6XhlnNg== Received: from MN2PR04CA0036.namprd04.prod.outlook.com (2603:10b6:208:d4::49) by CH2PR12MB4956.namprd12.prod.outlook.com (2603:10b6:610:69::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.33; Mon, 23 Oct 2023 11:22:55 +0000 Received: from MN1PEPF0000ECDB.namprd02.prod.outlook.com (2603:10b6:208:d4:cafe::25) by MN2PR04CA0036.outlook.office365.com (2603:10b6:208:d4::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.33 via Frontend Transport; Mon, 23 Oct 2023 11:22:55 +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 MN1PEPF0000ECDB.mail.protection.outlook.com (10.167.242.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.15 via Frontend Transport; Mon, 23 Oct 2023 11:22:55 +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; Mon, 23 Oct 2023 04:22:40 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) 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; Mon, 23 Oct 2023 04:22:39 -0700 Received: from vdi.nvidia.com (10.127.8.11) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Mon, 23 Oct 2023 04:22:37 -0700 From: Patrisious Haddad To: , , , CC: Patrisious Haddad , , , , , , Subject: [PATCH v2 iproute2-next 3/3] rdma: Adjust man page for rdma system set privileged_qkey command Date: Mon, 23 Oct 2023 14:22:17 +0300 Message-ID: <20231023112217.3439-4-phaddad@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20231023112217.3439-1-phaddad@nvidia.com> References: <20231023112217.3439-1-phaddad@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECDB:EE_|CH2PR12MB4956:EE_ X-MS-Office365-Filtering-Correlation-Id: 4e0ba71c-1c44-41cf-abe7-08dbd3ba6767 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gFEwYsvHeKBHlQfaiGYDUAo5iQdjPFWTNmElupRZjbcUxeJJ6G5UL7Xr4njqWwoImrFHwVTWb000ZusDGRA86vDyE9Tl6PAON3cE/+f4miL+tDLAd9Zfx8eE/PGiZs1U6fjHi/8U3ue9mXMUhEG+gX+89DivRxEpsDOOGJStMmL3IhzlII8l0yqfBtNWxzIXQUQRtIivOsI7oMp2+/ZuWojkBNtyexIz3h2Ug2ne6KXW/93uET77gvt1OsHQ8NMBPyxE6n9GbqNydVyzZS1rkO5bR/oj21VRiTAfVFeZZRpbx2jwrxuajh/piVl3V76a+ps74fLGZgFWDKEXuphVnxZVhx4T0+Ffn5rzU9usAHvt8lFt/fmAMgQWxs61dl368J13uDYwG4Quc8wGjI0GoPQ/j58kvcsMBojolY52WqUYB0aWBYquiuPmph7u9lIqmPcopagDOVO/qpgvUKo+W6ftok/X6S+mak6CC0WG99WOntLJscdpHqZtdoFC/BHznjfjERWYqb+YlAoJqxzF4L5gU14LDe2fEJCOg75gnQvwopd6/JTdRrYhOmUT1kDtrpK2FCrOHSaq5t3lVsk1B2SG8sRFpHfW31rm3k0saTEpb9RbK7O+KzyOK5ZI/vpYIoVv6CanOXFuyodWx3T+PpdtZe82F0lQj2WaKKS1EQ7EQgWT9/pHT6R4O/UiHqKImVaEOPCPuPLa6nPTlTCAZk76sDwBBaP2U6qQ7Mhd94Bat+NpUxz2MEGifB1GC09l 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)(396003)(376002)(136003)(39860400002)(230922051799003)(1800799009)(451199024)(82310400011)(186009)(64100799003)(36840700001)(40470700004)(46966006)(36860700001)(2906002)(41300700001)(316002)(70206006)(82740400003)(54906003)(70586007)(2616005)(1076003)(110136005)(7636003)(107886003)(6666004)(7696005)(478600001)(356005)(40480700001)(47076005)(426003)(336012)(83380400001)(40460700003)(36756003)(86362001)(5660300002)(4326008)(8936002)(8676002)(26005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2023 11:22:55.3407 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4e0ba71c-1c44-41cf-abe7-08dbd3ba6767 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: MN1PEPF0000ECDB.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4956 X-Patchwork-Delegate: dsahern@gmail.com 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),