From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Matz Subject: [PATCH 2/6] eal: move internal config initialization Date: Tue, 18 Apr 2017 16:22:21 +0200 Message-ID: <20170418142225.6308-2-olivier.matz@6wind.com> References: <20170418142225.6308-1-olivier.matz@6wind.com> Cc: ferruh.yigit@intel.com, jianfeng.tan@intel.com, thomas@monjalon.net To: dev@dpdk.org Return-path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 4E527567F for ; Tue, 18 Apr 2017 16:22:25 +0200 (CEST) In-Reply-To: <20170418142225.6308-1-olivier.matz@6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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 db154db9a..ed16c2e58 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 b2758799c..fbfbb94ba 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.11.0