patch 'net/mlx5: fix connection tracking state item validation' has been queued to stable release 24.11.4

Kevin Traynor ktraynor at redhat.com
Fri Oct 31 15:32:41 CET 2025


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/05/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/296bde8b85b6a0f22b5420725e08df426431630b

Thanks.

Kevin

---
>From 296bde8b85b6a0f22b5420725e08df426431630b Mon Sep 17 00:00:00 2001
From: Khadem Ullah <14pwcse1224 at uetpeshawar.edu.pk>
Date: Thu, 14 Aug 2025 06:16:01 -0400
Subject: [PATCH] net/mlx5: fix connection tracking state item validation

[ upstream commit 179e70fd7ad2027705b42e7416d436d299eca78c ]

This patch validate a connection tracking state when matching
'conntrack is' in rte_flow rules. Since conntrack item flags
is a bitmap, then any combination of RTE_FLOW_CONNTRACK_PKT_STATE_*
flags is a valid value to match on.

This patch validate the CT state item.

Fixes: aca19061e4b9 ("net/mlx5: validate connection tracking item")

Signed-off-by: Khadem Ullah <14pwcse1224 at uetpeshawar.edu.pk>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.h    |  5 +++++
 drivers/net/mlx5/mlx5_flow_dv.c |  5 +++++
 drivers/net/mlx5/mlx5_flow_hw.c | 10 ++++++++++
 3 files changed, 20 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index 8c3daed7d0..ce33a4e425 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -100,4 +100,9 @@ enum mlx5_indirect_type {
 	((index) & ((1 << MLX5_INDIRECT_ACT_CT_OWNER_SHIFT) - 1))
 
+#define MLX5_FLOW_CONNTRACK_PKT_STATE_ALL \
+	(RTE_FLOW_CONNTRACK_PKT_STATE_VALID | RTE_FLOW_CONNTRACK_PKT_STATE_CHANGED | \
+	 RTE_FLOW_CONNTRACK_PKT_STATE_INVALID | RTE_FLOW_CONNTRACK_PKT_STATE_DISABLED | \
+	 RTE_FLOW_CONNTRACK_PKT_STATE_BAD)
+
 /*
  * When HW steering flow engine is used, the CT action handles are encoded in a following way:
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 9fad6e8095..74391faf11 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -3290,4 +3290,9 @@ mlx5_flow_dv_validate_item_aso_ct(struct rte_eth_dev *dev,
 						  NULL,
 						  "Conflict status bits");
+		if (spec->flags & ~MLX5_FLOW_CONNTRACK_PKT_STATE_ALL)
+			return rte_flow_error_set(error, EINVAL,
+					RTE_FLOW_ERROR_TYPE_ITEM,
+					NULL,
+					"Invalid CT item flags");
 	}
 	/* State change also needs to be considered. */
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 0d0262a275..2beb854a8b 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -16684,4 +16684,5 @@ flow_hw_validate_rule_pattern(struct rte_eth_dev *dev,
 		const struct rte_flow_item_ethdev *ethdev;
 		const struct rte_flow_item_tx_queue *tx_queue;
+		const struct rte_flow_item_conntrack *spec;
 		struct mlx5_txq_ctrl *txq;
 
@@ -16704,4 +16705,13 @@ flow_hw_validate_rule_pattern(struct rte_eth_dev *dev,
 							  "Invalid Tx queue");
 			mlx5_txq_release(dev, tx_queue->tx_queue);
+			break;
+		case RTE_FLOW_ITEM_TYPE_CONNTRACK:
+			spec = items->spec;
+			if (spec->flags & ~MLX5_FLOW_CONNTRACK_PKT_STATE_ALL)
+				return rte_flow_error_set(error, EINVAL,
+						RTE_FLOW_ERROR_TYPE_ITEM,
+						NULL,
+						"Invalid CT item flags");
+			break;
 		default:
 			break;
-- 
2.51.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-10-31 13:53:53.486540835 +0000
+++ 0039-net-mlx5-fix-connection-tracking-state-item-validati.patch	2025-10-31 13:53:52.117523621 +0000
@@ -1 +1 @@
-From 179e70fd7ad2027705b42e7416d436d299eca78c Mon Sep 17 00:00:00 2001
+From 296bde8b85b6a0f22b5420725e08df426431630b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 179e70fd7ad2027705b42e7416d436d299eca78c ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index e890e732c3..ed0c1fcfd2 100644
+index 8c3daed7d0..ce33a4e425 100644
@@ -28 +29 @@
-@@ -101,4 +101,9 @@ enum mlx5_indirect_type {
+@@ -100,4 +100,9 @@ enum mlx5_indirect_type {
@@ -39 +40 @@
-index 7b9e5018b8..f673637e7d 100644
+index 9fad6e8095..74391faf11 100644
@@ -53 +54 @@
-index 3da8d93454..bca396a9ab 100644
+index 0d0262a275..2beb854a8b 100644
@@ -56 +57 @@
-@@ -17011,4 +17011,5 @@ flow_hw_validate_rule_pattern(struct rte_eth_dev *dev,
+@@ -16684,4 +16684,5 @@ flow_hw_validate_rule_pattern(struct rte_eth_dev *dev,
@@ -62 +63 @@
-@@ -17031,4 +17032,13 @@ flow_hw_validate_rule_pattern(struct rte_eth_dev *dev,
+@@ -16704,4 +16705,13 @@ flow_hw_validate_rule_pattern(struct rte_eth_dev *dev,



More information about the stable mailing list