From 3e08081637ca082a8b58d5db2a11836dbe4e3e8c Mon Sep 17 00:00:00 2001 From: David Marchand Date: Fri, 9 Apr 2021 13:04:53 +0200 Subject: [PATCH] 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 --- lib/librte_eal/freebsd/eal.c | 4 ++++ lib/librte_eal/linux/eal.c | 4 ++++ lib/librte_eal/windows/eal.c | 4 ++++ 3 files changed, 12 insertions(+) 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) { -- 2.20.1