From: Joe Perches <joe@perches.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
linux-kernel@vger.kernel.org,
Stephen Hemminger <shemminger@vyatta.com>,
Ben Hutchings <bhutchings@solarflare.com>
Subject: Re: [PATCH] net/core: Convert to current logging forms
Date: Wed, 29 Jun 2011 07:57:15 -0700 [thread overview]
Message-ID: <1309359435.29598.72.camel@Joe-Laptop> (raw)
In-Reply-To: <20110629111109.GA1613@hmsreliant.think-freely.org>
On Wed, 2011-06-29 at 07:11 -0400, Neil Horman wrote:
> On Tue, Jun 28, 2011 at 12:40:10PM -0700, Joe Perches wrote:
> > Use pr_fmt, pr_<level>, and netdev_<level> as appropriate.
> > Coalesce long formats.
[]
> > diff --git a/net/core/dev.c b/net/core/dev.c
[]
> > @@ -5397,8 +5380,8 @@ static int netif_alloc_netdev_queues(struct net_device *dev)
> >
> > tx = kcalloc(count, sizeof(struct netdev_queue), GFP_KERNEL);
> > if (!tx) {
> > - pr_err("netdev: Unable to allocate %u tx queues.\n",
> > - count);
> > + netdev_err(dev, "netdev: Unable to allocate %u tx queues\n",
> > + count);
> > return -ENOMEM;
> > }
> Don't all of these get called prior to device registration? This change will
> have us printing out unregistered net device: ... rather than netdev: ... on
> these errors.
True, that's not particularly good.
> Not tragic, but I rather think its nicer to just say netdev:...
If the second suggested patch is also applied,
it shows the "devicename (unregistered)".
I think that's appropriate.
> Ditto on the unregistered net device thing.
ditto back.
[]
> > diff --git a/net/core/skbuff.c b/net/core/skbuff.c
[]
> > */
> > static void skb_over_panic(struct sk_buff *skb, int sz, void *here)
> > {
> > - printk(KERN_EMERG "skb_over_panic: text:%p len:%d put:%d head:%p "
> > - "data:%p tail:%#lx end:%#lx dev:%s\n",
> > - here, skb->len, sz, skb->head, skb->data,
> > - (unsigned long)skb->tail, (unsigned long)skb->end,
> > - skb->dev ? skb->dev->name : "<NULL>");
> > + netdev_emerg(skb->dev, "skb_over_panic: text:%p len:%d put:%d head:%p data:%p tail:%#lx end:%#lx\n",
> > + here, skb->len, sz, skb->head, skb->data,
> > + (unsigned long)skb->tail, (unsigned long)skb->end);
> > BUG();
> > }
> Are you guaranteed to have skb->dev be non-null here?
I think not.
> netdev_printk handles
> that, but flaggin the fact that we have a NULL net device when thats not really
> an issue seems like it would destract from the purpose of this printk. Same
> with the others in this file below
With the skb_<foo>_panics, I think rearranging the
message output may actually help a _very_ little bit.
The next bit is a BUG which dumps stack and stops the
system anyway so it's not much of an issue.
[]
> > @@ -3061,9 +3057,8 @@ bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off)
> > if (unlikely(start > skb_headlen(skb)) ||
> > unlikely((int)start + off > skb_headlen(skb) - 2)) {
> > if (net_ratelimit())
> > - printk(KERN_WARNING
> > - "bad partial csum: csum=%u/%u len=%u\n",
> > - start, off, skb_headlen(skb));
> > + netdev_warn(skb->dev, "bad partial csum: csum=%u/%u len=%u\n",
> > + start, off, skb_headlen(skb));
> > return false;
> > }
> > skb->ip_summed = CHECKSUM_PARTIAL;
I think netdev_warn is an improvement here.
> > @@ -3076,7 +3071,6 @@ EXPORT_SYMBOL_GPL(skb_partial_csum_set);
> > void __skb_warn_lro_forwarding(const struct sk_buff *skb)
> > {
> > if (net_ratelimit())
> > - pr_warning("%s: received packets cannot be forwarded"
> > - " while LRO is enabled\n", skb->dev->name);
> > + netdev_warn(skb->dev, "received packets cannot be forwarded while LRO is enabled\n");
> > }
> > EXPORT_SYMBOL(__skb_warn_lro_forwarding);
and not a change here.
I'll reorder the patches to do netdev_name changes
first and resubmit if there aren't more comments
in awhile.
cheers, Joe
next prev parent reply other threads:[~2011-06-29 14:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-28 19:40 [PATCH] net/core: Convert to current logging forms Joe Perches
2011-06-28 20:21 ` Ben Hutchings
2011-06-28 20:31 ` Joe Perches
2011-06-28 20:36 ` Ben Hutchings
2011-06-28 20:40 ` Joe Perches
2011-06-28 21:37 ` Joe Perches
2011-06-28 21:49 ` Stephen Hemminger
2011-06-28 21:55 ` Joe Perches
2011-06-29 11:11 ` Neil Horman
2011-06-29 11:55 ` David Miller
2011-06-29 15:24 ` Neil Horman
2011-06-29 14:57 ` Joe Perches [this message]
2011-06-30 9:55 ` WANG Cong
2011-06-30 17:10 ` Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1309359435.29598.72.camel@Joe-Laptop \
--to=joe@perches.com \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=shemminger@vyatta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox