From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 79133A0A02 for ; Wed, 24 Mar 2021 11:32:59 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AC69C140D78; Wed, 24 Mar 2021 11:32:58 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id BF6814014F for ; Wed, 24 Mar 2021 11:32:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616581975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H3v8MTBVqDpMT9avhUtSZ9K8r9pf+Aafbyqx8YpqNR0=; b=NOdCdyaC66Amv0361YrBrOu0/Mn13aLkSidTaGE1VHytzLNTcDMkix4MjLum+xCF9JXfpk Da3MSj2G4bZdcSGYgk+lEVEiHjvg56MqTPGDRG6pzkf6BSoi1BIzpwA3YQe5JDwznNS2m8 o4P5OcnxfR32+gdsP5lDUzOFW+hJs8g= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-420-5IfbOmnaMV6r3qn-MHltCA-1; Wed, 24 Mar 2021 06:32:52 -0400 X-MC-Unique: 5IfbOmnaMV6r3qn-MHltCA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 30DFF180FCA0; Wed, 24 Mar 2021 10:32:51 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.193.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D931709ED; Wed, 24 Mar 2021 10:32:47 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: arybchenko@solarflare.com, l.wojciechow@partner.samsung.com, stable@dpdk.org, Thomas Monjalon , Bruce Richardson , Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam , Keith Wiles , Ranjit Menon Date: Wed, 24 Mar 2021 11:32:13 +0100 Message-Id: <20210324103213.29922-4-david.marchand@redhat.com> In-Reply-To: <20210324103213.29922-1-david.marchand@redhat.com> References: <20200626114751.22523-1-david.marchand@redhat.com> <20210324103213.29922-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-stable] [PATCH v2 3/3] eal: fix evaluation of log level option X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" --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 logtype.level EAL: lib.eal logtype level changed from info to debug EAL: lib.ethdev logtype level changed from info to debug EAL: lib.ethdev logtype level changed from debug to info EAL: lib.ethdev logtype level changed from info to debug EAL: lib.ethdev logtype level changed from debug to info 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 logtype.level EAL: lib.eal logtype level changed from info to debug EAL: lib.ethdev logtype level changed from info to debug EAL: lib.ethdev logtype level changed from debug to info 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 62320d610f..817961d8d6 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 9ffb4b3314..8070e0f632 100644 --- a/lib/librte_eal/linux/eal.c +++ b/lib/librte_eal/linux/eal.c @@ -704,6 +704,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 2fc3d6141c..e3b6a6ea61 100644 --- a/lib/librte_eal/windows/eal.c +++ b/lib/librte_eal/windows/eal.c @@ -149,6 +149,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.23.0