summaryrefslogtreecommitdiffstats
path: root/examples/qos_sched
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qos_sched')
-rw-r--r--examples/qos_sched/Makefile2
-rw-r--r--examples/qos_sched/args.c1
-rw-r--r--examples/qos_sched/init.c11
-rw-r--r--examples/qos_sched/main.h5
4 files changed, 18 insertions, 1 deletions
diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
index e41ac500..56829c21 100644
--- a/examples/qos_sched/Makefile
+++ b/examples/qos_sched/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/qos_sched/args.c b/examples/qos_sched/args.c
index 476a0ee1..2350d64f 100644
--- a/examples/qos_sched/args.c
+++ b/examples/qos_sched/args.c
@@ -245,6 +245,7 @@ app_parse_flow_conf(const char *conf_str)
struct flow_conf *pconf;
uint64_t mask;
+ memset(vals, 0, sizeof(vals));
ret = app_parse_opt_vals(conf_str, ',', 6, vals);
if (ret < 4 || ret > 5)
return ret;
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index fe0221c6..a82cbd7d 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -106,6 +106,8 @@ app_init_port(uint8_t portid, struct rte_mempool *mp)
struct rte_eth_link link;
struct rte_eth_rxconf rx_conf;
struct rte_eth_txconf tx_conf;
+ uint16_t rx_size;
+ uint16_t tx_size;
/* check if port already initialized (multistream configuration) */
if (app_inited_port_mask & (1u << portid))
@@ -132,6 +134,15 @@ app_init_port(uint8_t portid, struct rte_mempool *mp)
rte_exit(EXIT_FAILURE, "Cannot configure device: "
"err=%d, port=%"PRIu8"\n", ret, portid);
+ rx_size = ring_conf.rx_size;
+ tx_size = ring_conf.tx_size;
+ ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &rx_size, &tx_size);
+ if (ret < 0)
+ rte_exit(EXIT_FAILURE, "rte_eth_dev_adjust_nb_rx_tx_desc: "
+ "err=%d, port=%"PRIu8"\n", ret, portid);
+ ring_conf.rx_size = rx_size;
+ ring_conf.tx_size = tx_size;
+
/* init one RX queue */
fflush(stdout);
ret = rte_eth_rx_queue_setup(portid, 0, (uint16_t)ring_conf.rx_size,
diff --git a/examples/qos_sched/main.h b/examples/qos_sched/main.h
index c7490c61..8d02e1ad 100644
--- a/examples/qos_sched/main.h
+++ b/examples/qos_sched/main.h
@@ -69,8 +69,13 @@ extern "C" {
#define BURST_TX_DRAIN_US 100
#ifndef APP_MAX_LCORE
+#if (RTE_MAX_LCORE > 64)
#define APP_MAX_LCORE 64
+#else
+#define APP_MAX_LCORE RTE_MAX_LCORE
+#endif
#endif
+
#define MAX_DATA_STREAMS (APP_MAX_LCORE/2)
#define MAX_SCHED_SUBPORTS 8
#define MAX_SCHED_PIPES 4096