eal: move internal config initialization
authorOlivier Matz <olivier.matz@6wind.com>
Tue, 18 Apr 2017 14:22:21 +0000 (16:22 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 19 Apr 2017 23:29:01 +0000 (01:29 +0200)
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 <olivier.matz@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
lib/librte_eal/bsdapp/eal/eal.c
lib/librte_eal/linuxapp/eal/eal.c

index db154db..ed16c2e 100644 (file)
@@ -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);
 
index b275879..fbfbb94 100644 (file)
@@ -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);