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
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to