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 1D5D643AA0; Wed, 7 Feb 2024 16:56:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C88CF42E1C; Wed, 7 Feb 2024 16:56:16 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2065.outbound.protection.outlook.com [40.107.96.65]) by mails.dpdk.org (Postfix) with ESMTP id BFF9B42E1C for ; Wed, 7 Feb 2024 16:56:15 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Na24b5r5JldIqNhOn5SnkHaTIocttYa/4wWW7Ue41V5mirMyxY7wlT72bAeWjOcQDqmyV4DpTRmZa8CUJy2iZGUTTFSAE3nW5vaqsVmdk0fOgDK0xQPKn5dyW8gnH/BXWhXAt/7KpbYXb/WepetUWSq5t+7J8U32E7xTFIrt4f3FrXcr3VEAlfCLegL4PikdWVOd2x9ZpTGDTXmoRcJMNXON1whbAetI8QXEV4eGptUz2fKEn+4TRFQbYzCv7eoNj9Ho7ktLW9JTfoKAzYWsygzBinF2f7JEioF091cpwsYzUtqnNHAhzzP2pS6val9EESkXohSg6lwfCkdwImobHQ== 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=cZIZ/yHtDbacCo0VOzSEvXGKmHJtOTFORtkSKk88XeM=; b=lQ+/kcphDDx1SN4wri7RKpfe/51R8zRkRCr/biib7XD9V90tJw2yi3MdXZm0frquqObrm8pVt4VTUAE/DusYcgJq1ENmPJtm2Rb6W/5OE1qzpbWkdtqfEBinrcn3SfMRlVsqJC0OiyjuCi/9PYUOb8O94h2NpgezCKlLZu2IztVN76TVT/h1VFM+NwOfkDzkAgBc5FmpOXyYlKELks6slfi/77Bd4tZwWnm+8wsfU3jJR1txsAY0h2OLYJYw8dg0eizZ1ENlB06mJLxuixvLzzrXO3xVT6eWWGPviM0DCKhUwfbxlpSp8rlA4gjJBWlD34FXBefVovCc7joVfmATCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=dpdk.org 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=cZIZ/yHtDbacCo0VOzSEvXGKmHJtOTFORtkSKk88XeM=; b=hSRD+CHxzK7hq6Rmm0jSLSLw4Vafs21/12GW26I5YnaM5/+jRrXPo+2PYo/ZgPeJdAm24xqM9d+eiEDxvo/rvrnD7P+TvEicJe2h2VM4D3iqqy/dlSnB9C8YEQ9JLbXWxOo4sla9Zqf7FJeEGzRLMNz34S6QyETL9arLSsvDw6KJYkaYr4zIySHmKggoZD8hPjzuwyFbRJ4Vplzmht75R8ejOvh+uPG3LPqj9zszzn7oHDkdiKpgv561TeaIeFscGvH1l4R3qZVOYXsO1TlJMLX6W+VhUOClPxLgoBIk8sCyhEjUeFkPi1xikeDTsZcpF6/t/Yf117Qffh9Z4hSEDg== Received: from SA1PR02CA0011.namprd02.prod.outlook.com (2603:10b6:806:2cf::28) by PH7PR12MB5951.namprd12.prod.outlook.com (2603:10b6:510:1da::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.15; Wed, 7 Feb 2024 15:56:09 +0000 Received: from SA2PEPF000015CA.namprd03.prod.outlook.com (2603:10b6:806:2cf:cafe::75) by SA1PR02CA0011.outlook.office365.com (2603:10b6:806:2cf::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.38 via Frontend Transport; Wed, 7 Feb 2024 15:56:06 +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 SA2PEPF000015CA.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.7249.19 via Frontend Transport; Wed, 7 Feb 2024 15:56:06 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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.986.41; Wed, 7 Feb 2024 07:55:57 -0800 Received: from rnnvmail202.nvidia.com (10.129.68.7) 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.986.41; Wed, 7 Feb 2024 07:55:56 -0800 Received: from nvidia.com (10.127.8.13) by mail.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.1258.12 via Frontend Transport; Wed, 7 Feb 2024 07:55:54 -0800 From: Michael Baum To: CC: Matan Azrad , Dariusz Sosnowski , Raslan Darawsheh , Viacheslav Ovsiienko , Ori Kam , Suanming Mou Subject: [PATCH v2 7/7] net/mlx5: support modify IPv6 flow label field Date: Wed, 7 Feb 2024 17:55:33 +0200 Message-ID: <20240207155533.1582031-8-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240207155533.1582031-1-michaelba@nvidia.com> References: <20240206143950.1499532-1-michaelba@nvidia.com> <20240207155533.1582031-1-michaelba@nvidia.com> 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: SA2PEPF000015CA:EE_|PH7PR12MB5951:EE_ X-MS-Office365-Filtering-Correlation-Id: 829b2a50-71e9-435b-4755-08dc27f54b71 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a9QuNQwA5M+9/X1tyIH838dVQew4JNx6wYAy2EbQtQf0SnAEvgXriuXlev1Gl2qQGwuTtyTg+MDMiUnt/O71cARsXP1jRep5WdvZPDkKLEBnfQcCTYxqF070oI1h8NdjXsU8dNtTKM7lwV8K4tb6Fe2ErQrjbbPgV/iOUrTlqTMncgcu7J7LB9LhU+jyRrgMrkEvaFIH1E6x0j1PK6+3XQf8Mj62FrNa6hvfVcBm9ddRSM04L8q63N+YNOG1KOm5WOUQf1aIu4QcP8zEcxkwnm8rUwdsNvmAOfxqbgVermdiUNWAw17B7/8Sn5IhAi4bo4xn7Bz8iFC25kvidcKhR5eC7mA7JU/18mZBYFwiK7+VJODZOyjx3BxPoTKvSPXrjVFOw/BYbRJzKE51K0eYckS7T0Jn/Uk1q1WQuERdOiTr6QD9+mVkqwyB8P7Ti+6kiagR2QjPGs/5aeInINzH7BPVJU8sA0utyacDnInR6bOPqzYzCz2A3pVT1QsZ2HrPJ32hd34iBBQPcGx0KkPj28J+ipuO/GnwK6GE4terty+osqgOGNks1SfEpPeWe98QLEDY/hABrfWPaJyNCjCZEVCc4JR4Q9f/NGG383ggaJ7pNb8sqaNTs7FCq39vx7mkCy1Gr3CE9inZ8+n49WUc2XcJpAOhoJpJfHkaTMhjcvkXz9xvyiJOZy7p5aOAjv7ZYK+MrlYkhs4BBTzTkafl2ms3IlRGcRrt/WAQIHCUy8LGMy5CwJPVM8X9I8KWHGTy 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:(13230031)(4636009)(396003)(376002)(346002)(136003)(39860400002)(230922051799003)(451199024)(64100799003)(82310400011)(186009)(1800799012)(40470700004)(36840700001)(46966006)(40480700001)(40460700003)(55016003)(36756003)(478600001)(47076005)(7696005)(86362001)(7636003)(426003)(26005)(336012)(107886003)(356005)(41300700001)(82740400003)(6286002)(83380400001)(2616005)(54906003)(2906002)(316002)(70206006)(70586007)(8676002)(5660300002)(1076003)(6916009)(4326008)(6666004)(36860700001)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2024 15:56:06.4547 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 829b2a50-71e9-435b-4755-08dc27f54b71 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: SA2PEPF000015CA.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5951 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add HW steering support for IPv6 flow label field modification. Copy from inner IPv6 flow label field is also supported using "level=2". Signed-off-by: Michael Baum --- doc/guides/rel_notes/release_24_03.rst | 1 + drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++ drivers/net/mlx5/mlx5_flow_hw.c | 1 + 3 files changed, 14 insertions(+) diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst index 50ba66daac..267851f920 100644 --- a/doc/guides/rel_notes/release_24_03.rst +++ b/doc/guides/rel_notes/release_24_03.rst @@ -114,6 +114,7 @@ New Features * Added HW steering support for modify field ``RTE_FLOW_FIELD_ESP_SEQ_NUM`` flow action. * Added HW steering support for modify field ``RTE_FLOW_FIELD_ESP_PROTO`` flow action. * Added HW steering support for modify field ``RTE_FLOW_FIELD_IPV6_TRAFFIC_CLASS`` flow action. + * Added HW steering support for modify field ``RTE_FLOW_FIELD_IPV6_FLOW_LABEL`` flow action. Removed Items diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 7d92c1cc24..bf5cd37f2f 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -1394,6 +1394,8 @@ mlx5_flow_item_field_width(struct rte_eth_dev *dev, return 32; case RTE_FLOW_FIELD_IPV6_DSCP: return 6; + case RTE_FLOW_FIELD_IPV6_FLOW_LABEL: + return 20; case RTE_FLOW_FIELD_IPV6_TRAFFIC_CLASS: case RTE_FLOW_FIELD_IPV6_HOPLIMIT: case RTE_FLOW_FIELD_IPV6_PROTO: @@ -1806,6 +1808,16 @@ mlx5_flow_field_id_to_modify_info else info[idx].offset = off_be; break; + case RTE_FLOW_FIELD_IPV6_FLOW_LABEL: + MLX5_ASSERT(data->offset + width <= 20); + off_be = 20 - (data->offset + width); + modi_id = CALC_MODI_ID(IPV6_FLOW_LABEL, data->level); + info[idx] = (struct field_modify_info){4, 0, modi_id}; + if (mask) + mask[idx] = flow_modify_info_mask_32(width, off_be); + else + info[idx].offset = off_be; + break; case RTE_FLOW_FIELD_IPV6_PAYLOAD_LEN: MLX5_ASSERT(data->offset + width <= 16); off_be = 16 - (data->offset + width); diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index a41b46e18f..1d003c9389 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -5064,6 +5064,7 @@ flow_hw_validate_modify_field_level(const struct rte_flow_field_data *data, case RTE_FLOW_FIELD_IPV4_SRC: case RTE_FLOW_FIELD_IPV4_DST: case RTE_FLOW_FIELD_IPV6_TRAFFIC_CLASS: + case RTE_FLOW_FIELD_IPV6_FLOW_LABEL: case RTE_FLOW_FIELD_IPV6_PAYLOAD_LEN: case RTE_FLOW_FIELD_IPV6_HOPLIMIT: case RTE_FLOW_FIELD_IPV6_SRC: -- 2.25.1