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 DB20644020; Tue, 14 May 2024 05:22:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 69D4F402D1; Tue, 14 May 2024 05:22:06 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2046.outbound.protection.outlook.com [40.107.237.46]) by mails.dpdk.org (Postfix) with ESMTP id D1F3C402AE for ; Tue, 14 May 2024 05:22:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LwPklHWTjsreB7uIgqW4WkPugDP6R+MEDvEkAtAqp5Ud9suIXFAruUh5xLOAmxPWW3knE1i2PGUd8fq2wLLghZmXmvT1u+2i9A9Wq36bKCy+q0HQPDEf1tua5e/fhDlv2VGOXDiOWoVT2+i0T0k0FylSvO7cyDLedJcdpQWn1dp4kJe24qeK6TgdzmEWvAglU/1VEz+cqukma56qkTPi4rNTavIz/cfU3PNmp3dSDYV/8DeT4rdkv4SUUmwjUC9xQ7hzSMEAntFYVij5BDgYg9gSHS1JIVx2oTaKdk5em1jPi2a6plbhQTNZQPQK4yLsGxOQSs87WHwHQxpAzeY2/A== 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=je4+IGnbp51km6kzEwX4cg0XrCkLoZeGG5JRox/MGCw=; b=kSJof2U2rlLk2QI6LIrtQ4P1RwC+lF8pxfP3KIFIDpT1mwl4CeUWDZaak97rs0r5dmx3pjSI8II0iiS3Zaz7KvgmBXWogqaz5xJbvUgbHyvm3cztXHQnDDASBmYKny0FT6+FAqZgkQcJi+S7Ef+Bv2QegOKVA8Xq2gTxUg7Cry6ltxLU98VQoD9WPdTCHp9rwWcF2iBILSehWeIkWwjd8edfFfsQ8SibOSk7oIrGh32o/UHHCV8lnYTP38rACUtpA8MfKI2CLCfU6vQNQAvhZbnZUuWY2qfRxyMYYTiTRibe0GHfWpzAZ3vIPILvg6QaB+G30Bpoev1Y8GL+c0I83A== 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=je4+IGnbp51km6kzEwX4cg0XrCkLoZeGG5JRox/MGCw=; b=OiBr/PUy+qH3HqxiYbEbY7vZqwjy1Rtfz4i+5n0PMv7MutlNtW1KIl6ifTdcv1kGbBAKcQBHPBO/iXYIsxKoJ1vxgEYjUEQzYTUWz9dAozhrRPzLxVVfQCo8ir2eHdN/w4pfm639H3dt1h32A8Yz9+lA1Vegb9A7OLx0E7f1DiihnrAFUp1lsfGe64R+oPxet2qmXSxyExyzVFUkXAQPuET1uNahHxBdIK4E86GeOwXscl9SKrBv2K1Cui0XHq8uJKQtIVkvhg+b4yyFQQU0kkcS2QPO9DWAjgXZgmSN2MfB/4OF1gIjdQAb+RhJ0C5BoSLt4yEuqWEOSoKqH6sckw== Received: from BN9PR03CA0182.namprd03.prod.outlook.com (2603:10b6:408:f9::7) by BL1PR12MB5922.namprd12.prod.outlook.com (2603:10b6:208:399::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.55; Tue, 14 May 2024 03:22:01 +0000 Received: from BN1PEPF00004682.namprd03.prod.outlook.com (2603:10b6:408:f9:cafe::fc) by BN9PR03CA0182.outlook.office365.com (2603:10b6:408:f9::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.55 via Frontend Transport; Tue, 14 May 2024 03:22:01 +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 BN1PEPF00004682.mail.protection.outlook.com (10.167.243.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.21 via Frontend Transport; Tue, 14 May 2024 03:22: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; Mon, 13 May 2024 20:21:47 -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; Mon, 13 May 2024 20:21:44 -0700 From: Rongwei Liu To: , , , , , CC: Alex Vesker , Dariusz Sosnowski Subject: [PATCH v1] net/mlx5/hws: match VXLAN all fields Date: Tue, 14 May 2024 06:21:31 +0300 Message-ID: <20240514032131.153409-1-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00004682:EE_|BL1PR12MB5922:EE_ X-MS-Office365-Filtering-Correlation-Id: 18863941-0080-44b1-9157-08dc73c50525 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?zD+Dr7L+FnKb8LNi/e0idc8x81JMPipdh+JvwdT+UmdvtQRHNKJk2i0FSl8W?= =?us-ascii?Q?6OpBpHPJnpuZa8DN1W2CtbZEWmy1VpLi6ZLLkhTNcB6wFBbIuHEjoaNrdmaE?= =?us-ascii?Q?APomA24GMjgNwMm8qLl53CiNpfyGaXThe8cbDLLiPiq8dhEeg0jA/i367Sxb?= =?us-ascii?Q?mnxhKOrOB6b7e2bq02rA2I/srwrts/TRqcmFzpcdtWaV53g5EYAysVeMM/o5?= =?us-ascii?Q?xZPFmeGurz5LszKEjgK+yGf3JEjkxFN0MUOeFhNdyKGpOf7W123t/f6z8XMZ?= =?us-ascii?Q?k4NkoQWXGgnIVHBXTkI9+/gOhBFObaCIEcvb7hm00LruHrJ588QgXQJPspR1?= =?us-ascii?Q?xa72/5rIGvkgIsk8O+CTlRcowJDfZOhrZ3WgltU/y01g8036AoqPD9SomKCI?= =?us-ascii?Q?nqpHBTc9jLoE+6nC+DXHgfxRyrXYuZhk2CPu5qS/DhW/H+umq5MXHcp+FTux?= =?us-ascii?Q?d+Z8w3mwqji1Bf1ZPjNj6/9dj+baFdQ7DxUFAYCDiq4uEQyZVXzeIqnp/iYg?= =?us-ascii?Q?xqo4VK8XJZkMa4sb1fO3wZ6HvM2S7dcs7Y3031f9rz4msaJNzIXJfdaLrL8I?= =?us-ascii?Q?LMmsF4KzXdHybcZ3ZG6BmDGvY+H6RNXY/dF1fHMDv99P7BlcxJ5xELFMHq9I?= =?us-ascii?Q?EU1xhtvUvXQK1RobHJXkhA9PITkb+N6aT4Ag0wpUhuFU+PD+St+SFn8CYKBL?= =?us-ascii?Q?ZfltavlJaYG/5NC3qmpvtJ5MPu4DQG8yfFxRuZADiugqSGBsQVRwGhD+k7s7?= =?us-ascii?Q?zE3UMFaj1EuYAvXG0cPSMjyultq1hy+tIBiTTkavi1W80IE0hFzKdYvvt4wc?= =?us-ascii?Q?ER+YBYrsVexeBQShZ/j/YotRYjD4YRbEMTRR2V/eXrrpjVWbOiPHbGMaieHg?= =?us-ascii?Q?v0cQNVHjMyccgAT/n1xQMU0r/QgEdJbhAR8Lf0voWyFryxnMBgF4NuSzjJ5W?= =?us-ascii?Q?d2fuzzlurSHK4DENrBterGyHbvFiys1XptMkUbC5mSbH6/OSojiYlQZ8FdfB?= =?us-ascii?Q?uVP8A+jTUb5ToiWyBOaJG3nOcKBHdtc/D/vbejGoWzj+DpzG5eSn8qT21jXJ?= =?us-ascii?Q?qzXa0ATZAUXatXDeGIEiDaskw2tijCI+rzWtADAEKOYxsGXG3hrxb/58hkEu?= =?us-ascii?Q?12Yd2z3CwXLQdBJSHo6tBSDRV+hyv9ysx879eQ9ujWh6Me9XU8fM8qdORk3i?= =?us-ascii?Q?2Ghj8DHl+iKcuW+7B7je6d+CMcxBWCJjsvnFgPTtR9zc0WwsxVjr7jKHz9xg?= =?us-ascii?Q?ROrjNpLa2QL/JYSi0NZ97AGmE34pBHdrpi8LU0csTE/bhcL08zOS+QafiYSG?= =?us-ascii?Q?sWT6LbBd74LXdtBncWLxXStRhpV95LF+Zxpc7QlsqPMEeB1kJg2z0BW6mDsy?= =?us-ascii?Q?cZfDQbsgnqTbNjqw7/yK/VhzX3yL?= 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)(82310400017)(376005)(36860700004)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 May 2024 03:22:00.9836 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 18863941-0080-44b1-9157-08dc73c50525 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: BN1PEPF00004682.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5922 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 Support VxLAN all fields support. To match GBP or GPE extension, the user needs to set the right UDP destination port plus the desired VxLAN flag bits. Signed-off-by: Rongwei Liu Reviewed-by: Alex Vesker Acked-by: Dariusz Sosnowski --- doc/guides/nics/mlx5.rst | 18 +++++++------- drivers/net/mlx5/hws/mlx5dr_definer.c | 36 ++++++--------------------- drivers/net/mlx5/hws/mlx5dr_definer.h | 4 +-- 3 files changed, 19 insertions(+), 39 deletions(-) diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst index 9b2fe07fd3..dcc1beb812 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -302,21 +302,21 @@ Limitations size and ``txq_inline_min`` settings and may be from 2 (worst case forced by maximal inline settings) to 58. -- Match on VXLAN supports the following fields only: +- Match on VXLAN supports any bits in the tunnel header - - VNI - - Last reserved 8-bits - - Last reserved 8-bits matching is only supported When using DV flow - engine (``dv_flow_en`` = 1). - For ConnectX-5, the UDP destination port must be the standard one (4789). - Group zero's behavior may differ which depends on FW. - Matching value equals 0 (value & mask) is not supported. + - Flag 8-bits and first 24-bits reserved fields matching is only supported When using DV flow + engine (``dv_flow_en`` = 2). + - For ConnectX-5, the UDP destination port must be the standard one (4789). + - Group zero's behavior may differ which depends on FW. + - Default UDP destination is 4789 if not explicitly specified. + - User should set different flags when matching on VXLAN-GPE/GBP: like I and GPE bits for + GPE and G bit for GBP. - Matching on VXLAN-GPE header fields: - ``rsvd0``/``rsvd1`` matching support depends on FW version when using DV flow engine (``dv_flow_en`` = 1). + - ``protocol`` should be explicitly specified in HWS steering (``dv_flow_en`` = 2). - L3 VXLAN and VXLAN-GPE tunnels cannot be supported together with MPLSoGRE and MPLSoUDP. diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c index a0f95c6923..63381c1111 100644 --- a/drivers/net/mlx5/hws/mlx5dr_definer.c +++ b/drivers/net/mlx5/hws/mlx5dr_definer.c @@ -203,7 +203,8 @@ struct mlx5dr_definer_conv_data { X(SET, gtp_next_ext_hdr, GTP_PDU_SC, rte_flow_item_gtp_psc) \ X(SET, gtp_ext_hdr_pdu, v->hdr.type, rte_flow_item_gtp_psc) \ X(SET, gtp_ext_hdr_qfi, v->hdr.qfi, rte_flow_item_gtp_psc) \ - X(SET, vxlan_flags, v->flags, rte_flow_item_vxlan) \ + X(SET_BE32, vxlan_vx_flags, v->hdr.vx_flags, rte_flow_item_vxlan) \ + X(SET_BE32, vxlan_vx_vni, v->hdr.vx_vni, rte_flow_item_vxlan) \ X(SET, vxlan_udp_port, UDP_VXLAN_PORT, rte_flow_item_vxlan) \ X(SET, vxlan_gpe_udp_port, UDP_VXLAN_GPE_PORT, rte_flow_item_vxlan_gpe) \ X(SET, vxlan_gpe_flags, v->flags, rte_flow_item_vxlan_gpe) \ @@ -600,16 +601,6 @@ mlx5dr_definer_gre_key_set(struct mlx5dr_definer_fc *fc, DR_SET_BE32(tag, *v, fc->byte_off, fc->bit_off, fc->bit_mask); } -static void -mlx5dr_definer_vxlan_vni_set(struct mlx5dr_definer_fc *fc, - const void *item_spec, - uint8_t *tag) -{ - const struct rte_flow_item_vxlan *v = item_spec; - - memcpy(tag + fc->byte_off, v->vni, sizeof(v->vni)); -} - static void mlx5dr_definer_ipv6_tos_set(struct mlx5dr_definer_fc *fc, const void *item_spec, @@ -1555,13 +1546,6 @@ mlx5dr_definer_conv_item_vxlan(struct mlx5dr_definer_conv_data *cd, struct mlx5dr_definer_fc *fc; bool inner = cd->tunnel; - if (m && (m->rsvd0[0] != 0 || m->rsvd0[1] != 0 || m->rsvd0[2] != 0 || - m->rsvd1 != 0)) { - DR_LOG(ERR, "reserved fields are not supported"); - rte_errno = ENOTSUP; - return rte_errno; - } - if (inner) { DR_LOG(ERR, "Inner VXLAN item not supported"); rte_errno = ENOTSUP; @@ -1590,22 +1574,18 @@ mlx5dr_definer_conv_item_vxlan(struct mlx5dr_definer_conv_data *cd, if (!m) return 0; - if (m->flags) { - fc = &cd->fc[MLX5DR_DEFINER_FNAME_VXLAN_FLAGS]; + if (m->hdr.vx_flags) { + fc = &cd->fc[MLX5DR_DEFINER_FNAME_VXLAN_DW0]; fc->item_idx = item_idx; - fc->tag_set = &mlx5dr_definer_vxlan_flags_set; + fc->tag_set = &mlx5dr_definer_vxlan_vx_flags_set; DR_CALC_SET_HDR(fc, tunnel_header, tunnel_header_0); - fc->bit_mask = __mlx5_mask(header_vxlan, flags); - fc->bit_off = __mlx5_dw_bit_off(header_vxlan, flags); } - if (!is_mem_zero(m->vni, 3)) { - fc = &cd->fc[MLX5DR_DEFINER_FNAME_VXLAN_VNI]; + if (m->hdr.vx_vni) { + fc = &cd->fc[MLX5DR_DEFINER_FNAME_VXLAN_DW1]; fc->item_idx = item_idx; - fc->tag_set = &mlx5dr_definer_vxlan_vni_set; + fc->tag_set = &mlx5dr_definer_vxlan_vx_vni_set; DR_CALC_SET_HDR(fc, tunnel_header, tunnel_header_1); - fc->bit_mask = __mlx5_mask(header_vxlan, vni); - fc->bit_off = __mlx5_dw_bit_off(header_vxlan, vni); } return 0; diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.h b/drivers/net/mlx5/hws/mlx5dr_definer.h index a42ba9b81a..8f34ea64c8 100644 --- a/drivers/net/mlx5/hws/mlx5dr_definer.h +++ b/drivers/net/mlx5/hws/mlx5dr_definer.h @@ -122,8 +122,8 @@ enum mlx5dr_definer_fname { MLX5DR_DEFINER_FNAME_FLEX_PARSER_6, MLX5DR_DEFINER_FNAME_FLEX_PARSER_7, MLX5DR_DEFINER_FNAME_VPORT_REG_C_0, - MLX5DR_DEFINER_FNAME_VXLAN_FLAGS, - MLX5DR_DEFINER_FNAME_VXLAN_VNI, + MLX5DR_DEFINER_FNAME_VXLAN_DW0, + MLX5DR_DEFINER_FNAME_VXLAN_DW1, MLX5DR_DEFINER_FNAME_VXLAN_GPE_FLAGS, MLX5DR_DEFINER_FNAME_VXLAN_GPE_RSVD0, MLX5DR_DEFINER_FNAME_VXLAN_GPE_PROTO, -- 2.27.0