diff options
author | Luca Boccassi <luca.boccassi@gmail.com> | 2017-08-16 18:42:05 +0100 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2017-08-16 18:46:04 +0100 |
commit | f239aed5e674965691846e8ce3f187dd47523689 (patch) | |
tree | a153a3125c6e183c73871a8ecaa4b285fed5fbd5 /examples/quota_watermark/qw | |
parent | bf7567fd2a5b0b28ab724046143c24561d38d015 (diff) |
New upstream version 17.08
Change-Id: I288b50990f52646089d6b1f3aaa6ba2f091a51d7
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'examples/quota_watermark/qw')
-rw-r--r-- | examples/quota_watermark/qw/Makefile | 2 | ||||
-rw-r--r-- | examples/quota_watermark/qw/init.c | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/examples/quota_watermark/qw/Makefile b/examples/quota_watermark/qw/Makefile index fac9328d..627897ce 100644 --- a/examples/quota_watermark/qw/Makefile +++ b/examples/quota_watermark/qw/Makefile @@ -33,7 +33,7 @@ ifeq ($(RTE_SDK),) $(error "Please define RTE_SDK environment variable") endif -# Default target, can be overriden by command line or environment +# Default target, can be overridden by command line or environment RTE_TARGET ?= x86_64-native-linuxapp-gcc include $(RTE_SDK)/mk/rte.vars.mk diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c index b6264fcf..083a37a9 100644 --- a/examples/quota_watermark/qw/init.c +++ b/examples/quota_watermark/qw/init.c @@ -76,6 +76,8 @@ static struct rte_eth_fc_conf fc_conf = { void configure_eth_port(uint8_t port_id) { int ret; + uint16_t nb_rxd = RX_DESC_PER_QUEUE; + uint16_t nb_txd = TX_DESC_PER_QUEUE; rte_eth_dev_stop(port_id); @@ -84,8 +86,14 @@ void configure_eth_port(uint8_t port_id) rte_exit(EXIT_FAILURE, "Cannot configure port %u (error %d)\n", (unsigned int) port_id, ret); + ret = rte_eth_dev_adjust_nb_rx_tx_desc(port_id, &nb_rxd, &nb_txd); + if (ret < 0) + rte_exit(EXIT_FAILURE, + "Cannot adjust number of descriptors for port %u (error %d)\n", + (unsigned int) port_id, ret); + /* Initialize the port's RX queue */ - ret = rte_eth_rx_queue_setup(port_id, 0, RX_DESC_PER_QUEUE, + ret = rte_eth_rx_queue_setup(port_id, 0, nb_rxd, rte_eth_dev_socket_id(port_id), NULL, mbuf_pool); @@ -95,7 +103,7 @@ void configure_eth_port(uint8_t port_id) (unsigned int) port_id, ret); /* Initialize the port's TX queue */ - ret = rte_eth_tx_queue_setup(port_id, 0, TX_DESC_PER_QUEUE, + ret = rte_eth_tx_queue_setup(port_id, 0, nb_txd, rte_eth_dev_socket_id(port_id), NULL); if (ret < 0) |