From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH] test/event_eth_rx_intr_adapter: support NICs with fewer int vectors
Date: Thu, 26 Mar 2026 13:21:43 +0000 [thread overview]
Message-ID: <20260326132142.565979-2-bruce.richardson@intel.com> (raw)
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
reply other threads:[~2026-03-26 13:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260326132142.565979-2-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox