From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <olivier.matz@6wind.com>
Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com
 [209.85.215.42]) by dpdk.org (Postfix) with ESMTP id 97C4D2B84
 for <dev@dpdk.org>; Thu,  6 Apr 2017 17:16:12 +0200 (CEST)
Received: by mail-lf0-f42.google.com with SMTP id j90so28330909lfk.2
 for <dev@dpdk.org>; Thu, 06 Apr 2017 08:16:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=6wind-com.20150623.gappssmtp.com; s=20150623;
 h=date:from:to:cc:subject:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=i0bwXepK7AGh0ZXtc2XMuiZa3exhQyGctk114mL6q6I=;
 b=GuLfTWknOXW7EXDethH604k1X/8t68DY2JEJRbt8pkl2T+GiTo04uJrj1IPGRhEjox
 bAcNid8dUIzbI3VJ1fmlMyD527TRo2s0KKn2lJE+SUPLgSfQhv8j5EkSdeDxNPn1+6Pr
 n34zWEDtOQLjMb0kgb8ctt0N6njbN/M5o+z7Ye1yr3JRNT29gRpo9Cfj90MSh4jMHXpZ
 hMLKza+d/D1GKDqydWE7xGoBHkUScU76IBSPuSvi82nrFRC8wJJEo3mqjROMuw1VoOCR
 KUed1NdNGtUcat5SHuk6X19r05Xfy9c3mSeI09d7ozI+EVEIY3JRS3jkpN6o20kPHWe1
 hykA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=i0bwXepK7AGh0ZXtc2XMuiZa3exhQyGctk114mL6q6I=;
 b=R6NNp/aS+N7Vz/lcFY+UkhytrhMbo96MbjtMg1M1hVX0NpB/+nOQEu+8NhmpzIwK0d
 LkOv08N86CM3z2Gw3h2SE5n8n6MD7Xt9NUzoZHvUUP8eJPX/klxrwYoJHBA/+TX/WGS3
 QiB9lnx7FftKBMYjQyI1ungXO9mljKHfFIKcuZPPpBNOXJgVAofLfjd/+GnMYHcaxnN/
 ZyvdUXS3Znj1za3By2igpgBga3z27EPlqcS0/PKHzZCyKOl0x8tH3BlqluIajBRPnJN6
 TCZ9giOoIR5Mq/gbNzROxuvzSUM+Ir61rBcrnn42jfErUcALhen6IesDPe8q4hbBFkqw
 r9rQ==
X-Gm-Message-State: AN3rC/5Ke9Hl40b+bXzExam9bvhru7wkvhUSyzRhHZDa4lf9QNN0GE8EB0wz7tq8Fa2Jnk6S
X-Received: by 10.28.72.67 with SMTP id v64mr5727830wma.98.1491491772171;
 Thu, 06 Apr 2017 08:16:12 -0700 (PDT)
Received: from glumotte.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com.
 [62.23.145.78])
 by smtp.gmail.com with ESMTPSA id n13sm16736181wmi.28.2017.04.06.08.16.11
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Thu, 06 Apr 2017 08:16:12 -0700 (PDT)
Date: Thu, 6 Apr 2017 17:16:30 +0200
From: Olivier MATZ <olivier.matz@6wind.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: "Zhang, Helin" <helin.zhang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>,
 "Wu, Jingjing" <jingjing.wu@intel.com>, "Yigit, Ferruh"
 <ferruh.yigit@intel.com>
Message-ID: <20170406171630.6114f6c2@glumotte.dev.6wind.com>
In-Reply-To: <20170406143642.GA9928@bricha3-MOBL3.ger.corp.intel.com>
References: <20170406141655.15097-1-olivier.matz@6wind.com>
 <F35DEAC7BCE34641BA9FAC6BCA4A12E71AA54762@SHSMSX103.ccr.corp.intel.com>
 <20170406143642.GA9928@bricha3-MOBL3.ger.corp.intel.com>
X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-dev] [PATCH] net/i40e: disable init and driver logs by
	default
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 06 Apr 2017 15:16:12 -0000

On Thu, 6 Apr 2017 15:36:43 +0100, Bruce Richardson <bruce.richardson@intel.com> wrote:
> On Thu, Apr 06, 2017 at 03:31:23PM +0100, Zhang, Helin wrote:
> > 
> > 
> > -----Original Message-----
> > From: Olivier Matz [mailto:olivier.matz@6wind.com] 
> > Sent: Thursday, April 6, 2017 10:17 PM
> > To: dev@dpdk.org
> > Cc: Zhang, Helin <helin.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> > Subject: [PATCH] net/i40e: disable init and driver logs by default
> > 
> > Since "net/i40e: use dynamic log type for control logs", the i40e driver is more verbose by default, which could result in testpmd being flooded by log messages in some conditions:
> > 
> >   Checking link statuses...
> >   i40e_dev_handle_aq_msg(): Request 2561 is not supported yet
> >   i40e_dev_handle_aq_msg(): Request 2561 is not supported yet
> >   i40e_dev_handle_aq_msg(): Request 2561 is not supported yet
> >   i40e_dev_handle_aq_msg(): Request 2561 is not supported yet
> >   Port 0 Link Up - speed 40000 Mbps - full-duplex
> >   Port 1 Link Up - speed 40000 Mbps - full-duplex
> >   Done  
> >   testpmd> i40e_dev_handle_aq_msg(): Request 4097 is not supported yet  
> >   i40e_dev_handle_aq_msg(): Request 4097 is not supported yet
> >   i40e_dev_handle_aq_msg(): Request 4097 is not supported yet
> > 
> > Fix this by disabling the dynamic logs by default. It is still possible to enable them at runtime.
> > 
> > Fixes: c143e5a3d9e1 ("net/i40e: use dynamic log type for control logs")
> > 
> > Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> > Acked-by: Helin Zhang <helin.zhang@intel.com>
> > ---
> >  drivers/net/i40e/i40e_ethdev.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index cb8bf2b49..86f5669f0 100644
> > --- a/drivers/net/i40e/i40e_ethdev.c
> > +++ b/drivers/net/i40e/i40e_ethdev.c
> > @@ -12456,8 +12456,8 @@ i40e_init_log(void)  {
> >  	i40e_logtype_init = rte_log_register("pmd.i40e.init");
> >  	if (i40e_logtype_init >= 0)
> > -		rte_log_set_level(i40e_logtype_init, RTE_LOG_NOTICE);
> > +		rte_log_set_level(i40e_logtype_init, RTE_LOG_EMERG);
> >  	i40e_logtype_driver = rte_log_register("pmd.i40e.driver");
> >  	if (i40e_logtype_driver >= 0)
> > -		rte_log_set_level(i40e_logtype_driver, RTE_LOG_NOTICE);
> > +		rte_log_set_level(i40e_logtype_driver, RTE_LOG_EMERG);
> >  }
> > --  
> 
> Hi Helin, 
> 
> Is this the correct fix? IMHO, if this is a problem, then we should
> surely not be hiding and ignoring the error. If it's not a problem, then
> the log level should be reduced to a lower level, e.g. INFO or NOTICE.
> 
> Alternatively, this code could be modified to only print an error once
> for each unsupported request type.
> 
> Ideally both solutions should be used, I think. I'm not sure I like
> setting the default log level to just show EMERG messages.

Yes, now that these logs are not stripped at compilation, we should
do an effort to have the proper default log value (notice, warning,
error?), and have the proper log level on each log, depending on its
criticality and maybe its frequency (maybe we'll want to rate limit
the logs in the future).

This is a more global discussion, which is not especially related to
i40e (the only part of code that currently use dynamic logs).

Olivier