summaryrefslogtreecommitdiff
path: root/examples/ethtool
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/ethtool
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/ethtool')
-rw-r--r--examples/ethtool/ethtool-app/main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/ethtool/ethtool-app/main.c b/examples/ethtool/ethtool-app/main.c
index f79b962..bbab2f6 100644
--- a/examples/ethtool/ethtool-app/main.c
+++ b/examples/ethtool/ethtool-app/main.c
@@ -122,6 +122,8 @@ static void setup_ports(struct app_config *app_cfg, int cnt_ports)
struct rte_eth_conf cfg_port;
struct rte_eth_dev_info dev_info;
char str_name[16];
+ uint16_t nb_rxd = PORT_RX_QUEUE_SIZE;
+ uint16_t nb_txd = PORT_TX_QUEUE_SIZE;
memset(&cfg_port, 0, sizeof(cfg_port));
cfg_port.txmode.mq_mode = ETH_MQ_TX_NONE;
@@ -154,15 +156,19 @@ static void setup_ports(struct app_config *app_cfg, int cnt_ports)
if (rte_eth_dev_configure(idx_port, 1, 1, &cfg_port) < 0)
rte_exit(EXIT_FAILURE,
"rte_eth_dev_configure failed");
+ if (rte_eth_dev_adjust_nb_rx_tx_desc(idx_port, &nb_rxd,
+ &nb_txd) < 0)
+ rte_exit(EXIT_FAILURE,
+ "rte_eth_dev_adjust_nb_rx_tx_desc failed");
if (rte_eth_rx_queue_setup(
- idx_port, 0, PORT_RX_QUEUE_SIZE,
+ idx_port, 0, nb_rxd,
rte_eth_dev_socket_id(idx_port), NULL,
ptr_port->pkt_pool) < 0)
rte_exit(EXIT_FAILURE,
"rte_eth_rx_queue_setup failed"
);
if (rte_eth_tx_queue_setup(
- idx_port, 0, PORT_TX_QUEUE_SIZE,
+ idx_port, 0, nb_txd,
rte_eth_dev_socket_id(idx_port), NULL) < 0)
rte_exit(EXIT_FAILURE,
"rte_eth_tx_queue_setup failed"