From patchwork Thu Jun 13 21:00:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13697460 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2049.outbound.protection.outlook.com [40.107.93.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 184AE13A256 for ; Thu, 13 Jun 2024 21:02:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.49 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718312543; cv=fail; b=DYwXcTEymiwFzpXM9DIBs1ttBfH7ajroAXUKnyaahgnX8v9T3jhIxgna+EH2lgad3gePbXE/FIANeW12C5EjvVP8CSqXkn8bH11kOEwyq+3SQC2sM/L21iD555AZhMtrhHUBwFCGnJ5kzc/9gwNnJwfNsHfSaJ3kjGbCMbG/s7s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718312543; c=relaxed/simple; bh=5ek446OFcpGfKlzN8vv030fyf0V194rFzpGEetqNsxU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lSdVoV5Qv3BXuXDBOj2vqyi2C8GMPmah95qatZEZN7wqWaFip+WyCjnvG5CE7KCbtHq5AdCsjNsFfqyXLbk6T4AsQgKdeVtxf/EJuia3uwAF+thqcvc09ZhX92bGka2Jlev6DWo9k59lB+r3lxQaU01PMI6nk4RtEVJdOo/hAqk= 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=bG6x/50O; arc=fail smtp.client-ip=40.107.93.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="bG6x/50O" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G6qY4aB37JES+juLYOg6iSN50mtm1863FmuAE4oYbs5Xt0itAXJBfdnnKvbgwiwbI34M/JYrwFLiG59fNDUQynqgzh5Gerxmj+3nIhbngkPVpCAhSdDGcaoPBKpgd+LTtKx+CD/e3qhanNtdFjJ/bO2+6LQtcmIgsaK7G1tdRX+FsvaIiLNaTckONB+4/VMBayRsOuNt40axa/vUW3IN2m8ngVF66+7xSQFgU5C3o3tPSHnXnB8OstfacaOeC77exh0dUUetopPHwep2prmFttf84gkoUF3x5KtnWiUegNNuMTq8sPykWmc6tOJ3hGnxU/tj/OtSJNzPTVrm46ZErA== 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=cKfM3yRLh7cw46Kr3oCs1DVUdnp74PhvKCHpIqRDmwI=; b=mIeWt+KecSK5osSAsQN38nN33eQpdOY7Z5yJ4OOlMeJzHCDhA1RWj/AKMTcaVbGG6x8jubN5CtGLH+CSgiVK/I4CeV+7wUTr2ypBO7RpIKaXUCEtxbKVmtDr+sGlEXud3k2XBKUt9uuOArhVMkrwuzLrdgPUXICSTcEop05zqMOGZrtjnicLaP370qtRmSBIVtOyR1RaISD1Ew2ne6vQC7H/OEu4I/vgo3+kCYAkAbZSaKkGii6P3uwTkXu5C2sbsWXTTF+QwC5+skPfZ5uhepGUEQFfbCjgCfIO+Wky5aEwiA5F2ZGwFE0hdPADxGHZUDXNZb97c97C1N46erGh5g== 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=cKfM3yRLh7cw46Kr3oCs1DVUdnp74PhvKCHpIqRDmwI=; b=bG6x/50OtMWWRAOxXvuMqh/AZvXG7drs+ieD2TeBVBB6sr0+9GTAoRjGGAgmZZsS+CdEAVy+y1fQ25znvgmATsX3onFEYsmIi9wmDeJPXZi6zmkVQNvun1hvve+SSXb2VKwx1D2ycwTj5FXt2D/B2iePFfJB7wTpWFH17E6n3tl9dEwA0giq8sPtexnT+/REMeo/l5ABHw8O0QUog73Hdjp1MYG9xNORE7dRakZfBy/6imyCSoJBdokt9xRF8MYWeH2zVEYqqZBZFF1mv9kdaeKhnA5Krh0+PqsCKtFEwQ3QqOX99U0VRtiR5e2NTqk+AK3FqrGCDTamY0sDGdaNnA== Received: from BLAPR03CA0142.namprd03.prod.outlook.com (2603:10b6:208:32e::27) by SJ1PR12MB6051.namprd12.prod.outlook.com (2603:10b6:a03:48a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.37; Thu, 13 Jun 2024 21:02:14 +0000 Received: from BL6PEPF0001AB4C.namprd04.prod.outlook.com (2603:10b6:208:32e:cafe::50) by BLAPR03CA0142.outlook.office365.com (2603:10b6:208:32e::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.24 via Frontend Transport; Thu, 13 Jun 2024 21:02:14 +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 BL6PEPF0001AB4C.mail.protection.outlook.com (10.167.242.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 13 Jun 2024 21:02:13 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 13 Jun 2024 14:01:47 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 13 Jun 2024 14:01:47 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 13 Jun 2024 14:01:44 -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 1/6] net/mlx5: Correct TASR typo into TSAR Date: Fri, 14 Jun 2024 00:00:31 +0300 Message-ID: <20240613210036.1125203-2-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240613210036.1125203-1-tariqt@nvidia.com> References: <20240613210036.1125203-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: BL6PEPF0001AB4C:EE_|SJ1PR12MB6051:EE_ X-MS-Office365-Filtering-Correlation-Id: 16b81fb7-9464-4ee4-be8e-08dc8bec19c6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230035|376009|82310400021|1800799019|36860700008; X-Microsoft-Antispam-Message-Info: wy/wzhBWafKDYrntu04ZQXoRVBXaf8Hg/FNJjE0+lyfv2GJfiba5+UHHfd3LnyZx6k8jGXZWVtcNtIQHAh3qDmikI90CC8HHPfgClc8Uhz1Wz9bLuetRI43/OC30WyzgC7btHKARbynPrcrGw0EBTBfi054V2xRMGLcWMrBzB1MRpuBzTGK9TF0He5iGzIb+dFHd+syKprOrI8BOqnSdOWpsJqj9w8sEG2v/C9wTpiEjF/UdlAc32E9Zc7TXRLluRtuec9wQzmcc6KRbtRR2mPpzScBfAOj5bN1uVmEr0c7TtvTw9pXtggr1IrGIXnAcM/BSJuGaN/XJcqpiAOgY3ez43Gxeq966/5SHd93kwlxtgCgiWAcIRGGT4smF2rJbvFYhL4l2XAA2F+baVJLmpEtcGHDkL5fYlKj6Yu6w95K0D6cZVELAkCbdA7cAZ2pbbCZQy8PhGVkzNKrdgJp90aHrK36zC82N7EgF2iSAX6+WdcdLLlQssC9KDutsclqs7GuB7KA0Ubw8InnrF0q3MGreeWaLBHm0+J7V9mFTf/xwMtNppphM5t0JVaY/DmWuvjEaS+U/Kxd8vfr7Y2VaCQxg9icGvjkXM7jR9ki2qbZgoHAxOtWskzYfxnHOWR0P4PgExcRfeXMDAd+VZ4OJX1NA4EOuit0pbHOmDXmPuwsx2Y9qIITN/LOv/z8O9W5bnuJDab7DtbhMx7f4gCq3Rx7GZWOOVfYljJS/EwxQG38oJJA3FkaC3xYu32ry+RdZiPT2gQZV8Uq2iYLcO5cen2J1CkEOutrWCVsr+dhKozgF18FaSoYTkint1N1jygqX1vYrzc1IixwzMmi6TLLwULi+NcYBekq3wWOwJ1Sd6tgImZFUIw18eQzYe2OdIpLSnmTpcepVxg1Dp6V26pK/CyMiGp7SXpgzLoWHQM57Y/hgo3ha7z4Wu1VurbZWRfSN+mDBUXPpje0GERsXSdzGoJ4tVZ/JTxPMjdHSb9oEbO+qsuMIVoPgTcbpDQwX36Uca61wEt1DJDGOKg9Npb/rI86TvwMF7zF2t3eKt/nwoaaTSt1yACwu7+KCPnqpG7FiVs6vU1o6lLCqbsQfV2E/0sVYcF9ERHEnn/lTwFRXLUhkzzRexw3IRZ33qvNetGIsWAb5kxrQ3q/Hy1dbNIAqnDE1EY7rFmDufVcZuCElLfB+1wOWWKeFyCNwNmZOsVsr+RiuKpleJo5OrEPjmcbOLWcshQYaZrL5lFPC4Tk4C0xxtA2q2c7zoZXEsj1M5f13a7x3C/mFn48iyV9z/Vxvrb8l8Go67K6+es7yr79rozT32WudBjlXw61VMhp/sulMU0MkHnapgijWcTc9XrRkWaAkoTkJkyabinDt8zhfnFm/37qdqHEBaKbVa3PZUCeb3EiloEOeHtGriEdDqoBRFQ== 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:(13230035)(376009)(82310400021)(1800799019)(36860700008);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 21:02:13.8578 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 16b81fb7-9464-4ee4-be8e-08dc8bec19c6 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: BL6PEPF0001AB4C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6051 X-Patchwork-Delegate: kuba@kernel.org From: Cosmin Ratiu TSAR is the correct spelling (Transmit Scheduling ARbiter). Signed-off-by: Cosmin Ratiu Reviewed-by: Gal Pressman Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c | 2 +- include/linux/mlx5/mlx5_ifc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c index d2ebe56c3977..20146a2dc7f4 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c @@ -531,7 +531,7 @@ static bool esw_qos_element_type_supported(struct mlx5_core_dev *dev, int type) switch (type) { case SCHEDULING_CONTEXT_ELEMENT_TYPE_TSAR: return MLX5_CAP_QOS(dev, esw_element_type) & - ELEMENT_TYPE_CAP_MASK_TASR; + ELEMENT_TYPE_CAP_MASK_TSAR; case SCHEDULING_CONTEXT_ELEMENT_TYPE_VPORT: return MLX5_CAP_QOS(dev, esw_element_type) & ELEMENT_TYPE_CAP_MASK_VPORT; diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 17acd0f3ca8e..466dcda40bb5 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -3914,7 +3914,7 @@ enum { }; enum { - ELEMENT_TYPE_CAP_MASK_TASR = 1 << 0, + ELEMENT_TYPE_CAP_MASK_TSAR = 1 << 0, ELEMENT_TYPE_CAP_MASK_VPORT = 1 << 1, ELEMENT_TYPE_CAP_MASK_VPORT_TC = 1 << 2, ELEMENT_TYPE_CAP_MASK_PARA_VPORT_TC = 1 << 3, From patchwork Thu Jun 13 21:00:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13697459 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2049.outbound.protection.outlook.com [40.107.236.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 EC9DB5E093 for ; Thu, 13 Jun 2024 21:02:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.49 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718312543; cv=fail; b=WM8vIcAsHluYW1QiNGRGmXHsxq5+v3dce31hl7oHUoLFgq1Aj26Tgm/7/AsXm42VS3zgtsVKv9vDc7WVeW8RAy5Waax6tf3tZdDPVRiczlkh4WHO76LFc5oJ71D+SoH1JZP+aAXSAXQcCyVMf043Wf5nClyF/K209zxMh69fziU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718312543; c=relaxed/simple; bh=TiF/gjtgKjyBqmLKy4PRlnZ78GNOKrv2FfswD3SqFAo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ruOps3X/ajxy9vYJ4rDIK/ak3x5y/jWx63HbrfzZwxycuk9+/rh2sgrQoOg8EYq3pQDHqZA94W0/Vmjo6euIsv1zlX6j9GlqIMr6zikP0wKhgLzEGS2UnuO6UozeMn5G7RWpNDt0v92FRjEiNeAWG233qXyvYwJbDdps1Da0VFs= 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=qnDORUeC; arc=fail smtp.client-ip=40.107.236.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="qnDORUeC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JJly97bUayn8uC2kw6EpzwV1u/jEm3TUB75Hczoh+l6HNLDNv7q4FhKaRcg+G73YapOqCKRth/qkEqPTvznbxfQ0NBKza2qL8PX0O56h+6NCUTuwjfAYwDD6quxNX2Lp0FcG0uYpwg8+PNeMYK9N3aJ+h66PUXyqgeifCimQEswf6va/FN/exQzBXL/36U0c7MmvXC29FtSxEEZZBdWMm+DDxxpdnDVaoQ6Tl4M+kRB6gYfahlWfKoL9YfaxZjSq/7OcNcMQqJSN3OcXu04YSqTe1xiaJwOXzkIJe8EP1FrEZk5OILbYMGqOsGYeAZhCq5+J0qPkLp19vpvkjn1FLA== 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=teWzMc0qWcU2kinjkwqfP3+pnAv569grdtZRuLjHxJE=; b=cJR026FHqQbDKcWGiubz1ZE12f7uxcYX2sPUkzbtbDAuzvrnHZUiseK2j8eTQrQsFIiiPVY5IIYxwseBMWkr/+14JDp9vpJigkj/+HybubxR0cocuYIprSZYz5PNwh1yJvjH+UrDRYrjs73w1N6hnE9SEphAd8B46GnvMIRqjFRtFdUnsRtw7md6OiExiYLknWmjroyFcXEYxt5o7celgi0exW2jdHmOIxJmyn+sJE3l0vTkhxahqBShQWIe0UQSEQX4sQdmQD3oSYlYYwBIhgrpZIaStvIJ/YY+ELetOVMxjz30hW+wMgAMUllNEq4SAmRWQUv9mJLBZbJRCFBgag== 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=teWzMc0qWcU2kinjkwqfP3+pnAv569grdtZRuLjHxJE=; b=qnDORUeCk0xgypXShVA+6d9hk5ZBkt466lGuiWIkGltMcaL3XBai4IYYGGZq1rw6TKB+WEhVFnaOdD3nQi1prCHmdQCbVZqt2iYQoAhZYxlDapYlWM4RSBITpg+NWv/1vf9xR4U3E50mSsVKwIhkOsTif7Z0xZpLU8p609yBP0AMVJe/TNt6zmvxMbKZa0Ew6W1sGa/35tMMI5WHylWQpTHZu4S6csEFotIBqQiH+5cCV1U+MmiASSchz5i/WaMN+NmCWIkkKBSU1747cZBy1OH56e+1aftkvMdN2PUAX9tjs66Mw45TNYDpT10phvehRQi5/CVUmq+esBJsQXdruw== Received: from CYXPR03CA0094.namprd03.prod.outlook.com (2603:10b6:930:d3::16) by PH8PR12MB7373.namprd12.prod.outlook.com (2603:10b6:510:217::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.20; Thu, 13 Jun 2024 21:02:16 +0000 Received: from CY4PEPF0000E9D7.namprd05.prod.outlook.com (2603:10b6:930:d3:cafe::99) by CYXPR03CA0094.outlook.office365.com (2603:10b6:930:d3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.25 via Frontend Transport; Thu, 13 Jun 2024 21:02:16 +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 CY4PEPF0000E9D7.mail.protection.outlook.com (10.167.241.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 13 Jun 2024 21:02:15 +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; Thu, 13 Jun 2024 14:01:51 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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; Thu, 13 Jun 2024 14:01:51 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 13 Jun 2024 14:01:48 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Chris Mi , Paul Blakey , Tariq Toukan Subject: [PATCH net-next 2/6] net/mlx5: CT: Separate CT and CT-NAT tuple entries Date: Fri, 14 Jun 2024 00:00:32 +0300 Message-ID: <20240613210036.1125203-3-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240613210036.1125203-1-tariqt@nvidia.com> References: <20240613210036.1125203-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: CY4PEPF0000E9D7:EE_|PH8PR12MB7373:EE_ X-MS-Office365-Filtering-Correlation-Id: 325efb5f-6bee-42e5-13e6-08dc8bec1ae2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230035|376009|82310400021|1800799019|36860700008; X-Microsoft-Antispam-Message-Info: 88R4Dn0CMoErKEUAoSjxnp7Uus3hEZ2uyJTo7cXdghaOvD82MtU8x+/A0mykPQm5ENzH1uXGL2cq39Wx2jXKs6j00BOgv0C6qIa5yXxabji1Dfxu5Vwgkhs/KDxCkRHu5PRH1FuOObMjIZMT2y3bJcTdtph8hcfVsuhFX1AqssM6hZ6BxmzGS8lnF7bmx4wZ52Je/LMJYGfe1I5vraa3vCqymqwuc3D/PC5X/cDlaXS0hj1eJyd53fT7Y9Fd47eB4GlUiJsPQAFJlj4MIsoO0j77ZuZy0gRsdxc6ZVvJEn13oklF/r5866XqxxQPXxb69QRnkH1j6b4AF8QLQv0UDBorYCaGdlh63fBYf43DyFomiKQ/0RRP7DgrgIlfjd5VSbD5V6YORRbn4paqMmA/IyTyaNwH++8zfZVWfLero/zER+LKuQoupWDIY6jXPsbkpFZEgQzEIzF+RJWlx66jZMehh2NWQZoQ4hvr+VZ5QY5lcOYJNEwLDORMeZg9uOHC17GHP2SL9GRV3PEXWECV4m6rz8Q8HmkPdYxF0bBCyxGPEiFEQQIfczvdt4dJeWuCSoSOg4dT++DpZ+oGaNfJKD7EXj2seGkd7p0UMoQt+wlvCIDjjImWhvkhl3nr+3ypTZ8EkxnOuoyFJ55gGLSNs2kxwmrqjMugP8vC8jh4kfq9MBZJQyrvbfp3bgOLqqKLyQ/9RhISqHOeWFB+zpyEq8dU5rLJMVoObPYsEaMtHJZx/PNJTsn22qjv8/nHwLNizl3w6YM//iC5A5/zSB3ehPER6JbFjlSluWY+teKneq9JwyJ/svO2axKZtItJFe1cr8Q+/ADzsKQi/33MfvRBwMgVjU1sVQeHB+MyUpCmaz3JYLv+nUr0obBFMop605hzm6yXcU7OIVWjpMsjuhct2e+ovu9IOkO+oSdwYPiZ5qvwFVJiiHNPvUP27jA1fXmV5/dAEVrxE1XF17DmCMUhUX73NNgiqFUjq2G2wu9IFplKDwk2BjX7FnQItlCbMMQmrSfC9tuXABBIMxFxvtN+7GtHqkwRBsaEWGgCqNbmFEbZQQD8SGK8IGXqYQtLnQYDMOFnw1DpNrVtZyEOdeQsXfdXnzBS+M6oCJ65qIR07JGMV+Uqib7kA8gl7gt0hqIYHnst9D40plpT1Ftu9Vp2RF3qHOMQn2pjs2c3PQhky4Dwg6qRRZfOaAxFrHfzmErYX42lgGjVNGNWl6y0TWMjyu7iH5+XOLDkrRQbUn0NMlcBbj+RV7WJL5c1nIc4yeaigP2gvRGp1h3+RXEkutQ+yERPp2FYpQVME8JZihtDybbfBd1kTszy8cqrIaO0pGCF8bMIys4j1Ax59J3yb3fvaj2IhfH7T+dqdrdlzcA0mutphXvg56zKwkb7zoXVJMMGawqcNQJoMSHX/75wZCssCg== 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:(13230035)(376009)(82310400021)(1800799019)(36860700008);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 21:02:15.8240 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 325efb5f-6bee-42e5-13e6-08dc8bec1ae2 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: CY4PEPF0000E9D7.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7373 X-Patchwork-Delegate: kuba@kernel.org From: Chris Mi Currently a ct entry is stored in both ct and ct-nat tables. ct action is directed to the ct table, while ct nat action is directed to the nat table. ct-nat entries perform the nat header rewrites, if required. The current design assures that a ct action will match in hardware even if the tuple has nat configured, it will just not execute it. However, storing each connection in two tables increases the system's memory consumption while reducing its insertion rate. Offload a connection to either ct or the ct-nat table. Add a miss fall-through rule from ct-nat table to the ct table allowing ct(nat) action on non-natted connections. ct action on natted connections, by default, will be handled by the software miss path. Signed-off-by: Paul Blakey Signed-off-by: Chris Mi Signed-off-by: Tariq Toukan --- .../ethernet/mellanox/mlx5/core/en/tc_ct.c | 187 +++++++++++++----- 1 file changed, 143 insertions(+), 44 deletions(-) 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 fadfa8b50beb..b49d87a51f21 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c @@ -69,6 +69,8 @@ struct mlx5_tc_ct_priv { struct rhashtable ct_tuples_nat_ht; struct mlx5_flow_table *ct; struct mlx5_flow_table *ct_nat; + struct mlx5_flow_group *ct_nat_miss_group; + struct mlx5_flow_handle *ct_nat_miss_rule; struct mlx5e_post_act *post_act; struct mutex control_lock; /* guards parallel adds/dels */ struct mapping_ctx *zone_mapping; @@ -141,6 +143,8 @@ struct mlx5_ct_counter { enum { MLX5_CT_ENTRY_FLAG_VALID, + MLX5_CT_ENTRY_IN_CT_TABLE, + MLX5_CT_ENTRY_IN_CT_NAT_TABLE, }; struct mlx5_ct_entry { @@ -198,9 +202,15 @@ static const struct rhashtable_params tuples_nat_ht_params = { }; static bool -mlx5_tc_ct_entry_has_nat(struct mlx5_ct_entry *entry) +mlx5_tc_ct_entry_in_ct_table(struct mlx5_ct_entry *entry) { - return !!(entry->tuple_nat_node.next); + return test_bit(MLX5_CT_ENTRY_IN_CT_TABLE, &entry->flags); +} + +static bool +mlx5_tc_ct_entry_in_ct_nat_table(struct mlx5_ct_entry *entry) +{ + return test_bit(MLX5_CT_ENTRY_IN_CT_NAT_TABLE, &entry->flags); } static int @@ -526,8 +536,10 @@ static void mlx5_tc_ct_entry_del_rules(struct mlx5_tc_ct_priv *ct_priv, struct mlx5_ct_entry *entry) { - mlx5_tc_ct_entry_del_rule(ct_priv, entry, true); - mlx5_tc_ct_entry_del_rule(ct_priv, entry, false); + if (mlx5_tc_ct_entry_in_ct_nat_table(entry)) + mlx5_tc_ct_entry_del_rule(ct_priv, entry, true); + if (mlx5_tc_ct_entry_in_ct_table(entry)) + mlx5_tc_ct_entry_del_rule(ct_priv, entry, false); atomic_dec(&ct_priv->debugfs.stats.offloaded); } @@ -814,7 +826,7 @@ mlx5_tc_ct_entry_add_rule(struct mlx5_tc_ct_priv *ct_priv, &zone_rule->mh, zone_restore_id, nat, - mlx5_tc_ct_entry_has_nat(entry)); + mlx5_tc_ct_entry_in_ct_nat_table(entry)); if (err) { ct_dbg("Failed to create ct entry mod hdr"); goto err_mod_hdr; @@ -888,7 +900,7 @@ mlx5_tc_ct_entry_replace_rule(struct mlx5_tc_ct_priv *ct_priv, *old_attr = *attr; err = mlx5_tc_ct_entry_create_mod_hdr(ct_priv, attr, flow_rule, &mh, zone_restore_id, - nat, mlx5_tc_ct_entry_has_nat(entry)); + nat, mlx5_tc_ct_entry_in_ct_nat_table(entry)); if (err) { ct_dbg("Failed to create ct entry mod hdr"); goto err_mod_hdr; @@ -957,11 +969,13 @@ static void mlx5_tc_ct_entry_remove_from_tuples(struct mlx5_ct_entry *entry) { struct mlx5_tc_ct_priv *ct_priv = entry->ct_priv; - rhashtable_remove_fast(&ct_priv->ct_tuples_nat_ht, - &entry->tuple_nat_node, - tuples_nat_ht_params); - rhashtable_remove_fast(&ct_priv->ct_tuples_ht, &entry->tuple_node, - tuples_ht_params); + if (mlx5_tc_ct_entry_in_ct_nat_table(entry)) + rhashtable_remove_fast(&ct_priv->ct_tuples_nat_ht, + &entry->tuple_nat_node, + tuples_nat_ht_params); + if (mlx5_tc_ct_entry_in_ct_table(entry)) + rhashtable_remove_fast(&ct_priv->ct_tuples_ht, &entry->tuple_node, + tuples_ht_params); } static void mlx5_tc_ct_entry_del(struct mlx5_ct_entry *entry) @@ -1100,21 +1114,26 @@ mlx5_tc_ct_entry_add_rules(struct mlx5_tc_ct_priv *ct_priv, return err; } - err = mlx5_tc_ct_entry_add_rule(ct_priv, flow_rule, entry, false, - zone_restore_id); - if (err) - goto err_orig; + if (mlx5_tc_ct_entry_in_ct_table(entry)) { + err = mlx5_tc_ct_entry_add_rule(ct_priv, flow_rule, entry, false, + zone_restore_id); + if (err) + goto err_orig; + } - err = mlx5_tc_ct_entry_add_rule(ct_priv, flow_rule, entry, true, - zone_restore_id); - if (err) - goto err_nat; + if (mlx5_tc_ct_entry_in_ct_nat_table(entry)) { + err = mlx5_tc_ct_entry_add_rule(ct_priv, flow_rule, entry, true, + zone_restore_id); + if (err) + goto err_nat; + } atomic_inc(&ct_priv->debugfs.stats.offloaded); return 0; err_nat: - mlx5_tc_ct_entry_del_rule(ct_priv, entry, false); + if (mlx5_tc_ct_entry_in_ct_table(entry)) + mlx5_tc_ct_entry_del_rule(ct_priv, entry, false); err_orig: mlx5_tc_ct_counter_put(ct_priv, entry); return err; @@ -1128,15 +1147,19 @@ mlx5_tc_ct_entry_replace_rules(struct mlx5_tc_ct_priv *ct_priv, { int err; - err = mlx5_tc_ct_entry_replace_rule(ct_priv, flow_rule, entry, false, - zone_restore_id); - if (err) - return err; + if (mlx5_tc_ct_entry_in_ct_table(entry)) { + err = mlx5_tc_ct_entry_replace_rule(ct_priv, flow_rule, entry, false, + zone_restore_id); + if (err) + return err; + } - err = mlx5_tc_ct_entry_replace_rule(ct_priv, flow_rule, entry, true, - zone_restore_id); - if (err) - mlx5_tc_ct_entry_del_rule(ct_priv, entry, false); + if (mlx5_tc_ct_entry_in_ct_nat_table(entry)) { + err = mlx5_tc_ct_entry_replace_rule(ct_priv, flow_rule, entry, true, + zone_restore_id); + if (err && mlx5_tc_ct_entry_in_ct_table(entry)) + mlx5_tc_ct_entry_del_rule(ct_priv, entry, false); + } return err; } @@ -1224,18 +1247,24 @@ mlx5_tc_ct_block_flow_offload_add(struct mlx5_ct_ft *ft, if (err) goto err_entries; - err = rhashtable_lookup_insert_fast(&ct_priv->ct_tuples_ht, - &entry->tuple_node, - tuples_ht_params); - if (err) - goto err_tuple; - if (memcmp(&entry->tuple, &entry->tuple_nat, sizeof(entry->tuple))) { err = rhashtable_lookup_insert_fast(&ct_priv->ct_tuples_nat_ht, &entry->tuple_nat_node, tuples_nat_ht_params); if (err) goto err_tuple_nat; + + set_bit(MLX5_CT_ENTRY_IN_CT_NAT_TABLE, &entry->flags); + } + + if (!mlx5_tc_ct_entry_in_ct_nat_table(entry)) { + err = rhashtable_lookup_insert_fast(&ct_priv->ct_tuples_ht, + &entry->tuple_node, + tuples_ht_params); + if (err) + goto err_tuple; + + set_bit(MLX5_CT_ENTRY_IN_CT_TABLE, &entry->flags); } spin_unlock_bh(&ct_priv->ht_lock); @@ -1251,17 +1280,10 @@ mlx5_tc_ct_block_flow_offload_add(struct mlx5_ct_ft *ft, err_rules: spin_lock_bh(&ct_priv->ht_lock); - if (mlx5_tc_ct_entry_has_nat(entry)) - rhashtable_remove_fast(&ct_priv->ct_tuples_nat_ht, - &entry->tuple_nat_node, tuples_nat_ht_params); -err_tuple_nat: - rhashtable_remove_fast(&ct_priv->ct_tuples_ht, - &entry->tuple_node, - tuples_ht_params); err_tuple: - rhashtable_remove_fast(&ft->ct_entries_ht, - &entry->node, - cts_ht_params); + mlx5_tc_ct_entry_remove_from_tuples(entry); +err_tuple_nat: + rhashtable_remove_fast(&ft->ct_entries_ht, &entry->node, cts_ht_params); err_entries: spin_unlock_bh(&ct_priv->ht_lock); err_set: @@ -2149,6 +2171,76 @@ mlx5_ct_tc_remove_dbgfs(struct mlx5_tc_ct_priv *ct_priv) debugfs_remove_recursive(ct_priv->debugfs.root); } +static struct mlx5_flow_handle * +tc_ct_add_miss_rule(struct mlx5_flow_table *ft, + struct mlx5_flow_table *next_ft) +{ + struct mlx5_flow_destination dest = {}; + struct mlx5_flow_act act = {}; + + act.flags = FLOW_ACT_IGNORE_FLOW_LEVEL | FLOW_ACT_NO_APPEND; + act.action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST; + dest.type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE; + dest.ft = next_ft; + + return mlx5_add_flow_rules(ft, NULL, &act, &dest, 1); +} + +static int +tc_ct_add_ct_table_miss_rule(struct mlx5_flow_table *from, + struct mlx5_flow_table *to, + struct mlx5_flow_group **miss_group, + struct mlx5_flow_handle **miss_rule) +{ + int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in); + struct mlx5_flow_group *group; + struct mlx5_flow_handle *rule; + unsigned int max_fte = from->max_fte; + u32 *flow_group_in; + int err = 0; + + flow_group_in = kvzalloc(inlen, GFP_KERNEL); + if (!flow_group_in) + return -ENOMEM; + + /* create miss group */ + MLX5_SET(create_flow_group_in, flow_group_in, start_flow_index, + max_fte - 2); + MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, + max_fte - 1); + group = mlx5_create_flow_group(from, flow_group_in); + if (IS_ERR(group)) { + err = PTR_ERR(group); + goto err_miss_grp; + } + + /* add miss rule to next fdb */ + rule = tc_ct_add_miss_rule(from, to); + if (IS_ERR(rule)) { + err = PTR_ERR(rule); + goto err_miss_rule; + } + + *miss_group = group; + *miss_rule = rule; + kvfree(flow_group_in); + return 0; + +err_miss_rule: + mlx5_destroy_flow_group(group); +err_miss_grp: + kvfree(flow_group_in); + return err; +} + +static void +tc_ct_del_ct_table_miss_rule(struct mlx5_flow_group *miss_group, + struct mlx5_flow_handle *miss_rule) +{ + mlx5_del_flow_rules(miss_rule); + mlx5_destroy_flow_group(miss_group); +} + #define INIT_ERR_PREFIX "tc ct offload init failed" struct mlx5_tc_ct_priv * @@ -2212,6 +2304,12 @@ mlx5_tc_ct_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains, goto err_ct_nat_tbl; } + err = tc_ct_add_ct_table_miss_rule(ct_priv->ct_nat, ct_priv->ct, + &ct_priv->ct_nat_miss_group, + &ct_priv->ct_nat_miss_rule); + if (err) + goto err_ct_zone_ht; + ct_priv->post_act = post_act; mutex_init(&ct_priv->control_lock); if (rhashtable_init(&ct_priv->zone_ht, &zone_params)) @@ -2273,6 +2371,7 @@ mlx5_tc_ct_clean(struct mlx5_tc_ct_priv *ct_priv) ct_priv->fs_ops->destroy(ct_priv->fs); kfree(ct_priv->fs); + tc_ct_del_ct_table_miss_rule(ct_priv->ct_nat_miss_group, ct_priv->ct_nat_miss_rule); mlx5_chains_destroy_global_table(chains, ct_priv->ct_nat); mlx5_chains_destroy_global_table(chains, ct_priv->ct); mapping_destroy(ct_priv->zone_mapping); From patchwork Thu Jun 13 21:00:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13697461 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2062.outbound.protection.outlook.com [40.107.236.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 155BF13B5A5 for ; Thu, 13 Jun 2024 21:02:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718312544; cv=fail; b=ldAXQoaB9OUGxyVhdLiJV++YiXB4IHb+0Rz5vyAvPefDWTblhnxIY34tOscPWR3ohzUno0bWlVlLsMXr2cjW3jgORsRPwmgTWHt4veCeWmyFE/tpJhXlKm7Ni9JXLXRb624mqHbylfEoCFg9JybalCGpgkdOOuU+Hw8j7FyHyXs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718312544; c=relaxed/simple; bh=jTTRYhe7YPR2fZ3LOB3YP/CLGcArVlr9gd1bdCCPILg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NQfB88ZjNjQUQ6WdkmHHO8jgzhs7yg2ToAT9/EAiwDSfFoMoJG0rp6s9FAOtL5TKCfdBgrsiJUdfw7I58mwTH3wJHj7njGifKA8q6/zyq3nVBxI58xn5pgRFATMGf9BUXfqT5GJvaSmxfaOB7OGkMkE02U8HPTIVBQzscfyGtIs= 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=jb5Zs5oR; arc=fail smtp.client-ip=40.107.236.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="jb5Zs5oR" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A6clTkJ7rX+k1G/8/IWs1XUB0unbMfHK7jjVsgLTzgOWBqp2TO7I+Q6ykYfShBT5Rsdia1ZUKpkaPDmobVh0h09rFYgPhC0/+cRvBvps+LAjxg0kG8pEqK49yrPrUVYLypak66JLdoSQKPALECvbjlHTlLRXccX2vZovAqgA/8WXnEXwOrQiwzn02JqWZ3WKs6XKGvitwBqt8LTP6SDZXZRsHY/FzYHmGOAil/SnDxOmUAd3InHmRyRrKROpiku7j/6o0r4GC7wCCsllz2LScZ15FbH1TlX/xDiQWTyzOChDBwrEEeLyvpXKUatXZr1zLB1ZJFrFILtWL/xduXdgBA== 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=GMiDFskUebmfLzh9g6mtNchMKor8xNGWqDpX2cvyXsc=; b=UGuhGqVAr8Poi+WptlEgjPNLE8dQsz7A+/t+czEbS8XlJ+VU/q4mWTvJml60ktB42gaWx3csnqtF0JRUOva2S9L04TFNDjmhdx9i5F3rbyfvED9pcGYpzPTJfVqaE4xXZzZVpIuSfd6AY6CbejshGvMZfwRPVhTea2KkDqvpjKBeXF1w6qNWycmXFboXWL6cDUNVP7+KWfzzO1It0EQLrQ4Ni+WYgq6o0HYg0G4gleGQOn/71+WWKhp7RHY0/kVpqBsu4D7M8I4nGqw+Ebr1oefU+38kcCGAaGgIyH0MeL9eUuYIHSfqHfh7rKRejcnRPaZVFJu407MUsbqqGDoqVw== 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=GMiDFskUebmfLzh9g6mtNchMKor8xNGWqDpX2cvyXsc=; b=jb5Zs5oRJzW8Y/3pI25PgyRoEZiS8Kl3QvlI+/x55dU7+dWw/vu90e+rz8LsdA/scXqG/grhCj6+N63P8FlmcxG5oVYK0yBEdfpYVRtPJ0nWDzwIbHrcrvBRYMzF833+SsWNAekGhiqZidNLjSQBxgnP/JA85tkq2Y8E17pU8xfxukMhy+wItOSV5iqkYpLqhbfSb9KgX57B0N8ktelvF2EQ8hy/DJ6cS23fP++rj4HLxBtIBvh0hbqRytRLKEqhvdBnK8KB2bHcINgcZa44nyx6aHoFObZqxmtXB710TlmWogRd+zXcNOK4b2/sqVEgBjXY34fJUbFSTG/lLrEkag== Received: from BN9PR03CA0267.namprd03.prod.outlook.com (2603:10b6:408:ff::32) by DM4PR12MB5892.namprd12.prod.outlook.com (2603:10b6:8:68::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.26; Thu, 13 Jun 2024 21:02:19 +0000 Received: from BL6PEPF0001AB4B.namprd04.prod.outlook.com (2603:10b6:408:ff:cafe::17) by BN9PR03CA0267.outlook.office365.com (2603:10b6:408:ff::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.24 via Frontend Transport; Thu, 13 Jun 2024 21:02:19 +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 BL6PEPF0001AB4B.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 13 Jun 2024 21:02:18 +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; Thu, 13 Jun 2024 14:01:54 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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; Thu, 13 Jun 2024 14:01:54 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 13 Jun 2024 14:01:51 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Moshe Shemesh , Tariq Toukan Subject: [PATCH net-next 3/6] net/mlx5: Replace strcpy with strscpy Date: Fri, 14 Jun 2024 00:00:33 +0300 Message-ID: <20240613210036.1125203-4-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240613210036.1125203-1-tariqt@nvidia.com> References: <20240613210036.1125203-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: BL6PEPF0001AB4B:EE_|DM4PR12MB5892:EE_ X-MS-Office365-Filtering-Correlation-Id: 538597e8-d605-44cc-531f-08dc8bec1ca8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230035|376009|36860700008|1800799019|82310400021; X-Microsoft-Antispam-Message-Info: 6G/y9ys2VhPJQIM4hX5qKC8BJi6IAJYZlBAanwXqec5aphYnq0089DLyPgwRMuW++PhvVGBF8olQelgx6hcnqjGBDQ2upigzaf5LvxjDJ9ALX5jQTQZQ5KU1qfRjerghSQ2SCIZqqeX4Y0JDHXvKaD0GV4WeZhYg2urOPW69YlvfIQyy46Lfy6Uk8Y215HyUhBFUTc933A9/ilbcCJTKcHsfWq+LTvQ6drxPamoB906UsvujHMlMyzW2k0qqxyBY2xrZO94/BC3x2CYp8UtS4YA/JWsOGlUOJnOKnI4Uc/DmrfbpfLpV5IPp8hfbPfna1KKWxn9nf1MsfOXCXaJQ8b/cb6f1W7Zsq+5r89Z+Lpwt1FjQmyIRaLx31kAszubnACq+1eZgwCmCaYQK80b/6VACtvf8Y/2pqibUoy52xjuLToXPXP5j6RdK2aFv3matv55G3cnY+cEoy3OQMXkTmY5MO+VE0/7wozDRkRlPjLi5OtJS5wkMBI8WuBka/sbN0XScHQ7m5rZHHdGsOiyeqmfKG4SNS2843gPwwWRB7Q0rIDsFOwUNKvhdwGvNU34DrGrrfw/ChEVrky/6k4uhmjRDxsBeKY/lrF6MCAUMTL/R2RPueLZpraEmMwNMtz4CUb1bmhRHKS+MKigA6FhquRJFB0yfEhtnVS6ZbUqybpGTjcRLEVxKxwKFvAjYPt2ZWTetOEHs4MkfYWyK6cTFT2evXPD+33yUvoI7dhIpAhA1K3tGis0snpmD85HmYZsRY+kkEiNNfQ9/M5+oLA7502YmdoF0fgo06vop2HwRnvyf13pq6+ggm+c0G9hvlbA6HkkCghNA4yrmoyhvTa8mpDYgpa9ZsS2QaFpbS0G+F9AKH8JSaO4KbB/zWaYdHWs7YBhydlHiNOag+rpmZ1EXAJVMW37eCLJiYqKeOspeh1loTEv4KMTPi5+PGIpUxVf2jYTlROA2so/w+YMBBfaw5ahhsQUdSoiAsudXCOPSsxXwREoz3AvaLjQslVTH6ylE9lEK7s2x6uP1w5dS7UMwD0lgkMlrNomLq3AXsClR012fLOlgNcxdmJDY9b6Y5Qpjf4jcxLnCha86JdaOGRNaVbplZE9BmpfC2tq3HXPbVY7T47kqXLI2D7Mbg62oiCItkASmnluVfEKVNJUbRTspoJt0/Iop8dJWjndLjI3OgDkqJVfJfjvMlJQ/1WDTYG5XqEoHUTz0kUxZ9HYkA4J/F6m94MTPsv+1xFTuAcnWpDZjc7gvYhYHkayiJWyl9cwLerJ46cy6gz8v0BfQr5lzHuF+hsXtbBenQC//tQ3RBodY5gFcKBk0qtALdZdaZMzrW2rn9ZIZoH/wNQoa+Wb+O1tc973pTJk58xVo6Qyw8McNfktHm711EY8fsLh4t9X/B1hQb0hdoi1w/naz/UOZ0Q== 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:(13230035)(376009)(36860700008)(1800799019)(82310400021);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 21:02:18.7072 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 538597e8-d605-44cc-531f-08dc8bec1ca8 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: BL6PEPF0001AB4B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5892 X-Patchwork-Delegate: kuba@kernel.org From: Moshe Shemesh Replace deprecated strcpy with strscpy. Signed-off-by: Moshe Shemesh Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c index 32cdacc34a0d..a47d6419160d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c @@ -3353,9 +3353,9 @@ static int mlx5_fs_mode_get(struct devlink *devlink, u32 id, struct mlx5_core_dev *dev = devlink_priv(devlink); if (dev->priv.steering->mode == MLX5_FLOW_STEERING_MODE_SMFS) - strcpy(ctx->val.vstr, "smfs"); + strscpy(ctx->val.vstr, "smfs", sizeof(ctx->val.vstr)); else - strcpy(ctx->val.vstr, "dmfs"); + strscpy(ctx->val.vstr, "dmfs", sizeof(ctx->val.vstr)); return 0; } From patchwork Thu Jun 13 21:00:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13697462 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2055.outbound.protection.outlook.com [40.107.243.55]) (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 B352014374D for ; Thu, 13 Jun 2024 21:02:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718312546; cv=fail; b=LrNySQLMAJ6jiJQ9I4C1tTj6px8B8Gw7inU6aB0HhgnsrPUr5zZ/PQNEHVVUmWcuksiKTuROtiQiC6uYGLBdqsz5BQV0hJoFhMK1tbh6354S+DZrhElgx7bMsNiUZe7MOx6FEwCJoYiNYLRf7YjRr5gheBk62ldu0y02zW1odhM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718312546; c=relaxed/simple; bh=GX5hOgaqeIPGmYqPXq6rE586PMo0lzP3sNhSYJCgd4A=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GRPQc8SCdzPIUlswqQhdGGS3bBQ8eTbqa5IyXyHn7mD2v4rCa6xfet/EDXOllOJwz6d1igVzE9wAMWxFdURbNqvVJ9OssOL/YUNKesMCnQIpDgi8nGudqXA2h5qnIx+0yEGFEaGZ9lJl1yegff28vxtf4PsAbHk4lqA3I2N4kk0= 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=c021+sSr; arc=fail smtp.client-ip=40.107.243.55 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="c021+sSr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ef2gL3bnw/II4NX3aYv+EoveXcZL0BByeeheIm5BRU+YziaEY71IighH0SF9TgbjaCn2ND7PpPxc2WHL2+/aRLO5GFuT3/K3Mf/4tu67UT6Eq2fAVGoKBcKuxghfyLMNneTye6TyKWZZN1v4F5HcM/WCON9k8yoSeiilQYqcjosmgzMtWv1WEE2qXh47X2fj9SqS4k7bialGLOp3mfnPn3M+M5c4CFrTecvWiGKKi7tpess78RPcodJkH6IzLvQbe4ocaVJQFs4Kd696jyfk7UBDcCO5TgH7tJNr/gkwyBWe4P0c4yi6avutPhvl1wPaJetxggaTt38mJcmhVghTIg== 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=+SUYibYWBM9t1esJGHQYFRFI4U6OUVh0BMZvyctCa0M=; b=m06jtYaKknGYsRALP3LAWdSUfLlIqn9qd0c9FlvJfZI357IPSlZyMhzkRrp+ndENHY9Vt1foVyeK6jwCjlPW4ZFM9t70c6qpnTLNhY274oKoI/gw/ty4VCFpy5kWt3RcAcTPI4AI44DBYJPw+1uHCX9bX7FKgZueepnEbo4SdIkmpA3Qf9CL0RVr3CrJo1oGM/UuD1d2hDeLm+SJRpXzcUqvF4fjeg9QYVt4Yo9hwtxS2gu4COSbkv3mfH/rCMzEBVwviO9Wd38S7tkjGLItMfaoPlbiOA1Csfq4Y1w78ArbP4tYoPzFu4kDe0GRU27ko2TleD7oiQn8CevNbwyBUQ== 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=+SUYibYWBM9t1esJGHQYFRFI4U6OUVh0BMZvyctCa0M=; b=c021+sSrYL3Odyo9GpH6CwNjHD9LyTkhBqBgR+f4nOpVrySm0b1a2xGCaXfwr9uJm5olRrQyzsHteRlsk6IbD8tE8JP59+OtQq/ZiGJEB0QGf2Z64n0Pz48lcVhFEtQV2RpOFgx8DNruRH5vTuViGiC6WORcKrZvAjPREkBRdCqnnyCnHmOYybQ04Hzah2c3/Qa3Ykrb/c3UYdpcnSAlKmvxInKRHjkAbtaFHury3xzL5ZPsJbEPlTy0wboDTz/MleMkYBBpB9jDYGeBjo8OZ9sv1pgaIi8l/zmI8n8HZuIKH7s+csJJ3CpNG7rEha4LuJW/O93g1aODx/EbDAM6Yw== Received: from BN9PR03CA0495.namprd03.prod.outlook.com (2603:10b6:408:130::20) by BL3PR12MB9052.namprd12.prod.outlook.com (2603:10b6:208:3bb::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.24; Thu, 13 Jun 2024 21:02:21 +0000 Received: from BL6PEPF0001AB4C.namprd04.prod.outlook.com (2603:10b6:408:130:cafe::3e) by BN9PR03CA0495.outlook.office365.com (2603:10b6:408:130::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.25 via Frontend Transport; Thu, 13 Jun 2024 21:02:21 +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 BL6PEPF0001AB4C.mail.protection.outlook.com (10.167.242.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 13 Jun 2024 21:02:20 +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; Thu, 13 Jun 2024 14:01:58 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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; Thu, 13 Jun 2024 14:01:57 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 13 Jun 2024 14:01:55 -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 4/6] net/mlx5e: Fix outdated comment in features check Date: Fri, 14 Jun 2024 00:00:34 +0300 Message-ID: <20240613210036.1125203-5-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240613210036.1125203-1-tariqt@nvidia.com> References: <20240613210036.1125203-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: BL6PEPF0001AB4C:EE_|BL3PR12MB9052:EE_ X-MS-Office365-Filtering-Correlation-Id: 23861d6b-74db-43af-efb7-08dc8bec1de6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230035|376009|82310400021|1800799019|36860700008; X-Microsoft-Antispam-Message-Info: O/VZQ7W6pKqoA/KTbyyLkgGfQJTbAAZg3Mj89ZrQIIa5/B7Na5FjU0Q629lT+J58dTkiLDttkBaI3XHW7OAmkRORiI9PMqVhgXezSXkylwAkziQJLZjZx1himNiYyxGDkMtAYdoScrl7Mqr2aozqzaVhppXItswwIFhpDTfnbFdovOyrf7tdwqWK+tTKLLyYX5VKHVa640p6Ut0yb+7sHc6ptywygoUgtLitFT3fBK+ulYe3CLgWwccDAFWhJOh5yJMkcjmoVbXPYibuKCjGXf8lkE9CKxa83xkBoGat8MTid8Tj3rKMv2C9m5LzmjOIjsHfTS18j+MBgi/sU/SCPaZWkkbjCeqOtr2A1z+HaXfJeC8A5ToioUVsoz2iGOn+DoUK001Cwb08zj9YJSinj7e2f/uSoi0r2SKlSeVggRgpgEGZA6e1tWsc+UQcFdCxfo2EI5PrKKyorV8gbcO08M7hwlJvEgg2fedqxuz+Ftkag0EziNGasriYiqmOPHZ3mBPex6xr9fWtAHPxkhYjR239366/0p+1rBPI+PMaw+Je1N4O4UHw7QOYveuNMGeb2YrwyQ+tKZbvmfxAwSrpkzyuQRMS4+PMToUprdrF3zWqc+UDs6OXWV1/kXOcNA6GII5gMrGRwgmR3mjnL/RSawxTwKiXxif9A5Qal2wRVFUyHtFO/35Ox9od94DA5uRd8hVnsO08BSmb7Nroyc/ep0ARG33YR5g1K+zc5dbGXEnpkf0EgvUWRDqE4SmjMxVH/zpRFOaYCGXbKj+fwiHg5S++xyMQ0J9tzwxa+TyLznYozQiuJXehonMlen9pdII/cIwDWrun8JGTcF87YEZyOh8NfPL2YwZR6N7GPe+WJKqChRzUo9j6UvxC7Ph5wMNw2SFdzYZb11EuM4Jo1WajOgcicWchKZRQI4NHEmkb7Pq1Hgmwj58yiPBloY+n7OgSfRVmS9w4GaBVK5kdweJpjRkJtvXewMGEDr7HT/aFzG6+ucb84PCcDUHaG+aTIr0o4DjLVD/e2IGRvLOfbydBlEdS+wOl9oYpwfKiZ3d6dqiKDo4wnbXZc5Anb49ilNT+TkXbIDEAEHyhCjV3oH7GU3XHqbXoYIgPgnr8tPosYBQSsfVQaPu3nr47H2aOAvRdaL/gBNO9DEkt4+sC9KWHcxF7KP65mdcRtiyPRa3btWXCn5sDkFyw56wlrnuLw7dpSVUGyI+7qexcmvWp1CXyY4YcH4qBVA9tDsRJNjeWC8ybEnMLtvED417qMQEZXCxH40lhXCamx4PtnOGYlitW1uuDAwPM/wIxO/RraqugClMBZ2fj4dy4yfhracI5TcSCGJFZ6cjrZMoxw4FD2pxgf+1s6nQYAmY1vBg5mHHKyxpXNFj5hVli3qo+P4uGt/4UYiUT1303iuCdmr3cwzwUQQ== 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:(13230035)(376009)(82310400021)(1800799019)(36860700008);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 21:02:20.7953 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 23861d6b-74db-43af-efb7-08dc8bec1de6 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: BL6PEPF0001AB4C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB9052 X-Patchwork-Delegate: kuba@kernel.org From: Gal Pressman The code no longer treats only UDP tunnels, adjust the outdated comment. Signed-off-by: Gal Pressman Reviewed-by: Cosmin Ratiu Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 44a64d062e42..2e2b59df5563 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -4910,7 +4910,7 @@ static netdev_features_t mlx5e_tunnel_features_check(struct mlx5e_priv *priv, } out: - /* Disable CSUM and GSO if the udp dport is not offloaded by HW */ + /* Disable CSUM and GSO if skb cannot be offloaded by HW */ return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK); } From patchwork Thu Jun 13 21:00:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13697463 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2040.outbound.protection.outlook.com [40.107.92.40]) (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 907AF145A11 for ; Thu, 13 Jun 2024 21:02:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718312547; cv=fail; b=HT5kgrXTS+98AIMK3DQ/mepMbrrzJMgQhQAyP1v+0CH2oNtw7HEDkck2vIGoIqLM5XjzD6iP5M8VvvxAZ0l6xxFVhdzKKCu56LZYqMiafsAga4054hjq90krfxozH8OZ5C48Lbi/RpvALKDtJotYaxOpXMRttfIWpUiUf1jnSyg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718312547; c=relaxed/simple; bh=/ZclC6i8TPl4r+FrvwYS4x6caDf0wcKIE3io0NZQW1M=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lm4RkmjGyg4fikEzJshgFLmrL+hBLaXF46WackQhtTkjd1qWMRDBeVw7KGi4zs6C/WvcPEDXnEz+1cNaLzWj3RjT6qXTBpw/uNn6lG0kdFvHRHqcZ3jSwRwxYS412S0K77zhslz5hYg4zJi54zBmG6CjYgEz25Ojq60rk6JljFU= 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=rfoSHJoC; arc=fail smtp.client-ip=40.107.92.40 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="rfoSHJoC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DWy6yqN6oJ2Fp7Txmhz8znoWmyIHpYjqG7vNz91oKx1iOBXJGOcqBbFg1Q4eApRuYJCrtUNtoYuUnydIlw3PikmPp4zLhz3Fr1/7FZckLjvH/Egk+QUqTSBxFQmAVC8hYKRcJIZwoFRInHpm7+Zp8301JXww4qWK5CHKiLt6CWgra94Nl+/ohJBnJa79pjT5XxpweKNDGgkMKXz4fyqcFKL5W4NgVEeCVTmxYplcrlxllE7ifZ745rX3gnWOPIyPktIiPJiyFeNYp3I9yYFKBEvuxVIgfaLC/72lYBFLttFb3Fj1CbyUYgAReT5DLMoiALba2pAyhuPFpkDBL+4xgQ== 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=dEvZUV0o5pTEmb2jjo32VU2hBFSXeVvvRlACit5PUtM=; b=oFwAcWeEzjNfIy18wFwpEJLnP5kVNsQFn4KKpQ+OIfy54od54sIG2MnW3TXWcL+8bmzH+lRmGKSEW6JcjH/ugs2vcs4x38hCakujvxtS9afQLW7MciqY7Ce5/oLjcLrs+1mLz2dbYxBW0Ym5rwWEF7M2gLVObWkUrfCzRNn7NOyelJi9M3mNPJmpWCPVg7HTjT5NFjTOJPuNi2fZaTTvBiI9nBLYQN2kzRMz9lj4IFLHwOIN4dQ61WnYTtD2+3WTby2y3kEcgNF15KyEnluVhuPhcKyYzfBxyAeDbhQqnPURLs/4F9fOvMieGxtke90CAMY60vxUnNECH2JvxQ9lOg== 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=dEvZUV0o5pTEmb2jjo32VU2hBFSXeVvvRlACit5PUtM=; b=rfoSHJoCVqa/pW3/HSjt7ZGDvVfs2G27PVM8vR90MiokSJyv/4zmXWYUn/f9v1Hw5zmGi1kyKN0ubgAPrtiEAGAIlGRTv4Wo87Hxes+b0C7cNyncfGSE+hDOm8ojisTUR2kyQTG4LYUCDHKM/F8zoJXeE6nXoQGZhUYEARtr3Tvh+ahbyDE8F7zbCcAgOqaflEdG6TY9kae0z8anBzLPLMg19eUTKJhTnPPLW1IqjkFYnJr6XUN3askZ7BqTrykuq7D14MSyAgXaHIOlHfeWLpNm7IGcd2L7Vg1PxeNaFAtj8MsnVeUZPvT4r0NFAIkEze19yuK9TVQJwLn4rffuCw== Received: from MN2PR08CA0026.namprd08.prod.outlook.com (2603:10b6:208:239::31) by SA3PR12MB9157.namprd12.prod.outlook.com (2603:10b6:806:39a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.37; Thu, 13 Jun 2024 21:02:22 +0000 Received: from BL6PEPF0001AB4A.namprd04.prod.outlook.com (2603:10b6:208:239:cafe::1b) by MN2PR08CA0026.outlook.office365.com (2603:10b6:208:239::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.25 via Frontend Transport; Thu, 13 Jun 2024 21:02:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL6PEPF0001AB4A.mail.protection.outlook.com (10.167.242.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 13 Jun 2024 21:02:21 +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; Thu, 13 Jun 2024 14:02:01 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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; Thu, 13 Jun 2024 14:02:01 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 13 Jun 2024 14:01:58 -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 5/6] net/mlx5e: Use tcp_v[46]_check checksum helpers Date: Fri, 14 Jun 2024 00:00:35 +0300 Message-ID: <20240613210036.1125203-6-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240613210036.1125203-1-tariqt@nvidia.com> References: <20240613210036.1125203-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: BL6PEPF0001AB4A:EE_|SA3PR12MB9157:EE_ X-MS-Office365-Filtering-Correlation-Id: c6f446b3-d12e-4a92-af42-08dc8bec1e81 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230035|376009|82310400021|1800799019|36860700008; X-Microsoft-Antispam-Message-Info: ojpcpJI4qy3cdpcalBOy7sTCgb6vyhHmylJcvwqpBExbKyjqM32bWDA4kIsafOWBzrezgnotejiPH8aSg6AOtp8JQ07wj1Ux/7rUnxPHTMIdPDCEbbS2pdnwpuuFWp1zrc6vOSiKfPbGeJakpQSZELgGbIIgxSS+l1Mb1leENSO9SZj9n0PusEJpkHMJ6ojmXeudHIvpMB/5ckR8FlY18O0IbC0XmkzU2QMNDpd553E/tpPn8qtxebvh/Na5X6HRJI65E6HSS0Ra4eHTqKGhXq0+egswdgtbG5U8Lq3Synjx1DPKhrN4qqXUyEjbOveHsnZpEuHV1CBWBpxFZM8xRXwofYCA8KMwYlL0cWCj9AGGxgieEwAtqBSjcrdZqn2m5zfZa545KXwguhgw2CTfk52vM2BVQzYLdn8NzvNfp7q4jxyDfixBwnMZ85U8qK9dJccMw3DROCVElWKycBSixw9HDuOJfq1yliG4Xn9C8cPOYqtR95J8sG3Le6A/P1RqLeQh+SbJBJCyek9htcVhyhVNZ4h2OLc0ljTF5Uhd3WW8eQKKpGphWOwHvZcIAHRYhKuKIi7zAnI7YLjeodVPMPZhndlsozM7NKuk37agu/Im8pivALc01LsFCdfYrvSO6PvXOc4Siq2pOSSc854I5lqwJZudgKV/vE5blKi+qnLcw079kG3p071t40v6UeC55Eb8xdsn/ouXIQ8SjwKKmlHtQVrjVRSXeEDMjoJKoPBCCxVllZNlakiwOs/h1Vzn2DD6nswLsNJ8iaEs1CSK/mwNxZl+BPjX/AoxS5kBXV+zD9ahdDVvhx0rEJnskHq3NUS8FltZ2W8Vu23LFPBiwPg79PJhx1fNrnumWSUP2fkwYOJl8kteGCy9NEhwmknIE8UTO6vJmJRih6TYUb1jrlhWZ6bF4BkOHnCES/Pjf+zzPQD8dj83/YIxmZuJ8Teb/JX3stCwnC5ec68OeaItRzUMUFvqhhvHGnpXUFKP1+PdIpwAYk+n7CUfYCO0OYYZVxdFXM/MO+4ikwwfDB5qIrz7EB913KmbeoZsT93fA3WErDwZQMeSeCN0WAfaS6HCc6yFtaDoazHHxsNvQAXLJigK7XEwWgkL1QDXFSLENwKj2PcMjVwxgPtBeiU0JRujYH+YvMFP7c9n3aZt+hl0T60jP7jYsIfTFtpp2Lv9jUCMrjNKvy0BJauWXp9dJjgcbt98kIzGpuKFbGaUlc88JfOhZX5hOsUHEEHlcZGDMWr9UqLaBv08/zkzFaZS9H16OvUHOUuBBYiBiHoR5YMOGwe9X+6XLj4EvswKdyLXdxdEwg56oBjG6ny6MS3KOBPu1Xj95zQc1H98oesji9FOxyfg3KNHWFz77qRmJAK3AvU08UXqnc8DWi04KPYUfn448WQTXfJAJCi/tEXUmgxdGg== 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:(13230035)(376009)(82310400021)(1800799019)(36860700008);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 21:02:21.8094 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c6f446b3-d12e-4a92-af42-08dc8bec1e81 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: BL6PEPF0001AB4A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB9157 X-Patchwork-Delegate: kuba@kernel.org From: Gal Pressman Use the tcp specific helpers to calculate the tcp pseudo header checksum instead of the csum_*_magic ones. Signed-off-by: Gal Pressman Reviewed-by: Rahul Rameshbabu Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index 43f018567faf..225da8d691fc 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -1182,9 +1182,8 @@ static void mlx5e_lro_update_hdr(struct sk_buff *skb, struct mlx5_cqe64 *cqe, check = csum_partial(tcp, tcp->doff * 4, csum_unfold((__force __sum16)cqe->check_sum)); /* Almost done, don't forget the pseudo header */ - tcp->check = csum_tcpudp_magic(ipv4->saddr, ipv4->daddr, - tot_len - sizeof(struct iphdr), - IPPROTO_TCP, check); + tcp->check = tcp_v4_check(tot_len - sizeof(struct iphdr), + ipv4->saddr, ipv4->daddr, check); } else { u16 payload_len = tot_len - sizeof(struct ipv6hdr); struct ipv6hdr *ipv6 = ip_p; @@ -1199,8 +1198,8 @@ static void mlx5e_lro_update_hdr(struct sk_buff *skb, struct mlx5_cqe64 *cqe, check = csum_partial(tcp, tcp->doff * 4, csum_unfold((__force __sum16)cqe->check_sum)); /* Almost done, don't forget the pseudo header */ - tcp->check = csum_ipv6_magic(&ipv6->saddr, &ipv6->daddr, payload_len, - IPPROTO_TCP, check); + tcp->check = tcp_v6_check(payload_len, &ipv6->saddr, + &ipv6->daddr, check); } } From patchwork Thu Jun 13 21:00:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13697464 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2040.outbound.protection.outlook.com [40.107.94.40]) (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 CBD0E14374D for ; Thu, 13 Jun 2024 21:02:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718312549; cv=fail; b=nPwSNzOOvNTKyf69NBsqsjiEv57EOj/GetUV4PSrJVDqUGNrf8lHtnrw2ZIZdYbWHNxEQXxayfHIbTfz4p+ZMrNZfpt7c/JUCYSICm/GghEXx48VhbMZtacipjTRJoNN8GRiVn425Zh6H1iOqO7oyq3s6V+hDvC8HvwiPXnJxTo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718312549; c=relaxed/simple; bh=Alu65muSbvKZsh0c5yHd4PqjJaS6jcPdACyGqwuzGgM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ImqABwnPjauem4aSOgBrR4wGPQLY0/T0AMgV18LJ/j2ZPbcydoNMf1dv1VHzPd1UyeI05396jFBN9RXDoRiOZjHZQjRUpSMF3cNp2uIcjhKO/M+Ym3l+3Cb73Wh16aT3usJ4ChclC8v73wWFEuSTh6u9vh52OjWbUxLnSyWQjLM= 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=BTWvxZmf; arc=fail smtp.client-ip=40.107.94.40 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="BTWvxZmf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GZOMJoG8sBk42ack5I7m5rBKRAT5kAMy0MivXbKI95poM+pKdPf4ihNVXLKQuhi0nGtTzxzEZUR6ihzmEe4l5F7EIoA+s3urlAYa90e7bJoveW+m3rWrpF9RW91UbemTlgeRO3um5UIW/qO8WZs8OjzWwROKAOCE+N58qgvCFVfuh9NEwfkvoSIfqkK1nSpoBlhSNIuUk/mnB6kyTM3L/r0YygU6TGTXXBAoz4msdExibeGqWoIXe/Nd8G1b5Ja6WqUxwZ6i6ebk7AnLBzKocBjcr62c0iOloXb6Q4BX5A1elReK+Lv33vhYVprV99sGBKo6kR3k6RkUFmYD40bnTQ== 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=WCxYEAyehNBBTrJHsYWV2fC9tf/IAbR/GgEhszse1SM=; b=HeMzSVYtApAGaOgdNImS1apUqvBLIUM4axlyk3OQ0OHYZ/DGOkQRcp67PBz3D7YJRwMSBqqvqUnrDlu5147z72IrvJ/Gsh71y8wHBggOqHvUrEujUXLqEhmPpuG+PVlkeK9GI93V1rpAzxFTlDo3xQz2LJqZvEjb286yl8tt1W4zjnqlVoLSgDQ7vx+Lv5UBvaeYopZKcYBNmkOFsfFCdM34vbdGEWk0HuQrTvamtwtzMsg1z7BL0o1uBgUAsUN0sClwDahVRY8SvvdH71ua5fCI43P8jYD3R6mbeYCBbgrGj5Il2qkWPDwnq57saRvxe2XkffESjN48Y4aB2U+F2Q== 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=WCxYEAyehNBBTrJHsYWV2fC9tf/IAbR/GgEhszse1SM=; b=BTWvxZmfgrH+lHsUaBcN59r4iJ+ANSC/Uub4pl5teioDuxujjJwsMyIV2iDbCGR1LzA63ufTbzETxJaVMUtkJbMCckvoRChl+DudEVwTk3RmFYTmCCL5Tw33vYVOzPEL//RV8a0HZKV9nL+N89MJinW2nuahP1HVt3pr5/9HPplps0xHNNKyvPvaKLZ0ZietRIxhmQ8GigSGcMB7vz8LV6Tr69ZS2pkpJYrPmL8cEHTa+uESmzZ7TmneJ8Cq5O1kpOqJ472seWviYlNRatf9pDqAiF8VnqKdD+Hww9L/YbrStp5UQhMYRGCdF1a+BPBQzVJJXc6In0EX7mjFF7O1GQ== Received: from PH7P220CA0047.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:32b::6) by CH2PR12MB4118.namprd12.prod.outlook.com (2603:10b6:610:a4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.25; Thu, 13 Jun 2024 21:02:24 +0000 Received: from CY4PEPF0000E9DA.namprd05.prod.outlook.com (2603:10b6:510:32b:cafe::10) by PH7P220CA0047.outlook.office365.com (2603:10b6:510:32b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.25 via Frontend Transport; Thu, 13 Jun 2024 21:02:24 +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 CY4PEPF0000E9DA.mail.protection.outlook.com (10.167.241.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 13 Jun 2024 21:02:23 +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; Thu, 13 Jun 2024 14:02:06 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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; Thu, 13 Jun 2024 14:02:04 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 13 Jun 2024 14:02:01 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Rahul Rameshbabu , Cosmin Ratiu , Tariq Toukan Subject: [PATCH net-next 6/6] net/mlx5e: Support SWP-mode offload L4 csum calculation Date: Fri, 14 Jun 2024 00:00:36 +0300 Message-ID: <20240613210036.1125203-7-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240613210036.1125203-1-tariqt@nvidia.com> References: <20240613210036.1125203-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: CY4PEPF0000E9DA:EE_|CH2PR12MB4118:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c22c787-4eda-4f5f-f02f-08dc8bec1f66 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230035|376009|82310400021|1800799019|36860700008; X-Microsoft-Antispam-Message-Info: i+SS5Ai6ilHZ+KMD0q7uGcXD2ZxRYFCIX0IukeCJkDYJDFZaUj36rN3Nvoemh35P7JiP+YUCZ0d0u1vgKwjbzT1q+MopIy+Bu4lB1Lbe3U1/VBNII8IZeGcIBnnEOTlX9KIwS9XpWl5e7yQlPecqMbnxmxvtsptDXSVMyMLk/NlG3JpSopIaahNArFOkjz4ZUbjJGXCFlv8KL08n/cG/kMTUtgp+A8LX4xiwBgBjFmks9LUiW67JvUalj62zSmnh6V7D0z+WYDzOrgagYmCMjd51Bie78Xyq93olMmx1UgAkOjzAV8tBbCoFc66eXdQhfdlO+i2TdxxXYJrsJ84l2/U5JOTcV4LENu8MJVCTa9/7gKJn/m6/c9kTi7CPJDT2nsFEdh3VEJSP2JftxvT6XzIueBmIiUdUA7Rr0vZM3CRKT4kMBSCKGwAf03AU4PM0BWXbrHvkBVVScMfbCToq4dmKxmnfDp5svj6YkPF62Ocxnn6ROxknCOEojqr40xEZ/z9rP6X4QRfb1qvjGS4ELDpxyfnKIWRPwoS1NV3etC7DnSYgX2MhuHhOz0k4tLi7Kg9vO4clvziF2LpgxPGj4OHK+920zzHpf5f1ikDOhlD/l2vBQrHtrFcJSqH+qYZPE6ArSZmamLZa4jYEZqRLRm/0pLsjOvkkcHiZVGE6ekajePdseQo07E+aTevSsujFD/knS9DNs45+Bgloz7Q2G2Ftep9qCUtbNs77JTBa5acifSWtoh5XLzmm0gCnQpthHDfAfWq7GyYHt+fFkxGzyGoP0cLRITica5W3WoWrUobgoh/wOqIPlfBx0bAolVfea/kq/tEHnikjhWoP4tzbEFeBG9gwHXDqjkNBjmICJqTb0fc7863IryucZv0xLbIrubbOZmmSEUDm/HmlphlGZFZR7RjolAEizmb7gDYBExBHSyV1XUny3RNnQQWqjqPVAd2YjYoGvNhgtqHYW8CgpsaEVzVzTEeD5pKUl5j7puaVxm73Lo89unLTdOEYCBo6v6fCtwc1vxVPuiW+dce8GWYbaS8S3HhPrRRgVFu65rQu9hY0GAj3YB8MDftfSEeHDm87FyrreWX/o02CBEGtmgr2Z4Apjz9ykGR76RroTMCXs3wopyinw7eidrCOkQjr9GwlZFLh5S5GxmuBsWnBhJddLghu0hDirvndwng0uqWToGJPjRuSrlGyP2+ftIOiHB7BZkqgFhMdH+UNOHo2JclKIKc0S3EpXXXB/eB5JJkMTmerRuDhm3eQUorRYZKBJ2XweguFGNuipvaokCXkOT23h1LWi5FVxZtT4Vbi9FgkfYt8izIwIjggucoeaJhoPibulYGFuOv8Ito6hG9heT4HfzQ6+j5tF66GcZ+HGVQe12RzZk6ueK7+mw+SBJiHF+v//Q5trkD4Ld6tJLi4Yg== 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:(13230035)(376009)(82310400021)(1800799019)(36860700008);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 21:02:23.4056 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1c22c787-4eda-4f5f-f02f-08dc8bec1f66 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: CY4PEPF0000E9DA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4118 X-Patchwork-Delegate: kuba@kernel.org From: Rahul Rameshbabu Calculate the pseudo-header checksum for both IPSec transport mode and IPSec tunnel mode for mlx5 devices that do not implement a pure hardware checksum offload for L4 checksum calculation. Introduce a capability bit that identifies such mlx5 devices. Signed-off-by: Rahul Rameshbabu Reviewed-by: Gal Pressman Reviewed-by: Cosmin Ratiu Signed-off-by: Tariq Toukan --- .../net/ethernet/mellanox/mlx5/core/en/txrx.h | 37 +++++++++++++++++++ .../mellanox/mlx5/core/en_accel/ipsec_rxtx.h | 6 ++- include/linux/mlx5/mlx5_ifc.h | 3 +- 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h index d1f0f868d494..5ec468268d1a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h @@ -6,6 +6,8 @@ #include "en.h" #include +#include +#include #define MLX5E_TX_WQE_EMPTY_DS_COUNT (sizeof(struct mlx5e_tx_wqe) / MLX5_SEND_WQE_DS) @@ -479,6 +481,41 @@ mlx5e_set_eseg_swp(struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg, } } +static inline void +mlx5e_swp_encap_csum_partial(struct mlx5_core_dev *mdev, struct sk_buff *skb, bool tunnel) +{ + const struct iphdr *ip = tunnel ? inner_ip_hdr(skb) : ip_hdr(skb); + const struct ipv6hdr *ip6; + struct tcphdr *th; + struct udphdr *uh; + int len; + + if (!MLX5_CAP_ETH(mdev, swp_csum_l4_partial) || !skb_is_gso(skb)) + return; + + if (skb_is_gso_tcp(skb)) { + th = inner_tcp_hdr(skb); + len = skb_shinfo(skb)->gso_size + inner_tcp_hdrlen(skb); + + if (ip->version == 4) { + th->check = ~tcp_v4_check(len, ip->saddr, ip->daddr, 0); + } else { + ip6 = tunnel ? inner_ipv6_hdr(skb) : ipv6_hdr(skb); + th->check = ~tcp_v6_check(len, &ip6->saddr, &ip6->daddr, 0); + } + } else if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) { + uh = (struct udphdr *)skb_inner_transport_header(skb); + len = skb_shinfo(skb)->gso_size + sizeof(struct udphdr); + + if (ip->version == 4) { + uh->check = ~udp_v4_check(len, ip->saddr, ip->daddr, 0); + } else { + ip6 = tunnel ? inner_ipv6_hdr(skb) : ipv6_hdr(skb); + uh->check = ~udp_v6_check(len, &ip6->saddr, &ip6->daddr, 0); + } + } +} + #define MLX5E_STOP_ROOM(wqebbs) ((wqebbs) * 2 - 1) static inline u16 mlx5e_stop_room_for_wqe(struct mlx5_core_dev *mdev, u16 wqe_size) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.h b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.h index 359050f0b54d..3cc640669247 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.h @@ -116,6 +116,7 @@ static inline bool mlx5e_ipsec_txwqe_build_eseg_csum(struct mlx5e_txqsq *sq, struct sk_buff *skb, struct mlx5_wqe_eth_seg *eseg) { + struct mlx5_core_dev *mdev = sq->mdev; u8 inner_ipproto; if (!mlx5e_ipsec_eseg_meta(eseg)) @@ -125,9 +126,12 @@ mlx5e_ipsec_txwqe_build_eseg_csum(struct mlx5e_txqsq *sq, struct sk_buff *skb, inner_ipproto = xfrm_offload(skb)->inner_ipproto; if (inner_ipproto) { eseg->cs_flags |= MLX5_ETH_WQE_L3_INNER_CSUM; - if (inner_ipproto == IPPROTO_TCP || inner_ipproto == IPPROTO_UDP) + if (inner_ipproto == IPPROTO_TCP || inner_ipproto == IPPROTO_UDP) { + mlx5e_swp_encap_csum_partial(mdev, skb, true); eseg->cs_flags |= MLX5_ETH_WQE_L4_INNER_CSUM; + } } else if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { + mlx5e_swp_encap_csum_partial(mdev, skb, false); eseg->cs_flags |= MLX5_ETH_WQE_L4_CSUM; sq->stats->csum_partial_inner++; } diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 466dcda40bb5..66b921c81c0f 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -1093,7 +1093,8 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_bits { u8 tunnel_stateless_ip_over_ip_tx[0x1]; u8 reserved_at_2e[0x2]; u8 max_vxlan_udp_ports[0x8]; - u8 reserved_at_38[0x6]; + u8 swp_csum_l4_partial[0x1]; + u8 reserved_at_39[0x5]; u8 max_geneve_opt_len[0x1]; u8 tunnel_stateless_geneve_rx[0x1];