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 67A9D43BED; Mon, 26 Feb 2024 14:47:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5968442EAA; Mon, 26 Feb 2024 14:46:50 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2078.outbound.protection.outlook.com [40.107.237.78]) by mails.dpdk.org (Postfix) with ESMTP id 5E6F942E6C for ; Mon, 26 Feb 2024 14:46:43 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n8d6dzIEci3+9FII+ua4WL+3x1yajtJ4KeRAVrpWfDznjxGvKYP15evbIV7j2ED93V5VVP/HYA4PGXZba7IZAasoMTDjdQHp8jYBXXH9DwqLAPwtjeBbIRHdK34z1OUxxH1o5SHRyL2PYFH9k0tEtl1WjpOmUEiTFsXgGmpjiLWRtULTm3KKkCTOf/5ZtJWQ/nqm7o3EeGZ+dUkz7sMqzxSfLZgkCOieq46ORQB7sI59G9D2ZR5pQCRi9ds1hkLjZvPM0BBuK5+xdw7yargxT5Wez/Okt6+IRl2R4QwgzHaKDPwpWXALW+PDJLp1Mrp8y41R4j6tIBhbMNL45TcY0A== 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=4oIderHYSm8JOcb4liTCcHJUoGQh7UvysPZwNX0ICLo=; b=Pjkmh+7PCnqnH587lgn8ozHpay6yZkMt3ZSkIbMdDcUNkQqwBygxJ17N6ld2MVOdEalIUdcVSmdVgOta7ogp3V+ROsPJ3loiORd8n6IuGDXyZujfLDFaMxC0MRc6PbMHYxujVhfZes3vO3vaBAG8H9VQ2OgpFoHf1twW1DGCt1RfnIdMCZCQ/uQUCN4mV9kc/N6j245uZMJDcHknjHODTWTrXDNe8SWWY37sYyzao139jzqirfXePSsanelAX7YOz75DbbX+q4v2ApLZVMBSZxVNBAkeMtPwgtvbSOO3PdWjlsLexGbJlFaJ1AsNZpMSuXcbH1zQg+2wrVhnbxQN7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=4oIderHYSm8JOcb4liTCcHJUoGQh7UvysPZwNX0ICLo=; b=g5M3rAyJ8wlh+h/eeGXsejJ70vE+ZtgCSyMd53RToHVtyI/ejQB6bFqP+8qfmcu3UTiweK3nw71+sOYYPPcjqa5L7yDFCq/vjxM6ktnN2NGxDh1yPcHjWFLH2oYzBjPCknczJxsmM2La12OsDTD+4G16qC5C5RNJjvKqCLaWncSIM+85VzdsG7I4U292nC398yn3gMH86PFA3/yBsAmjoe4XtlrFiM4t4t79KK7TahRmZuKpkY6dHzjokyOJJ4HhcAS+7fk4y4BSa6nSklMB979R+FAysA0/E1Qf3zUdu8YzUh4KnIJ+H5WVc/lfhbj2OIHTzS93JMKWNooFWueGOQ== Received: from BN9PR03CA0649.namprd03.prod.outlook.com (2603:10b6:408:13b::24) by CYXPR12MB9428.namprd12.prod.outlook.com (2603:10b6:930:d5::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.34; Mon, 26 Feb 2024 13:46:41 +0000 Received: from BN2PEPF000044A7.namprd04.prod.outlook.com (2603:10b6:408:13b:cafe::82) by BN9PR03CA0649.outlook.office365.com (2603:10b6:408:13b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.49 via Frontend Transport; Mon, 26 Feb 2024 13:46:40 +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.7292.25 via Frontend Transport; Mon, 26 Feb 2024 13:46:40 +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.986.41; Mon, 26 Feb 2024 05:46:23 -0800 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.1258.12; Mon, 26 Feb 2024 05:46:21 -0800 Received: from nvidia.com (10.127.8.13) 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.1258.12 via Frontend Transport; Mon, 26 Feb 2024 05:46:20 -0800 From: Michael Baum To: CC: Matan Azrad , Dariusz Sosnowski , Raslan Darawsheh , Viacheslav Ovsiienko , Ori Kam , Suanming Mou Subject: [PATCH v3 7/7] net/mlx5: support modify IPv6 flow label field Date: Mon, 26 Feb 2024 15:45:56 +0200 Message-ID: <20240226134556.2985054-8-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240226134556.2985054-1-michaelba@nvidia.com> References: <20240207155533.1582031-1-michaelba@nvidia.com> <20240226134556.2985054-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: BN2PEPF000044A7:EE_|CYXPR12MB9428:EE_ X-MS-Office365-Filtering-Correlation-Id: 01e8308d-6dd5-415c-acc0-08dc36d15c8c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0v0K/lMiNncT5qheR34mpalwrivbmvUPeWDcR/mTcexCnO+JbQjBVkHlzaysAqdNDCyDJbKiw3ako+Z7NU/q+jGLAsu0tSjY0PGmzEncWfdd5aK33q9DnH+WGrZIob21hVCEfxcP1IXBzQeKEtmdRtM9gQ1iFKn+iIcIYUOzS68tf3Ub1F9ES5kMcMefd12pBJ9xtDqhI0faLXm9WRRyhIkiSfmIVPjJeh0E0A5/QXztZKZKy/q5QTyq31o/rNHhCsVZ0dO2BaC8wWo+U+cbtLSC81d3ysD8OcUgZ6RHDfj8oor06KjK3MABCBazVmcVSFqYxE9e8uEDAF+oS2bGxOPlimgp1qY+/tUpjF0q35mxL/MCZCYxwOHXyPPSqJj9Ys+XeXmbqcK8Ynp1910bwz5T2vaRDzoiK1R4nqdNu07YvxHdsfI9/k4ZAkfHoXnadhnSJ7kS8PCfAd5P1cld7aepySnAKXA2Invk98FSbM+Twvme8wZ6oAOwFEhfRrNjSSxJ/GX0i52vnWFzaUI/RsqiTeUu8qqZeP2lDsGa1mOqWsu6kJCxQxDsDAY6TayIp5F0mqUPXM58FXjy5HjlSUSzZgxZfc4RvagHbhs5A+b/PzaSR79wJwkATpUyHYXYdFz1CpqoTnlWc/hr3bV6IXxuNxv1nx7MrWuPcE1pT6yUPNcXkwCCPDxU1+OUW2C14ye3bSkHsA0XoKjibbdq8G0nnWSOuHgehojCyvR8TFTzFB2sfxCmJVb5XIHKGjpL 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:(13230031)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2024 13:46:40.5586 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 01e8308d-6dd5-415c-acc0-08dc36d15c8c 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: CYXPR12MB9428 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 Acked-by: Dariusz Sosnowski --- 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 c2fc22ed66..ff9c6552e4 100644 --- a/doc/guides/rel_notes/release_24_03.rst +++ b/doc/guides/rel_notes/release_24_03.rst @@ -128,6 +128,7 @@ New Features * Added support for modifying IPv4 proto field in HWS flow engine. * Added support for modifying IPsec ESP fields in HWS flow engine. * Added support for modifying IPv6 traffic class field in HWS flow engine. + * Added support for modifying IPv6 flow label field in HWS flow engine. * Added support for matching a random value. * Added support for comparing result between packet fields or value. * Added support for accumulating value of field into another one. diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 2c0c8e37f7..75a8a223ab 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 9d4fdb06c1..254273e0fb 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -5068,6 +5068,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