Skip to contentSkip to conversation

examples/vhost: increase MAX_QUEUE number

PATCH Applied Huawei Xie 2 participants 2 messages Dec 9, 2014 – Dec 11, 2014 1 message not in the archive

lore
Share & tools
lore

Huawei Xie

author
#0 lore raw

PATCH 1/1 examples/vhost: increase MAX_QUEUE number

increase MAX_QUEUES from 256 to 512
In vhost example, MAX_QUEUES macro should be the maximum possible queue number of the port. Theoretically we should only set up the queues that are used, i.e., first rx queue of each pool, or at most queues from 0 to MAX_QUEUES. Before we revise the implementation and are certain all NICs support this well, add a remind message to user.

---
 examples/vhost/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
examples/vhost/main.c +7 -1
index 0c76ece..d2c1852 100644
@@ -53,7 +53,7 @@
 
 #include "main.h"
 
-#define MAX_QUEUES 256
+#define MAX_QUEUES 512
 
 /* the maximum number of external ports supported */
 #define MAX_SUP_PORTS 1
@@ -380,6 +380,12 @@ port_init(uint8_t port)
 	/* The max pool number from dev_info will be used to validate the pool number specified in cmd line */
 	rte_eth_dev_info_get (port, &dev_info);
 
+	if (dev_info.max_rx_queues > MAX_QUEUES) {
+		rte_exit(EXIT_FAILURE,
+			"please define MAX_QUEUES no less than %u in %s\n",
+			dev_info.max_rx_queues, __FILE__);
+	}
+
 	rxconf = &dev_info.default_rxconf;
 	txconf = &dev_info.default_txconf;
 	rxconf->rx_drop_en = 1;
Signature · 1 line
1.8.1.4
#2 lore raw
In reply to a message not in the archive
Quoted 7 lines

increase MAX_QUEUES from 256 to 512
In vhost example, MAX_QUEUES macro should be the maximum possible queue number of the port. Theoretically we should only set up the queues that are used, i.e., first rx queue of each pool, or at most queues from 0 to MAX_QUEUES. Before we revise the implementation and are certain all NICs support this well, add a remind message to user.

Applied

Thanks

Signature · 1 line
Thomas