patch 'net/mlx5: fix storage of shared Rx queues' has been queued to stable release 24.11.4
    Kevin Traynor 
    ktraynor at redhat.com
       
    Fri Oct 31 15:32:35 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/01461927dfb1d9f392b22daefa8f020743d1815d
Thanks.
Kevin
---
>From 01461927dfb1d9f392b22daefa8f020743d1815d Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson at nvidia.com>
Date: Thu, 31 Jul 2025 13:41:38 +0300
Subject: [PATCH] net/mlx5: fix storage of shared Rx queues
[ upstream commit a0a7903376f2252b06ae272b2c3b69e9b939de04 ]
The MLX5 PMD maintains 2 lists for Rx queues:
- mlx5_priv::rxqsctrl - for non-shared and shared Rx queues
- mlx5_dev_ctx_shared::shared_rxqs - for shared Rx queues only
The PMD used the `rxqsctrl` as the primary list for Rx queues
maintenance.
The PMD wipes out port mlx5_priv object after an application closed
the port.
If PMD shared Rx queues between the transfer proxy port and
representor ports and closed the transfer proxy port before
representor, the representor port cannot iterate its shared Rx queues
because Rx queues list head was wiped out.
The patch separates Rx queue storage list according to the list type:
- shared Rx queues are stored in the `shared_rxqs` only
- non-shared Rx queues are stored in the `rxqsctrl` list only.
Fixes: 6886b5f39d66 ("net/mlx5: fix hairpin queue release")
Signed-off-by: Gregory Etelson <getelson at nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
 drivers/net/mlx5/linux/mlx5_os.c | 13 ++++++++++---
 drivers/net/mlx5/mlx5_flow.c     |  6 ++++++
 drivers/net/mlx5/mlx5_rxq.c      |  6 ++++--
 3 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 37819932d1..695911008d 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -748,11 +748,18 @@ mlx5_os_free_shared_dr(struct mlx5_priv *priv)
 {
 	struct mlx5_dev_ctx_shared *sh = priv->sh;
-#ifdef HAVE_MLX5DV_DR
-	int i;
-#endif
+	struct mlx5_rxq_ctrl *rxq_ctrl;
+	int i = 0;
 
 	MLX5_ASSERT(sh && sh->refcnt);
 	if (sh->refcnt > 1)
 		return;
+	LIST_FOREACH(rxq_ctrl, &sh->shared_rxqs, next) {
+		DRV_LOG(DEBUG, "port %u Rx Queue %u still referenced",
+			priv->dev_data->port_id, rxq_ctrl->rxq.idx);
+		++i;
+	}
+	if (i > 0)
+		DRV_LOG(WARNING, "port %u some Rx queues still remain %d",
+			priv->dev_data->port_id, i);
 	MLX5_ASSERT(LIST_EMPTY(&sh->shared_rxqs));
 #ifdef HAVE_MLX5DV_DR
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 5039a81b14..944d422f97 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1652,4 +1652,7 @@ flow_rxq_mark_flag_set(struct rte_eth_dev *dev)
 				rxq_ctrl->rxq.mark = 1;
 			}
+			LIST_FOREACH(rxq_ctrl, &opriv->sh->shared_rxqs, next) {
+				rxq_ctrl->rxq.mark = 1;
+			}
 			opriv->mark_enabled = 1;
 		}
@@ -1658,4 +1661,7 @@ flow_rxq_mark_flag_set(struct rte_eth_dev *dev)
 			rxq_ctrl->rxq.mark = 1;
 		}
+		LIST_FOREACH(rxq_ctrl, &priv->sh->shared_rxqs, next) {
+			rxq_ctrl->rxq.mark = 1;
+		}
 		priv->mark_enabled = 1;
 	}
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 508d27d318..82958565de 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1979,6 +1979,7 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
 		tmpl->share_qid = conf->share_qid;
 		LIST_INSERT_HEAD(&priv->sh->shared_rxqs, tmpl, share_entry);
+	} else {
+		LIST_INSERT_HEAD(&priv->rxqsctrl, tmpl, next);
 	}
-	LIST_INSERT_HEAD(&priv->rxqsctrl, tmpl, next);
 	rte_atomic_store_explicit(&tmpl->ctrl_ref, 1, rte_memory_order_relaxed);
 	return tmpl;
@@ -2311,5 +2312,6 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx)
 			if (rxq_ctrl->rxq.shared)
 				LIST_REMOVE(rxq_ctrl, share_entry);
-			LIST_REMOVE(rxq_ctrl, next);
+			else
+				LIST_REMOVE(rxq_ctrl, next);
 			mlx5_free(rxq_ctrl->rxq.rq_win_data);
 			mlx5_free(rxq_ctrl);
-- 
2.51.0
---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-10-31 13:53:53.281949523 +0000
+++ 0033-net-mlx5-fix-storage-of-shared-Rx-queues.patch	2025-10-31 13:53:52.078523499 +0000
@@ -1 +1 @@
-From a0a7903376f2252b06ae272b2c3b69e9b939de04 Mon Sep 17 00:00:00 2001
+From 01461927dfb1d9f392b22daefa8f020743d1815d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a0a7903376f2252b06ae272b2c3b69e9b939de04 ]
+
@@ -26 +27,0 @@
-Cc: stable at dpdk.org
@@ -37 +38 @@
-index 2bc8ca9284..85b3fabaf5 100644
+index 37819932d1..695911008d 100644
@@ -63 +64 @@
-index 7c6811b523..cc9ec73dfe 100644
+index 5039a81b14..944d422f97 100644
@@ -66 +67 @@
-@@ -1653,4 +1653,7 @@ flow_rxq_mark_flag_set(struct rte_eth_dev *dev)
+@@ -1652,4 +1652,7 @@ flow_rxq_mark_flag_set(struct rte_eth_dev *dev)
@@ -74 +75 @@
-@@ -1659,4 +1662,7 @@ flow_rxq_mark_flag_set(struct rte_eth_dev *dev)
+@@ -1658,4 +1661,7 @@ flow_rxq_mark_flag_set(struct rte_eth_dev *dev)
@@ -83 +84 @@
-index 77c5848c37..1425886a22 100644
+index 508d27d318..82958565de 100644
@@ -86 +87 @@
-@@ -2034,6 +2034,7 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
+@@ -1979,6 +1979,7 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
@@ -95 +96 @@
-@@ -2366,5 +2367,6 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx)
+@@ -2311,5 +2312,6 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx)
    
    
More information about the stable
mailing list