public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
* [PATCH] test/event_eth_rx_intr_adapter: support NICs with fewer int vectors
@ 2026-03-26 13:21 Bruce Richardson
  0 siblings, 0 replies; only message in thread
From: Bruce Richardson @ 2026-03-26 13:21 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Some NICs may not be able to support interrupts on all queues that are
advertised, which will cause the test to fail if the queues supporting
interrupts are fewer than 64. We can work around this by retrying the
NIC configuration multiple times with fewer queues in case of failure.
This allows the test to pass with NICs using ixgbe driver, for example.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/test_event_eth_rx_adapter.c | 52 +++++++++++++++++-----------
 1 file changed, 32 insertions(+), 20 deletions(-)

diff --git a/app/test/test_event_eth_rx_adapter.c b/app/test/test_event_eth_rx_adapter.c
index ae428b3333..7b38935bec 100644
--- a/app/test/test_event_eth_rx_adapter.c
+++ b/app/test/test_event_eth_rx_adapter.c
@@ -60,6 +60,7 @@ port_init_common(uint16_t port, const struct rte_eth_conf *port_conf,
 {
 	const uint16_t rx_ring_size = 512, tx_ring_size = 512;
 	int retval;
+	bool started = false;
 	uint16_t q;
 	struct rte_eth_dev_info dev_info;
 
@@ -76,32 +77,43 @@ port_init_common(uint16_t port, const struct rte_eth_conf *port_conf,
 					MAX_NUM_RX_QUEUE);
 	default_params.tx_rings = 1;
 
-	/* Configure the Ethernet device. */
-	retval = rte_eth_dev_configure(port, default_params.rx_rings,
+	while (!started) {
+		/* Configure the Ethernet device. */
+		retval = rte_eth_dev_configure(port, default_params.rx_rings,
 				default_params.tx_rings, port_conf);
-	if (retval != 0)
-		return retval;
-
-	for (q = 0; q < default_params.rx_rings; q++) {
-		retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
-				rte_eth_dev_socket_id(port), NULL, mp);
-		if (retval < 0)
+		if (retval != 0)
 			return retval;
-	}
 
-	/* Allocate and set up 1 TX queue per Ethernet port. */
-	for (q = 0; q < default_params.tx_rings; q++) {
-		retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
-				rte_eth_dev_socket_id(port), NULL);
-		if (retval < 0)
+		for (q = 0; q < default_params.rx_rings; q++) {
+			retval = rte_eth_rx_queue_setup(port, q, rx_ring_size,
+					rte_eth_dev_socket_id(port), NULL, mp);
+			if (retval < 0)
+				return retval;
+		}
+
+		/* Allocate and set up 1 TX queue per Ethernet port. */
+		for (q = 0; q < default_params.tx_rings; q++) {
+			retval = rte_eth_tx_queue_setup(port, q, tx_ring_size,
+					rte_eth_dev_socket_id(port), NULL);
+			if (retval < 0)
+				return retval;
+		}
+
+		/* Start the Ethernet port. */
+		retval = rte_eth_dev_start(port);
+		if (retval < 0) {
+			/* Some NICs may not support interrupts on all reported queues.
+			 * Therefore try to reconfigure and start with fewer queues
+			 */
+			if (default_params.rx_rings > 2) {
+				default_params.rx_rings /= 2;
+				continue;
+			}
 			return retval;
+		}
+		started = true;
 	}
 
-	/* Start the Ethernet port. */
-	retval = rte_eth_dev_start(port);
-	if (retval < 0)
-		return retval;
-
 	/* Display the port MAC address. */
 	struct rte_ether_addr addr;
 	retval = rte_eth_macaddr_get(port, &addr);
-- 
2.51.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-03-26 13:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-26 13:21 [PATCH] test/event_eth_rx_intr_adapter: support NICs with fewer int vectors Bruce Richardson

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