patch 'net/mlx5: fix IPv6 SRH flex node header length' has been queued to stable release 24.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 20 15:56:24 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/22/26. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/60b7756c5be0a58886070e6dbbfda8da583920c4

Thanks.

Luca Boccassi

---
>From 60b7756c5be0a58886070e6dbbfda8da583920c4 Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson at nvidia.com>
Date: Thu, 25 Dec 2025 13:02:00 +0200
Subject: [PATCH] net/mlx5: fix IPv6 SRH flex node header length

[ upstream commit f9399efbf39fe16d5a8beda666b72e7312103f99 ]

MLX5 PARSE_GRAPH_NODE defines the header_length_field_offset_mode bit,
starting from ConnectX-8. The bit value must match
HCA_CAP.header_length_field_offset_mode.

1. The patch copies header_length_field_offset_mode bit from a port
PARSE_GRAPH node capabilities to PARSE_GRAPH node definition.

2. The patch fixes the header_length_field_offset value to match
HCA_CAP.header_length_mask_width.

3. The patch replaces the static value in PARSE_GRAPH node
header_length_field_mask definition with one that matches
HCA_CAP.header_length_mask_width.

Fixes: a2234609bf7e ("net/mlx5: fix flex flow item header length")

Signed-off-by: Gregory Etelson <getelson at nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
 drivers/net/mlx5/mlx5.c           | 28 +++++++++++++++++-----------
 drivers/net/mlx5/mlx5.h           |  3 ++-
 drivers/net/mlx5/mlx5_flow.h      |  2 ++
 drivers/net/mlx5/mlx5_flow_flex.c |  2 +-
 4 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 8dce017867..b83d484ff9 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1032,6 +1032,11 @@ error:
 	return (rte_errno == 0) ? -ENODEV : -rte_errno;
 }
 
+/* IPv6 SRH header is defined in RFC 8754 */
+#define MLX5_SRH_HEADER_LENGTH_FIELD_OFFSET 8
+#define MLX5_SRH_HEADER_LENGTH_FIELD_SIZE 8
+#define MLX5_SRH_HEADER_LENGTH_SHIFT 3
+
 /*
  * Destroy the flex parser node, including the parser itself, input / output
  * arcs and DW samples. Resources could be reused then.
@@ -1090,18 +1095,14 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev)
 	/* Srv6 first two DW are not counted in. */
 	node.header_length_base_value = 0x8;
 	/* The unit is uint64_t. */
-	node.header_length_field_shift = 0x3;
+	node.header_length_field_shift = MLX5_SRH_HEADER_LENGTH_SHIFT;
+	node.header_length_field_offset_mode = !attr->header_length_field_mode_wa;
 	/* Header length is the 2nd byte. */
-	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;
+	node.header_length_field_offset = MLX5_SRH_HEADER_LENGTH_FIELD_OFFSET;
+	if (attr->header_length_mask_width < MLX5_SRH_HEADER_LENGTH_FIELD_SIZE)
+		node.header_length_field_offset +=
+			MLX5_SRH_HEADER_LENGTH_FIELD_SIZE - attr->header_length_mask_width;
+	node.header_length_field_mask = mlx5_flex_hdr_len_mask(MLX5_SRH_HEADER_LENGTH_SHIFT, attr);
 	/* One byte next header protocol. */
 	node.next_header_field_size = 0x8;
 	node.in[0].arc_parse_graph_node = MLX5_GRAPH_ARC_NODE_IP;
@@ -1155,6 +1156,11 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev)
 						(i + 1) * sizeof(uint32_t) * CHAR_BIT;
 	}
 	priv->sh->srh_flex_parser.flex.map[0].shift = 0;
+	DRV_LOG(NOTICE,
+		"SRH flex parser node object is created successfully. "
+		"Header extension length field size: %d bits\n",
+		attr->header_length_mask_width > MLX5_SRH_HEADER_LENGTH_FIELD_SIZE ?
+		MLX5_SRH_HEADER_LENGTH_FIELD_SIZE : attr->header_length_mask_width);
 	return 0;
 error:
 	if (fp)
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 56eb08bd7c..39a0705efa 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -1453,7 +1453,8 @@ struct mlx5_flex_item {
 };
 
 /*
- * Sample an IPv6 address and the first dword of SRv6 header.
+ * Sample IPv6 address in the first segment list
+ * and the first dword of SRv6 header.
  * Then it is 16 + 4 = 20 bytes which is 5 dwords.
  */
 #define MLX5_SRV6_SAMPLE_NUM 5
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index c552ff2496..af90860fb0 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -3652,6 +3652,8 @@ flow_hw_get_ipv6_route_ext_mod_id_from_ctx(void *dr_ctx, uint8_t idx)
 	return 0;
 }
 
+uint8_t mlx5_flex_hdr_len_mask(uint8_t shift, const struct mlx5_hca_flex_attr *attr);
+
 static inline bool
 mlx5_dv_modify_ipv6_traffic_class_supported(struct mlx5_priv *priv)
 {
diff --git a/drivers/net/mlx5/mlx5_flow_flex.c b/drivers/net/mlx5/mlx5_flow_flex.c
index 76a81dad16..73259f848b 100644
--- a/drivers/net/mlx5/mlx5_flow_flex.c
+++ b/drivers/net/mlx5/mlx5_flow_flex.c
@@ -458,7 +458,7 @@ mlx5_flex_release_index(struct rte_eth_dev *dev,
  *    6     b00000011  0x03
  *    7     b00000001  0x01
  */
-static uint8_t
+uint8_t
 mlx5_flex_hdr_len_mask(uint8_t shift,
 		       const struct mlx5_hca_flex_attr *attr)
 {
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-02-20 14:55:46.371216924 +0000
+++ 0082-net-mlx5-fix-IPv6-SRH-flex-node-header-length.patch	2026-02-20 14:55:43.300192702 +0000
@@ -1 +1 @@
-From f9399efbf39fe16d5a8beda666b72e7312103f99 Mon Sep 17 00:00:00 2001
+From 60b7756c5be0a58886070e6dbbfda8da583920c4 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f9399efbf39fe16d5a8beda666b72e7312103f99 ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
@@ -33 +34 @@
-index bde4d01e48..264ad4a0f7 100644
+index 8dce017867..b83d484ff9 100644
@@ -36 +37 @@
-@@ -1038,6 +1038,11 @@ error:
+@@ -1032,6 +1032,11 @@ error:
@@ -46,3 +47,3 @@
-  * Allocation of a flex parser for srh. Once refcnt is zero, the resources held
-  * by this parser will be freed.
-@@ -1078,18 +1083,14 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev)
+  * Destroy the flex parser node, including the parser itself, input / output
+  * arcs and DW samples. Resources could be reused then.
+@@ -1090,18 +1095,14 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev)
@@ -74 +75 @@
-@@ -1143,6 +1144,11 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev)
+@@ -1155,6 +1156,11 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev)
@@ -87 +88 @@
-index 966e802f5f..d84445db49 100644
+index 56eb08bd7c..39a0705efa 100644
@@ -90 +91 @@
-@@ -1472,7 +1472,8 @@ struct mlx5_flex_item {
+@@ -1453,7 +1453,8 @@ struct mlx5_flex_item {
@@ -101 +102 @@
-index 09084d311e..030f51c509 100644
+index c552ff2496..af90860fb0 100644
@@ -104 +105 @@
-@@ -3714,6 +3714,8 @@ flow_hw_get_ipv6_route_ext_mod_id_from_ctx(void *dr_ctx, uint8_t idx)
+@@ -3652,6 +3652,8 @@ flow_hw_get_ipv6_route_ext_mod_id_from_ctx(void *dr_ctx, uint8_t idx)
@@ -114 +115 @@
-index d21e28f7fd..12d79ffb9e 100644
+index 76a81dad16..73259f848b 100644


More information about the stable mailing list