From 08853d3cbc79b69ca1a3fe69e2617f539b1a0093 Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Tue, 18 Apr 2017 16:22:21 +0200 Subject: [PATCH] eal: move internal config initialization It's better to initialize the internal config in rte_eal_init() instead of eal_log_level_parse(), since this structure is not only about logs. Signed-off-by: Olivier Matz Acked-by: Ferruh Yigit --- lib/librte_eal/bsdapp/eal/eal.c | 3 ++- lib/librte_eal/linuxapp/eal/eal.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index db154db9aa..ed16c2e589 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -323,7 +323,6 @@ eal_log_level_parse(int argc, char **argv) optind = 1; optreset = 1; - eal_reset_internal_config(&internal_config); rte_log_set_global_level(internal_config.log_level); while ((opt = getopt_long(argc, argvopt, eal_short_options, @@ -520,6 +519,8 @@ rte_eal_init(int argc, char **argv) thread_id = pthread_self(); + eal_reset_internal_config(&internal_config); + /* set log level as early as possible */ eal_log_level_parse(argc, argv); diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index b2758799c1..fbfbb94bab 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -492,7 +492,6 @@ eal_log_level_parse(int argc, char **argv) argvopt = argv; optind = 1; - eal_reset_internal_config(&internal_config); rte_log_set_global_level(internal_config.log_level); while ((opt = getopt_long(argc, argvopt, eal_short_options, @@ -777,6 +776,8 @@ rte_eal_init(int argc, char **argv) thread_id = pthread_self(); + eal_reset_internal_config(&internal_config); + /* set log level as early as possible */ eal_log_level_parse(argc, argv); -- 2.20.1