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 E2F0548BAB for ; Tue, 25 Nov 2025 16:06:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D91DD40B9B; Tue, 25 Nov 2025 16:06:20 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id F08C940BA2 for ; Tue, 25 Nov 2025 16:06:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764083178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Gp5MJ38tThDl0/K2Y3QAMQiGPR2IWfneMwaBKIZnRvo=; b=Oc6YoVvexJt+WsLosMIw/p0I0GC9QbMBZEPXrJYTO6rvoRHwLwN8nghuOzmgwKPr2HS6K7 OaJxXmd8oTG1sZMESsk9sqETwpm/n+fs1xSHDkhdoscvmEoRtF/UsZy1l+7Zgy7HSXADaj /bqSXnGoPHAKX17teT0ikzyKgLhmL7A= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-158-P_mq-85KMX-hEIiJO_qHIw-1; Tue, 25 Nov 2025 10:06:17 -0500 X-MC-Unique: P_mq-85KMX-hEIiJO_qHIw-1 X-Mimecast-MFC-AGG-ID: P_mq-85KMX-hEIiJO_qHIw_1764083176 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1A8BA180123E; Tue, 25 Nov 2025 15:06:16 +0000 (UTC) Received: from rh.redhat.com (unknown [10.42.28.10]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B61233003761; Tue, 25 Nov 2025 15:06:14 +0000 (UTC) From: Kevin Traynor To: Viacheslav Ovsiienko Cc: dpdk stable Subject: patch 'net/mlx5: fix flex flow item header length' has been queued to stable release 24.11.4 Date: Tue, 25 Nov 2025 15:05:53 +0000 Message-ID: <20251125150558.232595-4-ktraynor@redhat.com> In-Reply-To: <20251125150558.232595-1-ktraynor@redhat.com> References: <20251125150558.232595-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: cRcl49niUzw0i_lKEJqeAJsOs_EPKQw9502olztaTi4_1764083176 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 24.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/28/25. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/1935158d6558c55a1f67f06a3995d3453c89aa20 Thanks. Kevin --- >From 1935158d6558c55a1f67f06a3995d3453c89aa20 Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Tue, 18 Nov 2025 16:57:06 +0200 Subject: [PATCH] net/mlx5: fix flex flow item header length [ upstream commit a2234609bf7e4f5bb1ad8f6f60c5f574f32c3558 ] There is the updated firmware providing the new capability bit "header_length_field_offset_mode". If this bit is set the length field offset in flex parser configuration should not be adjusted by the supported field mask left margin, and the bit "header_length_field_offset_mode" should be set in configuration command on the flex parser creation firmware call. Fixes: b04b06f4cb3f ("net/mlx5: fix flex item header length field translation") Signed-off-by: Viacheslav Ovsiienko --- drivers/common/mlx5/mlx5_devx_cmds.c | 4 ++++ drivers/common/mlx5/mlx5_devx_cmds.h | 2 ++ drivers/common/mlx5/mlx5_prm.h | 8 ++++++-- drivers/net/mlx5/mlx5.c | 12 +++++++++--- drivers/net/mlx5/mlx5_flow_flex.c | 3 ++- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index a75f011750..3b4da3db9b 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -744,4 +744,6 @@ mlx5_devx_cmd_create_flex_parser(void *ctx, MLX5_SET(parse_graph_flex, flex, header_length_mode, data->header_length_mode); + MLX5_SET(parse_graph_flex, flex, header_length_field_offset_mode, + data->header_length_field_offset_mode); MLX5_SET64(parse_graph_flex, flex, modify_field_select, data->modify_field_select); @@ -871,4 +873,6 @@ mlx5_devx_cmd_query_hca_parse_graph_node_cap attr->header_length_mask_width = MLX5_GET(parse_graph_node_cap, hcattr, header_length_mask_width); + attr->header_length_field_mode_wa = !MLX5_GET(parse_graph_node_cap, hcattr, + header_length_field_offset_mode); /* Get the max supported samples from HCA CAP 2 */ hcattr = mlx5_devx_get_hca_cap(ctx, in, out, &rc, diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h index f523bf8529..9e67c16a4c 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.h +++ b/drivers/common/mlx5/mlx5_devx_cmds.h @@ -120,4 +120,5 @@ struct mlx5_hca_flex_attr { uint8_t zero_size_supported:1; uint8_t sample_id_in_out:1; + uint8_t header_length_field_mode_wa:1; uint16_t max_base_header_length; uint8_t max_sample_base_offset; @@ -631,4 +632,5 @@ struct mlx5_devx_graph_node_attr { uint32_t header_length_field_shift:4; uint32_t header_length_field_offset:16; + uint32_t header_length_field_offset_mode:1; uint32_t header_length_field_mask; struct mlx5_devx_match_sample_attr sample[MLX5_GRAPH_NODE_SAMPLE_NUM]; diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index 4f45b104ae..43b48a96de 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -2112,5 +2112,7 @@ struct mlx5_ifc_parse_graph_node_cap_bits { u8 max_num_arc_out[0x08]; u8 max_num_sample[0x08]; - u8 reserved_at_78[0x03]; + u8 reserved_at_78[0x01]; + u8 header_length_field_offset_mode[0x1]; + u8 reserved_at_79[0x01]; u8 parse_graph_anchor[0x1]; u8 reserved_at_7c[0x01]; @@ -4921,5 +4923,7 @@ struct mlx5_ifc_parse_graph_flex_bits { u8 reserved_at_160[0x12]; u8 head_anchor_id[0x6]; - u8 reserved_at_178[0x3]; + u8 reserved_at_178[0x1]; + u8 header_length_field_offset_mode[0x1]; + u8 reserved_at_17a[0x1]; u8 next_header_field_size[0x5]; u8 header_length_field_mask[0x20]; diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 3c45643464..8dce017867 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1093,7 +1093,13 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev) node.header_length_field_shift = 0x3; /* Header length is the 2nd byte. */ - node.header_length_field_offset = 0x8; - if (attr->header_length_mask_width < 8) - node.header_length_field_offset += 8 - attr->header_length_mask_width; + if (attr->header_length_field_mode_wa) { + /* Legacy firmware before ConnectX-8, we should provide offset WA. */ + node.header_length_field_offset = 8; + if (attr->header_length_mask_width < 8) + node.header_length_field_offset += 8 - attr->header_length_mask_width; + } else { + /* The new firmware, we can specify the correct offset directly. */ + node.header_length_field_offset = 12; + } node.header_length_field_mask = 0xF; /* One byte next header protocol. */ diff --git a/drivers/net/mlx5/mlx5_flow_flex.c b/drivers/net/mlx5/mlx5_flow_flex.c index afed16985a..76a81dad16 100644 --- a/drivers/net/mlx5/mlx5_flow_flex.c +++ b/drivers/net/mlx5/mlx5_flow_flex.c @@ -555,5 +555,5 @@ mlx5_flex_translate_length(struct mlx5_hca_flex_attr *attr, msb++; offset += field->field_size - msb; - if (msb < attr->header_length_mask_width) { + if (attr->header_length_field_mode_wa && msb < attr->header_length_mask_width) { if (attr->header_length_mask_width - msb > offset) return rte_flow_error_set @@ -573,4 +573,5 @@ mlx5_flex_translate_length(struct mlx5_hca_flex_attr *attr, node->header_length_field_shift = shift; node->header_length_field_offset = offset; + node->header_length_field_offset_mode = !attr->header_length_field_mode_wa; break; } -- 2.51.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-11-25 15:03:57.978869017 +0000 +++ 0004-net-mlx5-fix-flex-flow-item-header-length.patch 2025-11-25 15:03:57.840651314 +0000 @@ -1 +1 @@ -From a2234609bf7e4f5bb1ad8f6f60c5f574f32c3558 Mon Sep 17 00:00:00 2001 +From 1935158d6558c55a1f67f06a3995d3453c89aa20 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit a2234609bf7e4f5bb1ad8f6f60c5f574f32c3558 ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -27 +28 @@ -index 22f6b29089..d12ebf8487 100644 +index a75f011750..3b4da3db9b 100644 @@ -30 +31 @@ -@@ -785,4 +785,6 @@ mlx5_devx_cmd_create_flex_parser(void *ctx, +@@ -744,4 +744,6 @@ mlx5_devx_cmd_create_flex_parser(void *ctx, @@ -37 +38 @@ -@@ -912,4 +914,6 @@ mlx5_devx_cmd_query_hca_parse_graph_node_cap +@@ -871,4 +873,6 @@ mlx5_devx_cmd_query_hca_parse_graph_node_cap @@ -45 +46 @@ -index 4c7747cbec..da50fc686c 100644 +index f523bf8529..9e67c16a4c 100644 @@ -54 +55 @@ -@@ -655,4 +656,5 @@ struct mlx5_devx_graph_node_attr { +@@ -631,4 +632,5 @@ struct mlx5_devx_graph_node_attr { @@ -61 +62 @@ -index 9383e09893..ba33336e58 100644 +index 4f45b104ae..43b48a96de 100644 @@ -64 +65 @@ -@@ -2120,5 +2120,7 @@ struct mlx5_ifc_parse_graph_node_cap_bits { +@@ -2112,5 +2112,7 @@ struct mlx5_ifc_parse_graph_node_cap_bits { @@ -73 +74 @@ -@@ -4992,5 +4994,7 @@ struct mlx5_ifc_parse_graph_flex_bits { +@@ -4921,5 +4923,7 @@ struct mlx5_ifc_parse_graph_flex_bits { @@ -83 +84 @@ -index 447fd31fd4..c1cfcb1f67 100644 +index 3c45643464..8dce017867 100644 @@ -86 +87 @@ -@@ -1081,7 +1081,13 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev) +@@ -1093,7 +1093,13 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev) @@ -104 +105 @@ -index b1174fe0ed..d21e28f7fd 100644 +index afed16985a..76a81dad16 100644