From patchwork Fri Jul 5 07:13:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13724457 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2067.outbound.protection.outlook.com [40.107.236.67]) (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 71C9413C9CD for ; Fri, 5 Jul 2024 07:15:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163728; cv=fail; b=tSoRg5ZRwb4hDxThFBLDxNDoj2/pH3x5boHPaoOe4aWUV8bmvaX58NokJ+J/ZmM2KDfiPjd/IfUVW+ZETHQXD1qjcLtuxNnvTiD+zxXDTX9kNQJ7xdxaGSuDUTxsDgMyq/74Jdzu3agghd5oHZRe/SkmkpxVpPuWPs3r64gpiuA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163728; c=relaxed/simple; bh=AnhjgvGIV82k24KRmrNwKdWUz1xIsA9OC2t7P6HGyWc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Al/PnlH3KAF2iBfSYfunKxKoLbL94atPTFfuzwS8f+8Pf6eTksvm2CI7VUVq+c96J96bzXtVd2BO/SCaNYQn6faPmN5nwiB7gjTrxHL4L/gkdQVQUYMVowbkkHd86Oz90RQ9U1lfVDJA/kcxWvDQqEUNGm+viKoHWtLWZEOyBFs= 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=rSdie5K+; arc=fail smtp.client-ip=40.107.236.67 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="rSdie5K+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XcxrKroXl2pM/OQNH+NOjfyo7LRQEVAfCUM/9EDLj+iyF3At9wQrKBfal7yVbOp1LVPYA8bkcABTHMUWlONjRKzY9N64HuxHEZK/c/M4zq5T5bJWBcWrvXwgFPzfjZ/oO06p9bWDfzB674g20cCScxKJK5Y++Dc/P/IvegzmgHdp50XIBs8uCN42huLrodhUczKQSWRC3XShSxR7SRMHZcdcVOePeqDtdwnZIPpg8Q7LhPG5HHPhGeGsMlmy8+iXvcsx/e21npmhY8V/TrnBwB1bnmbnqtYzU+/ScQfefy54UbpEoAMLgMaE4nDUOG9rsAqQJmiMGb9VJdr45vq3EA== 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=NdjPRwnRVnLr7tBx8g3LcaZILNfeTmLo42nwtTB1Xj1V7m6Zu3zxBzcJBOsMIbk67ttw+0CiHEmsQXN45exWSBJMUU7GkFoBYSJKWc9uvWm4l+f+FNF3yl9E4z1PKlEBRtGN21bgr2Xe1un9DZHcD/fhAH1T66xn45bSLsRGGhB+gNpbTT11ociMyv7aiIjNc1fzhushpzQNt6+Fvpi2On694UW6HyheCbkD8k8dXjQhRh8+hLU50bmUIQksIleEMxGWCgwbiLsCevxGoQaRp4XQxVg5fPIGvzuhCrbDsweUpXtwumj8+GY83vA396gb2eSYKjhhqTzQQAL2uY6rtw== 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=DHKFhVc/yEW9RV8BNv/0lEwVfAPcgMqyKxr9icBTMBQ=; b=rSdie5K+ZL2guTPz4YwSbgsM5cK6GC39lMaeEgersk+V9y/w8QAww/w7aNIp93WJTkJ7z+8N0iME6w7S7V8ui+9wbAOeAti8igqiQtUnj+cBrML4cDiI6yYzzHE04lo/P0HLef+CQM/aDFXDtxs5FQ5MSYRz/iq/7HPi3DMOZm3FRoHSiApIHqm6RtL2XREEfxSecgmSR2AkBSnT7VR7BDCsM/dxlTn+FiKxAzYzJt8AZ9NU/Tb/S/TnlvX5gVrhiTz7YX/45GLHyiUdVoOm4DD/0IwoioUOTj2MKv9kCqROpRrFBIsikKsVEQaJ+ugix1jLB7dVbuKkfgFVOeHSiA== Received: from SN4PR0501CA0132.namprd05.prod.outlook.com (2603:10b6:803:42::49) by SA0PR12MB4445.namprd12.prod.outlook.com (2603:10b6:806:95::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.25; Fri, 5 Jul 2024 07:15:23 +0000 Received: from SN1PEPF000252A4.namprd05.prod.outlook.com (2603:10b6:803:42:cafe::e7) by SN4PR0501CA0132.outlook.office365.com (2603:10b6:803:42::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.12 via Frontend Transport; Fri, 5 Jul 2024 07:15:23 +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 SN1PEPF000252A4.mail.protection.outlook.com (10.167.242.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Fri, 5 Jul 2024 07:15:23 +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; Fri, 5 Jul 2024 00:15:12 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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; Fri, 5 Jul 2024 00:15:11 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Fri, 5 Jul 2024 00:15:08 -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 01/10] net/mlx5: IFC updates for SF max IO EQs Date: Fri, 5 Jul 2024 10:13:48 +0300 Message-ID: <20240705071357.1331313-2-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240705071357.1331313-1-tariqt@nvidia.com> References: <20240705071357.1331313-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: SN1PEPF000252A4:EE_|SA0PR12MB4445:EE_ X-MS-Office365-Filtering-Correlation-Id: 6799c171-ef56-4c2e-4bf9-08dc9cc23cac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: I2YY+fxFNq6Si7VKk6q8QLyHSWW6/T5VsTkU/475rG4P4XoPyjK48svySRCIC/JgeikLV4KCDAfjAZr2Aw0/sWnEIzEjqB+xmk85hXVQoHjmftYOHnyoQaecWGcal85nuhQkoT4u+QLSVS4ocQbFRSIHee+2oTYW4MBN/FNrsDQX6S1iv9w8tCeYeYDJv5wFAMQR101A2CdFT+6q8RQtYl+2kltxAhnidBXwbLUEWJFInWVJiPs+kElQxbf/Bqf4GR1RK1s2J/4oO8TD82L17IyqMVFcyeYY9wGWxwpqBtjuyH43rFRnbJQzJLwp3tHY3Hp0QjJ9DRB56frcCoiUVKRS4vFl44LH+BJREPDpex7xSOpc1XY5BO0hdG7bi0urmOvQ+SXby+KqWZWzm3taoXkV3HuQfiU4p0n2MCQ3BZmZWxwRzDufMpwX1eAtcyTZOat0KPFr2FOncDbfzJElcCWLs7ehK7N5xvYMLFSu7v/48SzpbmUeL8kgE5T4RBIxTxHmCxJU4G4eDTio4YV1zll71rsWpoPiBo0jYGhuq2yxyqubMmoKdoAB8nVaOLhlaKxUyGnNoeqyGKnHD5dylaFqm/QlNLsRYxJMdfDvjxr+PC/5R9ipCOVeUwRX+bwNDe49HfzTdItFFXv+pWkp+6IhZQcreE7qcoICCEABpFoMZCVlzkwpKbxL5M2eniuEGopaRmTTT9vWPUEXItljy57Fu8GJKfs5may5lRgAfzGnif7NF3WXLmyAg8nPBxTuSB6+yLJJquue5KEAe7Ywx37GVHduTKiqNBLIhVoETlPKH1G90uJ3U8Y3rh9/2u90lk2TtVVuCKQnlOgoXASY1HzN7j95cMaI2jHPAF9O2v6y0FYubb7YTSHUckFLpOZxgJTbMDmk0ngYIaYw6ud5DkvTT7gAEUhFbn0j0JJtbJtH2WLHe9MUZEb5ASXU9VWTydbwJ2vix7TjyWsYh4XBsBmNudtrqbj09+ybkbQ1TQtryuZN7PykceY+Ahm0p5+1+9zEL96NhwtJbBKkMCdkRy++UCsPctbu0GG5kJFIoVbZKIJSci96t7nEsFi25yc/V0bwJ0QZSsZFp4c+lvS2CslJK7yM4866gLBW/jsp1qDd9104zB0Bp30MIkVM5zo3LLKpycj7sNJAkA2IswMiw91cELysNOGLOIjt0Zi0nc2c2E/XqwZ2BsH7bWG4HtPWPvwshSgmrZoWEm/zoBC7t9l6h/qmb8Dn9BxAJ+8JOMNkcjnPm7IzOLi0e+9hiy081MkZq8LKKBnW4SCmqbmIyWi9Xj/cYvVlcHHu2YoFZTIdUMgNRyx1M4XKDo5xW/i5LJKJ5bay3TxFAGc6hSgXHfv1Oj4/7iie0TuCeotmMZFn2ht6+Cn3URb4qtG24WeF3d4yX+0SJlF/5u/TvJ9iiblhqMcf5ErWp8w145hXv1+8t4s6Fj+K5oVxoQpPHRET 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)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 07:15:23.3874 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6799c171-ef56-4c2e-4bf9-08dc9cc23cac 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: SN1PEPF000252A4.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4445 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 Fri Jul 5 07:13:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13724458 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2075.outbound.protection.outlook.com [40.107.237.75]) (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 33DD113C9CD for ; Fri, 5 Jul 2024 07:15:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.75 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163736; cv=fail; b=ZFtmtyAIDEmg36gFCPDv36WrLnlwQ4OmRxd6l/WYlzql34AhjAd6gd5DRX4o2Ff0AwApZLqS7YghzcUdGqmFOfKQatKMR7besHd12qIILaI0ijeA64boqbFauy+Wkh+u9IJ2jjQXoYF6FhOwiXrJsv67hvDGNhz4bM2+r+DYkpA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163736; c=relaxed/simple; bh=qLW87sf90SxjtLcIOWhTe8TqRhMRydL5V7X1kg52cG0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hUYBBD2bU/FPEi0CrujGd0YfGtQk2FKZ/ycyvyRG+uKMHFjLFsBvwIJHjpwJyky1zdjT+Pli9Lr0FLk1OTD73G4a9AkoUfu6CPUhJOINIZ6HVEfgt0JQmxRq+WxuA1FUW/TVcKWH36yeelwwjYCYVQztsv97g1I/BB0I805Z0PU= 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=AlHaWprj; arc=fail smtp.client-ip=40.107.237.75 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="AlHaWprj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XayU6WQjqnabkHF0Klp5YS5+HhG6VKeVPBUM+OSXYRuNAu12yvSG8o/sBJk1SwI9o3o74Qvu3+BegpaG14TkkV+K+JtXmxfHVPS8dl9Dp2ufyONe2t/z4mqHdFDPRwdBLAjZdfgAzMjdujuRXgwVPCokntmvTXkJofGpB0RHtkJv3KQ7lLI3gV+nDVPCmylOzlqlvUZQ8UZHo59t1YX2E83YaD4J51b8kMngX8fltJOS5Pows0rNkLI/76YClUfnz1F3Uvulqr/FOry6zzSzqItbaIl6m3mZr8/wTqmcKdUU5Jz6TzG3KK5A3xfugq+kab3lI6eCYSGtv7hFkIS83g== 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=YwjaTNeAhXZ154wKn4rrLvtKxN4wRZ3FNg3ruJ6XDaZnawRhxF3ztt45qB+jr3eIXfSsNUQfK2U38Q4S/7H6cRqLBxaDsvMPC6QzLiZ9mGk8R2xfIN36FhTB4cDgTWRkHK769r+x8el6bg0JYc+wjoJLU3ktVMV9ku/LuYgrDv+oGs4wTBVRTsmXLffKJtAkXjoXc37tJjFHUnFZ6t4lSZ2JmlNX82a4ajMebD3irXEawBDQvQiYv+aGRh2DoPQL0rInFdLg3P9l7A4I7knvww6ALbSDmKYGh6wPS1dbl8ZrSisB6nOV4PJ8oPpSiyeYDo6oru1DBEBU902gC2JgIg== 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=AlHaWprjDTozUllqDwlpKCpnWeKJM9MgQ3tjYl+zwuz2hunK3uKaCuoKoXXj9zJY0dDqYALMwVkZFpPkk6lrECe25KIzNV7GLPqTdlmyd2VkNDs4+GZpX9/CkwLA89MShrfDAP1omyXXxI0MK0iNCUP2hqOD8xl6mhCsIKahtzhqrWrXLZ/7gcOi6hqfesdEKPfbXEkEF8vWZpWkeIDoyeE5Syw9+ta5nIb14JrCOctPX8dOxbIL6OZlqsOj365Xaf9yj5yhRVUkbPS941iNYtLnzDzN9btwXhy9l6ERyGERh2u+KYrhT1jq+FlamYaYPrDwvNIXu49oiflECPL1Dw== Received: from SN4PR0501CA0119.namprd05.prod.outlook.com (2603:10b6:803:42::36) by SA1PR12MB8164.namprd12.prod.outlook.com (2603:10b6:806:338::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.33; Fri, 5 Jul 2024 07:15:31 +0000 Received: from SN1PEPF000252A4.namprd05.prod.outlook.com (2603:10b6:803:42:cafe::a4) by SN4PR0501CA0119.outlook.office365.com (2603:10b6:803:42::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.14 via Frontend Transport; Fri, 5 Jul 2024 07:15:31 +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 SN1PEPF000252A4.mail.protection.outlook.com (10.167.242.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Fri, 5 Jul 2024 07:15:31 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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; Fri, 5 Jul 2024 00:15:15 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Fri, 5 Jul 2024 00:15:15 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Fri, 5 Jul 2024 00:15:12 -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 02/10] net/mlx5: Set sf_eq_usage for SF max EQs Date: Fri, 5 Jul 2024 10:13:49 +0300 Message-ID: <20240705071357.1331313-3-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240705071357.1331313-1-tariqt@nvidia.com> References: <20240705071357.1331313-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: SN1PEPF000252A4:EE_|SA1PR12MB8164:EE_ X-MS-Office365-Filtering-Correlation-Id: 94b99682-dda5-4694-fef2-08dc9cc2418f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: 9jfLBsN9kXqd7kED6+6ne/QlDJIJDJK5sZaIRXJcUj2r/K1sOF/h0qr5nhWboFUtsiCNsh2CWNNP5kyb+DqRKeItQXrhVYGMzNcYgAnZ+TzAjLmo/P3FU5zZllivuiA5kUbVREgBXkq1eDfmcSMCTwKbG/Hzw1mISxhFM9ebOZBNfCvJdBpob+wat/BuYUW3HXs8w/homsBBTUmvwTtPzXUQZKVwFqbtrgak0aB/64CN+wmc6mHP+RLHxedMrccicEBpkMjnSyQNxA/myh39loQyxxqA0HVP49v79i94gaBaIQj76PaTyJDQQN21QbY3J7vB4elLq+4ZZNu+62rl+5NH1zT21+EiIIebNhRIMxFUE2dmNo6aENROBhdOwZvzEHs0hB7pXP5HKdgdhCjNj5PTiYIm4OjdWal7FqhR7s+t6B1YsLob1omW2UeHsQtqmpj9mIMjEPuABhiN8yu/jAjFJ9E1IuO4tl4vMBzCZFij5rtlONZuXl94HyA+Zk/Y+GAorPQxvw1tzWz2vr4n4JE6qikpPAwoyfZOnvM2Ce1n0hoJTE9bqIZHzmaIPXpKjNCTy4qkFx3ND5ewzYr/6tDp940Ny3qTsCSTwpr1WjVeD0CbtUzaRNcQiGzcYpWuZrCt3StGl4G+1IUR1DUHNXLjYc98MXmYGa5dOEcsPPhMvVJwLWs0ZbzOjoBSzwKj22Nyubb/mZEQtIU+aCuwo/6EKhwGLBbeLiNd2A1EtRrcjhl0bYDFOv4tu7P4aMxOo+A0bS6PxVIsvF2s6EDOvv4G/U0DUsPYNX21KNqOG+ucxxnQvFrvhfPyndywv47pzDAK/p/lops3FHOLztPWSKdv/oXms4NPsdwIw8ti71awfnMTi8//w48zOAgkaTMGRltXqzqTOr3cqQFb6BXIBeN8u1+pXSplEGB/imIL4rIr0hI5mmzRfUzCpSFLtS6uGRMfokqaXkdAeY5KBJuUW5LeM+jKWDP7A9TMtqnnphU7m/U2qXEiMy/SQltkCJzHAH4iPj7JkL0HfVvdCEMmE239oKHyN1FCa8lrR8pNTkCj9jr41re2j5x6h5f56PKWdbwdnFA7CQrbli9hNtNxPBNskbPn3Z+loQCUV4Iqd6hYXpgiGHbfoH1SYXGiY2ypG3QWq355EVoByVN9jppWTcQfApUHTzxPm5dwHfEUYeWxMcLUPJdDet5fSvlPdR/Fw0XSScpj8hDb2GirgTGzftQEYZrbielu6ZnkEmhroqmekkLkhp6PZ80AjTXpx85hAtQxC6VPoyIMEbdFqVa2OC5EsdJ+zHnrusO4rUnHhn6LB62UBu7Mo60eTyvD5TON8XkjNhgbpJlG2WQVwq/g9Xa6Y2W2yYzJhAHvr2KrrWyA+Z6fJbzO6BnPVzX7+rcIeg/mPU92Mqk9X3eDAzbB8Y713KkKENkX658owN9CapTh+amHFVrSW467ERi/Dc+Z 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)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 07:15:31.5749 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 94b99682-dda5-4694-fef2-08dc9cc2418f 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: SN1PEPF000252A4.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8164 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 Fri Jul 5 07:13:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13724459 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2054.outbound.protection.outlook.com [40.107.101.54]) (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 295F61448E3 for ; Fri, 5 Jul 2024 07:15:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163741; cv=fail; b=szfADlxUB/dTmpIonV9gA36ZB2UwKO0WmdldWYDxw0yjS/XlPrYlAO5Ouethu42N+uqpkrHX0IAESHcxfHL3vL6KqUD90CDfbkXTZCtOKYDQ11ROlFVHRYDSRrNCwZMtnQGIlQfgo4b/DH8QSW38ZOwcIqhwq+ae1q2xUt0K3mw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163741; c=relaxed/simple; bh=Abl/mgl+7k2eozKu2ALzHu4Z5hyOl9gTDa3xN8Bvaxo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=t/Ned8gU0nzUW5iwHNl96hfratIvteUFaGD88mx5rvBM/pFnNtrTMTvMxGq/h5ARLvXIl3o+u70+f39bjwI14RXjHzamtixXYsdu30MHqand5d3EAiSwfBspz866RddLaMSA0TCnlp08t/5OFhHLrT7WpzYoB6rQoCUi9Zlu5wY= 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=HRth6uX5; arc=fail smtp.client-ip=40.107.101.54 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="HRth6uX5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jqL39paIpAZ7QLHt5HK2xE5g28XOtZkMb2i7vU7aSdEpuY+c7DWZXx6KQHFQb4xNeWR5pLIytoTqZ0surrLuE+yf7KZqxL0VlMJwWslPII323Mi5Wsd5ZpfQ4klOIMBgvdzxOmUQNMjViu6aVU/MQl83ZM7EmUS4hzc33laBd4+5fSTMSv7ToaDDD2rGx33es+jClp89fxA5yOVwpf1/OheyIruZL8CM+eJHGYvB69zwKeCLpjj1ppo66u6eOV8UuDrkdPbTOtgiku9KOujCm0BVarlqr3zIYYViagvQGPOA8z8cW4l52gHi0bJBcnpzdTmBRgRNzAd2ib/YpNqSTQ== 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=XIJ+w7xFKBG7tgQWqKNviAyRFcATq3sF1NXlKmUfEZt9Wt0x+4kh4M59JppJwTvV01J236jCOvJbZg/i3K1/O/TwRTZoFiM6N32hnpzyPw1ORqGN78TiuXir1WyHHlafJKtpR6NadiZFxiRC+wF4usUOqjVS5E7s6pJFRdUeJbJ8pJqCUv3+HWFrx5l87/BiKCKh/kHFXCTTVCgwvJsrk6e+9n267oao7TonlYN1pCy/C1rhkWZ+iJc7cFEWmU5VY5lQKRcuxvox3mqNNPBZfuT3fFcI2PrFNVBkyrRgdeIceBYcNl1lgJBrbWeSsMLb5P097/PZrNt7NUiERg3rIg== 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=HRth6uX5GAl0MD+hcVMP1laQEiBkPjau9NAwfo7KXFexi+QfEqCYJBFVxcYoI26vAVywNfpNhkq3q7DE39GJbNIwrZaOLCG43HcyiNaWbQaII+cRBp+F6y0rFOFtRdn7568VN4nyysZIB3frLibQaplGxdSZxGTUqs0VB2WIFXN6tHk8CmXh2ewrAPpiFHvEGxV+baQNRywO0TyOu4kwohfzXEp9rIq46wXQ8053ayAVj50gNIY7zqHAyTiZEhwjZ4G5SPOPiOwbNiygS8XHVdnWE+ynNCcGhbnjDdS/hTPHQ1HgEEOR/pEZbgmCPdD+Tks7DoVjciCtiiM+9KffBQ== Received: from PH0PR07CA0011.namprd07.prod.outlook.com (2603:10b6:510:5::16) by PH7PR12MB5832.namprd12.prod.outlook.com (2603:10b6:510:1d7::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.29; Fri, 5 Jul 2024 07:15:37 +0000 Received: from SN1PEPF0002529F.namprd05.prod.outlook.com (2603:10b6:510:5:cafe::b7) by PH0PR07CA0011.outlook.office365.com (2603:10b6:510:5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.29 via Frontend Transport; Fri, 5 Jul 2024 07:15:36 +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 SN1PEPF0002529F.mail.protection.outlook.com (10.167.242.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Fri, 5 Jul 2024 07:15:36 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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; Fri, 5 Jul 2024 00:15:19 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Fri, 5 Jul 2024 00:15:19 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Fri, 5 Jul 2024 00:15:15 -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 03/10] net/mlx5: Set default max eqs for SFs Date: Fri, 5 Jul 2024 10:13:50 +0300 Message-ID: <20240705071357.1331313-4-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240705071357.1331313-1-tariqt@nvidia.com> References: <20240705071357.1331313-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: SN1PEPF0002529F:EE_|PH7PR12MB5832:EE_ X-MS-Office365-Filtering-Correlation-Id: 2354f2f3-77f6-4069-ec51-08dc9cc24447 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|376014|1800799024; X-Microsoft-Antispam-Message-Info: BvT6kXOl8qfaKCp4Xd0sVVtHshztZt+zIHQJ8XoiX71xaFOKmLCrnpxLTVNtfxzrhx2+uT3jNV3gj9XZw02jvtzspKK4qBA8DXYFINzN887ZC/bp/17Q+My4AgS0goaI3V7Ggjl4GxCSBdTzDzD/F77Ei6SsDbGbanAZbcxJZ9u8WNBNXjwU+2DuwxZKLxeESIErxenWW61ojy79NvUM6XkGxCfnSaQVNHHoL8WafasboWipBzSOsEHeoltigPV3vsVz/ANYKEPrCmxdB8yvesHIDTr4egqOngWYFv+8i0kQ/ut5J+5qavgwJkcA3ScdHK39wVmoV+xYb0NSUihILn9FOceoyEzVQG71qlno+AZbY1YzCgKTBbPArIGivWYXLtj7npPRPt4ZF9Jzw1kR3bMO3mUFI/LfZ0bNu3W5WHzW0iOAD0f1jliq+u6Jvkhr8xLrlwzDc6HXVvsJzuyb8XctAOq41l57gArjWosk97GqCZhKMaQLw/7QCjXFrzydSreA1P4KCoBC0BjlG+nRpPmpfljeKtVmC8a9Mf4P4BZR4Vo0PBEOQ56jaAmJy/8eqIB3R8fuxukF78rWc9ZNWpiFli/yBMG6ytHDb+JT5UiIcYht89AjqsFmNPUA1Gk2XrzARF5h0PX4RljHLmZT3esNgpSIq0o0g7SnN1uv35J4XiI872PMylKPhml9HizIa47PMUy99Rv+NQsHd/erkvVtPAQkv86XLg2Tfww6rHsAu/mr7g3BJrHQkSdXj5hUskjXP+kG3gCdc12dNRex4An9WrA8FJbf0mubgcoHpIFHqnv+7BrRpL50Z86NXplmdA+AwHGqcya+l94HI9F6B6x/NMuDy4sWXRG53b1iDLFIgv6yuuxw9OzGmUeLfRY8KXKmZzlyf0gGXizpJ+bOkckyvUBYt/uVTRfyTGQlP4vsQQDN+MsqgfiN+RInu3gcM+Um8GDpNo1pJRNh7urrnnqxAiz/+jO89CdJnRtuGYdr9/fYr8/NJF246jzlEqCAJK+TNTaRyx/lh7PH3RWTjz8UDfVXTPzPgZjQj2a9LYlR0myk1NJkeiTU8Mgl54ZxkT203ROnOyg+nLJ8YFMVbelIV/Oc9eVThQHKfdqRFprSiJYdeq+S+DRjKcv0zL84lBZS1Pu7wX+qOWw8tXWkaXchnIhUiBeVGQU7GlUlPCYlZkFYLLZ4sU0q23UPhFILTqYkPa+/OTQmoPU2gixz5+q8kBdk7AdFPGx3oFQQCfwVESxokaSphjeC2cSIA1Hlqf6ocFljCeT5DMXITKm+f4NO0z3xNmJhleGF5i2UJ1cI/78Iyu1GEnEt2YvZ0ZPsbASd4dXBrjtsTuHfFz5N6WmMxIQEfgzfF8ILXqtuvhY8BlOZ35G5Lwd82I8cf5hoQsp9n3A/+Lb9Ba6qKP0tsPRD5cRADvfrhMDlwsFSRzmq/3rqVvCMFbElARhO81Br 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)(36860700013)(82310400026)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 07:15:36.1670 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2354f2f3-77f6-4069-ec51-08dc9cc24447 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: SN1PEPF0002529F.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5832 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 Fri Jul 5 07:13:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13724460 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2044.outbound.protection.outlook.com [40.107.223.44]) (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 BC6AF139D1B for ; Fri, 5 Jul 2024 07:15:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163750; cv=fail; b=DpXP9hu5+eyMVVALc4cEqFAEwMq7YsIpDLKcqokV8xjHdCtAYS+2RxHeVLm0uZhA+TRI91PVbw85vJWJ5lV+ooEZ2icXi0IBGivzmSKPayHoto5V4vFer1oMU4HomKvHC2DRS2ldZTDU0Hrh8oPODa4yuXSvs6c4WKxqM56Zi8c= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163750; 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=eQ2VcUTWkXbNNhIikrr7zy4ivWcYiqDT5xn2BdI2gjBvksYW2SwXm/g79HkFw7lWRAS50n6oo1T5y277bFcpYLI6x17Nuev7gquanqWNMU5a28BY2zr9Msz8KoXpTYcHhzuedf6d8gl2iKy1t39w+xz5uely8DU50y3fhsgwiQk= 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=eP0GjmaG; arc=fail smtp.client-ip=40.107.223.44 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="eP0GjmaG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ivyZg62uOcoGB8dZx71jSR7HyfWxSYFiUxvn+JMJa1NHGOCOXa4wGMh37rlcE6RhSdsgTn9SwpF4dXKnbbewFd2by/Fo7naAWf3aSuJpvKGucroAbrQhOSB/LdXaupjIqa7Ix4I7QXD2CsShQSKm4JL0IZ5c8vUK5lVZMfvGu8iTEdMuUFWwm2waQny8vGefBj+GEJp4DGwXLdBp6a9FZaXX26R9sdIlsT3YOY3/kpCF48nnjbTbJx8cj3Aaj97gOQkKQjjObkx4r+PoWYK7PFV+mR6XlxKbqz0gaIeP/MAUM+S2JibVzDn80HsMegYSM6hyYCdi4p0vGQ/fAoVNMw== 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=GUoF4ZQyQSQMjESfGnuIbu4QPHUM90UH2qFnI+wAFXSRHliwQV0k5HEVvF9CFth8dEYMzwfmaS7r1W4EFn8nLFksb0pXiJ7p35HNa4EEpnKAELcdeNfePUP+s5FsYQWJItlgHnETMQRblygtF6Q63hSaylX77pG71/qsRtWQXbW8HKPwsWMPS7CmijFeDsXigAZ5v8Kd8AL45mfqY9/xqxBLvZ8iTL/sLfdLct3l1KhgGlrQmY5udLHyVM2KrgGUNp48Y2NvYCxFHqZqL6zkU1/falK5fvvaNeawDrPvGkeoJ9f34vn3NEes/xrklFBdG5Zgqqvo+18TEl2a+dG+qw== 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=eP0GjmaGbVGtkmrDXhYVT21UYJKh5wERrIOyVVoSGFQ6GERyVnlkYQmWq4y0aLHjqfIWtN9SoPfFKSEdgFUlyJ5SwxCZcteLr2vrR5u/FCbiiUOmHD3nVKDPYGUzsW/HNi0Iks86XBnLTCCHPdwyChePyUA1lQG8GHoYjMpj93CZTuG+0AKzspVMeQbthCJv+kwq1AkNjTCWHXIK2IFDVnYtUUuUziFZAXCAMPGeqJGkrif69tYQT9j/CaNSkKsSfiRCW2a5JTDz5PK5BgQhe0lz89KvWXoeFPC6it+jMuzr34Al8CXupURFlTHStNdB1tG2uReCZ07D9Bz82d1TLQ== Received: from PH7P222CA0011.NAMP222.PROD.OUTLOOK.COM (2603:10b6:510:33a::6) by BL1PR12MB5875.namprd12.prod.outlook.com (2603:10b6:208:397::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.25; Fri, 5 Jul 2024 07:15:42 +0000 Received: from CY4PEPF0000EDD2.namprd03.prod.outlook.com (2603:10b6:510:33a:cafe::1e) by PH7P222CA0011.outlook.office365.com (2603:10b6:510:33a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.30 via Frontend Transport; Fri, 5 Jul 2024 07:15:41 +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 CY4PEPF0000EDD2.mail.protection.outlook.com (10.167.241.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Fri, 5 Jul 2024 07:15:41 +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; Fri, 5 Jul 2024 00:15:23 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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; Fri, 5 Jul 2024 00:15:22 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Fri, 5 Jul 2024 00:15:19 -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 04/10] net/mlx5: Use set number of max EQs Date: Fri, 5 Jul 2024 10:13:51 +0300 Message-ID: <20240705071357.1331313-5-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240705071357.1331313-1-tariqt@nvidia.com> References: <20240705071357.1331313-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: CY4PEPF0000EDD2:EE_|BL1PR12MB5875:EE_ X-MS-Office365-Filtering-Correlation-Id: 0bdc846b-a366-4f96-94e4-08dc9cc24748 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: zOoE3dhh10LtFVJjZVXKRy4vaJGvJnUHhCCxyX8igAWyuJVUR3YoLRYssSUN+IyCvbmPR5kPtBgOgrYLdZ94O/GXJt0I+XyRDpktsA8pfxT3SleWzSacR/w82eb9tpvAB8Vo2ygd2EMaM7S3Fe0GVyckwrvGRl0QeNJ3HNZ7vz7qRJWrU55tBxgC6wzMhlBpR+o+fP3p4Cf6723noxLjTpvd9QjvwtJvcIQ6yuZ7DBRn7kE51Rx/uOhjtRwJDaH5VXmhNt5yU61E4TEugCnKEZLPBmXNL26Eh2f1Vbs4Yr7h0q0V09ku+zQ1S5IprrnlM8wdVWU+w8UhqZy83oWTJHCN/++1S+VyGdCYOBAIe7QFmjcP4dF7wlUkM5KQk38fzhA9YDyYsFOIzJXm3klmmvjhPVMthLaGHeSitYuGHmF/DA8245yjCG4RGu6lZn6LFb3c0MeJVh/XB3mU+626qWPy+Ik182rj6dDkMtwcgvgfN5WEg/OB2oQgvG8Mpnz56YJlQ4eYHE+KurwtjaeJ2ddQZGm+lRaGc9k+9G971oG1FjpVEcTHRhGk7bJAkvwgsNQBRUbomICyewmN+mQdzkoPij22W5443HN+eAHsECFb2QK/g44MMOOFdRzBN56uRSmzwQwpfNhWTvTqnYkpJmfKCZvzNogCNLz9rF+G36dvCXQdbcL0HDTY3apO2AVUQ3+wowOKI64N9YBYKk1owh8w/5Pqyn6jMtj4OZeNwXfy/nH9dm+5daoIREytf+dG9awKxQ+ZSo3APxG6znHeoVObMa4W/ZW7xk1LYjS0s+SiWThut/zN6Tao6d/dKaoGliqU1ouH5aLtOpXCuKDpxphkZKqxBa73kUDfcR9uxTERrrDcbpsDeXnB6C0dpLI2KPkDkj+uxfbHcq1djcWFjVfZu6U43hyyO80WpIkBEXgfh5O+koDbUzf2SdI11152WL5pVVMllf0py/QzDGGNdTK1tDaB4iGncyhQ5yiuyiySxm5J1V3Aein1/1reDO5hWtoVexssL57+sk1om4uEi5JphqkzjrXq2vkNzWe2MyQI8/kMGD3Uu+2hYsZfxia71aCsCnlzxPxcEMvVeXbkxtwBJ+YTLFrzbcgs5wMjkV0tPLM51lLqgZ+ybRR0CX6aaU8BvTzoqzViE1kFqY4dYSxip0/Gads9e0gwN2Kd2qbmZB6EmV/8YL+0fXDPusvOaphgpALadj7fAZyn6hMGipXL1rGPqTtcIQG4DvrLaTSZVwV1RaCqKuKD7ykcAuFPSSbuZC1JqW9Z/d3m7mdgLxMc4kNsID2aH26IdtNZXnv9h3eW0CzGZX69VwqA4RgGSaHz9IRDVCJXR0Y09W3tp2C0QK8m/aAtA42oYUds1hpcvfJSYg1GfJPX/7uSBq4Cn4/a71u2OKRW1PMPGAvD9MJTQLtUIv1nbfikr2FEJcHIPptnJE9NPJtAWupjB87J 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)(36860700013)(376014)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 07:15:41.2201 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0bdc846b-a366-4f96-94e4-08dc9cc24748 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: CY4PEPF0000EDD2.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5875 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 Fri Jul 5 07:13:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13724462 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2053.outbound.protection.outlook.com [40.107.94.53]) (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 01764144D22 for ; Fri, 5 Jul 2024 07:15:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163752; cv=fail; b=BDXHhS89brgRmwKOWCdfiHwaT6OjWemJebPM3Le8pX5hyhvB1/6ctI6S31ABF10zIllfVG64+/12DJmqcF8MvUE34yHAwb9oajo9rVRwjqm8txn+FB1BXHW8Goamb7Fm1d3O/4ZnWpj1DMCB3GbvKPlGbaGR+M5Tizek3fiqouk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163752; c=relaxed/simple; bh=NAg7blGlM+IidWttZZ/NTJcgPctLv9P18VuBvtEv70s=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=paDTdbMbrRaQcumDYk1Ko8SKJJ9aFd55jFEkECHegs9Mp1h/mwOEduNjjO1fLcsW5ESFBdkrXBGjA8YxWNmapYAX07Tn79zZk80OG7rm8EcMoYgjP17gRkfVNgbvbcgW5pJiYBbtyNcjWDAWbD08JtkvJRcv8IUFgl3FjgvtlqI= 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=E7X3E1wI; arc=fail smtp.client-ip=40.107.94.53 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="E7X3E1wI" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U6V+IcKLV4IKxMIrTdYqmmGosTsQvvRpGy97snjbgRgxYtyueWt4L76ptlSh+sMjS4ISSg169exV8DJJ8E10IAnDP+5M+o5uCn9MtdRzI3WDLy91N+CgtzJQ/1oiSVtgdtdijAJzft3Wn7jiGBwOLWsTmDXZd4GjXPOD6pYuDV78uAO4TtHZbOhH8q0uTtGYxjXke7wlrWhymZ9DakyG3YirR8eGukab5ukPGsm8iKOM6bBTF2jCpWU0FRnr8OFPf/G05mYcxJ3mKzEk2Ov9dBR2zDtxGoXFYZJuq7XJR+5bunSNx3oLzVFIzf+EbXp7TeDm5+aWQdRP2OSiOuflVA== 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=fTcmXRB5W4fUbIDwbnS/kq/gr46Ktk19+07Ez6JShRhfAXufWyGeNgcGAWnddbyvOScXTog9ByejwcjBirvWv2cB0oNSlEb+onxkPXvw0z5+wgd9MO/bXi2g2VNz0ErPl44o9QM4LRXyoqP5CJC4IZnV1FJ3sv6pd6bEDu7mWh0AIpg9744+brdcSb96r/DeTZA6C+OXeQg+IGi4ElIftB2Fo3pdYWdMEsfoQE50CjEn0xVhN5cgRaT1nMEHMZJXXym8aiytZ5vC11C4RpqrVtck11H8YGy7EtjZA0M5N+j5/7Jz+f75eqNdl1TgX/hyeLUCiQvirLJnPaUij3HOXA== 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=E7X3E1wIhq/LU0ZDYus/fFaF1/da/62S+9j6f9lxa2zHMVmbM/JYSb0L2zMB30/IHLFmWUmAaruMZNf9V37oHZBKjEFV+esjz3EMD0Y83hR2+8JZ5GVCv4DCItnsznrMK68fFq+j0i8QlaFDGzvYg5HswNeMn3o49FyMcxUJ7cL9xv5Iz/O6al33HaF7D9db+ss/O2oJ43+/IIJfvboxojbpWIR8ROkD91wDnTXJaZcONTUQtI/xFCtuZv9NiZRAGFDS9uklvF56oN08P6fwWEDVB13X+lmwhNv3n92ioo6WTteWM11TwwOEnruxifrzaqyCkRLu/XugAKmSeo7k2w== Received: from SN7PR04CA0164.namprd04.prod.outlook.com (2603:10b6:806:125::19) by PH7PR12MB6977.namprd12.prod.outlook.com (2603:10b6:510:1b7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.25; Fri, 5 Jul 2024 07:15:44 +0000 Received: from SN1PEPF000252A2.namprd05.prod.outlook.com (2603:10b6:806:125:cafe::bd) by SN7PR04CA0164.outlook.office365.com (2603:10b6:806:125::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.30 via Frontend Transport; Fri, 5 Jul 2024 07:15:44 +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 SN1PEPF000252A2.mail.protection.outlook.com (10.167.242.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Fri, 5 Jul 2024 07:15:44 +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; Fri, 5 Jul 2024 00:15:26 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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; Fri, 5 Jul 2024 00:15:26 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Fri, 5 Jul 2024 00:15:23 -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 05/10] net/mlx5: Add support for MTPTM and MTCTR registers Date: Fri, 5 Jul 2024 10:13:52 +0300 Message-ID: <20240705071357.1331313-6-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240705071357.1331313-1-tariqt@nvidia.com> References: <20240705071357.1331313-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: SN1PEPF000252A2:EE_|PH7PR12MB6977:EE_ X-MS-Office365-Filtering-Correlation-Id: 8fa2bbc3-ea97-49a6-7244-08dc9cc248fd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: 0kmwMi9nQU7zpHRIGiGrRKEaqDk5HHcLmCwHphLVQKPbOEUjdhlIN1kthH+fkVEgmkVQi46sXq4w3ERPMAXLISi6BgNyKGuWezS46PbNNQKIvDQCzKtufHVtuCb4r8jNm+vW8tHK/96+ZxJC+37Iig40pP1721r5xWamtXwEjlcz8Lkm/I1EQJ++/BkFk+3Co8GUO1hIqyfwsMTSXLu7US5ra7zBQfTvJ1dSnF9N+UCOO9/4BHunbRnix2lXR4DQYhnCDpDX9b0iymIa4Tw27HI+BuTDpaYkgMLAyFaJlhlWKbjtQUZb4RIMQ5bgENBllYLhS4d/hgUzyiPQpMeqSLyu2IjE6Q2Ng0XjJFudDuGlCB/mTe2PiCAcFdljR6A93y1twuaF19i1nf62WEkQJ9t6i6FGJR+hcJVT4FIJlxtvwavUyBDfDR5ivcMH5TbC37wUPMp+rze/3uBt3HJYF61zbGzHA7ZqRB2nT0PSRIWs978DEWwoDaNM7OHjgmJMV53mF0i8GEDK7ruy51td2SD4QLKCEnG7kBOM463KemsUCQ/L64jzdt/ssDP/8MkLFOkHiJ8IMSUSGXPGER1AQDovXBvZITlahLQYTcEbsE0Ol5iIsEXEkU/vm5iWZRizvj8RwcIn4L6FfIEaKTdP75VoGm2Pw+rGN+cA6j5hMPRthHnSFFvgfPh4EjwfkOaFYYYRV3nFGL6WpDnNHpvSobeL+V9gt/9OfXQ+mv+SfyPLXQTLfTDjtJd/dTbmCPWDg5/bGHOFmnXo2LqDYhypDQHqlrkq0o+RCoGdUn3GhRFYyL0FYM2a1ndSQBWl1x6n9b/KVRhBpucxlnO0pHV8MbhA9IQTh/Em6F8bOip9SOGwSzaSIXS7JZE5bnRl8ZseA7Bfjbpv0EJJPY1pss/gmOnDspA+VgH4tjkt5J0ivys2G0JMjAz1MUFbmUJ5J22S5/YryDSI9LvxrsAz6YsyO9bR4yOoDw+Q8tfOT9U1lfqrrZdU5T5+HaUtZQB8dNRzxLZHA6Sdl0VCViWmpdmncsApOmsRr61PSBLOqrY4gRvDYVqh648YBAjPZW9jeYtSgCUH7rF0ka8OUAhZuDHc+OwiUK7Vx8gcNe8VK7iBNj63dBd4ku5qAJp84LhJ3//gDajj9Tm2xu5ERvQmkFWe8RmCiqbwdsnUTQXQvG1Wo7qbTD42ByyArinL3qbi/Mu0KdupJgSgAIsjJ/0xaruNpkFlqj1obp34xz/+vgfTA6V5hbhYfxjfH1JjgD8ZdNLn4SfFeKsF0948FsBNsl+pvNVJP3aD2M0qbt9DPwlF9wojCsh25xEfuCMVDrlCOtraJFyGHuXxf6PPTKBrp9Azm0fihMFFzePRs0AKBVXukdJIhWfo5vtWZfAY2ovnE31qXpuNf4PZJx5CJ7YvKr09nFaSQWjzPRacugeWtQcy44F3VjediE2oEJ4/2uUFY34b 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)(82310400026)(376014)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 07:15:44.0519 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8fa2bbc3-ea97-49a6-7244-08dc9cc248fd 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: SN1PEPF000252A2.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6977 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 Fri Jul 5 07:13:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13724461 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2049.outbound.protection.outlook.com [40.107.223.49]) (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 122A1144D24 for ; Fri, 5 Jul 2024 07:15:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.49 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163752; cv=fail; b=a2kZDC0Eal8fjOVCE4x+h5/dwLZ0gRgwtHHU2R0+WYRWhSGUZKf9XwhazCJtJBskwWHsS2Xadufrkd5uA7iPDbco43Vu8G1dyuxRjpssGDcikVtoZEAtXqMHCuM4jiiVEGDI3ArV7awPix5tVxAS46LCC74isUXfji54ZD1W+T0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163752; c=relaxed/simple; bh=AvCqdlCiJXHWyT9b5mhi9d3ljkSK3B9qSsSGUF/1QRE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gNQl08PpyNCHcODWMbsBHgNaNQbN5zA5Z1hfJPFz8pB1lWkwDx1oYcRkE5tCP2mjx8IZ5v3zQteL/YVpIq9UVKqtMzpe6CJReaIivEGEJs/Q3sTfvc4EtoVc3hHB+/+4UWa7q2Nu+ZL8+WoLl5etmrPihgRLgg51ORSHd0b3C9s= 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=EzPhWY5n; arc=fail smtp.client-ip=40.107.223.49 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="EzPhWY5n" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KOh2nogq9UpjytY5W3rbRCjohXqm2IvGw30nU+28s5aoKjGdanRiBgHoeQVFCmvwILe+RAeYf3ULv2R3ZDrPDSMezsmGzFlI/WNtixBVeQVZ2i9TmMZzOeWcpFRolaCthP1vc6GgpoQxxL6Bsr7T98vD8FOcJmDz7XMX2WeUYF/S/y/vIRtBZjqiYbwaU6cRPh1eNdSyqtjONd0IFY+zSw1HiAcrdkbyzAVePNnPbIpNcFJBk/mU2tL1VWkKAT/4TY9LM4VYiLThcyCdVY67hAG8+9zkpuwGxnfjPuQCMZLdft0yPwLTZU5MhFkfVH66P+LfICgWlCr2OpNpFxdL4A== 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=l4j880iJgJiJNKc+euKFP0kjxagb5Tua2KFkvCOUzU5a0V21Lk1MsPHbvCmTpA/YvVJAvRmnw7fmqr+zZ/KjgDOgmbDUWcqIYgFkq05qQOMe/V63QHOnROF4b2/xiWVSpeDPEuX13BrU/UhfehqAHu4RJ8X9QpaKOqLSY9EwFK9sdE7mdgpTCXhRyCXQ0AOkygikzlLEkao/roqK/iQZND+A8iZ3WHHbahp4AJnLARRUDwLd7jVGZJQXFqdSeMqantqGSqhLd4juHjAqn5K02fGLzvnxFCnYgnpvku6Vm9VPKkut/kPJ2Wt993/t66jp9YnzsIipNdc2nDDMC5GdTg== 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=QoIPinypRkgaCuUF6f31Slu3AfSCGOy1lXRq3AJaOA0=; b=EzPhWY5n0UOhIoRuS1X6QupGMuSvXl9JkI6BhxqWFaL1SnQJy5EoqvxweHhL6VgIpv3H9ZzQNWw6DeGemRaehU0IaORQGRyO3gd2tYAIJUehWgE/vP/WvG6kEuTAiGi7YD6rrcDTgVWoQFZ4Yrsuva04//Gr5ljC4OvyPZCY8TaHC7f0TLCIDP/woY7P5tdbRdJ6RVryZKKqVCBURyUm+5tj5wnHMkEczqmQUDPDYnTAFORX1Sv3U3Qb4MhtbDMd3oiplpHh0JQM6m4hahU4hH3kmiyRa7xyF7aAcEehMrcgHQzZ7aUuzsxJzCyWhk2AJxNgdfM+8PhgKbctBr1EYQ== Received: from PH7P222CA0013.NAMP222.PROD.OUTLOOK.COM (2603:10b6:510:33a::34) by CY8PR12MB7634.namprd12.prod.outlook.com (2603:10b6:930:9d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.25; Fri, 5 Jul 2024 07:15:48 +0000 Received: from CY4PEPF0000EDD4.namprd03.prod.outlook.com (2603:10b6:510:33a:cafe::bd) by PH7P222CA0013.outlook.office365.com (2603:10b6:510:33a::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.31 via Frontend Transport; Fri, 5 Jul 2024 07:15:47 +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 CY4PEPF0000EDD4.mail.protection.outlook.com (10.167.241.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Fri, 5 Jul 2024 07:15:47 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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; Fri, 5 Jul 2024 00:15:30 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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; Fri, 5 Jul 2024 00:15:29 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Fri, 5 Jul 2024 00:15:26 -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 06/10] net/mlx5: Add support for enabling PTM PCI capability Date: Fri, 5 Jul 2024 10:13:53 +0300 Message-ID: <20240705071357.1331313-7-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240705071357.1331313-1-tariqt@nvidia.com> References: <20240705071357.1331313-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: CY4PEPF0000EDD4:EE_|CY8PR12MB7634:EE_ X-MS-Office365-Filtering-Correlation-Id: d39ce388-a419-472c-92b6-08dc9cc24aee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: M6FKk1gRNphB4O0M/eSx0xKEriN6jXlEKOR1HRq7pBcspIPxlvtc6+n5iIPfX9/7NnN6FKHcy0rZIyforboRWfb2ZQ6X846jmg965ZhsR4QQZP9T3O9jASdmid/lrLguMBvL3ED0mRyw66NyAhdKyWmJaXUgil2I/m0/yUV9Y304vVlFXwr1ewrY0Er7oSOSaUtd5YPnxd7W6B4VYnHnlTYVnp7QfbS4kvMVtRJTkstMV0u17HPrx9SRl15Gpi3TD9FKOtPMnK6XOU6Jxj2L4Az/TZfZ27JrcPdcE4PXrOi0HUOtYzpl2htKvKsmnBwVl5X8hw6AvU2U1sjHnhR4d6VWidZw7bucicKhFm6mgxXoF+rOHuLwiFoKzEtVX+rPH7RjXKu1ZFSlc92bhCKGF2ask8+NMPDQ5770+FZOAU9+iq7x95V0UgFiGSpIZcKY5g86Rcr+z2q4Rt0la835cecwO2OALuv0OuckAoeAQchNPomkLP7D5xO/BEAw/ac7Xr515qePgUJys4Q1WZ61dhZBR7aHQV+hC6agcGd+OX6jPzUy4LMcUBEJvNYg8sBcx0OxvBWO7BQ/OlNQwYt3XtLue0pjBbga1EiAPUVd2Uo6XvHOUO239ddHTXbWs0Bih9b4qTtd57e/sLsklW0HH7i8/myDeJn94+VxSmdlzCjb2J8TLXlAklWtS7SXvlrhtY0GTN8qz2jB8uZW1+3g+xCCGakmBvmJPVWsZjIaIclpjyboM7661rj3gLyirervOmfhsK62qWqHx0aCJuroTS31UUNeqMbEfaHbwQnP9VN2SHYe1MNmmT8upf/6Xc66djZNBUqvthQuDpdunqTvyycoVuVwYCAYXbMzYJZWw/DnOA38r9OO7QAWjeSMHp81pTSzsGnET4ND735hV3eRuK4EyMFxw4JwgQjshcnpHH9gzQ/1a7IuABfdDhVekRjG+PY7NVxz73uLi5AUIaNwdNNfLFuf55bbIm0rXYGJWPv2jfgSM7FdI2eyIY6clKgwDBQtkIj6VPqCHkzF08KwH0dYd9NA8sJcJhXp/dbDWGFf+8lpTWoVY6Nki4sdm8jKg8frqIzbkuoBHfaoYqWuUXGBPM+d/6aKLd+PmrNLJnKiqzk2KngpdFG+zi7EdxHWbo6SLfHosaiLCWS0PWH3gKt/5RazgwswkXwftkNNhrQQ7gFmbVeCb9OFfU1CjvXwgu19DkA0mC0vZwcV4rLO82iEMJHIUl9lahUgdieFwLJGCdJChmbz1efs425NS6r4aJ7H3zGHAmp1GBHx9W7vpJX/DQ+xN9j1do/YGKbOSDnjSd2r5C2wPtBhLi76L4jAOpGoAgTSPsR6F+wP03rT74JlnZei/KP4FrQrhaKgYnHaahL+kgPWJWl8Bvknvs0mL1ESJCU45dVqyVwUei0VskHhps91u6F/UWSHhVeApkiOQbR/eh0BW99EAyOAaHY9 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)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 07:15:47.3567 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d39ce388-a419-472c-92b6-08dc9cc24aee 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: CY4PEPF0000EDD4.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7634 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 Fri Jul 5 07:13:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13724464 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2064.outbound.protection.outlook.com [40.107.92.64]) (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 099231448D3 for ; Fri, 5 Jul 2024 07:15:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163758; cv=fail; b=rLeUYJ93wUhwNS7XHVl46h0QwmeIdB44i3k0AKxgoFUyGMn1LUoeXvoc7nKahcr2Jo7I29wWhl7YbZfA/v9ccvCPTlAnUu8GTwbtSRdc2JToONUPaG3PV0I0FsiE+nJjDqWWikPe7rPqr0awj74LfoN1rvgVqq7CN35tMCShEic= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163758; c=relaxed/simple; bh=OB+BVukxK+YLc0FcI0LLLEpO9ASly19wQuSwV0fIq7M=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mEUNckBQCbxh9VEK3nPM7FwUB3YHUrcvunou02HjTX4DA2TYT2JstETt5x1bujdncdzbv4AFQDWp6/KVS9FFtIVC8l2iHD227wGHuH/zGAvvhaqbEWAxAyaHtYm0K8nIAN6V9Hd55bQ6Lpx/1WYbGjYhBAv5Ye4vnmO5p0Zr//w= 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=H96/gWUz; arc=fail smtp.client-ip=40.107.92.64 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="H96/gWUz" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T0083V8yr5slArh67UgyIZveQkqy+XBpQGEZsWGOrzvygUmS6FS0bo5QAqlKcEmvC2/IPcA8NiLA95d44smbwpOmMO4wHygTjjtPFZAgLyraqwivyL2kndUyRR2PaUAJ/y9+evH+Fpo3Q+pN1bUovTjIVg77m91AajsdmtfaedeS90rGmc2Xig0bF6VNsBMgR1aatRQhl3uZzGdljSv2adHx75UytqD1YdUxlgqq7UuxpWwSKDvZFIasIGKtjSxFatKrDdpijFufSPFGD6GxkZ3kFKUIas/KrtWMT+Jr5wKDRki+01SW1/Xn3Wor9Wwzbm5s7DVI8gtNY/aaX7EwNw== 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=rn/Q0rTdMzek4mM/QNGSMmL7TM1jTDQ7tHLAi8ycdhY=; b=O9WbTdEoiEY0DkAzs1gSdtXIIJptjduNdLOiFtJHvW0z0hMN7UIy1raRrmWzem1mUhJRrdfY6r98moKIxaPX642FzDgb2QGgX0KAagCBmyrQ+aZXeZKMIcO7/CGc/prANqnmDgXmq/G8e0haOgb7A0alNsVYzTFfBrFju1sr/PAl08tdQ7yPY+vQwCsJwhsfz1TVAA7CQLEdJpP29FidWosKRtEfaRA+jfBrElri6S+AJWV7Ok81LFK4ic5XNuczxts7nMW3kzBw4FPBkybfoAn01IJzvFt2/eELFmJt7Q9zq+JnjUHOfvvO8L1aj/M8wkIfUTH8xUYjqvByoGyT2Q== 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=rn/Q0rTdMzek4mM/QNGSMmL7TM1jTDQ7tHLAi8ycdhY=; b=H96/gWUzn+HKjYQ2yWJNOXkOdQLDk7BtQzvgUomKQ81LRLr9x7WVGymFwBLppHkcNmed0aD0UkI1cbEpU1f7XCVg40BQshn+PqCpxsSh8ATZ9DR76bB4ta+80vsflmTcIuit8GMA2P++tyvgLYSDd6pox446ny+/u/EYXRxwvH41JDn7rH/58eNEaV5zqZ18zOui4LAd7vPVBQQQ1pXnnQlq1wRG6xN6gMMSOru41EiWGP+NZ64HIY5se99adzX8vE5i2g0XSITkiSm45ZKrjpJ8a0pWssJdTezaSlsFoPzx5CCWMOrwG1ZbamvOOzS+jRifOyEfrEbBl6aD95y2Vg== Received: from PH7PR17CA0048.namprd17.prod.outlook.com (2603:10b6:510:323::11) by PH0PR12MB5606.namprd12.prod.outlook.com (2603:10b6:510:141::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.32; Fri, 5 Jul 2024 07:15:53 +0000 Received: from CY4PEPF0000EDD7.namprd03.prod.outlook.com (2603:10b6:510:323:cafe::5a) by PH7PR17CA0048.outlook.office365.com (2603:10b6:510:323::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.30 via Frontend Transport; Fri, 5 Jul 2024 07:15:52 +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 CY4PEPF0000EDD7.mail.protection.outlook.com (10.167.241.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Fri, 5 Jul 2024 07:15:52 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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; Fri, 5 Jul 2024 00:15:34 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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; Fri, 5 Jul 2024 00:15:33 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Fri, 5 Jul 2024 00:15:30 -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 07/10] net/mlx5: Implement PTM cross timestamping support Date: Fri, 5 Jul 2024 10:13:54 +0300 Message-ID: <20240705071357.1331313-8-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240705071357.1331313-1-tariqt@nvidia.com> References: <20240705071357.1331313-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: CY4PEPF0000EDD7:EE_|PH0PR12MB5606:EE_ X-MS-Office365-Filtering-Correlation-Id: 5008a377-f9f2-4e87-2674-08dc9cc24dda 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: BJJpMkfDTiiTrPcf9I0qymlK8pmrXU60Wu1qoMG8vVx0w5943CLFSOiLXcQrPo4qYlJoqrqV6lfdNex/xEHSXO/cmV/rPzY04ft7ULLOOMmmxs0cPFM1Ye6AJ1vbi3C2rPtxNrACsIG8lYyWomuJYSFanduNs3foVBxQWmOt8JXbqMtCn9Wet2MZ0cZCoDjA6OmbY4Ks+gGTf1eJb7ZDIJMZCVAH65qRTXV+v7x2TqqOLHCDm/sNIqudywE0BC1NErD5ddfyYOipaYZqV5q7Uk6qAl+wFasRn2HHH9rGzRpQVECXEc2hX0KXDXBg5N6ItK9TrgETum0KDF0WH5KJrmo3opBDBlNuxpAP9BLk30Kx9ifjdalo/vthx8zgIoLA0PCW1jc+i03sLHCVkqBGnwVbMvZE5MfsPLfVw4+qpFZxzDPPbY/EMvv7ImOO9jW0Ky4XnGh/zFzH66w7NHJJ4NxiP5+gTpCZoN54Kelg3hF3RcTWQXvrZfovNH+8eRh6de1TaQ4cXN64TDegQg4WUaVvAO5WElOLsH6aWKgU4Pe33L3FqajNpbuW3L2fxTJnktKXq/b148h3VJ5RmeG9V8wqt3qG29o4fbT61XHtO2oNLz3IoIn6w1LLeg9qEACT8viI03ynd3VsEJNCvXyb2q0IDNWpA77bBo5ae8HnRXU6Wbn5MCyPMqZzYl0NbHHLIQuVkfMFjS/sJe7QEBt4OPhYzEtjdfkdfVX4cVkS/rtAHaUn0pSmskOj9refx2LOjt6Vh2XohTLuwcQPvR2nCS+q9hahtymAr3y3VObqZQIEXg9Iz0/hPRiWWlikw+u7GUUZlQJJAOWCbK1bqMvITRVSbj4+jTzdqKiWld95g6WphmmRx//pRuog6tvGW0G9aXQ7a+lkGAmqPfoYeGLVSvn/PR9ABCKusZIbZ+CbgmVWwu9ImSHZTipUdDlqP2PBtjpML9CVE3GzfAqbQnxEij0N/ycguJIFewriPS6drpUfyKBVxqjADy0FF2opfenz9zFidm75hfXPblQvMiBdGYtK1rrxUyZd2pJrumCthFMH4czhv1Ace5ZSeXtVrIvXmoLyNlFmv10+x3Rkz0EYez7BJWXLb9BOmCx4qqi7nfABD54Yfo+FRDqXS5NkGdG4m3eofxY7NNxTGHJx57Vj2ehx6BGYzVTVy+83SMnOqqTp1Ghn1mHE4qAal340hMZn+TxFWCGOZo2xdv06phRy1R5R//Seyew56LJBi67Fa/pQaVBc3VwSjNM+kFlSOY6KZxTWBzbU7c6/4KjMwUpI6rpg789dlU+V589bdSjDs8mn3iAaoeWa6aH421BrBZBWIdayY67wLpIqndqrG/bxr6bDLLtcju2iPdl0hLp0+Yri2hH5gn3ZOi9loM3Jc70K+qyxv6PRDG2EIntTdFFdNtVL4nDIN8QPgaaxvwM3ZeFUN3iOcROHHcrdFbzlKEMk 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: 05 Jul 2024 07:15:52.2404 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5008a377-f9f2-4e87-2674-08dc9cc24dda 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: CY4PEPF0000EDD7.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5606 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 | 86 +++++++++++++++++++ 1 file changed, 86 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..e023fb323a32 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c @@ -30,10 +30,13 @@ * SOFTWARE. */ +#include #include +#include #include #include #include +#include #include #include "lib/eq.h" #include "en.h" @@ -148,6 +151,83 @@ static int mlx5_set_mtutc(struct mlx5_core_dev *dev, u32 *mtutc, u32 size) MLX5_REG_MTUTC, 0, 1); } +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); +} + +#ifdef CONFIG_X86 +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 +1114,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 Fri Jul 5 07:13:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13724463 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2073.outbound.protection.outlook.com [40.107.100.73]) (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 1938B144D09 for ; Fri, 5 Jul 2024 07:15:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.73 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163758; cv=fail; b=IcYUl/ILW74J2AB8Lld4m7b53QL+tCgxkZgpLWWJOUKuS+zVzTfEJARx9xavUgr34E38x/oQFa8HKMre+/K+x2xxvMvc1pY/KkiYrgBMKGRjNokO4unIAL6iup/2NSxeF1jnZ5UNT76qgJSpM5i8zvWIn8ym0fF6z6Pti5hJRe0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163758; c=relaxed/simple; bh=E+w8KXjvWeIa2V8vROs1111Qp46vuhWTtD0K6oKo2wE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Nk/XWff55k8gpKj107iYgeNM0MIGRvazS/Zt1TpklK6C1Qdj7jOVuB7n13ntDoyOt5EGTglKB3AOKFbntGXaQUPpITjqjd1v1dc5EM5nhc0WxnQl07Ug+Kw66zWnvSLIxFR7Bav5z9KCwO0itz/cxBIcV+R+o2r2urcVp64B0mQ= 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=dj0n5q3u; arc=fail smtp.client-ip=40.107.100.73 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="dj0n5q3u" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k8iPFgmYBCuKk3iizfMLYdw/XKrRhlVoG8oHztuozKUq+pgBPzXxVzXebXd8MpzEAKFjWC7AsJxGlN53j0xkBAmH1X2RxDbJlTdBw5BW0++Ugeu2LszbpLyB3pSR+wZxlMSqlJ8LXoggvJlT4heY2Gs8eBuxVD7xqIzv2GedYpasq4q0sKJ3vblkS/pVqDYqfJcToedT8fwwq697VGdDp6fscTUjQRT6ulDEuOrwJ7sEgcheb1X/l+t9+7fz2jle57Oiq+MVqZmrquDVoEzRxFoV+iWvEBC5KitlEyNsFZEdqB8KQXE1e5FqutAkMTb55IQrkT2tcQLgFm2BZ1v15w== 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=n9X+dTjasJr+YF+f9ppS8+WjiNpnqrdGGIqrUVnLFbnJOe4P5Te9X5xJNItgYRQx0CX9LB9LY3g8o/96NLSihbJ1yujuwIBMeSNlpifHxOR/HN1aoywiCg9VaYwPi2RZJYJLxbvwS7fOLlB52PPjSM17q6mBYWWLUeATfUaXZxrHQH/ptd+GL3k+76RRiKpHkkXG6mwvKR0xHFhHWEYL4SfgoBuY41hzBZyFbmTdwVPZWElz3qOFjXQGQC9lwrcLoyCjvuzCK1UyiVACWYHXAPPRkD1w+frvDFmJXctSnEA8gJvHp1yCjQrz/lkGjtelY5bhgGXFh9eKdNgDkHeJlA== 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=dj0n5q3uRn/IIV+5fM3R17xlxjKYKgJHR5qKRgBhkw+oGJ2cYW2rLNdil/Ac6OTM1uMPUKlUPrr/nVV1RpvUcMEuO4VZwfOqiUMIq4l22ya8Ta3QsNMogN9+BTp1y6QyleTv8ELjEEhJEBXw1SYnyS87HpOZ+4lsqptW2ucD8isY2YWsDynYBXnIZydMdmsoo/5IUs2PaWpWqYn6xEWs1Mz5eShgusQkCGGhMbx7O//duGKbEt+f5edqu9JfLQCOfjYlLNQ/0nHWjzqACKDuo3Hj4rRNqL3SWNxYDX/T2qvVLi9vcvg7lbk5rCW1ukExgu6+EC2kojoYtz0VdzhfEA== Received: from SA9P221CA0019.NAMP221.PROD.OUTLOOK.COM (2603:10b6:806:25::24) by SJ2PR12MB8848.namprd12.prod.outlook.com (2603:10b6:a03:537::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.28; Fri, 5 Jul 2024 07:15:53 +0000 Received: from SN1PEPF000252A1.namprd05.prod.outlook.com (2603:10b6:806:25:cafe::cd) by SA9P221CA0019.outlook.office365.com (2603:10b6:806:25::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.30 via Frontend Transport; Fri, 5 Jul 2024 07:15:53 +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 SN1PEPF000252A1.mail.protection.outlook.com (10.167.242.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Fri, 5 Jul 2024 07:15:52 +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; Fri, 5 Jul 2024 00:15:37 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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; Fri, 5 Jul 2024 00:15:37 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Fri, 5 Jul 2024 00:15:34 -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 08/10] net/mlx5: DR, Remove definer functions from SW Steering API Date: Fri, 5 Jul 2024 10:13:55 +0300 Message-ID: <20240705071357.1331313-9-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240705071357.1331313-1-tariqt@nvidia.com> References: <20240705071357.1331313-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: SN1PEPF000252A1:EE_|SJ2PR12MB8848:EE_ X-MS-Office365-Filtering-Correlation-Id: d66ee474-0363-4fa8-c3fa-08dc9cc24e4c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: eR1Ze7E5pSMmTd2mcpzLnpEBbF7zt7bhQCGdScnpycW2IcW4PxjSRcnEzX/A2fudoiGSIs+Uc0eS+S3kWJfT2eHyAlcbvPKNH7/g7x/SQwJYqSOjMIkEL8SFyUah51IYdQ5KG3aejwwpuYxeSkhcgYm6g+iMp9nEEVz8zlWoH1COkGS0/OMySv87v/XJOK+Ha9LCsVB8pVYDjVMiAsCjBIycQEQtwDx4ARdWpJCcHrn7W+U2LwRGnbdDL11KzCVI8I5f+xRvjnRKKcJvE48jxp0ZC6cA7PUrGEZ4YA19HcaDmkbzJP6GrZrMcw1nMLqMf+hOLXo0Td1KypiEeZHYz7pJwahKcG4uyZrsdPAfHYVm0GYf5g21ZHPRj9U1nNApGRrV0usru+5/6j2NNrQh3u/Hl2umZEMnrLMdzqtm0/QeAbRqBY9PR76i6bMOqQAi9kyIHygswfQt+pTl6JYG6Mi63TucuPujeVyXXmK4K8Cn8aKb/qm4C+QxvMrlclSZijMBU6fa87F79nGg1aOxyjBWNKqz80bHYmW+cJeGkpb/pF53TKntkeFlV+CL6U2r9Ye6jUp+X3fmbqzr7p/slsysErBLexR28xrTN09yqKHHCVlc6FKTmiT4cOyPY/7fGzeZYCX6ZobMHXVc/lcr2Fc2G0x5U5JJXYAERiNwj6sQCu0/MZkD6hxnZ70GujM5WRitBjFXiL9B/okEXrb/tEHU74CKQ0AQJIB/nbY7qjRMHSTVJwQBlaMl/05uNuCrUACxPtHQDA9PGlWkIgHX2KbjpU4/p9dm3ouI3hNzaa3Kg3hkINbWUrluDztEtYRdIMrl38LEUzO6Un45b71v2U4ff9OncBY6oSLPS89D2QeUeX3GjfLYP2RW4Cl3ynmE5HJaPdP4SAbJ5CkLJkpaKi6xHI4QhkT94x00MF2TQE29ZzhudvGl9/oBysuYcAvr5wEGbJhmE1gXHFi8df19VzkmSMFH14IGYEPl6bxAF7NzkiOTAazJ7i24e0BIgN/HFI5uKRkb4fvQVwG2q1axrAHQSerJbe2o2hpZJ0ydq5Uzn/peFkR6c365KzoLLbduywh5qb2s3StLcU5Ok32x8jvq8gzGbuwDdOdd687GRnql7fGaTN3FZV1QkEOuHteDrcz1QuGuSG25DTVOQ5jFOTwWUYY+eGwWMSMqoMg/Mcu/8zyZIjWW+G2b2Otj9VBIn5Y0DK8aN4lBXpe8DaKtnx3lGN9OIW056lF9BTG5uoMnh9KPI/QxFRJLfy+6RwscylWuMBIEIT0/IYskgaDlmWQV/WwKQuBS96dkUS+gFlwTDP75eKI5cv4RdKF2iNMfl4vYlv7gbTbg7REJciIYNGZSAOPwDVT8hD27SbHHJAKpIxqDmzzL+lSNOoFbFquWkK7BUeGhzzgHbqWQN0XUT6HxFeiGhRaMfg0V1QIgdTdO/3Jwnr8lT33MwOKBzmHA 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)(82310400026)(376014)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2024 07:15:52.9759 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d66ee474-0363-4fa8-c3fa-08dc9cc24e4c 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: SN1PEPF000252A1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8848 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 Fri Jul 5 07:13:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13724466 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2070.outbound.protection.outlook.com [40.107.223.70]) (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 223DF145325 for ; Fri, 5 Jul 2024 07:16:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163765; cv=fail; b=qpkZ33lsUl/7VEDE5H53V3bVIf2voal1Dzg0tYgQHPMdns0Py9NlZZzfeW5zDu7SEd9J+lZQjCD7KjG3gUHcPM6l/Ns+b17Y5wzojciidR+288oPDYl76zIZehxn9O+JZHKLJI+CQCZ4b7RmXaEVWrK4Am2ykAOYPehxw8llH3M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163765; c=relaxed/simple; bh=NXqyCbm3M/3uO/LJkiD7zifcUf2AiOp4RcMoh8yHr44=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AzCeVxpSuV2Gin0m1hIEj3wT1QwlK0m+YxgLKEOhPuEDfCFjRWP9Jxoa+qhEL0hoLrnJAsIU+lOA3VGQBfzgoFQggNP6EC6SrA1uvU0ObQRhVYJfL652N9wF+iim1eZuyUzNgVclvJ7GJEFYfhWZrd9XVX4f9BSjuVyiu/2z5wY= 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=ScQqmwZ/; arc=fail smtp.client-ip=40.107.223.70 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="ScQqmwZ/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V2KnaeHHYpgnYaxhdiB/qByeL6QDxF0Z8VrwcODr+y+VeZvpzUxNzj7pXfaEExUg1VLHI/iwheG6Dp94qVoinyLdZWoy9wOo3X2D1rqY2qJhEs31Kc9q8FbTsadGUMYPIXOCx2r+MVcJlWL/DdG+PcghnQmOyLKDltQ5MHxq0O5qgqM4CM0dru6NfKdi67zDzrj2iHDAXj3ayujkUA209BT5UUwyeh1MRE5JBtbPifHj15Aa1vli1sgzEG2YgtC3mm1JIE9lPskmj24VdqxQ6qwsPmyL7K0L8eG0iov3ljevUY7FwI+tOYScHwnUkVfteshtfiS7RrnHnXaM8OhC1w== 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=Fi49Z+nCnSPQJuj5na/oTd8tqyeU62W58IAeEZYwsBeUP4kdrK/VAV6E6f1Gyv/itRyzmdUYR52Li9i6mQXEBytShGG91LVZ18UJA5sJztEgLC9iIYaGl40wOx2Zy9nfVU34PzuRJ+2hoUA9WIIW/MnMTpesdN8bc5WCH7Z6sogkXo+uqi3vJ5bdO/hoxVOIH1TOql6y52GFwKbbnQHup8OGlFvv/gMbML+Oq3zM/wrhS6M5BKkVIcx4QwIiYGkHy9qIpQhAI2N1FR+qfz1RrR4rv6dbwR+HASf5tpXOUJRWqM/0Q6xc18vDFqB5YQUXfMmsTmMv9O3FkwJyda765w== 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=ScQqmwZ/AzjIKp7Dy9V4mXpZUh8w4o6D9H/v+wQFnj6c52UJn/GkLZhLHM1IjfjyH/CGEnsBV2JUzei/tdQvPLTDTxkZ4cteLsExCv9sC2F7sd1tXnp1EQ85Y4dT+51jdBv3/aOsnPOKj8CKTCm/dWtGxWwoWxG+YGxCczhkSLd21n79EqFn1yDHoVmmEPhihsS5Qfa4oCYpkmcL6Iantxklwyx72KeI2x33NkowXUkUrJL0CWjGriibE7Rk0CPglmKiXN+N5hk/lwpatNY/1EiQw2axo8YmEGilPCFqCbTnl0wce4San+Z1CnhU7mx/xK+4+84ZG8IVUjQi1nqM/g== Received: from SA9P221CA0026.NAMP221.PROD.OUTLOOK.COM (2603:10b6:806:25::31) by DS7PR12MB8419.namprd12.prod.outlook.com (2603:10b6:8:e9::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.25; Fri, 5 Jul 2024 07:15:55 +0000 Received: from SN1PEPF000252A1.namprd05.prod.outlook.com (2603:10b6:806:25:cafe::4d) by SA9P221CA0026.outlook.office365.com (2603:10b6:806:25::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.30 via Frontend Transport; Fri, 5 Jul 2024 07:15: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 SN1PEPF000252A1.mail.protection.outlook.com (10.167.242.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Fri, 5 Jul 2024 07:15: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; Fri, 5 Jul 2024 00:15:41 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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; Fri, 5 Jul 2024 00:15:40 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Fri, 5 Jul 2024 00:15:37 -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 09/10] net/mlx5e: SHAMPO, Add missing aggregate counter Date: Fri, 5 Jul 2024 10:13:56 +0300 Message-ID: <20240705071357.1331313-10-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240705071357.1331313-1-tariqt@nvidia.com> References: <20240705071357.1331313-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: SN1PEPF000252A1:EE_|DS7PR12MB8419:EE_ X-MS-Office365-Filtering-Correlation-Id: 618464fa-acd8-44f5-cb01-08dc9cc24f76 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: Ax3qrZYfh9P639YGbtBTIrRViDDQULB06oLaOjCi/WkDKvOEvR90rt7pgHXC352LWwHLuEeKXhGIud3kCoPUBxl4QyJ6IBZjVcfmcyUKuWNeyq16KvvDa6GAe0rSRm+rEJguelw7ytHiG6UWOswBKM1fujcKOwhizAscwGnA8Fltf8lC6edQUtp9aVYd9IwJBIpqIc5GJblyk2ffHh74ASsbeIDy24ThMS1HTFHt5ZxpXQSktO60B+KiBU1Y5LDGwUSazvyAZVcGfjz8fet/gHhZCNSpIQHs71jhIgWqXxxNyVqwL1z8lQwfjf10KoW3HDvs+A25xIeaP+4Hwg21IeBuaI/bkqGR3fD1MfobWUHtBDHsTq1LhY+9ZTZgHqUOw2OKEAL05jrpuqk5lKmzDmDJaYUj1hY5p6lBingW13QBdL+5d+cdomA/arc4cy1+FIt0K//VKrm6cMgJNl2NlvkWih7wLcgLzO23KDqKZdM0cPTcsu2/Uh7KQyTjTOBnv5YHSKwKeDsbiKDlPp/b7eaD5P3VVMN0gom7G5C0+jU622BjCGT13EqIWsKr7fSr+Q64Yv9WnKui1ogM30DLVA9qSatTd62ReC1xju3VVSE41kfMLV4LfuJ9aJ9ofLIkKzFdAn4LpL9J7KbZCr6yNaFtgMDOCtx8wHZRTxxy/naY0i0b40vaqIZjQ35Qua5u3dghz0mQZkuNb1sNcRGbhXL+7JsXr/BqqkLw0YA6e9LY7tUuDKBY5pZbCzFoSq915MCCR4LjYwvfgGc/pPCYgkPhPw4kkJYf0VOUJLUwmOkhpmYx8isyRxxYTD7ntq8655TjUSYrN3ClfnYsnso96jWOY0IhlA8Hi7hDZ37Vd1Ez4DwRSe3uPl02q2yy3dFJsXbi0dAupQJK7WkdqFTn2MemBxzAsxX8e8OL4O2HkU+BC7IYWp/aFTNdoQbaToYotJ9fSyQmHqlazWDDmK5xUyzzUF8x+GblhFz2+Md72kn/wsamK9AKt9WncfKg5/669E6K6Lkf02gRob6RtuE3XL95ROTDO0B3jWebNZwxq2ZofUD5pZ1UqCUvh8SEVaVD9dUb9juiJ0N4p+l3xdLUVnHULnzSyxe610Pi+EvZcasr1asDp9kDQc09ZwAa5CNI3T2dn88pLC6obwgXaDZDYXLw7mEkNdrzl/J1RvM2dmjlscG29BbrTYm9CyjZWzbnHPvLSNkYG9P1yjH3f6obZq0orL/uRRW1rZmJ36l9JSsyRAaVmZQHzCrhUDriXYemact7EV1TwKdlb/7yCStBcEjtYyRc4OAPrNs0BvBCfZU+lhMqFhFx1amxuC2AWvJZoFVMRnJL3qG2ZeOX3SUICptRHES2lrlP9hq5NSL+VLKRLKo4dmQbWvi1AtEi4/GCFlF7ydodPYUjHwkd+g8Hu0qxyoDbtC/agO5B73KafYaPsrO37jkrrSr9ElVkFW7C 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: 05 Jul 2024 07:15:54.9135 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 618464fa-acd8-44f5-cb01-08dc9cc24f76 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: SN1PEPF000252A1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB8419 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 Fri Jul 5 07:13:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13724465 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2062.outbound.protection.outlook.com [40.107.102.62]) (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 00EE013A26F for ; Fri, 5 Jul 2024 07:16:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.102.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163763; cv=fail; b=m8PFLcXSKh3fOrvlXAlGZieCStr7ECvM5IdeFOl1VnCrwwbD5FIeahNQU33UIOYfSzc02xYseIcwEA/vuIM2tm6s0zsqEw/AJmncV5SQIkil41gZ+W96tRapGmcnp6rLsSLhfAwgZxnpVL1RdJwEzwXYyi9A+WcVK0+JjRNDMp0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720163763; 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=Lzj02jxAcrl7RM1iPGPAc1IKp3Q62NBlQuQ9g7i4upSl5oLHQdl9f6Zw/rViD9wWE9ST7F1yTSXbra7SFTTyGbXO3f8FvNfzFTUQpdvwsX60Cute8qM0Tt2Db3DsKOioV/1g0pcMh9VmZFW8MnuSHvRkApYh3sChJ8lwi7D/G+Q= 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=pxPTcO40; arc=fail smtp.client-ip=40.107.102.62 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="pxPTcO40" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GT20SQgvbwxO0fsQMgvPCM97bLPndKkkzkyHE7XOEv8YINuiA4cxd+l5Tw+G1MUR+Kuh+qqRKeDb6dtfLX4GBWudyeUeqacmTxxsqdad4ZItnm46RexdN6ZKhkuL5CWv6uywZJcmikEnvYGZnmZa4sZSEypwqjYBkpxAPnwZFSnZMa6oeUd4ppHq8WM5/chfIJARp20TSY87FZCXgNUCZDMoDR6Jp9+yGDj9wZj+AoPqFA/Z1J/eJ4dj5SLW0YfNwVk7sw8rLNJJSnwW0tGuu0TGa5a+Uw7OHMM7S5KZ3FKM4wPqwhuydGxClmhEaapvJGFCpk3UbBtUHMjsEvXeWQ== 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=m05p9gICMC6EZ8VaQNkvBWYAv/SRHf7FKTULh+sI4Dirvzr3LqksLdF3axx7B56CefKc4dQS3fhxViYpJCaDFqjYR5b4aBEwR67Tf7KIPLRkXtrD9HnDfBkyhPmk5U+p46o0lK7mWKqPSonhpjTazwi7tjb3oeJ0vbxEOVb34qanNbxrJhgVcztSEXO6P1sybXrd447DUtey0knuiUkw5EZ8uuIfIIrxRGGNvp3U+/gvpODCor3EPRNRvirGDLm1t/ubeBTlmvvWOKsDaDvTQWFQC2jpLXyPB3qd/4OsvH7pRjEc+De1Fd+e+xlv8fBRX5F1EnmXS8/Qds/7QypXdw== 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=pxPTcO401UrHP6WmkEBpLGuS6eOZCRAnWLtW0NdD+nCQqEMH/j8caVM+UxJhQLL178i7+FPlKVfSoMD0+SWAq/+8gkpTGC8MFH0pRfYAnh4VHKGB2an8X73r0QYajQ8Lw48znRqs9LKCwGQNHp0WNIC+ov3kIRZLq8OX56j7WCzZRnozKtLn11rWQSmbDlEZ066gowVLZX9RHJ4dJN7BQaNIcOFkRRcDC+1daubTWKYsTNXxN5pgv7ufZI9/RLEG+EYBxZCHffnEq1+ZAGTFE9fqVRs+U4V+yyQSFLDErMcXOxfdx+Bxd5FWJ7NQ0E25Je+pm2Nhfy+J3OmS/iamug== Received: from SN4PR0501CA0068.namprd05.prod.outlook.com (2603:10b6:803:41::45) by SA1PR12MB7102.namprd12.prod.outlook.com (2603:10b6:806:29f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.29; Fri, 5 Jul 2024 07:15:59 +0000 Received: from SN1PEPF0002529E.namprd05.prod.outlook.com (2603:10b6:803:41:cafe::bd) by SN4PR0501CA0068.outlook.office365.com (2603:10b6:803:41::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.12 via Frontend Transport; Fri, 5 Jul 2024 07:15:59 +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 SN1PEPF0002529E.mail.protection.outlook.com (10.167.242.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.18 via Frontend Transport; Fri, 5 Jul 2024 07:15:58 +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; Fri, 5 Jul 2024 00:15:44 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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; Fri, 5 Jul 2024 00:15:44 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Fri, 5 Jul 2024 00:15:41 -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 10/10] net/mlx5e: CT: Initialize err to 0 to avoid warning Date: Fri, 5 Jul 2024 10:13:57 +0300 Message-ID: <20240705071357.1331313-11-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240705071357.1331313-1-tariqt@nvidia.com> References: <20240705071357.1331313-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: SN1PEPF0002529E:EE_|SA1PR12MB7102:EE_ X-MS-Office365-Filtering-Correlation-Id: 51c3da88-3e89-425b-2a48-08dc9cc251a1 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: 9Zo34RDzrc7e7Ggem/g4VzS1qoDyh02qA67t6oxofKr+qAS237ZqE93ExfGYoSnO5RJiJkGlhT1YX2cR+kq+ooSCeO0tTgY8O2DvGxkdGoII8+UH7Aq8NaXPuzuInmPIhxkXDGBVj4xdLu2oDr7gaqBbpXg+rZLfzchmaIdi5qNKCcG35UypQuTMU/G28JRy+oXBWXI5BApFPEXnPeMmTrVGfrJ2i+eO7AvDMStGgKC+r5ZNePnMhP0RNTuFywHsrAxBAc1CqLPj1gmjGX0kDIYlrxftjHeUqD+b9lWkgkRdTeKRC1Dmgp4KuLkPYgriFW126MgBelGWe8Xj2YzLAfvboneyVOBF3Aa4TBnPJmbbSJEIwqNTD6IqRXlT18unxkZ7N/VKEWwMXiQs3NQb1IZiz2GboWzaVHheCKNIA7pVKCahh1MX/KO63lV5UAkj7bzFSTbUftnGebrfntlhJnkP6gLP75WusgfhrwQXzswNRCocaeXI1Uzh65RYp3MfhjYcL4+wlK/sUSybnqqrW/zNHY+M2friVFd1Dx5U3aZ5RSG3fkkwZi+Fb1QG8TXygp99bCaPqH/vBAXJo6+TUpHdE17ZABbnHe4P21fD1we7pQBXQkdp4vKdtYR79KxsnPzh9w6G/9ZYjHjb+3XnpoZUx2uitfUjaVCaGT3UaPDZSNqkjuMv7xGUPz9c3W7Pn3CxgPfZxQfJAisOwVnD+WJaKNuCBKUl+w/KSBwntEU3m7misaSBlx6P/PMqxFjZE6NRVzSpRhmdc6ownXXq7XHjjQB4CObtDspvIBMWFKrL9Pyot0C9n+YeNv1qfEpo/PGALotKtKW2Uoe/hQhP1LoCMTlJLrZoQq3va0KdoQ7T9D9RUQd2w3lLyHYAj8G9kgyYIxxZoXMH0j+6ADpS6Z7J3IfDiAGsL+7zu479jUOyry2syneUkVI04z6umXqgQiR43OsGlGjKXvgL7e63vUSN8jrVEWSgYPofMqsW366UvYTwSDMJ/CsGPmoi5fX/y7LlCo/34ssoeQzuwTYdDv2lOvbaisDsVI/OcwJzZGFI9BrmWKpyyn1j7CzpRhj0hHoehLXW0iW6m3yLT5ABqq/7uM2aqHT8VG0ybtwHyqFf82c8uTZcf/zgBQFBoLtVQkhEv5EaYMJYHM9BB3ygFj1URyDY2QJaqLLWURtXwHPsuiolaPWryklIqhchNLPyh5JNOlkLFGd5z4I3W9AAeHbklhs4Zhtj3cupVuX8Bd+qu6wOsd4SQpMUq2UoyCIuiZYiImH+pYbOE4pDYDOpFrlP5gCpJeRcSoak7GfK6P0vZqoQqKB8qTWxgCJBf4Z0oeLOxeBqHu4sjZah2onJG42huWrVD+FpmCTBoOaaF2B5Ekpm5OoTq3l45A0LLx6Qi9WzItTFDSjC5driZsar2vYjrFuqQrYOFEtMmIfU/6iftsb48I4YKBqWy9uZ4mcX 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: 05 Jul 2024 07:15:58.5466 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 51c3da88-3e89-425b-2a48-08dc9cc251a1 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: SN1PEPF0002529E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7102 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,