* [PATCH] net/mlx5: fix HWS meter ASO SQ leak on multi-port init
@ 2026-10-18 8:55 Maayan Kashani
2026-10-19 8:11 ` Dariusz Sosnowski
0 siblings, 1 reply; 2+ messages in thread
From: Maayan Kashani @ 2026-10-18 8:55 UTC (permalink / raw)
To: dev
Cc: mkashani, rasland, stable, Dariusz Sosnowski,
Viacheslav Ovsiienko, Bing Zhao, Ori Kam, Suanming Mou,
Matan Azrad, Alexander Kozyrev
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")
Cc: stable@dpdk.org
Signed-off-by: Maayan Kashani <mkashani@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 cd84ab1966d..caaa319d10e 100644
--- a/drivers/net/mlx5/mlx5_flow_aso.c
+++ b/drivers/net/mlx5/mlx5_flow_aso.c
@@ -316,7 +316,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 e7afcf5399b..6d30f318521 100644
--- a/drivers/net/mlx5/mlx5_flow_meter.c
+++ b/drivers/net/mlx5/mlx5_flow_meter.c
@@ -60,7 +60,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.21.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* RE: [PATCH] net/mlx5: fix HWS meter ASO SQ leak on multi-port init
2026-10-18 8:55 [PATCH] net/mlx5: fix HWS meter ASO SQ leak on multi-port init Maayan Kashani
@ 2026-10-19 8:11 ` Dariusz Sosnowski
0 siblings, 0 replies; 2+ messages in thread
From: Dariusz Sosnowski @ 2026-10-19 8:11 UTC (permalink / raw)
To: Maayan Kashani, dev@dpdk.org
Cc: Raslan Darawsheh, stable@dpdk.org, Slava Ovsiienko, Bing Zhao,
Ori Kam, Suanming Mou, Matan Azrad, Alexander Kozyrev
> -----Original Message-----
> From: Maayan Kashani <mkashani@nvidia.com>
> Sent: Sunday, October 18, 2026 10:55 AM
> To: dev@dpdk.org
> Cc: Maayan Kashani <mkashani@nvidia.com>; Raslan Darawsheh
> <rasland@nvidia.com>; stable@dpdk.org; Dariusz Sosnowski
> <dsosnowski@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>; Bing
> Zhao <bingz@nvidia.com>; Ori Kam <orika@nvidia.com>; Suanming Mou
> <suanmingm@nvidia.com>; Matan Azrad <matan@nvidia.com>; Alexander
> Kozyrev <akozyrev@nvidia.com>
> Subject: [PATCH] net/mlx5: fix HWS meter ASO SQ leak on multi-port init
>
> 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")
> Cc: stable@dpdk.org
>
> Signed-off-by: Maayan Kashani <mkashani@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Best regards,
Dariusz Sosnowski
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-19 8:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-18 8:55 [PATCH] net/mlx5: fix HWS meter ASO SQ leak on multi-port init Maayan Kashani
2026-10-19 8:11 ` Dariusz Sosnowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox