From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758267AbbDXU3X (ORCPT ); Fri, 24 Apr 2015 16:29:23 -0400 Received: from smtprelay0236.hostedemail.com ([216.40.44.236]:33665 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757274AbbDXU3W (ORCPT ); Fri, 24 Apr 2015 16:29:22 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2559:2562:2693:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3870:3871:3872:3874:4321:5007:6119:6120:6261:7576:7688:8660:10004:10400:10848:11026:11232:11473:11658:11914:12043:12109:12296:12438:12517:12519:12740:13019:13069:13148:13230:13311:13357:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: crack76_3449dd1734113 X-Filterd-Recvd-Size: 2267 Message-ID: <1429907357.23327.14.camel@perches.com> Subject: Re: [PATCH net-next,v2,1/1] hv_netvsc: introduce netif-msg into netvsc module From: Joe Perches To: sixiao@microsoft.com Cc: kys@microsoft.com, haiyangz@microsoft.com, devel@linuxdriverproject.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 24 Apr 2015 13:29:17 -0700 In-Reply-To: <1429900488-7302-1-git-send-email-sixiao@microsoft.com> References: <1429900488-7302-1-git-send-email-sixiao@microsoft.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2015-04-24 at 11:34 -0700, sixiao@microsoft.com wrote: > From: Simon Xiao > > 1. Introduce netif-msg to netvsc to control debug logging output > and keep msg_enable in netvsc_device_context so that it is > kept persistently. > 2. Only call dump_rndis_message() when NETIF_MSG_RX_ERR or above > is specified in netvsc module debug param. > In non-debug mode, in current code, dump_rndis_message() will not > dump anything but it still initialize some local variables and > process the switch logic which is unnecessary, especially in > high network throughput situation. [] > diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c [] > @@ -888,6 +891,11 @@ static int netvsc_probe(struct hv_device *dev, > > net_device_ctx = netdev_priv(net); > net_device_ctx->device_ctx = dev; > + net_device_ctx->msg_enable = netif_msg_init(debug, default_msg); > + if (netif_msg_probe(net_device_ctx)) > + netdev_dbg(net, "netvsc msg_enable: %d", > + net_device_ctx->msg_enable); Please use newlines to terminate formats. It helps prevent log content interleaving when multiple processes are emitting output at the same time. This could be shortened to use netif_ like: netif_dbg(net_device_ctx, probe, net, "netvsc_msg_enable: %d\n", net_device_ctx->msg_enable);