summaryrefslogtreecommitdiff
path: root/examples/vmdq
diff options
context:
space:
mode:
authorRoman Zhukov <roman.zhukov@oktetlabs.ru>2017-05-25 16:57:54 +0100
committerThomas Monjalon <thomas@monjalon.net>2017-07-08 18:47:00 +0200
commit60efb44f73c9a5f3f19cc78ba2d6eaf398ab51dc (patch)
treeb1275fa51805e3666be7c86376722f6bfd7fb877 /examples/vmdq
parent0f67fc3baeb99e087ac32c6b9116d5fe44e50de6 (diff)
downloaddpdk-60efb44f73c9a5f3f19cc78ba2d6eaf398ab51dc.zip
dpdk-60efb44f73c9a5f3f19cc78ba2d6eaf398ab51dc.tar.gz
dpdk-60efb44f73c9a5f3f19cc78ba2d6eaf398ab51dc.tar.xz
examples: adjust Rx and Tx descriptors to device limits
Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Diffstat (limited to 'examples/vmdq')
-rw-r--r--examples/vmdq/main.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index f639355..d096831 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -195,7 +195,8 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
struct rte_eth_rxconf *rxconf;
struct rte_eth_conf port_conf;
uint16_t rxRings, txRings;
- const uint16_t rxRingSize = RTE_TEST_RX_DESC_DEFAULT, txRingSize = RTE_TEST_TX_DESC_DEFAULT;
+ uint16_t rxRingSize = RTE_TEST_RX_DESC_DEFAULT;
+ uint16_t txRingSize = RTE_TEST_TX_DESC_DEFAULT;
int retval;
uint16_t q;
uint16_t queues_per_pool;
@@ -253,6 +254,17 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
if (retval != 0)
return retval;
+ retval = rte_eth_dev_adjust_nb_rx_tx_desc(port, &rxRingSize,
+ &txRingSize);
+ if (retval != 0)
+ return retval;
+ if (RTE_MAX(rxRingSize, txRingSize) > RTE_MAX(RTE_TEST_RX_DESC_DEFAULT,
+ RTE_TEST_TX_DESC_DEFAULT)) {
+ printf("Mbuf pool has an insufficient size for port %u.\n",
+ port);
+ return -1;
+ }
+
rte_eth_dev_info_get(port, &dev_info);
rxconf = &dev_info.default_rxconf;
rxconf->rx_drop_en = 1;