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 A8BC844183; Fri, 7 Jun 2024 16:03:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6C43F42DD4; Fri, 7 Jun 2024 16:03:07 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2055.outbound.protection.outlook.com [40.107.243.55]) by mails.dpdk.org (Postfix) with ESMTP id 08BA742DC0 for ; Fri, 7 Jun 2024 16:03:05 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hi5duUNRB7iCLZngYWQ7fDPtwSdjStFvo6eZGxyAdfSxqKuGmWkEOxQ/MDou8S2Xw8K29gAMzGZXByTYa7O/StMRPdHMH5aK6c+ckTRYeSdRgK2g7tgbfqTNORlkns2KJpV+Tb2UYKmAumOZgUUi/Lim01sxZnzxFe1iJgmijjlPIAIasUiSZH3J5or58CMsvwNjafnkzE5dM3q7RLpa/jalMHO+hFfBZVf8snLrHua/a+b8/3hDMMQqjVOg9tA3XstGR55azgB5BMoOpL96KdIEPS4+O2p3RFm2iVaqx0Z6lPreEDzxSBYA0tPgF3p74bORJJd8VPwxdZf9AOYdXg== 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=7uWs490U3tKrkJPbrFC9LRWKrZUpBT1Df21aKHMDXDY=; b=QONsaZ7F3iX+0/qFxn5NaLwR9nEZe+3Su0DVM9U1FwPiVZEM73iH6sKojunaJkvYLHBuTZw2IUcgpCIE1XRtIlxd6cwqRPqun5B+Ld9uiFRfDXsebC+4u/Uq1ksvURp934vJPOWb9xp6OzRDRbaEEvjRzj5h2jC0jqfHKMepR+yu9KtJkq3YIdxj1eVS4wFlRhdRktWF6xLmy3FGDIiCNoMGmGSGLTm1uJA8XV2uhPJLyBq7sxbi+TV2BlmRZe/wxavSU3MA2i78QjMTmbI8Sbffrhi00oF0qsSSpdod0i6U547JRbhszUKV0alVnmzmtFl7lcc+x00EGWRaq2SSQw== 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=7uWs490U3tKrkJPbrFC9LRWKrZUpBT1Df21aKHMDXDY=; b=LpBc1Hu/Nu5tJEdaww/iF5EUUIDnu+St+MWrHKrjs8cPQ0cjjSwmRwoPxM5aWxlA2Mlxi+B8IkFwVuO3lyyCwCRwE993B9MDCZc8H8Wo3Y6TR2nCi8ohuLS5h5mAOMRUvsgLvNC+Lk/XD6EuomewOoJx48N2KNelMepuy1DVBrdgc2QVwKhrFIU9EAEupg+9UAqaICh8llWBmUQhb54n6KehYWyW0w7CBY9QSCYBrTQxJDiv2PLQiUIMDZOTyVm6pJXt6Dus+M10QYrm9jceBrSUmkwbD3L8dWWXlweIzl7JgKbGZmaF4SWTVacR4uBE9VX0ox3o72WEXhHYwfrYtQ== Received: from SJ0PR13CA0186.namprd13.prod.outlook.com (2603:10b6:a03:2c3::11) by MW3PR12MB4458.namprd12.prod.outlook.com (2603:10b6:303:5d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.34; Fri, 7 Jun 2024 14:03:01 +0000 Received: from CO1PEPF000075F0.namprd03.prod.outlook.com (2603:10b6:a03:2c3:cafe::8a) by SJ0PR13CA0186.outlook.office365.com (2603:10b6:a03:2c3::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.14 via Frontend Transport; Fri, 7 Jun 2024 14:03:00 +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 CO1PEPF000075F0.mail.protection.outlook.com (10.167.249.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Fri, 7 Jun 2024 14:03:00 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Fri, 7 Jun 2024 07:02:34 -0700 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Fri, 7 Jun 2024 07:02:32 -0700 From: Rongwei Liu To: , , , , , CC: Dariusz Sosnowski Subject: [PATCH v8 3/3] net/mlx5: implement VXLAN last reserved modification Date: Fri, 7 Jun 2024 17:02:08 +0300 Message-ID: <20240607140208.315235-4-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240607140208.315235-1-rongweil@nvidia.com> References: <2909053.FA0FI3ke8A@thomas> <20240607140208.315235-1-rongweil@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000075F0:EE_|MW3PR12MB4458:EE_ X-MS-Office365-Filtering-Correlation-Id: 5508f637-4da2-4d0a-5ad9-08dc86fa8abe 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:13230031|1800799015|376005|82310400017|36860700004; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?OlVDcYDum9Vfiawbcg+7KIhUK7yEbqUH0r9NC+fQmIvLKNQtDQiFsDOQSxpz?= =?us-ascii?Q?oy9ocOV6Ey3sdNrx7OpM+p8QIwa9koI/8nKimGa3MSjhfzQSRTpmvvgBgrsm?= =?us-ascii?Q?NxqLy/O1UPwnBGZvMAPARpQMJh+6tZmgx05d16u9ZHi68enZagAn/jA6u57G?= =?us-ascii?Q?D56LuZWgeOMfQveoUGYcukMPZt1ZfkwvbyBYoGCF+hg1mO5w58dsR6GmjSH/?= =?us-ascii?Q?1/BOnf5ydfPtdfZ7SY2Abttm80uOD3cMtZkP0Dg+vpZQrTd/mdCIfHQAcfN2?= =?us-ascii?Q?LjrsMYtgf4AW0RwJVd5jNXGynaMCGnt9aZLD64C8Lyr/S7AYjgdage2PS9xt?= =?us-ascii?Q?S0vQO/NYvWANwGT4NyyUg5p/+k6kfs03HqY0saWQvaKEFGG3U3Z8l0uGx1vO?= =?us-ascii?Q?ho9jD0/pnmjiJjf2e4G+1V+L3svPAWHkYn/+MQ8u+ff7Ap3kMZdKXkbHQkbP?= =?us-ascii?Q?+VmJV0EOWweyvZyURpzuELy09eQBSRhQnbs2eGiCqm9Eblb58u7EgQ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wCXKZQr7Wob7ReFbOjZm5aw=3D=3D?= 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)(1800799015)(376005)(82310400017)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 14:03:00.5882 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5508f637-4da2-4d0a-5ad9-08dc86fa8abe 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: CO1PEPF000075F0.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4458 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 Implementing the VxLAN last reserved byte modification. Following the RFC, the field is only 1 byte and needs to use the field_length as 8 instead of the real dst_field->size. Signed-off-by: Rongwei Liu Acked-by: Dariusz Sosnowski --- doc/guides/nics/mlx5.rst | 5 +++++ drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++ drivers/net/mlx5/mlx5_flow_hw.c | 5 +++++ 3 files changed, 22 insertions(+) diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst index 8afb32ed35..4d0b8bf309 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -639,6 +639,11 @@ Limitations - Modify field action using ``RTE_FLOW_FIELD_RANDOM`` is not supported. - Modification of the 802.1Q tag is not supported. - Modification of VXLAN network or GENEVE network ID is supported only for HW steering. + - Modification of the VXLAN header is supported with below limitations: + + - Only for HW steering (``dv_flow_en=2``). + - Support VNI and the last reserved byte modifications for traffic with default + UDP destination port. 4789 for VXLAN and VXLAN-GBP, 4790 for VXLAN-GPE. - Modification of GENEVE network ID is not supported when configured ``FLEX_PARSER_PROFILE_ENABLE`` supports Geneve TLV options. See :ref:`mlx5_firmware_config` for more flex parser information. diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 714613b15a..789e28b0ff 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -1439,6 +1439,8 @@ mlx5_flow_item_field_width(struct rte_eth_dev *dev, case RTE_FLOW_FIELD_VXLAN_VNI: case RTE_FLOW_FIELD_GENEVE_VNI: return 24; + case RTE_FLOW_FIELD_VXLAN_LAST_RSVD: + return 8; case RTE_FLOW_FIELD_GTP_TEID: case RTE_FLOW_FIELD_MPLS: case RTE_FLOW_FIELD_TAG: @@ -2038,6 +2040,16 @@ mlx5_flow_field_id_to_modify_info else info[idx].offset = off_be; break; + case RTE_FLOW_FIELD_VXLAN_LAST_RSVD: + MLX5_ASSERT(data->offset + width <= 8); + /* Last_rsvd is on bits 7-0 of TUNNEL_HDR_DW_1. */ + off_be = 8 - (data->offset + width); + info[idx] = (struct field_modify_info){1, 0, MLX5_MODI_TUNNEL_HDR_DW_1}; + if (mask) + mask[idx] = flow_modify_info_mask_8(width, off_be); + else + info[idx].offset = off_be; + break; case RTE_FLOW_FIELD_GENEVE_OPT_TYPE: MLX5_ASSERT(data->offset + width <= 8); modi_id = flow_geneve_opt_modi_field_get(priv, data); diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index e8562660dd..41a83768fb 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -1313,6 +1313,10 @@ flow_hw_modify_field_compile(struct rte_eth_dev *dev, value = *(const uint8_t *)item.spec; value = rte_cpu_to_be_32(value << 8); item.spec = &value; + } else if (conf->dst.field == RTE_FLOW_FIELD_VXLAN_LAST_RSVD) { + value = *(const uint8_t *)item.spec << 24; + value = rte_cpu_to_be_32(value); + item.spec = &value; } } else { type = conf->operation == RTE_FLOW_MODIFY_SET ? @@ -5508,6 +5512,7 @@ flow_hw_validate_modify_field_level(const struct rte_flow_field_data *data, case RTE_FLOW_FIELD_ESP_SPI: case RTE_FLOW_FIELD_ESP_SEQ_NUM: case RTE_FLOW_FIELD_VXLAN_VNI: + case RTE_FLOW_FIELD_VXLAN_LAST_RSVD: case RTE_FLOW_FIELD_GENEVE_VNI: case RTE_FLOW_FIELD_GENEVE_OPT_TYPE: case RTE_FLOW_FIELD_GENEVE_OPT_CLASS: -- 2.27.0