[PATCH v4] app/testpmd: fix DCB queue allocation for VMDq devices

KAVYA AV kavyax.a.v at intel.com
Thu Apr 9 08:43:46 CEST 2026


When using DCB mode with VT disabled and requesting more queues than
traffic classes (e.g., rxq=64 with 8 TCs), testpmd crashes with null
pointer errors because it artificially limits queue allocation to
num_tcs.

For VMDq devices, use actual VMDq queue layout (vmdq_queue_num) instead
of limiting to num_tcs. This allows VMDq devices to utilize their full
queue capacity while maintaining compatibility with non-VMDq devices.

Fixes: 2169699b15fc ("app/testpmd: add queue restriction in DCB command")
Cc: stable at dpdk.org

Signed-off-by: KAVYA AV <kavyax.a.v at intel.com>
---

v4:
* Replaced configured queue count with PF-based layout.
* Revised commit message.

v3:
* Replaced configured queue count with actual VMDQ queue layout.
* Changed comment accordingly.
* Revised commit message.

v2: Moved the comment inside the else block.
---
 app/test-pmd/testpmd.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index e2569d9e30..23a27322f8 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -4481,8 +4481,11 @@ init_port_dcb_config(portid_t pid,
 				nb_rxq = rte_port->dev_info.max_rx_queues;
 				nb_txq = rte_port->dev_info.max_tx_queues;
 			} else {
-				nb_rxq = (queueid_t)num_tcs;
-				nb_txq = (queueid_t)num_tcs;
+				/* Use PF queue count for DCB-only mode with VMDQ devices */
+				nb_rxq = rte_port->dev_info.max_rx_queues -
+					 rte_port->dev_info.vmdq_queue_num;
+				nb_txq = rte_port->dev_info.max_tx_queues -
+					 rte_port->dev_info.vmdq_queue_num;
 			}
 		}
 	}
-- 
2.43.0



More information about the stable mailing list