Subject: Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

From: "Kok, Auke" <[email-masked]>
Date: Mon, 11 Jun 2007 14:52:36 -0700

Auke Kok wrote:
> A lot of netdevices implement their own variant of printk and use
> use variations of dev_printk, printk or others that use msg_enable,
> which has been an eyesore with countless variations across drivers.

<snip>

> +#define ndev_err(netdev, level, format, arg...) \
> +	do { if ((netdev)->msg_enable & NETIF_MSG_##level) { \
> +		printk(KERN_ERR "%s: %s: " format, (netdev)->name, \
> +		(netdev)->dev.parent->bus_id, ## arg); } } while (0)

so now the only question is whether we want the ndev_printk() stuff to format as 
much as possible like dev_printk. dev_printk also prints dev_driver_string(dev), 
which is what above macro omits. To make this as much similar as possible, we
could do:

 > +#define ndev_err(netdev, level, format, arg...) \
 > +	do { if ((netdev)->msg_enable & NETIF_MSG_##level) { \
 > +		printk(KERN_ERR "%s: %s %s: " format, (netdev)->name, \
 > +		dev_driver_string(netdev)-dev), (netdev)->dev.parent->bus_id, \
 > +             ## arg); } } while (0)

it would (e.g. e1000) change the output from:
eth1: 0000:00:19.0: NIC Link is Down

To:
eth1: e1000 0000:00:19.0: NIC Link is Down

But I am unsure whether the addition of the driver name is useful at this point 
- most drivers already printk some sort of association out that can be used to 
track the bus_id/netdev name back to the driver easily.

So, hence I omitted doing this in this patch.

Auke