From patchwork Mon Jul 8 08:00:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13726265 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2084.outbound.protection.outlook.com [40.107.223.84]) (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 7AB2025634 for ; Mon, 8 Jul 2024 08:01:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425711; cv=fail; b=l2Hds/wLlI9af/Ig2dPCiCqZ1JjzEaaYlgPHYl9J3hkoiR2/5f0OSf6Br6BGH9U0eZyUPlDYW+qM9mZJaJCphn2bopBdRV/rk+lj78Zbsd2VcVPGx9QvM/JrN5tCzwGpZ1FXChFWBUlFH/IPy3/zwOvV/hTYy11Ehg8DtdrYvwY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425711; c=relaxed/simple; bh=AnhjgvGIV82k24KRmrNwKdWUz1xIsA9OC2t7P6HGyWc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=o9vghe9qUD4gyoD8u9P/CbwVb6qxnwZULl3rjUdWMc0Ag8k0GZuHLioHO8Hz3VHXkWQCh6RAovyaAtkj3+GXhX4vyKOvi7Wwz7eoDVYkKWEwef+aoeRAMZtvkXJJ40pMnAiLM2Zx4ro6fy/e57lfJZVROPEsN/DljogogpxRSpA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=NwtfotXC; arc=fail smtp.client-ip=40.107.223.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="NwtfotXC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ga5KvBR5m22o6k1NjZcVtdbQ6XajL7RLuFagyETQEvMKNWCKf2DUjiQQSzfQ5+2d/Fnr8Db1a6ast0PSZMxoXxc6I/oeQK9M8DSAsmAq0l3+ZGSTads4K8WeQO/bzeg6/8gYTHn67Zz188N5wEmJETVpTEwfh5GDEsKFPoEiejNv1U6XqeR6SgZTJww055YLEuzOFYxlpkB85HixYY1jySw3XV/jmLIe1jwUvmiZjxqZIpV4BE7gAsSim9dr+Oy6NVzyIppnC/1NsHAt9vW4cQ/z2evRIy0q6havK4VtwJXTFgdP2M3CsrDfdbW5lrzHV5rFTQem2JRJuYZRPuVwuQ== 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=DHKFhVc/yEW9RV8BNv/0lEwVfAPcgMqyKxr9icBTMBQ=; b=d1bp8CFZr4CrrA4K/v540iBve9jNUpH9+iv4evGPJLZPdbF/gvw95G4VooaDNH1uBhevUauTu6Ku2VUZuXJJ0L22gBwVF8FqxSjEP8R0hIB1VbXgnW0uhmrJH9bOV5NK74rpW68Fo838MU/09M4rwf5yTVDiDcC+OditXf/lv7cdPDHh39GULxxyUDcobZZnkkVaW0/hB7h4WJR96pG6aS3ikgzo9v4/BNODJfbXwaYKXirAzS45ci6dPhRg8pWYb39RtQnN8zfQ94vgL3ZbccywjjeCHAkdpCp7RWvFIALAFnDB1foQ1yFpSOdf86yaBD43Uv1jjsjejkjmjjT4lA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net 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 (0) 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=DHKFhVc/yEW9RV8BNv/0lEwVfAPcgMqyKxr9icBTMBQ=; b=NwtfotXCwVD8OVVxPbr7vA+lAQjazJd3B1zj+CORf/cEJQHd6nGhKeQF5pdh+NGyEcU5N/DJVZwP0L+4J7hVxFW19E3/4js03UsFscf9Zr+uMV4pC3o6SWjxqS91vNCk6D2Bh+vXLSTWGE/0qQiegbW7DOPnYDLBo52m7wcf024D7kZIqdvqlgYrRHxTArdgziA3QZaxBcGOqPCyJpoXFf2TAn+RuWVW3k6vDeT/UIoMaFOfJyfz09f+cOvO+x499ElwvN3+wiSO7w3qcydY2WMKgwoOTGcSaVV9VGJ9rrlLaEB/tX7dvchy/8cwRfXNGtHTJqcjkuGIurnlF4LjHQ== Received: from SJ0PR03CA0139.namprd03.prod.outlook.com (2603:10b6:a03:33c::24) by CY5PR12MB6225.namprd12.prod.outlook.com (2603:10b6:930:23::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Mon, 8 Jul 2024 08:01:45 +0000 Received: from SJ1PEPF00002322.namprd03.prod.outlook.com (2603:10b6:a03:33c:cafe::7d) by SJ0PR03CA0139.outlook.office365.com (2603:10b6:a03:33c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35 via Frontend Transport; Mon, 8 Jul 2024 08:01:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SJ1PEPF00002322.mail.protection.outlook.com (10.167.242.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Mon, 8 Jul 2024 08:01:45 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:01:34 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:01:34 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 8 Jul 2024 01:01:31 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Daniel Jurgens , William Tu , Tariq Toukan Subject: [PATCH net-next V2 01/10] net/mlx5: IFC updates for SF max IO EQs Date: Mon, 8 Jul 2024 11:00:16 +0300 Message-ID: <20240708080025.1593555-2-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240708080025.1593555-1-tariqt@nvidia.com> References: <20240708080025.1593555-1-tariqt@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: SJ1PEPF00002322:EE_|CY5PR12MB6225:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ce7b30d-1b6e-4709-86dc-08dc9f24361f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: eMbB3G+hzTco9iMFc6W0JFYweM8qz3osxO9hL/kWHZEFwZ3eadYlRMSscUUs5fjokwpdRw7ol14v/1JIxcPWeNMbNd17NQl1lTAdKNnae/NK3mkcTkZkOrBSgGvWJ6XEgBClGlP9Bfa5jyYrBQidmv7qjqq1ZsoFe7HzOtK/TH/wlpBKIxoqsyNxe72SVgaEI8QaqH8gLpOQ32B8sqplVBaaLp8SKqOuOokCOl+OP0qadYaeWeOVezgl3Qy+Idoh25eFi8dmTZi48cwSWv4eGG/dL5iau8p1sDEn29OqVB2Y/Zvb+Q+W8A3pAqCYXSP4gbY1zuQNVd0lS9xGsf6codIaP83hkdKrCGlIhGHuCDTPreDWeCKM04rgmgG4h1QRyEv9oyd2ac2zWQjfckPlI+qYQmlalE3j0ZMMZB0xZDD7SYi6QwnkUpdzErLu2poj7WERQFd7tdaPhoxcT7H2nEpo+Up49NAMh/T7XnVALnXGsGstNq90rBfEd2BYbyNGxXdpXzfz9Z6EdjzX1kGLaPn5MyOuuiqmrdklwYW1GrMeoJB61TV9LmNPfWuDZKHbr6oCeAML+wM0cedAjRAJUmdiq12bmhELoMGXsIxnDBOqleFTmFD+LxkvrdBkAP77n/ajQj8KVbg2Q+PRbCarsjLDu3akzH6sW6gXbmrTT+/gilByrSRrYQYnbDzWEP9Iy2ZBW/ehOULS/Z1HXiEaMz3XO4j5EBpTC8lmFyLHhtm06Jm2zHuzQFZe3h8dkeQi1M5J0cKj1MH98eXz00AAJ9lfG8deGDNDDSzn59/Lv6qusVIEWuIt1KkYwJeV4E+zqk2BgtQOITXs2hk+XE6LyCZFic6/r8Ot3xhPNnVLmRN4uROC7jOvAksl17Ij1EeCbyuNy52ebs+peX/7ke8da4mDXw0YyTLGGuUYdO6SGH/khS7fJtldMB1ex4XiK/TL0QVBSr5gHPwEF4vkgSQRcVndIq0DvC5chT5D4wJX/Pni3+1uKeOzLdGBwjkqrNQUNBAPTeUnZgQGQyiW1Kz8XawpBZxC+YTm5dJJ7ke5qSJIoyp/pnWLIbir3ZRxljt7zh34YJrlCpk2WPXttPFO2vuekMt18i2XxxxvtRtPSGsRnhh7NxK+Sidp0wINUxrOhqbiDATK2uwA5rG+rTs+Izqh2tZH//TbaR9e5YS82m0js/h90rATgkHWzqn7hekWlZRhbRFirx7duC7J7aBRuqbtW5RGX3yjFkxAATff6X4HIiJoWyAZ5jUQviJzaZqpfZXrTnNK9yN4a+loDU/ZZH8YKwgJvioYt2DWs8KdN5JdTRy/6ZtZF9xye9OKHT2TshfC8QQYG8Y6PgzJz5fpa4NayyLoCjmjbJdlaUPSCiw05gMSiBi4coHCkmu0aEG9AKrSIeu42QLA+vVPKDUQkXMRmitos8hov9oE/xAJPIRBDixpegik1dIKGjYqV9dZ X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 08:01:45.5286 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7ce7b30d-1b6e-4709-86dc-08dc9f24361f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00002322.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6225 X-Patchwork-Delegate: kuba@kernel.org From: Daniel Jurgens Expose a new cap sf_eq_usage. The vhca_resource_manager can write this cap, indicating the SF driver should use max_num_eqs_24b to determine how many EQs to use. Signed-off-by: Daniel Jurgens Reviewed-by: William Tu Signed-off-by: Tariq Toukan --- include/linux/mlx5/mlx5_ifc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index fdad0071d599..360d42f041b0 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -1994,7 +1994,9 @@ struct mlx5_ifc_cmd_hca_cap_2_bits { u8 migration_tracking_state[0x1]; u8 reserved_at_ca[0x6]; u8 migration_in_chunks[0x1]; - u8 reserved_at_d1[0xf]; + u8 reserved_at_d1[0x1]; + u8 sf_eq_usage[0x1]; + u8 reserved_at_d3[0xd]; u8 cross_vhca_object_to_object_supported[0x20]; From patchwork Mon Jul 8 08:00:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13726266 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2066.outbound.protection.outlook.com [40.107.244.66]) (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 DC82525634 for ; Mon, 8 Jul 2024 08:01:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425719; cv=fail; b=ETMw7xCN7iWB4bk4RJ/PonGZCXgNTB2c1I6kXgd7MvgdqYpm9pTjiXeUCRnVHxR+yefF8W4NJa1yEmOicQXtNst+P+JR3QmgEIspwhMZ6L+ymb37BwYK1CDw4QfE8N18kFhcG5y7pyIGv1Tikb//gEQllEPn2yOb85n3HgSp8qk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425719; c=relaxed/simple; bh=qLW87sf90SxjtLcIOWhTe8TqRhMRydL5V7X1kg52cG0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=R5ONG8ex2pe7clsyG5TlbFwmjTFBa6FiBqzDUGYhe5Woa3F+u5PuEcjrN6FtT4ySbadjxlho7k3W11lWlMGz1gcHDhBA1r+7siTHV0Inj1au/hqvP0d/kix8PR8sxDSrfiw/JK2J6r1zTIVLjdT7u1kTFtaJAGYRd40zacuTXFU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=sFToV2q4; arc=fail smtp.client-ip=40.107.244.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="sFToV2q4" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TSODc5pVlMrdVIe/QXrvoMkfpHGQSSmrea5pmp4DCgozNy7b4fNrNu6Csf0Jl/90ObzrX1J6qK+mif6f6A9agTgOK2tQcZwkIT4Efh5PPSmp+KILF8NiArMYb21ftMx3anC48liqDUWX7XcXB1bpjwzKA+It5QV0eZ10O+tkhj0l+mCNeeuegKysvYS3hEpsky3jrIynYdokH+Lsdu45mzFOUz4TNJS4wlK62/CHVwcmbO0wYJi0lXX35N1Jcg4B1V2vtx1YWVwnZItjNLftiRrgaTFUFOXNnvCCL6lyMAVqSfU9aTNKhNNAak/tJH3+j/jPohUMxtoEzWI8pGmyqw== 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=0qDoyakM3nv53e9IIBozTjfPT6bA8ClYVo6mzNpuJzM=; b=WAmFLUFFZ+6at4Mm50nDp3zwYS2p7JePEv70p1mddYenyGOsExGSjpu7kVmhv35emqSb5jlffME9iwOEonocF9TWjsqB65nl5MLVonQaWDU+O+t6arRM+2osuKCvIwD7j+MILP3UGWvzRnLGzn72xV5I5QCIo2ASFjZRcsyNucbaFsv7aMJ5/lUwiHYnp46txXZzm00qAgkkW9HkdrtIl4gJkMQKkQmcTM8x30jkvjER1EMgiqrqLtlMP0wvVXsVpG95657SKj+myJP5iOMdKpiIzSxvyXtfNwwL5gVTqZhiWZtg8/pa0f1HqsbUU6UjbnOWJ1qun+EG5X+2nFYXBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net 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 (0) 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=0qDoyakM3nv53e9IIBozTjfPT6bA8ClYVo6mzNpuJzM=; b=sFToV2q4Qj10fo5yYGMTCY+tvZeXy6wFKklw/xeGs4mlRa62TiohH65JnBh10jKRijp/HIYYCKteHFPyPIhBVi68dRE7JXb3UF6UvAQV0Xoci4837nfRg93h5M5z8+xQ7aZJYYGezu9PBFIj2vC/Vd6uLqtqwZqnmHCXBv3Xnqe3j4wtD6UxQq1DRcVs2Q0YRFHma01FSn+gScgFA9npYr1G8h+lQ86pZeseCww0oc5ssPSosKO2DLn0ysoonQamLEawjBlpZBn15AQbHMfw2cTLaZnbDK7vo6yBv73ZUGpvpvmr/jMvtTglhq2etW88avIjrBTcfQ/fKt5G5MkfZg== Received: from BL0PR1501CA0024.namprd15.prod.outlook.com (2603:10b6:207:17::37) by MW3PR12MB4410.namprd12.prod.outlook.com (2603:10b6:303:5b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.36; Mon, 8 Jul 2024 08:01:55 +0000 Received: from BL6PEPF00020E61.namprd04.prod.outlook.com (2603:10b6:207:17:cafe::66) by BL0PR1501CA0024.outlook.office365.com (2603:10b6:207:17::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35 via Frontend Transport; Mon, 8 Jul 2024 08:01:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL6PEPF00020E61.mail.protection.outlook.com (10.167.249.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Mon, 8 Jul 2024 08:01:54 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:01:38 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:01:37 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 8 Jul 2024 01:01:34 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Daniel Jurgens , William Tu , Tariq Toukan Subject: [PATCH net-next V2 02/10] net/mlx5: Set sf_eq_usage for SF max EQs Date: Mon, 8 Jul 2024 11:00:17 +0300 Message-ID: <20240708080025.1593555-3-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240708080025.1593555-1-tariqt@nvidia.com> References: <20240708080025.1593555-1-tariqt@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: BL6PEPF00020E61:EE_|MW3PR12MB4410:EE_ X-MS-Office365-Filtering-Correlation-Id: fa5a93fa-ce03-4e8d-631b-08dc9f243b9f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: 1uXeyHwjPxZSFu3LtGf+TIgJik9wJINMQgQGRFB2HRy/Beu1SuhSar9+34o0g0uUigc+75p0TDyBoOPqAV87CSBrGea5o04yTRypaM9d854NY1/GcsRAPlgOHUUmZqxMyf4+IEzq+knnZFCm1qr1yhfIUVlT+cMKDLmR8LwOs3bpP0xwblyvm2KWv6y3vWNR6//CrRpFM8zlpElUQiCYDUAG/3H9Qkrbs/L9K1JUhIE5g301NURMAgFGiR+6hvrQx3INZLJ3ehUe7VWIQ1MvidOuH/HxBnB0ANkY/axv6PhRFgeHaAqgvRsUjBcfQWxN70SlnZJFiK2Kpii1dZICikq6TKyekn9/xFC5Kd0xj1vuJraGrRwDLd8qoaxiVoxuhhLf2t7DxBf++q60xTV+I6M5XA7LnvsCy5yd1h4tGTX21jmBsi+m+xcQ0IC2wAVPLFxn9sGihPaEBFuHKEcNHp8svULlbXxIvD3R1H43V1h5y9GBITudu3/QR9zxd/Z5Uigs3Y4vewy7b0etWezLbfHtwtbfmMrv3+J8VontF4H6PfWVm6m7a6fxBVAd+GC4fk1rkPHS2cG3Jg49wkAiDXknQhrLBPwYXEZKPGh+f7dDzjvzXgf0XypznROndQlWHKFgYcW13v05vsO9otL/CKYnCix5dcXwFm+3lfu285cHkAeuR4Kmy0uLt5W7ghYFAjliNYhbSWJnuBGa8VDnN6pPm6UWwLiMx2DlS12diaJKzyDlu+c+g66DSKbFIBeTMhHH8ZC88GCMxCln09GGe88nZfD5TRMoYbme3lZUZ/QeI7gHF5gGSV8DG0yRpgtdhwhVcbbWmZKkUuDqDg0BW7kEbiKXLyBFyhzwOYrz/ZXYRuW8gyDMxjdTzQzc9WiLQSrohbXPm6/YKt1KAClCd60YC1R+L1igtzhZzyWFQ04fsAGdhbqlcEfAkpPJ/WzfHue6oUG/rXdbCSKOJOR/kfB67tCfsX8/n850XbW9h3qhrz1j+iooentnuJum7tIVheR70D1gPOmyOb3T6i3Bl2NVVu0DrLH9eduBwAOICuD1uHjbcccZzWJNZhs8pt0goWtxc2sFw0WUwlJPsCHlJ5G2CZioAgenbwV0/LF15bjAJS2L413JfwkbzolZCELr2H3wR5bh4YW2Qk2CNJ2YeUDpCPRizzqnH0fdGmtYNrJM/fgW19V65v/VsN3JnGJp3UJujlhtgVV/kyA7vW/oLAlZoixgfBkfjDYzvCqON3ckjSQEJiglLycfCbLmwuTaZbHwUGtPqXFkW74kQQKO+tv8LO2I+bzAUw+jA6a9nr+MddHjUE3RshS4zZJ3P/NigK8A3sO/xzr6LsScpZNUIZxJw3kYt+Wuv8YgSXF20dWuG3xej83jGiMEuvHHT0GqKFXGs84Ju9Gs9n1hX4HYL9wvAh+Vhd/dvT07kZXCyuzuGA5Bcy1t4LjR2zalKlfV X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 08:01:54.5520 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fa5a93fa-ce03-4e8d-631b-08dc9f243b9f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00020E61.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4410 X-Patchwork-Delegate: kuba@kernel.org From: Daniel Jurgens When setting max_io_eqs for an SF function also set the sf_eq_usage_cap. Signed-off-by: Daniel Jurgens Reviewed-by: William Tu Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index 72949cb85244..099a716f1784 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -4676,6 +4676,9 @@ mlx5_devlink_port_fn_max_io_eqs_set(struct devlink_port *port, u32 max_io_eqs, hca_caps = MLX5_ADDR_OF(query_hca_cap_out, query_ctx, capability); MLX5_SET(cmd_hca_cap_2, hca_caps, max_num_eqs_24b, max_eqs); + if (mlx5_esw_is_sf_vport(esw, vport_num)) + MLX5_SET(cmd_hca_cap_2, hca_caps, sf_eq_usage, 1); + err = mlx5_vport_set_other_func_cap(esw->dev, hca_caps, vport_num, MLX5_SET_HCA_CAP_OP_MOD_GENERAL_DEVICE2); if (err) From patchwork Mon Jul 8 08:00:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13726268 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2056.outbound.protection.outlook.com [40.107.220.56]) (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 3ADF725634 for ; Mon, 8 Jul 2024 08:02:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425724; cv=fail; b=Gu/ZbqnQ3nhPM3IBhKzbs5W/A3U7Eak5KwpqqVqhEuJgypFUVr2qogIqY+zVW51jo0zjtW1UT9+4v8v2jY8H2n42WBiCHJgVP3J3dI/buWA6GbC3rfab16bvUSQDEMwkvv9kpRYVCZfahd+avK3FaVhUUPJtsC8PblfXP3w8kkk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425724; c=relaxed/simple; bh=Abl/mgl+7k2eozKu2ALzHu4Z5hyOl9gTDa3xN8Bvaxo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=P4bX4vZpDK4kxKu0jqefEpMugnKWq4ouEGUNd3KN/4kb3ZtLbSDpKHFWMFJumUhIqv9Jaw9TnVK6GBoGfncXMh0Q6h9opFfrzCS2WpCaS5Q69IcDvVBVQ7w+mKBPW56Cm4frVAxENiodA2VWcDhpwE2i1/LcOrTL7UG3qAe0SLQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=Sx7nUnI3; arc=fail smtp.client-ip=40.107.220.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="Sx7nUnI3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NTbZsKAFuoNXHNaYpbOXEZAfCknBbA+QFNL9E2U3/B3x7klbgqyr4kvdA2zu/E2lJh8RunR1NUZP39Y7HXDTLfFNJ3HVRMFWnke7Olv+Hf5oHfMW6yD83D0c7jDXmzSY2MXp3KdVg726IIkZmJEBnNaNQNEzujKh1FEev2m9lNL92VnMxxcBstUSYRJC4z1Jj8pyZS5tz192UH5MZaK20xRxaaF/vxqqnPZqhUrLIaHBLxcTknv4C4tvtAkvqCeNfrDoFpKeJqNzOM5rz9QBG+xPhy5eI9G/WkLFS7QPTbemottDBw/E14KyWsiXnxCDX8ypddQPgaWzfGwNN0MeTA== 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=LED6M5sdB7PSysZvBJ0cSaTk00BstLkXE3b9A1IB6FU=; b=M8gz7RG0vrLn1WqJygYWaSwJZ/iRTjktSC4BiS/68ajGuzXcsv3MYRVoxrn4YC0x/XnWKXHGFQP7X3zrCb64H04z7EDINtYmTCL2m5AjjFI29DB9D+ndLJ89PYTPRdyteUyZPH6/qe1QlO2A17Mrro88mt6ILDtN7it6Z6dbLpbuC+pVnl9Q+ndVP5vaTSm1QhlojWi/f1UDXCn2jaIwC4ju7GX/37eiCBSKmUXdONV9vQs4iKIcB2KMb4OEAKk0CZ3bbylperaurNA9/ufPRsYCyrk5LMjOYGGQsa3YwdRtL5PDBF3l2c4QJqS4ZM0HJccdfEOnasS5MCvVPel0CA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net 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 (0) 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=LED6M5sdB7PSysZvBJ0cSaTk00BstLkXE3b9A1IB6FU=; b=Sx7nUnI3REKlTBjPHSBHGqZVxrEGPuSDeCfaDyPZcxRDlAA493cWhY/aE7Zl0VOX/oApPlQIYlemfQZGEScDzUm517bk5TGBIqHewEP94xSJQZMb6XDAfbyAZDdoQPdCNkLpRBlUIf3y7lOGXdzz6euq3/YHDPHLjd/3DDW9dxiXl8q7x9Et0UiQr8jhKB7jTYjHaLQyzr/vIvG/4/xCAMfiY8Xy34weUCx7kQF7T+5YYp/+sS2hmqCFqpSL4oDk452/83upVXIZQQp4pzDvD0qG1SUAET0Eg1V8uQYpybwdJzmC2QzpYHgj5nUrAZ76QXSrhK2oz1Yho9uLPS3Znw== Received: from BL1PR13CA0109.namprd13.prod.outlook.com (2603:10b6:208:2b9::24) by SJ0PR12MB6783.namprd12.prod.outlook.com (2603:10b6:a03:44e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Mon, 8 Jul 2024 08:02:00 +0000 Received: from BL6PEPF00020E62.namprd04.prod.outlook.com (2603:10b6:208:2b9:cafe::e8) by BL1PR13CA0109.outlook.office365.com (2603:10b6:208:2b9::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.19 via Frontend Transport; Mon, 8 Jul 2024 08:02:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL6PEPF00020E62.mail.protection.outlook.com (10.167.249.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Mon, 8 Jul 2024 08:01:59 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:01:41 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:01:41 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 8 Jul 2024 01:01:38 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Daniel Jurgens , William Tu , Tariq Toukan Subject: [PATCH net-next V2 03/10] net/mlx5: Set default max eqs for SFs Date: Mon, 8 Jul 2024 11:00:18 +0300 Message-ID: <20240708080025.1593555-4-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240708080025.1593555-1-tariqt@nvidia.com> References: <20240708080025.1593555-1-tariqt@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: BL6PEPF00020E62:EE_|SJ0PR12MB6783:EE_ X-MS-Office365-Filtering-Correlation-Id: 5aa4b015-d1c7-400e-a2ac-08dc9f243ea6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: QenT207SjhxTospazoszP07jiZt0cCA1ARHFi0amZEtAkjTeJkX+q8Zqcc6fMSwBfdP8cC5+ZDFYL/CR4qt9xZ126UOqOAsfDsgymUKLZ2HV2WR6EOkN1Kpvtmuzr48Y9Bw8SejZkajlqR11BU1v8RkE+aggJpEiiuA0GA5HCgr917pmMHeAJEl9G3geeBaUbqzpMW5DLi2rmqL/ApSSW4w/ZXY3vkzUbKKiWXGLFhgS6PlIe1BTVyualCrwuuyfrvTh/VkgNYDsnYrbzK3lU+vYTf+8csasFjsDI+/AzlL33zHsYPPL17alWpk5X1iF/roqQwSfzi9upWTvhuZt6g8ZY1O0X/oufgR8V6TYyd2GwHreqb/SC5ifHb1D2KJTJ6lVNZA8N+M+5CPVE2Fg7aG66Husw/nJNy48Aary7U8nsyYRKCHtjSpFp7J5ruvu86IkGGi1KsqZMTkDLdD1HCojMXV64Z4oXU9Jok63qnyxflgSXJ/MVPr+bJa5ayfdc9MGIyEw+ziHSzj4cgGko6Gxu9KS4EqMb/kf7t5perZchby5EMxqJoPLJxC8FKdm+LNHiu5fWy0dTYSJYnKeC24RdVQ9pZAS1afXLyJti8MPbP6NAqDptSYO+urZilD0pNGECtF+Pq3VBaLNN2Ty3OY3k/dxDt7qtplSLcpeXMlazdN68uUpcV7FXOuMAAmQcMuCoBU5ePqPAw5imiSLeH+/l7Opog9wjLNhxHHvxlI/eG/DOUbj/XkRzWZ85DerbVGdYmasBm+cK+mxAtlpJ1nPo5DynqURNEljgOkEvJ6JQ/Y5vRi0K9Y6Hqsmr22epEc/DDO4j6WjihgKTtvgDH0BNkAdg4UCI3S+6BMx6JNJkop3C0XVg8y20dXmnW3a3Qk78gyMicF7rTJcQ8x6YwmCJkXwgkLJcAaoOL70afcLZINCPery+FcinIBP5WzEeFgwcZX/UNCTmDY1CajrMbRt9dCF0o7d1XKYgnGiEOenvSABd3y16UHsODITrD9oMobskcQ/VvfQfmbxfk1Y2WhRRVz8Jvw3voadJmvKz8z3ZRgAlkXQazN+ntLf0Ng0MisS/RJmObf6C3Tv5oH/Op0vi5hvmz4q5+wSSSYYmBVmARgp8iAQVRGw5MxYvAkONwV7Ud7bsF1e0izxpsVbHewOFR2ChAFR+WoVr1Rssush92YAPr15xFYkSFrXYB1KM1Nix/x9+i7tnLTNPDyIJj7RGb6cQwikySlKv69TU19VyZOTB/sus0RkxEebTMRHYwxbf1A76T0giV+SkEiZc/+pQn8yQEv1qjpO2UHJTEyeljjxw07HQvjtz1qtFTSfn/zpb+3dD3ISunVlbHbKWBlm9RDlbXTRc8l+v8iee5lUcxea5vmq4MbLC/1AP8aBqZgo8tD/uACCbu+hRsxXsI1B2JW55t2E29opHtHziPQwWOD4u35Ve0gNcQ280bWk X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 08:01:59.6483 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5aa4b015-d1c7-400e-a2ac-08dc9f243ea6 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00020E62.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6783 X-Patchwork-Delegate: kuba@kernel.org From: Daniel Jurgens If the user hasn't configured max_io_eqs set a low default. The SF driver shouldn't try to create more than this, but FW will enforce this limit. Signed-off-by: Daniel Jurgens Reviewed-by: William Tu Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 3 +++ .../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 12 +++++++++++- drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c | 12 ++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h index 88745dc6aed5..578466d69f21 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h @@ -223,6 +223,7 @@ struct mlx5_vport { u16 vport; bool enabled; + bool max_eqs_set; enum mlx5_eswitch_vport_event enabled_events; int index; struct mlx5_devlink_port *dl_port; @@ -579,6 +580,8 @@ int mlx5_devlink_port_fn_max_io_eqs_get(struct devlink_port *port, int mlx5_devlink_port_fn_max_io_eqs_set(struct devlink_port *port, u32 max_io_eqs, struct netlink_ext_ack *extack); +int mlx5_devlink_port_fn_max_io_eqs_set_sf_default(struct devlink_port *port, + struct netlink_ext_ack *extack); void *mlx5_eswitch_get_uplink_priv(struct mlx5_eswitch *esw, u8 rep_type); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index 099a716f1784..768199d2255a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -68,6 +68,7 @@ #define MLX5_ESW_FT_OFFLOADS_DROP_RULE (1) #define MLX5_ESW_MAX_CTRL_EQS 4 +#define MLX5_ESW_DEFAULT_SF_COMP_EQS 8 static struct esw_vport_tbl_namespace mlx5_esw_vport_tbl_mirror_ns = { .max_fte = MLX5_ESW_VPORT_TBL_SIZE, @@ -4683,9 +4684,18 @@ mlx5_devlink_port_fn_max_io_eqs_set(struct devlink_port *port, u32 max_io_eqs, MLX5_SET_HCA_CAP_OP_MOD_GENERAL_DEVICE2); if (err) NL_SET_ERR_MSG_MOD(extack, "Failed setting HCA caps"); - + vport->max_eqs_set = true; out: mutex_unlock(&esw->state_lock); kfree(query_ctx); return err; } + +int +mlx5_devlink_port_fn_max_io_eqs_set_sf_default(struct devlink_port *port, + struct netlink_ext_ack *extack) +{ + return mlx5_devlink_port_fn_max_io_eqs_set(port, + MLX5_ESW_DEFAULT_SF_COMP_EQS, + extack); +} diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c index 6c11e075cab0..a96be98be032 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c @@ -161,6 +161,7 @@ int mlx5_devlink_sf_port_fn_state_get(struct devlink_port *dl_port, static int mlx5_sf_activate(struct mlx5_core_dev *dev, struct mlx5_sf *sf, struct netlink_ext_ack *extack) { + struct mlx5_vport *vport; int err; if (mlx5_sf_is_active(sf)) @@ -170,6 +171,13 @@ static int mlx5_sf_activate(struct mlx5_core_dev *dev, struct mlx5_sf *sf, return -EBUSY; } + vport = mlx5_devlink_port_vport_get(&sf->dl_port.dl_port); + if (!vport->max_eqs_set && MLX5_CAP_GEN_2(dev, max_num_eqs_24b)) { + err = mlx5_devlink_port_fn_max_io_eqs_set_sf_default(&sf->dl_port.dl_port, + extack); + if (err) + return err; + } err = mlx5_cmd_sf_enable_hca(dev, sf->hw_fn_id); if (err) return err; @@ -318,7 +326,11 @@ int mlx5_devlink_sf_port_new(struct devlink *devlink, static void mlx5_sf_dealloc(struct mlx5_sf_table *table, struct mlx5_sf *sf) { + struct mlx5_vport *vport; + mutex_lock(&table->sf_state_lock); + vport = mlx5_devlink_port_vport_get(&sf->dl_port.dl_port); + vport->max_eqs_set = false; mlx5_sf_function_id_erase(table, sf); From patchwork Mon Jul 8 08:00:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13726267 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2086.outbound.protection.outlook.com [40.107.92.86]) (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 E823D38FA5 for ; Mon, 8 Jul 2024 08:02:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.86 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425723; cv=fail; b=bnlCMrcz3hFtW80quHvPmShvnQAdHtnKyQ6oD0ea6B96nxPHYs3+HCZx4/8h6C3JqGXU/+5A+vAFlthoeNARAMpMBB9jbPHVM2Hl2PKfajULiIT9QV+TUAbPS7Kjfg+zEgk+pv81O5dem0z3yaMtWrNoUebC230rbzYbCIKRcDA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425723; c=relaxed/simple; bh=RHQjAuhoiRjirbAejjQCFA+AM7yT/z88prJmKI/O3Mg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pVju1xcLEpDgk0meGQRt1Gfm2H67xJPSSPW5qktgTEySuZtsSPuz7pntPAaajSTD4s45iRiwsTC00EtDtA3d20Spk1IRnO9gEZvlx1VMVt/B84rBoxKDMvI7Ib8Fx6vvu4ujU95Jo3eq1Rc5JBsYBid2yTc4NUXdTjp4MZQpTgc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=QYk+VQMq; arc=fail smtp.client-ip=40.107.92.86 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="QYk+VQMq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XD1wy4nT1rKwvsWruLpPVIY8M2+RjEP349FS6jMmjuEOlDwJMYHqt2rd6HHvZlNR+WlDvDb8cOxZWaUiabaooTFTRUyZFpqf2TYqukPnl2gtTnWoU2iqmYIgpoPxu3Ri/7ha7qn47x5vE84gxDb1jDTInbdL4ZCtKg2m+Hu1H3NRb1dQuAyMtsux8LOSMm+Pvz5Lc7V+hhtWEHEtNgcZ14WbVnO2uc5kobMJttW7Iq9kV2kFzzlJrk+64K3R5m1k5NQ9luFV8sDMh6mNJjxK/DluL+JloQH/eJmhAdpHSGj3fTtpIUSb1pJmQXxJW5uBw8xmGvBNTdo+IS5bSFeaTw== 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=IuYqxYkF9oZSSWu4pQ18JRkHhlg2fhpxMOzB+47uMLk=; b=VWvRXXosdUznFdtPMqVCNi/U5XIYHyMAFHgApsvV/fTtyPJIJdgDlFFRiBdANC15WS67IoDFyLxrPzBnMLHdFA+D4q6i04JDp6z2kfGDfqwipyj0OxQ/cNx0DZTWz82QLuMTyS5hAjEr1BP3moo+LHc9d+6LHRawp+Jx5CzEewuy2eC3DLA2JggvRXnme0lI4kfEesMFeDKPfgj2mUEzTm3Q9NQkTD52lHR7bNsaIYqB2qpGXhQzYkDcmiRmVeKohlDbZ3j7yoHbGOMYrkt5ctC+Ls/MRWygmaZiGtKSTsd9T/843cXAosnKpAs9VkSLlIOyBBctQcms4oRyKS7VKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net 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 (0) 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=IuYqxYkF9oZSSWu4pQ18JRkHhlg2fhpxMOzB+47uMLk=; b=QYk+VQMqCJa2Ru1zbwShEsmE0yEz4xNhCDJTzp/q5NBkED1ePxrq8Orm+WQEtGYBcaPIkQluFR/Y92rGjnueeZpxyQGBdbnLP4U60dyBK2/bn8vj6RD+wz0G2EA/Owh5EdakBtESfwMpRtBl1aoGmW26i9Vxu7Lfa3sts9Cjbcl5mWrXPzuZ47eMlu/9OC/LiHDrQRSZmUlPZTHjrncdJ5nhJAQSu/qQe/YI/6RrKF8QtqDaZ2zabu0r7eFbIlnxMDnu79WT38syA8EF59/FCLvCRMxLCWYmBlIcdffCqS61F7mj4FaiLg8txpBQ7pmaG3WUDNtOiiXc6AS9y/DAew== Received: from SJ0PR03CA0124.namprd03.prod.outlook.com (2603:10b6:a03:33c::9) by CH2PR12MB4263.namprd12.prod.outlook.com (2603:10b6:610:a6::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Mon, 8 Jul 2024 08:01:58 +0000 Received: from SJ1PEPF00002322.namprd03.prod.outlook.com (2603:10b6:a03:33c:cafe::16) by SJ0PR03CA0124.outlook.office365.com (2603:10b6:a03:33c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35 via Frontend Transport; Mon, 8 Jul 2024 08:01:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SJ1PEPF00002322.mail.protection.outlook.com (10.167.242.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Mon, 8 Jul 2024 08:01:58 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:01:45 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:01:44 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 8 Jul 2024 01:01:41 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Daniel Jurgens , William Tu , Tariq Toukan Subject: [PATCH net-next V2 04/10] net/mlx5: Use set number of max EQs Date: Mon, 8 Jul 2024 11:00:19 +0300 Message-ID: <20240708080025.1593555-5-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240708080025.1593555-1-tariqt@nvidia.com> References: <20240708080025.1593555-1-tariqt@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: SJ1PEPF00002322:EE_|CH2PR12MB4263:EE_ X-MS-Office365-Filtering-Correlation-Id: 7e32fdc3-dcdb-4847-d1f5-08dc9f243d9e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: oNuynEDcPvASU18uemaDjGXYiKKVwykg17+QmC0/bWrvr7PzRtbtQ+EltOdrxdG3FKaKSNDHEC73D8RWqUI3Zkt5iJPluJH9F8Bmr+BS4mG8fmeVtP1zCivuPv8GTS2TkdWOXF/6IGHs8Y0BIZimZnF7QeyVomX3welkUQvXYPkPHNKrWHhu4lbu2ZubUJczKTMCy87v2HmJrPZ7u/tTgY6qKLLGjOXcDXCKnw85FMt6dR1fX4NSu1LYVNuakwjzP9CKsjMs0VekypVNyhbg85D18Gtr7tcdgbR2LPGNbu/4G0WDUq2n9T4chqqMvQPHwgYncnr5QMC8W4O0g7UQXjZ+6+8xwTvDEbeCoC7rjbjjGzSqYrXwa83EW/qqPWRD8MJbYUq+ZNhKpqw+xkjBirQkX31K5+dcHMSSPHZlj2DHVJWJ53aPG0lqXWrbWcoj4iplk5Sb1UEXotfzmwZY+rO+mggPFClU/O1CEhox0nwfqfh5Tvu//pNEVr08jjGce8iHeC8rVPRne7TXXE3ZhWqIJpPLG1n0WVG5U0c2fJKYm741Nb2JYkaXJJTXGzp0p1IIzS+WC+hLPf0cyF1q3061eCHuxQLFzQngYtphcdLx2rXFutqBkhtFi+AmCtV5Ia+Rb6aD7pqHVkEUDvEryEJKe3IP7Pn/rk9FP2pmsfdlZI6Uu4klNG5E4RwJeJ9TMuzI/P/NDM5ISmUKIvW7D+bSpng6VyO6C3VFSxI18F+FxEZ6C/f3QSF8in56in1HPlAflYM/pTt1Uo0p2XNmTPO/nBBD8mhPIgSqH4uBREFuviomeDnv5QE6ARiyqWJIej6agoA0RYz1LWHU3AmWbekryeI2dF3eVc3WKSU4aagvOJdF3VmvER67YnfhLYxjwLSFLDUUPj0pcBL8zBSQSB+D0p0er/pDcF9Pk/oWAHYKoJgUu8+gIbOgjSN3atBccAUWtQLbC0LVfiSMjvtP1dXOVAppSeGP5BkCG9SR9sVcKwfcEG6EgBOTupKi1JBtf8iEyBmOO2uBlOvTwZ2Vx/HUnFvBIQCVEhDvhpx2wJmQQ0eZ5UiEbDJTE4WtRxn5rFNFIPe1RlyLq0z3DVHY/THx98FAdvRjRNsx12EbediWCx7XpGEzP/KAgjAB4W9KjvY+c/QYG7bBkKuQzpkhicOzgyp2/EkWEARMWUvJXIvz/uzNrPcNfYYl7f3eE0lGOMm9sBh4kKvkpHPngywaSRYIWlEsjOsoFcYxNtcbjf/w6rP6LGEy0CQACdEqHm8kzzh7GdJSEybnOXodK/uEuNM3AdMSs0RMVgY5E5f/5Lfz/0VlBohAOQtQb7dUs0c60R0iZQVcPC+83Gz+o0k9EbfT6vL/MH8YmgGxM9q8NrFhCOlpF3ewIT87pFDxE2JM9ZGxcDswAsNqd8gA2X5MNByIkaOYAQx4rOV9r4snjzvapEXSoIDvCyz5+5DFqluJ X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(376014)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 08:01:58.0912 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7e32fdc3-dcdb-4847-d1f5-08dc9f243d9e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00002322.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4263 X-Patchwork-Delegate: kuba@kernel.org From: Daniel Jurgens If a maximum number of EQs has been set for an SF, use that amount. Signed-off-by: Daniel Jurgens Reviewed-by: William Tu Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 7 +++++-- drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c | 12 ++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c index ac1565c0c8af..4326aa42bf2d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c @@ -1187,7 +1187,6 @@ static int get_num_eqs(struct mlx5_core_dev *dev) { struct mlx5_eq_table *eq_table = dev->priv.eq_table; int max_dev_eqs; - int max_eqs_sf; int num_eqs; /* If ethernet is disabled we use just a single completion vector to @@ -1202,7 +1201,11 @@ static int get_num_eqs(struct mlx5_core_dev *dev) num_eqs = min_t(int, mlx5_irq_table_get_num_comp(eq_table->irq_table), max_dev_eqs - MLX5_MAX_ASYNC_EQS); if (mlx5_core_is_sf(dev)) { - max_eqs_sf = min_t(int, MLX5_COMP_EQS_PER_SF, + int max_eqs_sf = MLX5_CAP_GEN_2(dev, sf_eq_usage) ? + MLX5_CAP_GEN_2(dev, max_num_eqs_24b) : + MLX5_COMP_EQS_PER_SF; + + max_eqs_sf = min_t(int, max_eqs_sf, mlx5_irq_table_get_sfs_vec(eq_table->irq_table)); num_eqs = min_t(int, num_eqs, max_eqs_sf); } diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c b/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c index 401d39069680..86208b86eea8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c @@ -16,6 +16,7 @@ #endif #define MLX5_SFS_PER_CTRL_IRQ 64 +#define MLX5_MAX_MSIX_PER_SF 256 #define MLX5_IRQ_CTRL_SF_MAX 8 /* min num of vectors for SFs to be enabled */ #define MLX5_IRQ_VEC_COMP_BASE_SF 2 @@ -589,8 +590,6 @@ static void irq_pool_free(struct mlx5_irq_pool *pool) static int irq_pools_init(struct mlx5_core_dev *dev, int sf_vec, int pcif_vec) { struct mlx5_irq_table *table = dev->priv.irq_table; - int num_sf_ctrl_by_msix; - int num_sf_ctrl_by_sfs; int num_sf_ctrl; int err; @@ -608,10 +607,8 @@ static int irq_pools_init(struct mlx5_core_dev *dev, int sf_vec, int pcif_vec) } /* init sf_ctrl_pool */ - num_sf_ctrl_by_msix = DIV_ROUND_UP(sf_vec, MLX5_COMP_EQS_PER_SF); - num_sf_ctrl_by_sfs = DIV_ROUND_UP(mlx5_sf_max_functions(dev), - MLX5_SFS_PER_CTRL_IRQ); - num_sf_ctrl = min_t(int, num_sf_ctrl_by_msix, num_sf_ctrl_by_sfs); + num_sf_ctrl = DIV_ROUND_UP(mlx5_sf_max_functions(dev), + MLX5_SFS_PER_CTRL_IRQ); num_sf_ctrl = min_t(int, MLX5_IRQ_CTRL_SF_MAX, num_sf_ctrl); table->sf_ctrl_pool = irq_pool_alloc(dev, pcif_vec, num_sf_ctrl, "mlx5_sf_ctrl", @@ -726,8 +723,7 @@ int mlx5_irq_table_create(struct mlx5_core_dev *dev) total_vec = pcif_vec; if (mlx5_sf_max_functions(dev)) - total_vec += MLX5_IRQ_CTRL_SF_MAX + - MLX5_COMP_EQS_PER_SF * mlx5_sf_max_functions(dev); + total_vec += MLX5_MAX_MSIX_PER_SF * mlx5_sf_max_functions(dev); total_vec = min_t(int, total_vec, pci_msix_vec_count(dev->pdev)); pcif_vec = min_t(int, pcif_vec, pci_msix_vec_count(dev->pdev)); From patchwork Mon Jul 8 08:00:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13726271 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2071.outbound.protection.outlook.com [40.107.236.71]) (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 02A9B2F2E for ; Mon, 8 Jul 2024 08:02:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425737; cv=fail; b=gIUm5UNGgpLPg9EPtNpjtT9f+bcIa3WQ4uRFFhQnGudU/yw4G1+St4FSh8+SDDj6z67iJ9kDYvI5zAVdH+woc9hfy3bYfKeGCODFVgFCAPpi6ioL2LkzZeT4bMnlQnOihNWZC8QAv/xqp2e9MkN/+tNv/J1UGYOa2uAaaFAxJsI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425737; c=relaxed/simple; bh=NAg7blGlM+IidWttZZ/NTJcgPctLv9P18VuBvtEv70s=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=h182Ee5MZ9cygNIn+MYS2wNvfE9Lj7XH2KI86Oi6+REirNYwSfcadrNK2Zxkl//lgLjrvRKqlGzNTjZvMJtI+WtVotwX0QviDqE58NdTIE32feNmexMNudeIRb5yV5F6X+zKabzURbq8wRmdPmQFYS7uf02Zw7Yi3fEbtSY5E6A= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=LxYlhQYP; arc=fail smtp.client-ip=40.107.236.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="LxYlhQYP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HgzGbUS7kRgu7w3bsQSjgnUd27600fwmSCpNIPVgPGR6s0IBcTGIxB++l/BrDRszjkwLiZwIyUcVi7fuKUAbmHBSUXaDxvIfKmZPrJUabjJflDtJHaSpjwhMDgXhDbO/S9ao9yK44QZ9eZ7TF0eaQuqWeRSUF+DR6ugVLRvQmOM2zkEcELtF0xVJy+QGjijFmSmXdm/hdMwD4vik5GblZkxT9reGbMJwoo9h3LdZCU/56m9sphz5GeLo7idZYEB816SdGq12glikXRfyMBXLrT4CskZY766t4tSDlvL7mqEbtHKXKK0C9IGCMJhmg2XKvISiLmEndxim4Mjw3IvGng== 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=1t6st82wRO0osuqWhjejfcvfk0VJ+4vdfP2KwEkD7Ts=; b=F/9PQUuHYZL7Y7HB8ctEnjTe+2XTzFIgjAEstSMs8BrD68HS0qouupg/bC3upuwXnOPiAc+NurLT/T+4QFi+MI1OrZUQI2HD4/85BbrYJuiEpEd6tSSGFl7fT5E2y2ib0r8GDIMMqbvKzf7yu0mHrZ45dXNdS950OeorSuzQsq0F3JFaZXGLZzDhbuwmnVAf5sMndXFljiUKcnMPEVTGH2HJlGLGX6BBcmdpKnXqhvMwjGHSHNBrRSqW9WUIcKV61bEAykfjpbNBPLzPNIAwlKZ5U5xqjWZJumplDfj9G2SZz1dhyAOiXkXwlLisq0OxxWllAs++rg2xkuz5FDf70g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net 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 (0) 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=1t6st82wRO0osuqWhjejfcvfk0VJ+4vdfP2KwEkD7Ts=; b=LxYlhQYP3/ysNVCaN9Ff3QHxMbkqvXlmq/tnMuZcSYYHADsC/3//A7R3kENqWYKiZScvzmOe26EoIEBFjWjts/35cKR68+EhzZ4yT330eYPk9+jcziEBKjRs/WdaRwwkAOla3gNB42C0jkZnMfF168r4p0aLgI0Uki8jjDlz7FEpaUjjtdDiVXZlKZ2BBrBwZeeBdFpP+gRMe30zaP/WFsXIle39xRVqnrcK21yRDsq6+NtUet+MtqfUL3pmfTr9plyjRP/0dvilZwQWTcORbpSX/egGnBlIB+OUA7tmg8+KJ9M7Su+O7PQc8Jek2yLME9U/RSKkjSvAhGx3ZRnPvQ== Received: from BL0PR1501CA0017.namprd15.prod.outlook.com (2603:10b6:207:17::30) by MN0PR12MB6104.namprd12.prod.outlook.com (2603:10b6:208:3c8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.36; Mon, 8 Jul 2024 08:02:07 +0000 Received: from BL6PEPF00020E61.namprd04.prod.outlook.com (2603:10b6:207:17:cafe::1c) by BL0PR1501CA0017.outlook.office365.com (2603:10b6:207:17::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35 via Frontend Transport; Mon, 8 Jul 2024 08:02:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL6PEPF00020E61.mail.protection.outlook.com (10.167.249.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Mon, 8 Jul 2024 08:02:07 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:01:48 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:01:48 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 8 Jul 2024 01:01:45 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Rahul Rameshbabu , Tariq Toukan Subject: [PATCH net-next V2 05/10] net/mlx5: Add support for MTPTM and MTCTR registers Date: Mon, 8 Jul 2024 11:00:20 +0300 Message-ID: <20240708080025.1593555-6-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240708080025.1593555-1-tariqt@nvidia.com> References: <20240708080025.1593555-1-tariqt@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: BL6PEPF00020E61:EE_|MN0PR12MB6104:EE_ X-MS-Office365-Filtering-Correlation-Id: 1f06130b-2d8d-40e5-00e6-08dc9f24435f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: H/xljWQvdv0ArTzlXDMfNMypONmYxgklZMKDYMrL+D/P6lfNItU6lcNtShLgRjr9IwxCP7h3SWctmVTVkwyoGflDrOQZDPP1ui3cIKr5ldfSNdoOHY+P1bi00XhZfCOC+Ss7kNMRsA//L1z5Ndk361TIV8VKKmkBl/0JHC0ALRiIbIYZb9T6D7H1MWJP2XWUYkXiB1+RLrVK2i26kUVq3uBLX2XeQgG/ki5CAXXBo0ABYKtPIaJj/CQqv3fZUujFIU1OYtGb4Ua0hHRXT0F+nmC6r2B4Z32iMVK8W/jCZLqeEpzKhG3rKMAYSnGs/WbtGPfShVixeaFGlQf1TWTn8RDFssBp0/wTsht9yKN5x85Cj+LP7AX5zxREhnOE51uS0XExKT1FEu+eHkberbSkYaCEtLyRk2mb+bSMbykwiuxMZYxamBPgokLgD5JQS/cJDEJCn3d17/M+gVnT8TKs4pCQHee2Vw/HIO70QlQNnbFG8wX7jZLwMdI/SI1F/3A2MKaqvhiiHmiC+KyBmhFwMbEn6/NNaE7wYjHvPAmlmm0GKcvu7CAfFuF8YshYJRJJbR3CEsu45Zh4zlFu960XDQR+SFifVtzhY0nvfWpY8LwKOooTOV9NvXswbEDeKjrJCfp6o5ThOy7RaJVx4IUqAvctb9ozWAAOUY268ukfWZdmcYy5nBvS4DYqHhBaPLeOGx6PPtnx7oyPuXbkjyJ7kb5c6jTZXtrk6yek9RT0V0rlck/uZL1b2FdErYBKX6xbHZmLXWY/2kuwTi1Zh1qxfGaCfK0lOlznAMnbNI9khTIoLYbBQDQ07mEQ7rLR7Q7O65oBqDEO4m8trN1SbXwGCOmFOvCDG6W3/C+zUm1s+ESYK7OyvK60n4PffFH8w+hxXQxmiLDPk4XK37kcIhOoWFGfe2XSQhgvWyVEKRBIDAD6uljsFPHhjCWvIXZk9b8yeBiMYjZrm3E36AhpgMDlIWtaEKyBBp5ySv/nVoi2XmVY3pur/+ZD4g8Tf/TkjbCP8mHfSDqRs+RhY3bygCJW49yO70mdEnZIkKRJQoQoO+7kWMdpALCNjwjyhyNBqlnsINEsIJxUltdHhANRLhGVhlhbfu3+NQ927DeViUJvk+0peYeMFChpv0Tf6so5zEXSk9UThLY7PdqpvhIsHc9IN/hZ865gQoqVvT3l0/ZVJc0bT4xHSgiMw6NPEHPc7m48BeEqgavOVtV28cRA/bc4A8lbwUHjmqqWmfihN8LSINco4Urcp1groeaImsgdcsQbZV9wc5GeYNmQo1QPPXQxR4VgBATCLmtCwW3+6coMJuHBvSCqVOtqRWOv7hAD5Fdv2IWPN+q0fGeVfyTyg/GKZYS4qbcd/gzoNQNx1lEJjXkp2xHeeXp9A59exro0UH30cGI3ujSpmsB3rrrdAJicpI32kPDRJs5U37uchv6fGfcWypFYWJZT+I3PP3MuDEip X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 08:02:07.5675 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f06130b-2d8d-40e5-00e6-08dc9f24435f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00020E61.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6104 X-Patchwork-Delegate: kuba@kernel.org From: Rahul Rameshbabu Make Management Precision Time Measurement (MTPTM) register and Management Cross Timestamp (MTCTR) register usable in mlx5 driver. Signed-off-by: Rahul Rameshbabu Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/fw.c | 1 + include/linux/mlx5/device.h | 7 +++- include/linux/mlx5/driver.h | 2 + include/linux/mlx5/mlx5_ifc.h | 43 ++++++++++++++++++++ 4 files changed, 52 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fw.c b/drivers/net/ethernet/mellanox/mlx5/core/fw.c index b61b7d966114..76ad46bf477d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fw.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fw.c @@ -224,6 +224,7 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev) if (MLX5_CAP_GEN(dev, mcam_reg)) { mlx5_get_mcam_access_reg_group(dev, MLX5_MCAM_REGS_FIRST_128); mlx5_get_mcam_access_reg_group(dev, MLX5_MCAM_REGS_0x9100_0x917F); + mlx5_get_mcam_access_reg_group(dev, MLX5_MCAM_REGS_0x9180_0x91FF); } if (MLX5_CAP_GEN(dev, qcam_reg)) diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index da09bfaa7b81..76ce76f13e5e 100644 --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h @@ -1243,7 +1243,8 @@ enum mlx5_pcam_feature_groups { enum mlx5_mcam_reg_groups { MLX5_MCAM_REGS_FIRST_128 = 0x0, MLX5_MCAM_REGS_0x9100_0x917F = 0x2, - MLX5_MCAM_REGS_NUM = 0x3, + MLX5_MCAM_REGS_0x9180_0x91FF = 0x3, + MLX5_MCAM_REGS_NUM = 0x4, }; enum mlx5_mcam_feature_groups { @@ -1392,6 +1393,10 @@ enum mlx5_qcam_feature_groups { MLX5_GET(mcam_reg, (mdev)->caps.mcam[MLX5_MCAM_REGS_0x9100_0x917F], \ mng_access_reg_cap_mask.access_regs2.reg) +#define MLX5_CAP_MCAM_REG3(mdev, reg) \ + MLX5_GET(mcam_reg, (mdev)->caps.mcam[MLX5_MCAM_REGS_0x9180_0x91FF], \ + mng_access_reg_cap_mask.access_regs3.reg) + #define MLX5_CAP_MCAM_FEATURE(mdev, fld) \ MLX5_GET(mcam_reg, (mdev)->caps.mcam, mng_feature_cap_mask.enhanced_features.fld) diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 779cfdf2e9d6..4c95bcfb76ca 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -159,6 +159,8 @@ enum { MLX5_REG_MSECQ = 0x9155, MLX5_REG_MSEES = 0x9156, MLX5_REG_MIRC = 0x9162, + MLX5_REG_MTPTM = 0x9180, + MLX5_REG_MTCTR = 0x9181, MLX5_REG_SBCAM = 0xB01F, MLX5_REG_RESOURCE_DUMP = 0xC000, MLX5_REG_DTOR = 0xC00E, diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 360d42f041b0..0726022a2ecd 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -10350,6 +10350,18 @@ struct mlx5_ifc_mcam_access_reg_bits2 { u8 regs_31_to_0[0x20]; }; +struct mlx5_ifc_mcam_access_reg_bits3 { + u8 regs_127_to_96[0x20]; + + u8 regs_95_to_64[0x20]; + + u8 regs_63_to_32[0x20]; + + u8 regs_31_to_2[0x1e]; + u8 mtctr[0x1]; + u8 mtptm[0x1]; +}; + struct mlx5_ifc_mcam_reg_bits { u8 reserved_at_0[0x8]; u8 feature_group[0x8]; @@ -10362,6 +10374,7 @@ struct mlx5_ifc_mcam_reg_bits { struct mlx5_ifc_mcam_access_reg_bits access_regs; struct mlx5_ifc_mcam_access_reg_bits1 access_regs1; struct mlx5_ifc_mcam_access_reg_bits2 access_regs2; + struct mlx5_ifc_mcam_access_reg_bits3 access_regs3; u8 reserved_at_0[0x80]; } mng_access_reg_cap_mask; @@ -11115,6 +11128,34 @@ struct mlx5_ifc_mtmp_reg_bits { u8 sensor_name_lo[0x20]; }; +struct mlx5_ifc_mtptm_reg_bits { + u8 reserved_at_0[0x10]; + u8 psta[0x1]; + u8 reserved_at_11[0xf]; + + u8 reserved_at_20[0x60]; +}; + +enum { + MLX5_MTCTR_REQUEST_NOP = 0x0, + MLX5_MTCTR_REQUEST_PTM_ROOT_CLOCK = 0x1, + MLX5_MTCTR_REQUEST_FREE_RUNNING_COUNTER = 0x2, + MLX5_MTCTR_REQUEST_REAL_TIME_CLOCK = 0x3, +}; + +struct mlx5_ifc_mtctr_reg_bits { + u8 first_clock_timestamp_request[0x8]; + u8 second_clock_timestamp_request[0x8]; + u8 reserved_at_10[0x10]; + + u8 first_clock_valid[0x1]; + u8 second_clock_valid[0x1]; + u8 reserved_at_22[0x1e]; + + u8 first_clock_timestamp[0x40]; + u8 second_clock_timestamp[0x40]; +}; + union mlx5_ifc_ports_control_registers_document_bits { struct mlx5_ifc_bufferx_reg_bits bufferx_reg; struct mlx5_ifc_eth_2819_cntrs_grp_data_layout_bits eth_2819_cntrs_grp_data_layout; @@ -11179,6 +11220,8 @@ union mlx5_ifc_ports_control_registers_document_bits { struct mlx5_ifc_mrtc_reg_bits mrtc_reg; struct mlx5_ifc_mtcap_reg_bits mtcap_reg; struct mlx5_ifc_mtmp_reg_bits mtmp_reg; + struct mlx5_ifc_mtptm_reg_bits mtptm_reg; + struct mlx5_ifc_mtctr_reg_bits mtctr_reg; u8 reserved_at_0[0x60e0]; }; From patchwork Mon Jul 8 08:00:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13726270 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2057.outbound.protection.outlook.com [40.107.244.57]) (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 6E9403FB1B for ; Mon, 8 Jul 2024 08:02:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425737; cv=fail; b=gS8pTjhgUVam0Dn6J8Ee2ZUOmCBPXW+pA4+A2dtb9atcHWwN/K02VeSeLg3GDXk/NcnZn5HCqn9DlP5sQN+BtbGGAKdVBXwZZM13Tfvpgv+uGaSXBpx1NpqZ2PYSZ8ttN7pra5l4hPmf+HAgHNhWdC3rM1R/IThl8mtvsfljgws= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425737; c=relaxed/simple; bh=AvCqdlCiJXHWyT9b5mhi9d3ljkSK3B9qSsSGUF/1QRE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VtWxGyGwxCFkKDvgRxeUx5jyuInhVaA8SUZfngiGQVDh8p0uPw0raGNBLzAAL5cCTHfYVb7vGryI9ylftXynFAjHTfnjoWT2/uyiPbH2R0f6mh8csUDL2YYMB9zF4lhLbDXRLxyG+oEEpohmEVX7dXGbacZJt3Fv8gA874NMqQY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=hgSnc/bg; arc=fail smtp.client-ip=40.107.244.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="hgSnc/bg" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ATS/Figvje9VNF88Igl97+uJ51kAHfNVjJdljY8tNU0uOH83ANiooKjlcoeG13FfSdXMxQLhZ+dMm1mERx/r0SU7rXbG/7Il5DzFg2fvdJ0i8VH16gJvyYA51pxGLO5h2SlFrzpzBLITMp9flQ2PMjIsQXJiPKengmlrO8kF9Bi3TUObhlfxh/Fj7lO4LIQRtqFw0R6OR3Ra/B5Msu6SIo2VVV3mWCAMcGFldnYCiv82Sz4LnnP6uqS7xh0LzNUCQ+5thPl7Q1anGtVWaMpjko9BNY2Uy/m7+D8opcG6p8Xt+ek1CjDUg1Dcl0YxKTCGnHREaHjGoV/Ilx9QxQme8A== 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=QoIPinypRkgaCuUF6f31Slu3AfSCGOy1lXRq3AJaOA0=; b=DMgraqyrphnBCRQvQs4X00LM1j4IW10EL3zTVPsg3JzzJ1SvAyo1k9dzS8nwnJDRF//XLiSouAQHjOh8D05m4Z6HbyjqjVum4pvvSRrCcyjpfcDJCJS+0kvwxbc8nE4qmrnPoRbtyw9xOLFD8DmPdRIu/3HtlJbSl+Fhc1iKiwWKxfWjFYd2tFZBL0qRGafMnLxoclPZg37RxvoohsBooNRpPLK2Rr4fKnqOzW2yi2L//HniJqguaAPfR3kSxeSuPPbdTHqOGWZDaTgSXXvp7JgYpDgsvWejxOk2s920tmKdovts32NY4c/mja2guViNh6hAgeCGTI3utIjTYHc3nw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net 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 (0) 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=QoIPinypRkgaCuUF6f31Slu3AfSCGOy1lXRq3AJaOA0=; b=hgSnc/bgQ66X9gyEYqOphJ+zCVnFRwNO22PMG2TSF3gbrnf2BFe1yWRMgOz4G0sKhAjGctVcefISQrrhFhDJRLGjJ6DUQdjk9psnfnWuurAPCwW/Q+tVs5iSaToeDTKpzQxQJxnezJRDirFqgEwTxLN5Rh2S1qsaM/sogL+EZY889X9XcTazd/kns0g1SqMxLjPwRCHR+qTHexcLisp5wcFOF+rIO7o/RtzATAFfYQQiQ1W+32FuTslio2ZLP0Avubk6DmErWQCLMIY+MYFTtItC0gCmle9n12ntqbSO6XL34BYp6QYwJV27oxM2PlfqyfrHJh0spQw26ia/5zdtgA== Received: from BL1PR13CA0106.namprd13.prod.outlook.com (2603:10b6:208:2b9::21) by SA0PR12MB7074.namprd12.prod.outlook.com (2603:10b6:806:2d5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Mon, 8 Jul 2024 08:02:11 +0000 Received: from BL6PEPF00020E62.namprd04.prod.outlook.com (2603:10b6:208:2b9:cafe::65) by BL1PR13CA0106.outlook.office365.com (2603:10b6:208:2b9::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.19 via Frontend Transport; Mon, 8 Jul 2024 08:02:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL6PEPF00020E62.mail.protection.outlook.com (10.167.249.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Mon, 8 Jul 2024 08:02:11 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:01:51 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:01:51 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 8 Jul 2024 01:01:48 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Carolina Jubran , Tariq Toukan Subject: [PATCH net-next V2 06/10] net/mlx5: Add support for enabling PTM PCI capability Date: Mon, 8 Jul 2024 11:00:21 +0300 Message-ID: <20240708080025.1593555-7-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240708080025.1593555-1-tariqt@nvidia.com> References: <20240708080025.1593555-1-tariqt@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: BL6PEPF00020E62:EE_|SA0PR12MB7074:EE_ X-MS-Office365-Filtering-Correlation-Id: d77c0e9d-4817-4330-3b1f-08dc9f2445b8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: 019VykUV+o+ZxP9ClgcoFCZLjESM1u3F1Cb96KFcMKtqzXYilaF2FrXGrRkLB3nK5T/KcLmQNJdFNuqAOf8vD3DVTuNklZgnGzJmvZL+F0X34kiQpP+MwkHzQC81acMta60Ep119oYx6E/WrhNpf9vLu0jw6ekoQ2uVDP8X+E6blWxD0nLLK52ni+ulEFIGZV26Sd1svYSUFrtyhGAcpz7ZUeYOcT8RnBX2SEDxntiECQ/nTG1iyNaGPVPtsNZ7+7D6BDjeqKQBfzowpDx9ZkRhL9wG7ICKWBVc1ffQyFesNc4l5yE+lHBw/PDruN8dEaViQMROPrVPYlDBx96Nt9zczmCVzjsTh3EIg5DAz7sEYypl41YyF9sXuRbfgIZhghysCzCODo0ZFECt5qJovMjEzIBT4llntIcqB7aj2tmeMBhfeet13TR0JIADKTmSjTvC2g/TaSWLecmydLLfNbBJLBqleIGQ56hWYmZ/XqCMUUBt92LkGJzkGJJ+QOiFyrmEdB9HTvpfSad+OiPKk3971+bodzNESWBy6jFZPPSDOv/m9L52S6pd+elAtKowEHuwd4dmfrhGkk9ULu69so/tRzYYLRJfhD3iwdMmIWEQnGs0/8TW6xg7ZFNob07k38j6sbbfY2yyy2PXsBkEYAUCuDR84hqRiPm264/TacZuH1zAA5T+/G6gqBMeHBvPtYQaGYdTXWvgICMCirVpbq1t098CK7c9zRs5CGUSAfRqU27Xr9fsCxmOvG/PhySaAvurSldEZa051Pi21dcco9U8MZivw6WjSecabAiMjrDsZgUAdaB0a7BFpBkXnzYopnHfnuRlSQbuQK9/KitcLyaZHChDBlykcAKMiW++BgOU3YhkZsHKn2k7RzBob8A5rhW9pGGRWIJXn8jUWgu4cOEdvawW+4+/5EJ4fik41xGjNQCxivYSJUZI7AaJ5rc6eEgrtwjQnXH6pQCdZ6DVD6IDYEKHtNMLN7qY4EdBetbyenxKvhxFBeOVZIUukn6CCWAjY/KtwmbjByyprYv4v+WIlYrYJiyC3pW8C5L7vRxp281rkiNeoB1HkYNqZ+1ZRfXESzCgMv+Y/MAXxTcQqzIHsO0/vin9+M4AvqsHhGB5FmJESIz92RFlhMVlWIoJz0nk4a28bCqWfsZTVMtdoCbjcEqHe1rZRKbHfhlm7FCmPADMV2HNTNG4OvOtRbdD3VAD0P8qqxr0eOCCFFN2Dvnyam2fOmp260R0u2BcVZ6G9W/NF3YsLEz/769c2qKgj3ZZ0Ot/ZISWDcpb5K7e1KRVoXEfGZQgW2OnlrscQYAwttsGY3/SiiiE2iYpl3+lT1XGDFD/dKlMPnOxUWxcMTedKYSJhq46V+6GX0K6LSZXdjWXHVzgrlutCWMkIJTMZje3HD34kA3YLvqxqDtjWBqVUDhOySKubyyMoNhHyz2OqP3vDnxI80vxR3Z3GIs3X X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 08:02:11.5077 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d77c0e9d-4817-4330-3b1f-08dc9f2445b8 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00020E62.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB7074 X-Patchwork-Delegate: kuba@kernel.org From: Carolina Jubran Since the kernel doesn't support enabling Precision Time Measurement for an endpoint device, enable the PTM PCI capability in the driver. Signed-off-by: Carolina Jubran Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index 459a836a5d9c..31a43e0ee57f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -923,6 +923,11 @@ static int mlx5_pci_init(struct mlx5_core_dev *dev, struct pci_dev *pdev, } mlx5_pci_vsc_init(dev); + + err = pci_enable_ptm(pdev, NULL); + if (err) + mlx5_core_info(dev, "PTM is not supported by PCIe\n"); + return 0; err_clr_master: @@ -939,6 +944,7 @@ static void mlx5_pci_close(struct mlx5_core_dev *dev) * before removing the pci bars */ mlx5_drain_health_wq(dev); + pci_disable_ptm(dev->pdev); iounmap(dev->iseg); release_bar(dev->pdev); mlx5_pci_disable_device(dev); From patchwork Mon Jul 8 08:00:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13726269 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2069.outbound.protection.outlook.com [40.107.223.69]) (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 434F439AFD for ; Mon, 8 Jul 2024 08:02:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.69 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425733; cv=fail; b=l8yLNJM6DB525jEblsFInq9rJ3Dzz/aD2PJGpKi3cEKWHQQjXwXi6FVkjLv3+JlvApvpbfqip5I/fVtxIuCJ1n2yCbbMe6JgX1K6te6emYgdSU43apW5Jr1LGc4o87tA5bxrfkpvTZZhGenDsYAmpvNgEWjoL/yXE9GVqnPjtgY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425733; c=relaxed/simple; bh=hnKiD60GwOT8EA4a3YY3nLoFelp5jDMB+cKNL87IyLs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XCRJzu5WTFN8/XtrVTj531nnBZHqQ7YA+PBrkQKFvL7Hz6ZPpeW8WK0jlTGQ7xfb4UkHYMdhBLZ0xG27yFqwJ8rQ9fNiwOk1JPSWTcqC9BFYC8JEVnnqj9AIypHFbshY2yGARrCKgPEZ+GW/nrNeh9lF/bkyJY270JooKIDlyG8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=bazlgm56; arc=fail smtp.client-ip=40.107.223.69 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="bazlgm56" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i6XTR5xOHJGZXZSx+yIQP6PqfwwJJ5uSVCVQbjqwiwR7+nLB4LHZlJ8TwTKw3OLiA8Vl3MqpPefzDVehgDhfaZ3TwtgUgFfiCSz/cSPPCNOUlr0pVJRaKemEiCf9GYNrLYLMRQ/Hrzf9YYyWJcNhhlcL4AuLNnRI3dRulC4GflB2gKQjfen1PXb3997wYHL5O1tPcdm9ZNxLknapGdcICa6FDTxt6wtzWFhzkNQwf53ZA2CKVH5+6N6bpyuWmQOyMwCH4fYlXbcI6f82BKQLRWvJRrnUU8fBQsVaXlM8EnxfEvFiQ46U+D0jw5AJOL/XY/OrJqKipvfVRD0loFHj1w== 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=KUdvmT2JWsdOqCl57mibw+huo3A1EYojMJyr4V96Wsc=; b=noRqmDrUK0RzwfKBk9SlKqbwRkL66Qo2l/LpAOKX1QZTQzc3HaK0xIVmod9WYli2nTceTSpCKO6B3s53ojpMQMZPgsIxent0llFmbEJGw9qbcRM5nlJqky3XrAJrmavDzxGXVS8F740DcmPJoOtfGIj1+Liw9aMZSFrZbYFn9Xhm5rRzmDw/78KK2Dpkgt3dW+1Zzl/IxtYoNjXRhVi1d3R9g3WbHkI0ZsVBwrLyO8KO7NQxwpxwZdoksZLhsRlFIj5CJJ/cm3ndv3aOL1jJfGwJFsKBuUh1qOZHPVXjijl+ZJo5NDuZJGktXPFPYrp3APoB66Hn1GfihCbu2QAw+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net 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 (0) 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=KUdvmT2JWsdOqCl57mibw+huo3A1EYojMJyr4V96Wsc=; b=bazlgm56xTaJRhGuEPUYHiqoIBOTCc/ByPBmxqnUq5pYsTzy0XGe3JZ4BNam+OV/nCwbZefVcxY6oHHvSYHQLaBbAYbCeA+ceI25osqyphOzS2dJDA8bDhFjie8x89/gq/QQrvwzw9mmDfno14NGKMbNtIrwIzEoJNQK+AAyi1+YbrsyZPOTZUcutk+Q9DeByZLE2b8Ry3GmNM8pJzG+7l0axS24Tqlc9hDBwAriMH106eYzOGAVdtjAMqRAYgUPGPbxzwp3dn8DomZQF6yJzBHLGg6F/qF/Asr/1jZ4E/8IdDxPxWXhLHPofnhUwo0F0KV8h7NNDJRdJPbgnhnusw== Received: from PH7P222CA0016.NAMP222.PROD.OUTLOOK.COM (2603:10b6:510:33a::7) by CY5PR12MB6154.namprd12.prod.outlook.com (2603:10b6:930:26::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Mon, 8 Jul 2024 08:02:07 +0000 Received: from SJ1PEPF00002320.namprd03.prod.outlook.com (2603:10b6:510:33a:cafe::e4) by PH7P222CA0016.outlook.office365.com (2603:10b6:510:33a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.36 via Frontend Transport; Mon, 8 Jul 2024 08:02:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SJ1PEPF00002320.mail.protection.outlook.com (10.167.242.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Mon, 8 Jul 2024 08:02:07 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:01:55 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:01:54 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 8 Jul 2024 01:01:51 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Rahul Rameshbabu , Carolina Jubran , Tariq Toukan Subject: [PATCH net-next V2 07/10] net/mlx5: Implement PTM cross timestamping support Date: Mon, 8 Jul 2024 11:00:22 +0300 Message-ID: <20240708080025.1593555-8-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240708080025.1593555-1-tariqt@nvidia.com> References: <20240708080025.1593555-1-tariqt@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: SJ1PEPF00002320:EE_|CY5PR12MB6154:EE_ X-MS-Office365-Filtering-Correlation-Id: 702db8ae-62b7-437f-8467-08dc9f24432c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700013|376014; X-Microsoft-Antispam-Message-Info: aQRsG6KUskpanA4v+Fs0s5LjSmdBbhI4Rl4ZWyzpRsbtsUNTWERSATA0IO+pgmdaVP2KdpR115F9vYm5yeGlx3xAHA/45Wd/vWUh356HHyBq47mKOOD0cekO6sVwxjZrDm6wNZMFYWg9Euv7hzDvH8xp7h1W15omn48wHHZGq8ywKHDLJEAbaYcpaFZTeyrCVX9C4ZotidDP/NDh9KshL9ysnEsJoeGKk8l/sg4Z/Bioj9U/95TOan0OJqzmnRwtFQMjv+/gdDUYsDk0IQjhyDoXMG5orA/0gge+IHXLRB+CHKvRzZW4IOLkpGjXujDxyolBNp+ORia0KhCir+nlUhnr7KGN5b0NU/b4JhpGd+zDmeulZ46Wpkof/bSsWH/UhrlPZ7cF68JvLNFde7auAjP7j3+nOhqc7UTGbWsdDbB+eSRyIMsvZApKqiQdAORKeK4PCszMU4NRjT1c/ZPVQFRsKwiXC1aLwrHBvHf9E8NSvexXnzVDLUsL0WW7sBPEYbPYZhv0M1wnBWX/JaITr3sUAzAudqZAc0hbj4KQjkihTZWm8oC8CYaZNJ+qVoGB+bDO7c45V53+eCybD+cX9B2MmexiEWwChho7GlfFpKXXXOGqTsnU9F5lNfaORpp5z1DQpz6sDsZA3mIrX3l407HE640RAcX7CD+iRdVgVcfN363++DIJSNfc9JxN8sfCvvgvvnOLL6MNa8NtNrL0Oa5SMhApjUIeqCSJZdAtqm9DbiaULvXgGcCQMLRdP0m21UkkvZv/x1ga8ThMuD09PuBTWbMUz1D6Yuzta4Jn4yX7/0h7Gjmch+LrSQO9WHkPv6K6X6zKI3qgzRfP80ou1bJzjDCYjHRvEJHNfUb6y4WqRdjJtcvGdGENzvyBx5kIHB6V2SxQ5pHMQT0d47qS463dNl56Mv70wodmkvAuCU/UJIVyj+bQAoM3lp0SHaNkbEL1f9EsEjlGg8LlN2Ovs4kiL2B0TzvliPCulnlj/7cH+SKi2PZV1I7WqwohkHLZeuKGrDtvuuVD23/fzfBHwMyM7oEsDFjVaDFM1U3Eb3MdfSgieJde2inO1cbtWGZLGlMnQWlEND/2qvlQxAQICN8d90LlOgZNnhL9gBqLWyc92Kzr+qc9+dAZ3LBtNs927vHvS02YqisuYRqfMu/cXkYc1WU4KfH6z9AcfvM8EvvNuaYYAXRyRi6nt5nXR7zQR5GH2Ognvrz9sBwHGYe4pQzVHa/8YXQsuQ97pgz/6P+OGVsWe+enjBr2WGlSdmYSbJSsn7CVUUpBU2ZnBl7RRBfysk9pGkBY4TZ5K2T69ZyyP1jIDv+QjCcLJ977RkVVbJIk6buVeThCSKFwwmi3JgOgijx/8dSmeP8shKY/ZgMUQiMnopyVkuft/2RtPzk8iH1g0LNhuHFxOjZVYFCbXzYWoGuVUIArcFd/maJ9dfAP//49frQ6WojM9/O9BaN0 X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 08:02:07.3929 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 702db8ae-62b7-437f-8467-08dc9f24432c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00002320.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6154 X-Patchwork-Delegate: kuba@kernel.org From: Rahul Rameshbabu Expose Precision Time Measurement support through related PTP ioctl. Signed-off-by: Rahul Rameshbabu Co-developed-by: Carolina Jubran Signed-off-by: Carolina Jubran Signed-off-by: Tariq Toukan --- .../ethernet/mellanox/mlx5/core/lib/clock.c | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c index 0361741632a6..5e7bd1ce54c5 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c @@ -38,6 +38,11 @@ #include "lib/eq.h" #include "en.h" #include "clock.h" +#ifdef CONFIG_X86 +#include +#include +#include +#endif /* CONFIG_X86 */ enum { MLX5_PIN_MODE_IN = 0x0, @@ -148,6 +153,83 @@ static int mlx5_set_mtutc(struct mlx5_core_dev *dev, u32 *mtutc, u32 size) MLX5_REG_MTUTC, 0, 1); } +#ifdef CONFIG_X86 +static bool mlx5_is_ptm_source_time_available(struct mlx5_core_dev *dev) +{ + u32 out[MLX5_ST_SZ_DW(mtptm_reg)] = {0}; + u32 in[MLX5_ST_SZ_DW(mtptm_reg)] = {0}; + int err; + + if (!MLX5_CAP_MCAM_REG3(dev, mtptm)) + return false; + + err = mlx5_core_access_reg(dev, in, sizeof(in), out, sizeof(out), MLX5_REG_MTPTM, + 0, 0); + if (err) + return false; + + return !!MLX5_GET(mtptm_reg, out, psta); +} + +static int mlx5_mtctr_syncdevicetime(ktime_t *device_time, + struct system_counterval_t *sys_counterval, + void *ctx) +{ + u32 out[MLX5_ST_SZ_DW(mtctr_reg)] = {0}; + u32 in[MLX5_ST_SZ_DW(mtctr_reg)] = {0}; + struct mlx5_core_dev *mdev = ctx; + bool real_time_mode; + u64 host, device; + int err; + + real_time_mode = mlx5_real_time_mode(mdev); + + MLX5_SET(mtctr_reg, in, first_clock_timestamp_request, + MLX5_MTCTR_REQUEST_PTM_ROOT_CLOCK); + MLX5_SET(mtctr_reg, in, second_clock_timestamp_request, + real_time_mode ? MLX5_MTCTR_REQUEST_REAL_TIME_CLOCK : + MLX5_MTCTR_REQUEST_FREE_RUNNING_COUNTER); + + err = mlx5_core_access_reg(mdev, in, sizeof(in), out, sizeof(out), MLX5_REG_MTCTR, + 0, 0); + if (err) + return err; + + if (!MLX5_GET(mtctr_reg, out, first_clock_valid) || + !MLX5_GET(mtctr_reg, out, second_clock_valid)) + return -EINVAL; + + host = MLX5_GET64(mtctr_reg, out, first_clock_timestamp); + *sys_counterval = convert_art_ns_to_tsc(host); + + device = MLX5_GET64(mtctr_reg, out, second_clock_timestamp); + if (real_time_mode) + *device_time = ns_to_ktime(REAL_TIME_TO_NS(device >> 32, device & U32_MAX)); + else + *device_time = mlx5_timecounter_cyc2time(&mdev->clock, device); + + return 0; +} + +static int mlx5_ptp_getcrosststamp(struct ptp_clock_info *ptp, + struct system_device_crosststamp *cts) +{ + struct mlx5_clock *clock = container_of(ptp, struct mlx5_clock, ptp_info); + struct system_time_snapshot history_begin = {0}; + struct mlx5_core_dev *mdev; + + mdev = container_of(clock, struct mlx5_core_dev, clock); + + if (!mlx5_is_ptm_source_time_available(mdev)) + return -EBUSY; + + ktime_get_snapshot(&history_begin); + + return get_device_system_crosststamp(mlx5_mtctr_syncdevicetime, mdev, + &history_begin, cts); +} +#endif /* CONFIG_X86 */ + static u64 mlx5_read_time(struct mlx5_core_dev *dev, struct ptp_system_timestamp *sts, bool real_time) @@ -1034,6 +1116,12 @@ static void mlx5_init_timer_clock(struct mlx5_core_dev *mdev) if (MLX5_CAP_MCAM_REG(mdev, mtutc)) mlx5_init_timer_max_freq_adjustment(mdev); +#ifdef CONFIG_X86 + if (MLX5_CAP_MCAM_REG3(mdev, mtptm) && + MLX5_CAP_MCAM_REG3(mdev, mtctr) && boot_cpu_has(X86_FEATURE_ART)) + clock->ptp_info.getcrosststamp = mlx5_ptp_getcrosststamp; +#endif /* CONFIG_X86 */ + mlx5_timecounter_init(mdev); mlx5_init_clock_info(mdev); mlx5_init_overflow_period(clock); From patchwork Mon Jul 8 08:00:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13726272 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2068.outbound.protection.outlook.com [40.107.101.68]) (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 6F6163BBEB for ; Mon, 8 Jul 2024 08:02:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.68 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425740; cv=fail; b=XMxMa82KVbHe+eSuyBE1/BILYHPCnVbhbMCR4LTK67ImV5RF3WUU21O7FUdd0qGzUr231mlj/1H/3C0FMojqi33CSzIuALdxro0VI0YwadJTG4AheTBBIepgQ++Voq+IJnLHRqBrSKQv9GD7lUsEXqX39dSvEGp1mVQ5uKfq6wY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425740; c=relaxed/simple; bh=E+w8KXjvWeIa2V8vROs1111Qp46vuhWTtD0K6oKo2wE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ifTw8a1AdBsxcYUA+Dd5oKu04JehL4QFD1gvKaCt2U4lFhnzL9/s9OL+2Ra09l7r5sKp1sj5bGc3BlBY92jxcgA58rTnkah+GlgZ4NgGo9N6AzeoKnkpTnS5AbOuzsu355wp/yEqu070vfrDaZsaGcpbdFKYzWdQEoJWy2O1Urc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=SrdLNdFr; arc=fail smtp.client-ip=40.107.101.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="SrdLNdFr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y4gu1qzKl3tFIrwrSWpqrQhOnXCcGSOHgP1X0Tx5jthWo6IC1pYlVBuR0ki6HNjOtWfJBGPTo6rR0uVwrBRruQgtumdnlaW1fwJaxTJUl7vljDfhjEfwuvSIUlPK/HORgxux47937qiq9zkCOZY1dTPt/xUnFEgBbWZouXXLIg19xDUZ2SJWLQmqM3cLH2tsgxqc/tvAESzBeonQFv7O6KV7xsK7dkZBWGY4nimZWUGDfSdXokVVLTpHi/YhvOtxpxcxT1TNnzj8gkDixkE79GX7n8x13lfEwAxdGSUtjMlXVWevgKvrGEpgf+mlEu+E2usBxty0/h06Y/7klyLZhw== 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=Gw8ZiEzx3HHRbMRgB0Qs3f+4Km3q7TmsmWGNBiTcK6M=; b=N1MxccWbZJFHqVy2+5UvtECvDwONoWAJ3G2px/yzvj6P28ZbN43EZ9kv1K+DtcswVql9iijVD3lr9PPgXeHT5NvJdpcbKKMHcqN5jYsHLBqaORf3koKO7uTkHxQ4y8rrDADwE7wgoBUN7SwYJQF/QsPZD0XzydsCNPz4+idI3mLXac7AaSnknipga5I6xl0nDd4G/VWEDn1b/0wn17ZDAN30iiXzFvIEGNOP6YOSZEUL0BKYpY9SIzNV+Re9YdwatW4ffV8YkbMvk+z7WVOWtv87e8NHJAam1weHYZ/js9S/WKR0picO8G3kYRiyzgMqhdz9ha8OEdWB/iBUdJu9sA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net 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 (0) 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=Gw8ZiEzx3HHRbMRgB0Qs3f+4Km3q7TmsmWGNBiTcK6M=; b=SrdLNdFrxfYIm2PLwGhxppnanJTnoorFdcYAtHEKSSxc+Sd+pYH8JkGNok/x/3F6E6MZ6XaREmDzqNhZKFa4t+XQjIX28gaWuTJnEMFBMpbP0uIn6uMz2go7COpMK++9R//zf9RsXdHOT1KOkRHP205Dn46PlBS5lkOZ3L1tWUoNatUBTpTpAjDbuOk/IQdwUj7VIFLw5gdjiqyllakIhQ/6r33CPtQ0aUPDxGTR+iSYbIjOzNqJsFSopLt1BKh9O1NmIlImoJdREo/KdwJNtx/KMJ1gk5lvcKLuU7DcLe8PnwMHcvlP+YNRd64NGbZaadNX2tU2lJxNMAOarSbk5g== Received: from BL0PR1501CA0021.namprd15.prod.outlook.com (2603:10b6:207:17::34) by SJ2PR12MB9085.namprd12.prod.outlook.com (2603:10b6:a03:564::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.34; Mon, 8 Jul 2024 08:02:15 +0000 Received: from BL6PEPF00020E61.namprd04.prod.outlook.com (2603:10b6:207:17:cafe::e6) by BL0PR1501CA0021.outlook.office365.com (2603:10b6:207:17::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35 via Frontend Transport; Mon, 8 Jul 2024 08:02:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL6PEPF00020E61.mail.protection.outlook.com (10.167.249.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Mon, 8 Jul 2024 08:02:15 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:01:59 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:01:58 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 8 Jul 2024 01:01:55 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Yevgeny Kliteynik , Alex Vesker , Tariq Toukan Subject: [PATCH net-next V2 08/10] net/mlx5: DR, Remove definer functions from SW Steering API Date: Mon, 8 Jul 2024 11:00:23 +0300 Message-ID: <20240708080025.1593555-9-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240708080025.1593555-1-tariqt@nvidia.com> References: <20240708080025.1593555-1-tariqt@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: BL6PEPF00020E61:EE_|SJ2PR12MB9085:EE_ X-MS-Office365-Filtering-Correlation-Id: 8b0b380a-8d75-4ea0-0378-08dc9f2447d5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: qUiAWU10tUfM3z8sD54jpokvhh6hkO/b102beSBG872mD9mB97aFM+/FpX29f+snDxlKiAT1tn8lFvjrSZKncgO53OtRGG6hx0UTKzkJdr/MqKn7izhazifSEJbUbvwYNLbKrEdfZnxjESBMt8LEItyqC9YIgqW922hgaVP7amN59BUyul6Gs2x1rHL7HBYQTjvOXHtHfAJJiU8x57yBsD9aV7ZEbdQNOO06ceqN1z0IA1OXEY0BRfIRWuei9+mgaq0lwcdVOu9OK23kg2Z70ETCsHfDGr6mH+3IxvLBvzF3zFta8WrLd09owJsbbAa+Ao4cFJSCGN1go2+BQjCd7Hzx6SXfbntiCIVbR1MINAPkSMMG9zstiiRP8GRMDHhOZbTJe1EhlbWY6qEpBV7+9dk7P49c68FBNPBHQOcen+mnfVNhbffWD60Nu6naBeAcfUY9P/PJccctxZqbx7CERhQ55C012+7Itg8RWZe3/yThgDyrxhqG/QYQ1U9X88bYrGbTzm0SKDEItj8vNLOfwKjyYHui55ePSMC4em9cxvizF36KMXScAq1Ha12h8iSdk6GUlNOALVoDEtLsLkKY3Iu36tfMK6nx6kvAJgeJdm0j476+kTk8syRR9kI66v/1FTTmhrWSYZeoaqCaY7R9nBsdLw625r8Ik7z+BpsUZT1oaOtnVhOh2vXlAReA8Dlltaxj/aPXwPReIA/AoAzMlcCJMz03+ql0LZ+b5gy3wiNzaiI/yxFL72XjjwivQ9hqULMQoptszv+WkkeRKO9V3/n/A8CVLxYg9lEzjhX/xVFGgpcuircCTy7YlnvUyhrwc3BnxW1bKegv+5jIc8dcY+4l6MMX8/MPCOuX2GyzMpMUsgsIsSBd1uqqdReT1V6wBnLZVYEwvWwDCTScODFZheDtxHlH2Td98I/x29/WN0Cyw6ZIfAysrIIX5fk1dMHCLd+6cWNspWDm9yrDb/UqGufvwD6Hhen6RDd/LAnNRy2SgUEOakclu+L6K74siRlz8/3qtAdaMefLxsFHi0d7GUK8rspvuSQE1O2Wg5FajZYLxvZt729DUFijJMFFof8BFAC2NGZ7iFw0jFg9cagFkAMHX29uzm25VtoTIIMVV4IG1t40tka5HcspCYH/lesgkjz6usGklHWRi2tA0AztiGIsa5F8eqcaDjF+YS+NidwKbWP8ALlqLzbyD85HPQ4jyH8qtCa0+qL6ERoBM705wOyIz476Op3zOESPchc21gM9ZDez4OX9nLUFDmmTWb5vz7FMR5ytKjQ2XFFLZGi24Wbo2DovAiasxzS2yDi7hjQD4iIZUNZNe0fECWN0zzpQBwHTc2rOCLv6UkWMS28G2/DPfBtqPb4xK8LmrFQGKruagw+eMJ2jNDQ6nO1XTcsrq6x98FLyVIGRfPQJhZp3zbdOSeVTOuZroSKlr/8fIdy3WPUJtRkLKHsXyWz/5FWp X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(36860700013)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 08:02:15.0518 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8b0b380a-8d75-4ea0-0378-08dc9f2447d5 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00020E61.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB9085 X-Patchwork-Delegate: kuba@kernel.org From: Yevgeny Kliteynik No need to expose definer get/put functions as part of SW Steering API - they are internal functions. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h | 5 +++++ drivers/net/ethernet/mellanox/mlx5/core/steering/mlx5dr.h | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h index 81eff6c410ce..7618c6147f86 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h @@ -1379,6 +1379,11 @@ int mlx5dr_cmd_create_modify_header_arg(struct mlx5_core_dev *dev, void mlx5dr_cmd_destroy_modify_header_arg(struct mlx5_core_dev *dev, u32 obj_id); +int mlx5dr_definer_get(struct mlx5dr_domain *dmn, u16 format_id, + u8 *dw_selectors, u8 *byte_selectors, + u8 *match_mask, u32 *definer_id); +void mlx5dr_definer_put(struct mlx5dr_domain *dmn, u32 definer_id); + struct mlx5dr_icm_pool *mlx5dr_icm_pool_create(struct mlx5dr_domain *dmn, enum mlx5dr_icm_type icm_type); void mlx5dr_icm_pool_destroy(struct mlx5dr_icm_pool *pool); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/mlx5dr.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/mlx5dr.h index 89fced86936f..3ac7dc67509f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/mlx5dr.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/mlx5dr.h @@ -153,11 +153,6 @@ int mlx5dr_action_destroy(struct mlx5dr_action *action); u32 mlx5dr_action_get_pkt_reformat_id(struct mlx5dr_action *action); -int mlx5dr_definer_get(struct mlx5dr_domain *dmn, u16 format_id, - u8 *dw_selectors, u8 *byte_selectors, - u8 *match_mask, u32 *definer_id); -void mlx5dr_definer_put(struct mlx5dr_domain *dmn, u32 definer_id); - static inline bool mlx5dr_is_supported(struct mlx5_core_dev *dev) { From patchwork Mon Jul 8 08:00:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13726273 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2080.outbound.protection.outlook.com [40.107.223.80]) (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 5E0A84AEE6 for ; Mon, 8 Jul 2024 08:02:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425745; cv=fail; b=hZaJO4yYTU4VNkL+Fvii6FMYu7lerHu1bS6ymw9t+S3dfFZoSSycPz5KPQZ1ksvBNmHoa7+RXflgyAbj1wYHgQJTM3Jm3j2R4vjxh2aP2ZSM3jgsVa1ngfz64kSSlGq8QWTDOucEc9DOVG+vrmG0dNyEYTUI3EJ1dy/QVUpig+Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425745; c=relaxed/simple; bh=NXqyCbm3M/3uO/LJkiD7zifcUf2AiOp4RcMoh8yHr44=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DuVCybZk92M7cXAOVdI0Lpaej0oVeYdtOBWfZXeJWbPp/S5yQng6s+x8kNxyAtCTm7S7pKrxYAmmn2UdHH4akhbOpU4VAbJMG0REH5id4x/h4m7sUnpdenGjJ9ccNBb3JVninl/GS/c3Pwc4BSnu2IEAgaPaKwLZM/FhIRxoIJs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=gSbXRU3q; arc=fail smtp.client-ip=40.107.223.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="gSbXRU3q" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LLSnug62+PQi1+e/LFfRGjLFEeIDNQtR34sXKUXOnCIvbPaD5rbUQasArwFe0Qb1IX4nxe+P5+2kHrT4I6WpHOgUspYb6hNKOd6ZZTRd8xrtQ1IqZ7yv4lI9FQ2iIpnqQQsmz7pRUY6gVPlhU3bKgwLlDUXzSn7zn7DEEhTAdpeCX+67aYF4AdSaUpIZFsoJZ9KzjafAXMCO9AMIzvQHNis6aN38qShn2MA/nRmUbOX/AbW2vafnrSczvzkpQCwYtGCNgEHUZKbbWzfoawZVg66JrrTfZrJsncYlILefkM9KukKlVxXfK111rNASX2vpuMmWvdYbtZsbeq1cq2A37g== 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=XJarBeswd38mN62Mm6QnYaddXOnpgbyw7M7umv68Qr0=; b=dN+ItFqJA5dc5vZoSodOahP4dc8BqmIU7W5YOba3DjXFNdjcGjdiHDmZOL5ZGLKUCF/U/D369IqnuRuqsgw0gjKfs+vQaA7SaAegCV18BxKDvEWhUCQC1YEbkgAm3sVK23JB9MVEbLJa5wl4+UYa6rb0wWEIVAqmYihWxV5WAFeYnq6wIWP1VZ/WaGFcgvvGn2pxhCO6VR22IVuoPv51r5wddNH4PoVrdyYa7mv/sOaqFcyM352tFyls7oRIDE/lP/fdtJasvJSTcptKI3paaLwvfEvtDazJjfdqdb0/b1V/vdKj+B+y5G+NzviQ9oOFHgPRQY9CpyZeucQYWHRCLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net 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 (0) 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=XJarBeswd38mN62Mm6QnYaddXOnpgbyw7M7umv68Qr0=; b=gSbXRU3qUmpDsGHo7BQBzAkiPthn8AWoMlwpjKfKT25LeVhWckdWJ48irZGUoti7S0ousAVA4fkFNNVjUHjP/VwDKO1f91MgsEAxsLuYldvWy2ahAFNb6apiHcqBKzyqU8KL83gMm3+F73MGymrg3JVm+pOQUeqttOe2PcA524y3oToTKIcpcZuZfYzIBZhzyIQXGwDrfYeHqfo+Y+4gvZRYXM8AxPJsKRZikYfiDxlwnmM00Z8S32zXSvorK7TxCIfFzQNL4G8dS9nEC8CG4sU9t0dJ0bX0Hs2Q1RjlRGhHAHPcwQuiFXoppwmgd6w27/92Fk7Qfe63fSKOEqtNeg== Received: from MN0P220CA0023.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:52e::27) by PH7PR12MB5829.namprd12.prod.outlook.com (2603:10b6:510:1d4::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Mon, 8 Jul 2024 08:02:18 +0000 Received: from BL6PEPF00020E63.namprd04.prod.outlook.com (2603:10b6:208:52e:cafe::d8) by MN0P220CA0023.outlook.office365.com (2603:10b6:208:52e::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.36 via Frontend Transport; Mon, 8 Jul 2024 08:02:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL6PEPF00020E63.mail.protection.outlook.com (10.167.249.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Mon, 8 Jul 2024 08:02:17 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:02:02 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:02:01 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 8 Jul 2024 01:01:59 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Dragos Tatulea , Tariq Toukan Subject: [PATCH net-next V2 09/10] net/mlx5e: SHAMPO, Add missing aggregate counter Date: Mon, 8 Jul 2024 11:00:24 +0300 Message-ID: <20240708080025.1593555-10-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240708080025.1593555-1-tariqt@nvidia.com> References: <20240708080025.1593555-1-tariqt@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: BL6PEPF00020E63:EE_|PH7PR12MB5829:EE_ X-MS-Office365-Filtering-Correlation-Id: 71916363-21cd-4465-99db-08dc9f244953 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: AEMtBUuJ6CzpSEz3vA6G+P3vdN52Z4NiNMw4jIYE3um7D4NfHJeVx1xldXyYYJm+ORSnFXANXH4XF58JPUPwAdo952atE+4/PWdt0bwkBzQw8Q4PGRbI5PaTDTGw8otZMVT2aGE9fBQQnC6WmUX2eS/ileUlr3F/N3EDimgIUhKY3lRC6qBRBa4qHL30MtBbALYGv3uPOC4OqKn2iLgm5JrxVg533c10DPzGZYL6RXSbJ88EQP34BG+yJtE9H11Fdy0Ra3BjecIoJleUz4g1jMLS36kh4Xkrse+3gq8WrWoBn53zSCCiJ5spJzms/zUKHvV64akK3ko+/weiI+ZBQCGD30BqWdzJJZp1lShn+ZyQOmeHALjPzYCmo+1CSiDF+lOO9hU59fRLCehubJPfX9NnzrUJjBIGcFbLKZ3R1zRtl/IEBUJUvPmUhuaD1ATBhYFEAJEwwbot+rMHLyqm/i1ay6SQqvbffce3IkYTVubupl8sRYe1oslY7/BFaCpAjupBX8iYUpjp+l/YgGr1DAXxl5VEqpNawXI6tmnaf8ew3q+g+EiKOZ0cDW4UbElenYO7inpj7qkrIYR/M/tdsMr8EXLFtFdpZPqYRFrNxErzD3yuNc3H8F14v+loZVEFi2m7ygTjli81hPYRt1cQoH7JnM3ZPvQJ1vXueSypGEZDLGChTfbktNt0rE4IOH+YMzmf1GAxFZ7U9ozQ7LUqLUVUn4yvsxNjGGLls/TqWMkBmm3G/+CsEJPoLi13jIkJnmNmAmVyxDNWdeQQouEqztqKjyf1aPgSSAKuzXDDKjcqEoeNSRuaAFLun2X+VdFv1/Ly9zueW5HyMcQ95JGN3Iaz8QRIrqdqmqS7c1Ulu+/vy5/vFEEFoTbgjO0AH5RHb/5D0/vyH8KOUGys3X4crPtZYWMlYagHQZxTZq5ttdiqv8gXmcG43yv5FxkoZ9xOK6vCxT5V4msLpXfA2Nft9kc7ct+DEgO7ANYei7UiRgF97NOwqH+k6fDePAOE0X0U0pzgT6JR0eGfROMjkvABmprrMk3ytSdWAMqVX30IefwwMPeLSXi9kbfFcXHn1ksVyuaciFU9FhApas3TqeeO9mtt53FVC5BCsw5dArnnRfR6IhkpzkvPcwuXk5y/KFG/5OappDN86lIaFJPd/3T/yUv0vZQ4n048zq+OgaURncYHCiN9Z0ZZWqpGehGuA7aOCMVioQVxmnfepDaCZWIAYnhP6FVCAGHCUSjwwBERt4rFApyt9R+0S/tUM1so01vy6Q5v76hLD2VlFtGnlC2FzwnZ+Wd6gRRoDZz8SNi2p5x4YkxZDfFK4VU0TDve5Crq2vghJNu0w2pAiYlO4pDHHp39ridM2vqch85bzW37ZdqQgONqqBvzBHdZcMrDUeWnThfyvvunwOGQAVHWFLwYF7hMSG/JRG8XTeeK6j8tmVPn2Y+gha2hWwRQeByA21Nw X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(36860700013)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 08:02:17.5747 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 71916363-21cd-4465-99db-08dc9f244953 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00020E63.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5829 X-Patchwork-Delegate: kuba@kernel.org From: Dragos Tatulea When the rx_hds_nodata_packets/bytes counters were added, the aggregate counters were omitted. This patch adds them. Fixes: e95c5b9e8912 ("net/mlx5e: SHAMPO, Add header-only ethtool counters for header data split") Signed-off-by: Dragos Tatulea Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c index db1cac68292f..e7a3290a708a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c @@ -142,6 +142,8 @@ static const struct counter_desc sw_stats_desc[] = { { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_gro_bytes) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_gro_skbs) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_gro_large_hds) }, + { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_hds_nodata_packets) }, + { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_hds_nodata_bytes) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_ecn_mark) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_removed_vlan_packets) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_csum_unnecessary) }, From patchwork Mon Jul 8 08:00:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13726274 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2050.outbound.protection.outlook.com [40.107.92.50]) (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 4FD9F34CD8 for ; Mon, 8 Jul 2024 08:02:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.50 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425753; cv=fail; b=NyF0fNl0mxJeNq7lqD3SBrtVz2Ite78p2YoiE377kuQ2Cs7SelVpo0vf+AwDgZSAfut0S4U9pZaFAM20t1etZP694EY/qmkh+9BRVVdvCXNbGktXTYJDQpji7Uyl4w2Z3Wm654SzxkP7iayxaxpHD5My8dd/JdWXHPcmHOKS2E0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720425753; c=relaxed/simple; bh=NKU+ozA/j3V2qsOhMj13F1QAPvRE3Mpw29u1+5IAfp8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jl8KvVR05bj55016stRpGc29g4NTaWxfU8osbyaUKIi9lQY0qI5bFyreFSU+AiHlKIasl25sGfNZ7wT/RzW8mZw1OKbuN5KB3FTuWftMRexjHDZPNfJaeom0P7EdnX6CMLIXZmfB82QuKk7cToNj67Ohfl4EHengWXvzJ2DOxUI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=BnJ+meDw; arc=fail smtp.client-ip=40.107.92.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="BnJ+meDw" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G2cPMYNbPlFF0lkDFEkmAwBqvZRHpRAITclRQhewLj25IxivOg6QQSb9jFf2Dd+jCZh6Hg8kHlUUGb2Gyv/eLW9ZwO2C2cuk+Gr1EyOPkKLC+n82qqQGiSI/OfPmItrVEkG9VHSotnfHbGvQp9dYci7T01U2FSBS54zjfyw603MFPupn0Svu45JdMHW0p44/cZ+vClpAw+ZLYLqkNvu1A2XwWhmdUmadPuzGOsj9QdMKQzDDiODl7AM1j3I8c9LX/zEgQx++RZ/tBQ1At15Sa0vbTLM5C5NxCmzq8ogGqHRmFoZsh54YwHqVZ+1P/LL2SBwHt3QNBSBIXl1vo3aaIg== 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=kDKjQgsgGUgtLC5rq26bxue9O9tIgvgEIScJ+yDV7T4=; b=htt3nxCfEMLBnX1//Uy1xV7nKrCvQ8VHIn4pv1dBlCEAdIPLuDaJwMnIUHuWastBrX3eE8sJ4rlLVGDt/kv+qpviSgKAtMEOIMUQo/zBColngdT/5UYryn7GQ5Vp4TM7gdyVq6TUlGZ74eEM1qRl1h2Lg7LF0UZWGwkybEjpqlXR6EA1Sbfix1/CduRkkUB0zgJUifOouiLoZaEXsGDV+cz3cltoAU3wVNA7Hayi7Z5JtAaK55q2KHgQCX+UzQKqgnbWOoUKElIve0wim0k4ucyMG/dkXPOZU2NDC+6XtP/B1Cn2f3zqmAR8RE6k74a2tGaTcmUUFdM3x8fmO0A7kQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net 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 (0) 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=kDKjQgsgGUgtLC5rq26bxue9O9tIgvgEIScJ+yDV7T4=; b=BnJ+meDwxoNBoh90xWlkp1UU/GSMnSSZWP9QVV5fvz85O8Bcb1eRuzUjEv7SZOvvK8Ypytajc//6uwgvDO16oiDJb1lpXcvQzIvwQQIHfm1zfsklAax0SGIpz5NPqurQgf5h6ZJxKCo/Qvu1w/aagOPf97wJBfhvjIVtZ2GsMdgnVi9XJYp2/cAjSrDXnGHNgAwRJtBMdYiM0tk+NV2aCRqOQKzNIivkV10FawWqh3OOCXTqjbU3sdw+Zl2+usU3Pzt7manbb7cXhZkd04A6HFv5dSFxMCCjVHveY2pifIB4eOVkOqdsfItqgoMl4aVVIjh79T+q5V+JPTRSYK1u1A== Received: from BL1PR13CA0334.namprd13.prod.outlook.com (2603:10b6:208:2c6::9) by MW4PR12MB6952.namprd12.prod.outlook.com (2603:10b6:303:207::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Mon, 8 Jul 2024 08:02:28 +0000 Received: from BL6PEPF00020E64.namprd04.prod.outlook.com (2603:10b6:208:2c6:cafe::37) by BL1PR13CA0334.outlook.office365.com (2603:10b6:208:2c6::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.19 via Frontend Transport; Mon, 8 Jul 2024 08:02:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL6PEPF00020E64.mail.protection.outlook.com (10.167.249.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Mon, 8 Jul 2024 08:02:22 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:02:05 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 01:02:05 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 8 Jul 2024 01:02:02 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Cosmin Ratiu , Tariq Toukan Subject: [PATCH net-next V2 10/10] net/mlx5e: CT: Initialize err to 0 to avoid warning Date: Mon, 8 Jul 2024 11:00:25 +0300 Message-ID: <20240708080025.1593555-11-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240708080025.1593555-1-tariqt@nvidia.com> References: <20240708080025.1593555-1-tariqt@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: BL6PEPF00020E64:EE_|MW4PR12MB6952:EE_ X-MS-Office365-Filtering-Correlation-Id: a1b7434d-7503-41ff-9dae-08dc9f244c36 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: cXqxCKVcEpZhN3WaPLa3nk9K0f04QYh0aKjZMnBzP9EMQtljhXY9lP4ET34f1hkDrMwApyudf34C2z0FsXiT8i/lo5dJdx/4OD/6N/mswCKEoSVIzJNj1QL/QDaOXZ5XTjl4DyrvuHNbc/jEofjo05ldxoMVR6WgnAdbtebgFhPAgGCsAIK4a5zXXiltTq4+gocNIzFTaBXmn0w3wSro9R6AOLITqP23cdTFQBGjCYwmtHGI1iH47ShQ0BOjxWMSyTWQ0YFk6cU+3X6Ns/6VlEF3MKkabWOSAC6mbH6nI80bIQhnbBYkENcbVc4/D7wka/CvXblfzmKDXv26azGGYbH56gzsCiD03Y1Aa0T5LIg2S+RVI6pgRncp6iQUfgucr2i1lXL88onc52By3Tb+uLJHKcuW9k1URUZC2RUeDYc1Zy5SxJawD79r84zjq2SuUNM/9Q3h3jccG7ou1qYAP/w1Wnbb35rCPBeoJx7+Db6ljqCOQAsQV6jtM40pyBRmvOB8/aqX8Y8fl1SV2Wkz2UOq/jyoMRFWas5TUS2dVcJs1QbWA1VQx6Q1G3VMqfvyF+UJCQSsqV3r0+lSkmrA5lQsji6fUSaXjdlQT21I28RN6nvf0Unt84uR0F4POPzteTphI5+lygs6vFJPzZJg0InuJNwTsooai2iqhP9Q+4F36NA/V/OIaIh+su5mowMYZALDuZvwEiUL3Oi64BPXxwX9AbjGbVNnOXaZjcSBAohyN98cTGcrXra6DhXZK2PlQqVwBj6juoaFR6YtistK9c6MxC9kki9NtbE/FeP2QYgQ5ot5ij0jto+zQ0jDf/8aARDvm1o3MQMzoD8DdoDfPCOSDgN5mZ7Su5cjJ2upAdNIYRU3kR873uAEkjo5lnZetJkXxGyY162EJ6RntzCYvAnRKdLiJLEW7fea4iVePzBXIgkvrBqMO66wz3FGW5eIzz+g9aCfK7NK5XxJ31Pikc+BZizvNVFMbKmqMqDVfZ5Muzzk9QFSfNBQd7uA8zofCJKQW2S1z2BmoeH1WdUQXR8dzsZnYVBcPGhQJeyWJ25yzuh/0nNDIceNOjwlMuI5sdo4CQG8rLN5EZhppHe/J+t4dHbBuEfgYp44G0yrdcFaoag0GdiE9qTonHMwOGdKsFP3HZqrjE0KPWMdG+Q92TNbxuKDkDq9DvtKJe6BGpguoA2s9fIuJUQLeFGaKIdQ7WB4ft3JfXfvIp6e1tQXVSOWHL8zMJFQwagRaklR+npYifazDG0QTyIqMYeFyLgJX5jxA2hQYfRy301G5Fqlyv56WDZ00Y+WfEcwu9+FwGFYiZddXtl6B+B/w6Y6g1AYl0bjM28umLD88/V8aLTlOBr2dsTySxp1/PU+ROEHOCqrPReLAhmbsoFLToAMIWX9Njnr07Itj7K6RMBOH/y5cuUIPoMAdbJkXe0UMXfkd9svYfctnMslDGd3LprMIXYU X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 08:02:22.4023 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a1b7434d-7503-41ff-9dae-08dc9f244c36 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00020E64.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6952 X-Patchwork-Delegate: kuba@kernel.org From: Cosmin Ratiu It is theoretically possible to return bogus uninitialized values from mlx5_tc_ct_entry_replace_rules, even though in practice this will never be the case as the flow rule will be part of at least the regular ct table or the ct nat table, if not both. But to reduce noise, initialize err to 0. Fixes: 49d37d05f216 ("net/mlx5: CT: Separate CT and CT-NAT tuple entries") Signed-off-by: Cosmin Ratiu Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c index b49d87a51f21..8cf8ba2622f2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c @@ -1145,7 +1145,7 @@ mlx5_tc_ct_entry_replace_rules(struct mlx5_tc_ct_priv *ct_priv, struct mlx5_ct_entry *entry, u8 zone_restore_id) { - int err; + int err = 0; if (mlx5_tc_ct_entry_in_ct_table(entry)) { err = mlx5_tc_ct_entry_replace_rule(ct_priv, flow_rule, entry, false,