From 8b25d1ad5d2264bdfc2818c7bda74ee2697df6db Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Wed, 6 Jul 2016 09:22:35 +0200 Subject: Imported Upstream version 16.07-rc1 Change-Id: I40a523e52f12e8496fdd69e902824b0226c303de Signed-off-by: Christian Ehrhardt --- examples/qos_sched/args.c | 14 ++++++++------ examples/qos_sched/main.c | 2 -- examples/qos_sched/main.h | 5 ++++- 3 files changed, 12 insertions(+), 9 deletions(-) (limited to 'examples/qos_sched') diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c index 3e7fd087..476a0ee1 100644 --- a/examples/qos_sched/args.c +++ b/examples/qos_sched/args.c @@ -123,7 +123,7 @@ app_eal_core_mask(void) uint64_t cm = 0; struct rte_config *cfg = rte_eal_get_configuration(); - for (i = 0; i < RTE_MAX_LCORE; i++) { + for (i = 0; i < APP_MAX_LCORE; i++) { if (cfg->lcore_role[i] == ROLE_RTE) cm |= (1ULL << i); } @@ -142,7 +142,7 @@ app_cpu_core_count(void) char path[PATH_MAX]; uint32_t ncores = 0; - for(i = 0; i < RTE_MAX_LCORE; i++) { + for (i = 0; i < APP_MAX_LCORE; i++) { len = snprintf(path, sizeof(path), SYS_CPU_DIR, i); if (len <= 0 || (unsigned)len >= sizeof(path)) continue; @@ -162,7 +162,7 @@ static int app_parse_opt_vals(const char *conf_str, char separator, uint32_t n_vals, uint32_t *opt_vals) { char *string; - uint32_t i, n_tokens; + int i, n_tokens; char *tokens[MAX_OPT_VALUES]; if (conf_str == NULL || opt_vals == NULL || n_vals == 0 || n_vals > MAX_OPT_VALUES) @@ -175,9 +175,11 @@ app_parse_opt_vals(const char *conf_str, char separator, uint32_t n_vals, uint32 n_tokens = rte_strsplit(string, strnlen(string, 32), tokens, n_vals, separator); - for(i = 0; i < n_tokens; i++) { + if (n_tokens > MAX_OPT_VALUES) + return -1; + + for (i = 0; i < n_tokens; i++) opt_vals[i] = (uint32_t)atol(tokens[i]); - } free(string); @@ -270,7 +272,7 @@ app_parse_flow_conf(const char *conf_str) } if (pconf->tx_port >= RTE_MAX_ETHPORTS) { RTE_LOG(ERR, APP, "pfc %u: invalid tx port %"PRIu8" index\n", - nb_pfc, pconf->rx_port); + nb_pfc, pconf->tx_port); return -1; } diff --git a/examples/qos_sched/main.c b/examples/qos_sched/main.c index e16b164d..e10cfd44 100644 --- a/examples/qos_sched/main.c +++ b/examples/qos_sched/main.c @@ -201,8 +201,6 @@ app_stat(void) stats.oerrors - tx_stats[i].oerrors); memcpy(&tx_stats[i], &stats, sizeof(stats)); - //printf("MP = %d\n", rte_mempool_count(conf->app_pktmbuf_pool)); - #if APP_COLLECT_STAT printf("-------+------------+------------+\n"); printf(" | received | dropped |\n"); diff --git a/examples/qos_sched/main.h b/examples/qos_sched/main.h index 82aa0fae..c7490c61 100644 --- a/examples/qos_sched/main.h +++ b/examples/qos_sched/main.h @@ -68,7 +68,10 @@ extern "C" { #define BURST_TX_DRAIN_US 100 -#define MAX_DATA_STREAMS (RTE_MAX_LCORE/2) +#ifndef APP_MAX_LCORE +#define APP_MAX_LCORE 64 +#endif +#define MAX_DATA_STREAMS (APP_MAX_LCORE/2) #define MAX_SCHED_SUBPORTS 8 #define MAX_SCHED_PIPES 4096 -- cgit 1.2.3-korg