patch 'net/dpaa2: clear active VDQ state when freeing Rx queues' has been queued to stable release 24.11.4

Kevin Traynor ktraynor at redhat.com
Fri Nov 21 12:20:51 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/26/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/81aeed2d39aac27302eebe15e80a3d1d9be30e24

Thanks.

Kevin

---
>From 81aeed2d39aac27302eebe15e80a3d1d9be30e24 Mon Sep 17 00:00:00 2001
From: Maxime Leroy <maxime at leroys.fr>
Date: Fri, 14 Nov 2025 11:54:52 +0530
Subject: [PATCH] net/dpaa2: clear active VDQ state when freeing Rx queues

[ upstream commit 360a8d674c36e628523bdd83bedd27ce34b3091b ]

When using the prefetch Rx path (dpaa2_dev_prefetch_rx), the driver keeps
track of one outstanding VDQCR command per DPIO portal in the global
rte_global_active_dqs_list[] array. Each queue_storage_info_t also stores
the active result buffer and portal index:

  qs->active_dqs
  qs->active_dpio_id

Before issuing a new pull command, dpaa2_dev_prefetch_rx() checks for an
active entry and spins on qbman_check_command_complete() until the
corresponding VDQCR completes.

On port close / hotplug remove, dpaa2_free_rx_tx_queues() frees all
per-lcore queue_storage_info_t structures and their dq_storage[] buffers,
but never clears the global rte_global_active_dqs_list[] entries. After a
detach/attach sequence (or "del/add" in grout), the prefetch Rx path
still sees an active entry for the portal and spins forever on a stale dq
buffer that has been freed and will never be completed by hardware. In
gdb, dq->dq.tok stays 0 and dpaa2_dev_prefetch_rx() loops in:

  while (!qbman_check_command_complete(get_swp_active_dqs(idx)))
      ;

Fix this by clearing the active VDQ state before freeing queue storage.
For each Rx queue and lcore, if qs->active_dqs is non-NULL, call
clear_swp_active_dqs(qs->active_dpio_id) and set qs->active_dqs to NULL.
Then dpaa2_queue_storage_free() can safely free q_storage and
dq_storage[].

After this change, a DPNI detach/attach sequence no longer leaves stale
entries in rte_global_active_dqs_list[], and the prefetch Rx loop does
not hang waiting for a completion from a previous device instance.

Reproduction:
  - grout:
      grcli interface add  port dpni.1 devargs fslmc:dpni.1
      grcli interface del  dpni.1
      grcli interface add  port dpni.1 devargs fslmc:dpni.1
    -> Rx was stuck in qbman_check_command_complete(), now works.

  - testpmd:
      dpdk-testpmd -n1 -a fslmc:dpni.65535 -- -i --forward-mode=rxonly
      testpmd> port attach fslmc:dpni.1
      testpmd> port start all
      testpmd> start
      testpmd> stop
      testpmd> port stop all
      testpmd> port detach 0
      testpmd> port attach fslmc:dpni.1
      testpmd> port start all
      testpmd> start
    -> Rx was hanging, now runs normal

Fixes: 12d98eceb8ac ("bus/fslmc: enhance QBMAN DQ storage logic")

Signed-off-by: Maxime Leroy <maxime at leroys.fr>
Acked-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
 .mailmap                         |  2 +-
 drivers/net/dpaa2/dpaa2_ethdev.c | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index 8af58f1614..06fd64f764 100644
--- a/.mailmap
+++ b/.mailmap
@@ -998,5 +998,5 @@ Mauro Annarumma <mauroannarumma at hotmail.it>
 Maxime Coquelin <maxime.coquelin at redhat.com>
 Maxime Gouin <maxime.gouin at 6wind.com>
-Maxime Leroy <maxime.leroy at 6wind.com>
+Maxime Leroy <maxime at leroys.fr> <maxime.leroy at 6wind.com>
 Md Fahad Iqbal Polash <md.fahad.iqbal.polash at intel.com>
 Megha Ajmera <megha.ajmera at intel.com>
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index c9dc0fbdf0..83ff6e0a04 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -482,4 +482,25 @@ fail:
 }
 
+static void
+dpaa2_clear_queue_active_dps(struct dpaa2_queue *q, int num_lcores)
+{
+	int i;
+
+	for (i = 0; i < num_lcores; i++) {
+		struct queue_storage_info_t *qs = q->q_storage[i];
+
+		if (!qs)
+			continue;
+
+		if (qs->active_dqs) {
+			while (!qbman_check_command_complete(qs->active_dqs))
+				continue; /* wait */
+
+			clear_swp_active_dqs(qs->active_dpio_id);
+			qs->active_dqs = NULL;
+		}
+	}
+}
+
 static void
 dpaa2_free_rx_tx_queues(struct rte_eth_dev *dev)
@@ -496,4 +517,6 @@ dpaa2_free_rx_tx_queues(struct rte_eth_dev *dev)
 		for (i = 0; i < priv->nb_rx_queues; i++) {
 			dpaa2_q = priv->rx_vq[i];
+			dpaa2_clear_queue_active_dps(dpaa2_q,
+						RTE_MAX_LCORE);
 			dpaa2_queue_storage_free(dpaa2_q,
 				RTE_MAX_LCORE);
-- 
2.51.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-11-21 11:05:11.675357497 +0000
+++ 0067-net-dpaa2-clear-active-VDQ-state-when-freeing-Rx-que.patch	2025-11-21 11:05:09.545201519 +0000
@@ -1 +1 @@
-From 360a8d674c36e628523bdd83bedd27ce34b3091b Mon Sep 17 00:00:00 2001
+From 81aeed2d39aac27302eebe15e80a3d1d9be30e24 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 360a8d674c36e628523bdd83bedd27ce34b3091b ]
+
@@ -60 +61,0 @@
-Cc: stable at dpdk.org
@@ -70 +71 @@
-index 50a59a596a..2678c4a9de 100644
+index 8af58f1614..06fd64f764 100644
@@ -73 +74 @@
-@@ -1038,5 +1038,5 @@ Mauro Annarumma <mauroannarumma at hotmail.it>
+@@ -998,5 +998,5 @@ Mauro Annarumma <mauroannarumma at hotmail.it>
@@ -81 +82 @@
-index fcda267e0b..f2b24fc953 100644
+index c9dc0fbdf0..83ff6e0a04 100644
@@ -84 +85 @@
-@@ -632,4 +632,25 @@ fail:
+@@ -482,4 +482,25 @@ fail:
@@ -110 +111 @@
-@@ -646,4 +667,6 @@ dpaa2_free_rx_tx_queues(struct rte_eth_dev *dev)
+@@ -496,4 +517,6 @@ dpaa2_free_rx_tx_queues(struct rte_eth_dev *dev)



More information about the stable mailing list