From: David Marchand Date: Fri, 9 Apr 2021 11:04:53 +0000 (+0200) Subject: eal: fix evaluation of log level option X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3e08081637ca082a8b58d5db2a11836dbe4e3e8c;p=dpdk.git eal: fix evaluation of log level option --log-level option is handled early, no need to reevaluate it later in EAL init. Before: $ echo quit | ./build/app/test/dpdk-test --no-huge -m 512 \ --log-level=lib.eal:debug \ --log-level=lib.ethdev:debug --log-level=lib.ethdev:info \ |& grep -i log.level EAL: lib.eal log level changed from info to debug EAL: lib.ethdev log level changed from info to debug EAL: lib.ethdev log level changed from debug to info EAL: lib.ethdev log level changed from info to debug EAL: lib.ethdev log level changed from debug to info EAL: lib.telemetry log level changed from disabled to warning After: $ echo quit | ./build/app/test/dpdk-test --no-huge -m 512 \ --log-level=lib.eal:debug \ --log-level=lib.ethdev:debug --log-level=lib.ethdev:info \ |& grep -i log.level EAL: lib.eal log level changed from info to debug EAL: lib.ethdev log level changed from info to debug EAL: lib.ethdev log level changed from debug to info EAL: lib.telemetry log level changed from disabled to warning Fixes: 6c7216eefd63 ("eal: fix log level of early messages") Fixes: 1c806ae5c3ac ("eal/windows: support command line options parsing") Cc: stable@dpdk.org Signed-off-by: David Marchand Acked-by: Thomas Monjalon Acked-by: Lukasz Wojciechowski Tested-by: Lukasz Wojciechowski --- diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c index 5544701f20..f4d1676754 100644 --- a/lib/librte_eal/freebsd/eal.c +++ b/lib/librte_eal/freebsd/eal.c @@ -521,6 +521,10 @@ eal_parse_args(int argc, char **argv) goto out; } + /* eal_log_level_parse() already handled this option */ + if (opt == OPT_LOG_LEVEL_NUM) + continue; + ret = eal_parse_common_option(opt, optarg, internal_conf); /* common parser is not happy */ if (ret < 0) { diff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c index baeead3301..ba19fc6347 100644 --- a/lib/librte_eal/linux/eal.c +++ b/lib/librte_eal/linux/eal.c @@ -705,6 +705,10 @@ eal_parse_args(int argc, char **argv) goto out; } + /* eal_log_level_parse() already handled this option */ + if (opt == OPT_LOG_LEVEL_NUM) + continue; + ret = eal_parse_common_option(opt, optarg, internal_conf); /* common parser is not happy */ if (ret < 0) { diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c index 68a1fd1d21..41be20d89f 100644 --- a/lib/librte_eal/windows/eal.c +++ b/lib/librte_eal/windows/eal.c @@ -150,6 +150,10 @@ eal_parse_args(int argc, char **argv) return -1; } + /* eal_log_level_parse() already handled this option */ + if (opt == OPT_LOG_LEVEL_NUM) + continue; + ret = eal_parse_common_option(opt, optarg, internal_conf); /* common parser is not happy */ if (ret < 0) {