diff options
Diffstat (limited to 'examples/quota_watermark')
-rw-r--r-- | examples/quota_watermark/Makefile | 2 | ||||
-rw-r--r-- | examples/quota_watermark/qw/Makefile | 2 | ||||
-rw-r--r-- | examples/quota_watermark/qw/init.c | 12 | ||||
-rw-r--r-- | examples/quota_watermark/qwctl/Makefile | 2 |
4 files changed, 13 insertions, 5 deletions
diff --git a/examples/quota_watermark/Makefile b/examples/quota_watermark/Makefile index 17fe473b..40a01fa4 100644 --- a/examples/quota_watermark/Makefile +++ b/examples/quota_watermark/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/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) diff --git a/examples/quota_watermark/qwctl/Makefile b/examples/quota_watermark/qwctl/Makefile index 1ca2f1e9..e0f0083d 100644 --- a/examples/quota_watermark/qwctl/Makefile +++ b/examples/quota_watermark/qwctl/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 |