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 E9BD044153; Tue, 4 Jun 2024 14:16:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3FE1943701; Tue, 4 Jun 2024 14:16:00 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2067.outbound.protection.outlook.com [40.107.92.67]) by mails.dpdk.org (Postfix) with ESMTP id E73D443701 for ; Tue, 4 Jun 2024 14:15:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z4FWo0moKifHDDNGAjZ7BclafSnpdZUkrLAj0N7+TI8htlT/oKEGby8kq7ftZ7JnVhs/gETeylLbtvwLOmF2hrZA1I9+Oy0QzotVaPEDzMsEiLgFtUMEkbv89Fn8VH11NPMJWDVL4SP7qP8Gc5wp+5dgfiMwebFSgXQfEcnlTrep66Rt6UEpNZqjWiDRb92uFiAaZqNLV+GBw7ROnMDamVWIbDAZtfIOgd5BQCDc1QGgyNEJUBohWzE1LUoKMfZZ9izsxtIJmCCywR1DV0TeTy6+88KE08A4nC0DFt9/hWdpEVfk2T2s3t8w+k/EkAQIoPjmYgGOAjVgt+sgbCVcZA== 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=uzw8XitLQNxlvLCWePWS/YgvOstciCo3Jk3IPtPcP0E=; b=C7/gBZ8FrBbsOUKqfDIAlT5cjluH9UYoSCeN4y3YHEnoDeHIau4VhuU56w/xMRx88TaH7wMijG/+Ut0OV7KIXO5TWhbyvZi8hPdJhdgqE6+F8lfRzHHoT5xmw1O6llHB12tDREnAphDMQ73VVyQFsTVMvOF3AbH2wQ9VvTV3/clYg3cx2m4dfq2qJ4kqILv6gnai2kDahMy2VHxg6kP6Q0AJH1DPvhPjM+444mK+UF5C8+DeD9dayMrxxJjCq5iasYUEUq6yFTD9mL88pN3I+H1IH5I18fCdCVXk2ESZDfizlOtE1eFxIQS3WWytpz492JNBD9wpUrlHDUunLJ5r9A== 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=uzw8XitLQNxlvLCWePWS/YgvOstciCo3Jk3IPtPcP0E=; b=bO+6WuRdIgspgAj+bJZRGOMnpQdLiTFBZRBVnYfphpt7oIHqz5EDSfamBvrA2dwe5HNOgQYbJIdZmzH5a+Imkb8dvylZHOr8ELitXggt915svvTmEqf6nxuxLsc6lgqB/1W1GBfivVs9t8dk+Jq9k77eRD+73hB0dTaFM982J/dy5IwAAL+Ld6kYkBMplOP43PNsXIw2CMpo+H4apm2yM0606TlrgSjXZjfF8vG69ksPcNryYTEAlsYy/14e+Dn/fEVbav8dbaOmtxepPx6ZfNpRlCsyifaZYdewmmWNXVpsFNHbVbnVJ/zeQlTCH2nGJcJ888JtzHhRclaqm3Yxzg== Received: from PH0PR07CA0055.namprd07.prod.outlook.com (2603:10b6:510:e::30) by IA1PR12MB7664.namprd12.prod.outlook.com (2603:10b6:208:423::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Tue, 4 Jun 2024 12:15:54 +0000 Received: from CY4PEPF0000FCC1.namprd03.prod.outlook.com (2603:10b6:510:e:cafe::87) by PH0PR07CA0055.outlook.office365.com (2603:10b6:510:e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.30 via Frontend Transport; Tue, 4 Jun 2024 12:15:54 +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 CY4PEPF0000FCC1.mail.protection.outlook.com (10.167.242.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 4 Jun 2024 12:15:53 +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; Tue, 4 Jun 2024 05:15:32 -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; Tue, 4 Jun 2024 05:15:30 -0700 From: Rongwei Liu To: , , , , , CC: Dariusz Sosnowski Subject: [PATCH v3 3/3] net/mlx5: implement VXLAN last reserved modification Date: Tue, 4 Jun 2024 15:15:02 +0300 Message-ID: <20240604121502.376102-4-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240604121502.376102-1-rongweil@nvidia.com> References: <2585221.otXNkdZ6W1@thomas> <20240604121502.376102-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: CY4PEPF0000FCC1:EE_|IA1PR12MB7664:EE_ X-MS-Office365-Filtering-Correlation-Id: eca809c6-a4cd-42d0-9d46-08dc849014c2 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|82310400017|376005|36860700004|1800799015; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?WVLsszYluLp7rAT9Icj7/xpKDryTxo9lkdF9ifKG/l29/tTE2PS/X2U+3zUK?= =?us-ascii?Q?zIZg/U1DeCzZQl8fpb8IvC2vxC+f/Lbr2kGpgIQQL/wttsmS6iyrurCC/XRR?= =?us-ascii?Q?ldIkZqP6yD+t4o0GQbNsucGu1D+vhZ6HQrqdCnTu7qFb4KA/nwhRlNe5I19U?= =?us-ascii?Q?UBBMAR/9fsob2hSAeMvTN+TzNuPR+WrAc7kc1AC6DwY/CujuI7yy1nMjHkll?= =?us-ascii?Q?5NWApFdih+GfyW2Qkt89j1+GL/8fPzYjNMEqThhLVvdG4TqfdTnirk1oHqrI?= =?us-ascii?Q?ryK+VuaTnZyKcQPg8B8xEbai2ZhalL84rOjDWqE2lzR7s+rqgItssGXjRGrV?= =?us-ascii?Q?xkEpzprnTwpa2p+VgxMwgde5pxFhTTHSZzYm0MeNhCEz8ARwKplRSqBj1HJd?= =?us-ascii?Q?WeI+NohX7RS7MV0EwZF+gSeZOnP3LjLx1XtRnJ1bvTCMGghQEKhEOgeJs6hA?= =?us-ascii?Q?v+q494AT4pNcM/BzrNbGGDsUSytgEt3oCvimV2M3WesMKVE7Ld23fZqklgnj?= =?us-ascii?Q?IUOWYa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: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)(82310400017)(376005)(36860700004)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 12:15:53.6817 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eca809c6-a4cd-42d0-9d46-08dc849014c2 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: CY4PEPF0000FCC1.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7664 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 b5928d40b2..2cedb3696b 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -685,6 +685,11 @@ Limitations - Second tunnel fields are not supported. - Encapsulation levels greater than ``2`` are not supported. + - Modification of the VXLAN header is supported with below limitations: + + - Only in HW steering (``dv_flow_en=2``). + - Support VNI and rsvd1 modifications for traffic with default VXLAN/VXLAN-GPE/VXLAN-GBP + UDP destination port. - Age action: diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 6f72185916..48554ab8d1 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_RSVD1: + 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_RSVD1: + 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 27e3ec550e..2feff05c24 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -1371,6 +1371,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_RSVD1) { + 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 ? @@ -5515,6 +5519,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_RSVD1: case RTE_FLOW_FIELD_GENEVE_VNI: case RTE_FLOW_FIELD_GENEVE_OPT_TYPE: case RTE_FLOW_FIELD_GENEVE_OPT_CLASS: -- 2.27.0