patch 'net/mlx5: fix HWS meter ASO SQ leak on multi-port init' has been queued to stable release 24.11.9

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Nov 5 17:41:49 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.11.9

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/07/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/98313da4358421cdec46d60c9af2ea1157cd517f

Thanks.

Luca Boccassi

---
>From 98313da4358421cdec46d60c9af2ea1157cd517f Mon Sep 17 00:00:00 2001
From: Maayan Kashani <mkashani at nvidia.com>
Date: Sun, 18 Oct 2026 11:55:09 +0300
Subject: [PATCH] net/mlx5: fix HWS meter ASO SQ leak on multi-port init

[ upstream commit d94b526e08a37bc4890dc8de2aaad6698620ce3e ]

When multiple ports on the same device initialize HWS meters via
rte_flow_configure(), mlx5_aso_mtr_queue_init() recreates the shared
pools_mng ASO send queue without destroying the previous one. Each
additional port with meters configured leaks one SQ/CQ pair until the
shared device context is torn down.

This is observed as steady growth of hugepage allocations (dump
socket_mem count alloc) when repeatedly attaching and detaching a device
with multiple SF representors configured with meters in HWS mode.

Create pools_mng.sq only when its DevX object is missing. A send-queue
id of zero is valid, so sqn cannot be used as the existence check.

Do not destroy that queue from mlx5_flow_meter_uninit(). It is shared
by every port on the device, and releasing it when one port closes
breaks meters still configured on the others. The queue is released
with the shared context in mlx5_aso_flow_mtrs_mng_close().

Fixes: 24865366e495 ("net/mlx5: support flow meter action for HWS")

Signed-off-by: Maayan Kashani <mkashani at nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_aso.c   | 7 ++++++-
 drivers/net/mlx5/mlx5_flow_meter.c | 6 +++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_aso.c b/drivers/net/mlx5/mlx5_flow_aso.c
index 5e2a81ef9c5..8f95a8f5e6d 100644
--- a/drivers/net/mlx5/mlx5_flow_aso.c
+++ b/drivers/net/mlx5/mlx5_flow_aso.c
@@ -318,7 +318,12 @@ mlx5_aso_mtr_queue_init(struct mlx5_dev_ctx_shared *sh,
 		}
 		hws_pool->nb_sq = nb_queues;
 	}
-	if (pool_mng) {
+	/*
+	 * pools_mng->sq is shared by every port on the device.
+	 * A send-queue id of zero is valid, so the DevX object pointer
+	 * is the indicator that the queue was already created.
+	 */
+	if (pool_mng != NULL && pool_mng->sq.sq_obj.sq == NULL) {
 		if (mlx5_aso_sq_create(cdev, &pool_mng->sq,
 				       sh->tx_uar.obj,
 				       MLX5_ASO_QUEUE_LOG_DESC))
diff --git a/drivers/net/mlx5/mlx5_flow_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c
index 4426470c8a3..c9e416c20d8 100644
--- a/drivers/net/mlx5/mlx5_flow_meter.c
+++ b/drivers/net/mlx5/mlx5_flow_meter.c
@@ -61,7 +61,11 @@ mlx5_flow_meter_uninit(struct rte_eth_dev *dev)
 		mlx5_free(priv->mtr_bulk.aso);
 		priv->mtr_bulk.aso = NULL;
 		priv->mtr_bulk.size = 0;
-		mlx5_aso_queue_uninit(priv->sh, ASO_OPC_MOD_POLICER);
+		/*
+		 * pools_mng->sq is shared by every port on this device.
+		 * Destroying it here would break meters still in use on
+		 * another port. It is released with the shared context.
+		 */
 	}
 	if (priv->mtr_bulk.action) {
 		mlx5dr_action_destroy(priv->mtr_bulk.action);
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-11-05 16:42:45.880587556 +0000
+++ 0022-net-mlx5-fix-HWS-meter-ASO-SQ-leak-on-multi-port-ini.patch	2026-11-05 16:42:44.917060667 +0000
@@ -1 +1 @@
-From d94b526e08a37bc4890dc8de2aaad6698620ce3e Mon Sep 17 00:00:00 2001
+From 98313da4358421cdec46d60c9af2ea1157cd517f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d94b526e08a37bc4890dc8de2aaad6698620ce3e ]
+
@@ -25 +26,0 @@
-Cc: stable at dpdk.org
@@ -35 +36 @@
-index cd84ab1966d..caaa319d10e 100644
+index 5e2a81ef9c5..8f95a8f5e6d 100644
@@ -38 +39 @@
-@@ -316,7 +316,12 @@ mlx5_aso_mtr_queue_init(struct mlx5_dev_ctx_shared *sh,
+@@ -318,7 +318,12 @@ mlx5_aso_mtr_queue_init(struct mlx5_dev_ctx_shared *sh,
@@ -53 +54 @@
-index e7afcf5399b..6d30f318521 100644
+index 4426470c8a3..c9e416c20d8 100644
@@ -56 +57 @@
-@@ -60,7 +60,11 @@ mlx5_flow_meter_uninit(struct rte_eth_dev *dev)
+@@ -61,7 +61,11 @@ mlx5_flow_meter_uninit(struct rte_eth_dev *dev)


More information about the stable mailing list