public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
* [PATCH] app/testpmd: fix DCB queue allocation for VMDq devices
@ 2026-03-13 10:15 KAVYA AV
  2026-03-13 21:00 ` Stephen Hemminger
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: KAVYA AV @ 2026-03-13 10:15 UTC (permalink / raw)
  To: dev, bruce.richardson, aman.deep.singh, vladimir.medvedkin
  Cc: shaiq.wani, KAVYA AV, stable

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 device-specific queue count (nb_rx_queues/
nb_tx_queues) instead of limiting to num_tcs. This allows VMDq devices
to utilize their full queue capacity while maintaining compatibility
with non VMDq devices.

Fixes null pointer dereference when queue structures are accessed
beyond the allocated range.

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

Signed-off-by: KAVYA AV <kavyax.a.v@intel.com>
---
 app/test-pmd/testpmd.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index fbacee89ea..70be52d36f 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -4444,9 +4444,11 @@ init_port_dcb_config(portid_t pid,
 			if (rte_port->dev_info.vmdq_pool_base == 0) {
 				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 device queue count to prevent null pointer errors */
+			else {
+				nb_rxq = rte_port->dev_info.nb_rx_queues;
+				nb_txq = rte_port->dev_info.nb_tx_queues;
 			}
 		}
 	}
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-04-09  6:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-13 10:15 [PATCH] app/testpmd: fix DCB queue allocation for VMDq devices KAVYA AV
2026-03-13 21:00 ` Stephen Hemminger
2026-03-16  5:52 ` [PATCH v2] " KAVYA AV
2026-03-23 23:51   ` Stephen Hemminger
2026-03-24 10:05 ` [PATCH v3] " KAVYA AV
2026-03-24 15:46   ` Stephen Hemminger
2026-03-26 11:22     ` A V, KavyaX
2026-04-09  6:43 ` [PATCH v4] " KAVYA AV

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox