From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3E18A45AD3 for ; Mon, 7 Oct 2024 10:35:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3460D40E6E; Mon, 7 Oct 2024 10:35:40 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2054.outbound.protection.outlook.com [40.107.236.54]) by mails.dpdk.org (Postfix) with ESMTP id 6A72D40151; Mon, 7 Oct 2024 10:35:38 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eVPJkKQnILeP71NuNW6yrO+CsQ1g4xf8cY7B4FrEh/u86VPYK2CDxxtKXX0sT4t2Lf+dNd9YeRkgpZTMRuKOnfIWEtZcSR6RymA59/Ck03k7JOawoZ0GPMt7wokVNGSXR8UxrnwO6MmZ6tHjTPBSb6/pE3hF0F6mW29KwmzU/nL/QA56A6bCGUll/6KrYCIiEFEd3PnJr7NitlCyb6MemiLbi1/nuTu1kSDSgtmw80jr8GQDXnsDyOS92g2+mdpGmvXcVaxtKlwKfn0kDUfq9AZ1Sw7u2r8QVbtLMuXsvVP5hx/h9zieKZylOf0XA2nAWB0F6FDiz9feIOSXoQ5aDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=VC6psF9o0gf1U55reKYz+pSKnHrF7+Y+qEWnTanEs04=; b=ZgaHBJXO7BPQIAa2BKF7U6F4nYmne3zI/s87x5FooAQ/JbLTU5GWk4rKP1W840MYrv6kLSpG7QRFTdCMAF7iwwkHuNYcJtt52il1O5rNupTGIe0ncMLkhIi8DT/1IAzkxXswPMG5iYbGw8Wlem4o6Y4JCzmWOnO7DkgZGl3JAcRwx26IqYKEpjX0TNIqDvUYc3rqE0Hx/2m5TW+I1jlnja54R8TIbMHty24LiQHyXm9GHq0U8nixo2LnhLTHZ5esbOqF1rmJpCUCIKkHiQ5TVlfO2Gzz0KUBPEZZD/rjYNMTzigkQ+gIkHld0uuOnoroDkIKcLstme+7bSyAyVfWzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=monjalon.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=VC6psF9o0gf1U55reKYz+pSKnHrF7+Y+qEWnTanEs04=; b=FDukfvAfK+nFDMHkzSnYPFthPLH5I2vPyD8GMut0SducI9UIPmlJEvl2mKfVVqcFrrSePBhEx8OqAM80DMQzdLTbgDPhdm5eKEACQfyoYHUs0LwuOBUjLAsFHi9+XKaeGCHaqcppyVK0+6atlzp9SwJhRh+5r/T8mDbEt+kEkqNIQSkVodRyEchsiRBSrUspkH8QMuPfYaB51hogd2Kg0BkL43PkQ3b1BnH/+CyxVdxhhIGwIdu9Z7IxGKjTRDZkZd/eSB/cBuQ1sKGDQoH2CjSjjNEVjGR066FT69y6ZoMxyVVjb5Ub02E28FK2aj+P/nabl/rMcp+T5gI8RVDIyg== Received: from BLAPR03CA0087.namprd03.prod.outlook.com (2603:10b6:208:329::32) by DS0PR12MB7945.namprd12.prod.outlook.com (2603:10b6:8:153::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.22; Mon, 7 Oct 2024 08:35:35 +0000 Received: from BN2PEPF000044A7.namprd04.prod.outlook.com (2603:10b6:208:329:cafe::55) by BLAPR03CA0087.outlook.office365.com (2603:10b6:208:329::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.20 via Frontend Transport; Mon, 7 Oct 2024 08:35:35 +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 BN2PEPF000044A7.mail.protection.outlook.com (10.167.243.101) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.13 via Frontend Transport; Mon, 7 Oct 2024 08:35:34 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 7 Oct 2024 01:35:20 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 7 Oct 2024 01:35:20 -0700 Received: from nvidia.com (10.127.8.12) by mail.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 via Frontend Transport; Mon, 7 Oct 2024 01:35:16 -0700 From: Itamar Gozlan To: , , , , , , , Dariusz Sosnowski , Bing Zhao , Ori Kam , Matan Azrad CC: , Subject: [PATCH] net/mlx5/hws: in NAT64 fix TC to TOS fields mapping Date: Mon, 7 Oct 2024 11:35:12 +0300 Message-ID: <20241007083512.1332053-1-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000044A7:EE_|DS0PR12MB7945:EE_ X-MS-Office365-Filtering-Correlation-Id: a170bff9-57fc-45cc-8aaa-08dce6ab0345 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|36860700013|376014|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?vu2Qb229m5vJvvt2oW+DLIewfGYJxGvxR89Aez1umpbJtemXAlL4tDnbeTQS?= =?us-ascii?Q?p7SfxyFljP9rSzzDsdcQUlI6Q6dIQSiv1CeV/+fW7IviO2fnNYMZLLB30RyQ?= =?us-ascii?Q?0jLvMNfMwytoH9UjReGdkesVjGf1fG2WhqOmhtzabdqgVIHN5exll4Z0xg8b?= =?us-ascii?Q?QrEdwWWoWJIf1Xu0Ay1tANWKV7jZbufiLfl8FDCPhMLIDhEechQIt/VQn/vY?= =?us-ascii?Q?a95XMIqX8h7UXbUytSYkHN90jVi5aArFbPMFzvRS4Kr7d7veiYYtix3skDDb?= =?us-ascii?Q?YKpGuTOz0OuaIefDUSnSkNCkb7YE4yzrqbV1SBT/RVXZxXINRqOrkXN83II+?= =?us-ascii?Q?ujSiJSixohkvTKNSlBI6cGsmFqU+RP0PMwXEP+0PPGxGrHzS87M9A7GMYo5s?= =?us-ascii?Q?8KEQWkpEDVh8x+n8c4YvBZ6WRnNd0H/a6brYm+ENgd4ddRF03rGJj5iViJc0?= =?us-ascii?Q?PgEskCXsbb21r5yjZIWt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ascii?Q?FAa5YzEPARP3gNwekUYccFarwy/8?= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2024 08:35:34.6421 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a170bff9-57fc-45cc-8aaa-08dce6ab0345 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: BN2PEPF000044A7.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7945 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Hamdan Igbaria In IPv6 to IPv4 scenario when copying the TC field to the TOS[DSCP:6 bits, ECN: 2 bits] field the mapping of the fields get set wrongly, since the destination field of TOS is defined as 2 split fields of DSCP and ECN. In IPv4 to IPv6 we don't have this issue since both the source field of TOS and destination field of TC defined as 8 bits. Example to the problematic case of IPv6 to IPv4, TOS to TC mapping: TC=[abcdefgh], it should be mapped to TOS=[DSCP=abcdef, ECN=gh], but instead it was mapped as follow TOS=[DSCP=cdefgh, ECN=ab]. Fixes: 06d969a8c5b8 ("net/mlx5/hws: support NAT64 flow action") Cc: stable@dpdk.org Signed-off-by: Hamdan Igbaria Acked-by: Dariusz Sosnowski --- drivers/net/mlx5/hws/mlx5dr_action.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c index 3fceb96de2..f163be256c 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.c +++ b/drivers/net/mlx5/hws/mlx5dr_action.c @@ -617,7 +617,7 @@ mlx5dr_action_create_nat64_copy_back_state(struct mlx5dr_context *ctx, MLX5_SET(copy_action_in, action_ptr, src_field, attr->registers[MLX5DR_ACTION_NAT64_REG_CONTROL]); MLX5_SET(copy_action_in, action_ptr, dst_field, tos_field); - MLX5_SET(copy_action_in, action_ptr, src_offset, 24); + MLX5_SET(copy_action_in, action_ptr, src_offset, 24 + (ecn ? MLX5DR_ACTION_NAT64_ECN_SIZE : 0)); MLX5_SET(copy_action_in, action_ptr, length, tos_size); action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; @@ -629,7 +629,7 @@ mlx5dr_action_create_nat64_copy_back_state(struct mlx5dr_context *ctx, MLX5_SET(copy_action_in, action_ptr, src_field, attr->registers[MLX5DR_ACTION_NAT64_REG_CONTROL]); MLX5_SET(copy_action_in, action_ptr, dst_field, ecn); - MLX5_SET(copy_action_in, action_ptr, src_offset, 24 + tos_size); + MLX5_SET(copy_action_in, action_ptr, src_offset, 24); MLX5_SET(copy_action_in, action_ptr, length, MLX5DR_ACTION_NAT64_ECN_SIZE); action_ptr += MLX5DR_ACTION_DOUBLE_SIZE; } -- 2.39.3