From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 501F01E9CB for ; Thu, 14 Jun 2018 08:46:22 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id n5-v6so9650054wmc.5 for ; Wed, 13 Jun 2018 23:46:22 -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:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=7PHG3HLeW2mes44KruNnOOHt2OgGsoojxpU+XQRKRAc=; b=hAfSNv3eSZZtsAeaHCFjKFJop2iHIZ53v7S0YOlwmffR1Bul+eV3fOhGGo4XkYn+Sj v5KLINMZdMlDf7OTRY2859QuD217PuASm2hKPy4I9Hf17Fk90q8YFumVduICLmsvRG8K e0OMZQ9IcmD0SWqaIYHuxr1FIjazXipZ9zQCWn1HCx0ofxJtWdLhd6P/I4zUxAZcCvvE B5MtVqh9SFdXpIZe5VU+A0wSZs9vjRhRJgZykeWd9tIbrFmZOVjOF9UwbxH3bjww1caj yEV6mC04DXq7qTmS3bSJfDZsnqaJk4u0Vb8XaCCisRTEO+JWmgUP4bYTjigTK+Uc/2KI NuKw== 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:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=7PHG3HLeW2mes44KruNnOOHt2OgGsoojxpU+XQRKRAc=; b=KjJ8wFxnA6JFcLb8Q5QhBbEWlhwNXcokuU+5Z5A79qlTDFqjd3tEPYDM9d84Ehn/g/ wIhEfMq1Z+KLUXDmMuBtOVkxYI28VV/muakheLcaeIb5ediMs/9prSY9HTJYNeF6IsKi ATuOxvAQXJleccffkXeOSVXzVUwNTOa4BZ6eo4rhKCtBwRkb9wHIEPBawgQ0XQAElqBW x/x/CM6xKmQyGrGoUSXFNFALM7AMaeBiDPODl6vL9uLm04Kr0MAMm4De/feRv5Lal2wg BRfSjwTVlCIbe4+EZVVLwyuRDFAZmReBXxCFUuvgNXXo2N+uZm7MSIZWUX5jfaFcLThC XlLA== X-Gm-Message-State: APt69E2ib0lZDpexJ9sW2JoXEiwCUMjrpIJUPu0P0WIskIqwmDicx073 7Z03WYrVISdPcDmiboqRD3WoeiyGAg== X-Google-Smtp-Source: ADUXVKJpT2B5JDV3aSflMHbFYb+sJrxL3ysQW4KpFSISpFN/MOoP51QfujXtwq3JBUP8YucSUB+R4Q== X-Received: by 2002:a1c:954d:: with SMTP id x74-v6mr811610wmd.57.1528958782132; Wed, 13 Jun 2018 23:46:22 -0700 (PDT) Received: from laranjeiro-vm.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id m65-v6sm5240461wmd.1.2018.06.13.23.46.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Jun 2018 23:46:21 -0700 (PDT) Date: Thu, 14 Jun 2018 08:46:20 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Stephen Hemminger Cc: dev@dpdk.org Message-ID: <20180614064620.jfdsgvg5b7jiu5z7@laranjeiro-vm.dev.6wind.com> References: <20180613184626.13458-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180613184626.13458-1-stephen@networkplumber.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH] mlx5: fix log initialization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 06:46:22 -0000 On Wed, Jun 13, 2018 at 11:46:26AM -0700, Stephen Hemminger wrote: > The mlx5 driver had two init functions, but this could > cause log initialization to be done after the > other initialization. Also, the name of the function does > not match convention (cut/paste error?). Indeed an error in the copy/paste, sorry, > Fix by initializing log type first at start of the pmd_init. > This also gets rid of having two constructor functions. > > Fixes: a170a30d22a8 ("net/mlx5: use dynamic logging") > Signed-off-by: Stephen Hemminger Acked-by: Nelio Laranjeiro > --- > drivers/net/mlx5/mlx5.c | 13 +++++-------- > 1 file changed, 5 insertions(+), 8 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c > index c933e274fe32..6ec4f3178b6b 100644 > --- a/drivers/net/mlx5/mlx5.c > +++ b/drivers/net/mlx5/mlx5.c > @@ -1439,6 +1439,11 @@ RTE_INIT(rte_mlx5_pmd_init); > static void > rte_mlx5_pmd_init(void) > { > + /* Initialize driver log type. */ > + mlx5_logtype = rte_log_register("pmd.net.mlx5"); > + if (mlx5_logtype >= 0) > + rte_log_set_level(mlx5_logtype, RTE_LOG_NOTICE); > + > /* Build the static tables for Verbs conversion. */ > mlx5_set_ptype_table(); > mlx5_set_cksum_table(); > @@ -1480,11 +1485,3 @@ rte_mlx5_pmd_init(void) > RTE_PMD_EXPORT_NAME(net_mlx5, __COUNTER__); > RTE_PMD_REGISTER_PCI_TABLE(net_mlx5, mlx5_pci_id_map); > RTE_PMD_REGISTER_KMOD_DEP(net_mlx5, "* ib_uverbs & mlx5_core & mlx5_ib"); > - > -/** Initialize driver log type. */ > -RTE_INIT(vdev_netvsc_init_log) > -{ > - mlx5_logtype = rte_log_register("pmd.net.mlx5"); > - if (mlx5_logtype >= 0) > - rte_log_set_level(mlx5_logtype, RTE_LOG_NOTICE); > -} > -- > 2.17.1 Thanks, -- Nélio Laranjeiro 6WIND