archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <>
To: Jim Keniston <>
Cc: LKML <>, netdev <>,
	Andrew Morton <>,
	"Feldman, Scott" <>,
	Larry Kessler <>,
	"David S. Miller" <>,
	Linus Torvalds <>
Subject: Re: [PATCH 2.6.0-test11] Net device error logging
Date: Fri, 05 Dec 2003 15:03:36 -0500	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Jim Keniston wrote:
> The enclosed patch implements the netdev_* error-logging macros for
> network drivers.  These macros have been discussed at length on the
> linux-kernel and linux-netdev lists.  With the v2.6.0-test6 version of
> these macros, we addressed all the issues that reviewers had raised.
> This is just an update for v2.6.0-test11.
> As previously discussed, these macros are in demand now (e.g., for
> the e1000 driver) and have essentially no impact on drivers that
> don't use them.
> RECAP (from previous posts):
> Calls to the netdev_* macros (netdev_printk and wrappers such as
> netdev_err) are intended to replace calls to printk in network device
> drivers.  These macros have the following characteristics:
> - Same format + args as the corresponding printk call.
> - Approximately the same amount of text as the corresponding printk call.
> - The first arg is a pointer to the net_device struct.
> - The second arg, which is a NETIF_MSG_* message level, can be used to
> implement verbosity control.
> - Standard message prefixes: verbose (interface name, driver name, bus ID)
> during probe, or just the interface name once the device is registered.
> - The current implementation just calls printk.  However, the netdev_*
> interface (and availability of the net_device pointer) opens the door
> for logging additional information (via printk, via evlog/netlink, etc.)
> as desired, with no change to driver code.
> Examples:
>         netdev_err(netdev, RX_ERR, "No mem: dropped packet\n");
> logs a message such as the following if the NETIF_MSG_RX_ERR bit is set
> in netdev->msg_enable.
>         eth2: No mem: dropped packet
>         netdev_fatal(netdev, PROBE, "The EEPROM Checksum Is Not Valid\n");
> or
>         netdev_err(netdev, ALL, "The EEPROM Checksum Is Not Valid\n");
> unconditionally logs a message such as:
>         eth%d (e1000 0000:00:03.0): The EEPROM Checksum Is Not Valid
> The message's prefix includes the driver name and bus ID because the
> message is logged at probe time, before netdev is registered.
> As examples of how the netdev_* macros could be used, patches for the
> v2.6.0-test11 e100, e1000, and tg3 drivers are available on request.
> Since there is no v2.6-style struct device underlying the net_device,
> a v2.4.23-compatible version of netdev_printk would always log the
> interface name as the message prefix:
> #define netdev_printk(sevlevel, netdev, msglevel, format, arg...)	\
> do {									\
> 	if (NETIF_MSG_##msglevel == NETIF_MSG_ALL			\
> 	    || (netdev->msg_enable & NETIF_MSG_##msglevel)) {		\
> 		printk(sevlevel "%s: " format , netdev->name , ## arg);	\
> 	}								\
> } while (0)

I discussed this a bit with David.  My personal feelings are that I 
prefer just leaving all the printk's as they are.  But Linus and GregKH 
have been accepting patches into other parts of the tree like this one, 
and logging additional already-computer-parsed information is probably 
not a bad thing long-term, so perhaps I've been being a bit of a Luddite 
on this issue.

It's definitely too late for 2.6.0-testX mainline merging, until Andrew 
(2.6) and Linus (2.7) re-open their respective trees, but a good first 
step would be for me to merge this into the net-drivers-2.5-exp queue.


  reply	other threads:[~2003-12-05 20:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-05 19:52 [PATCH 2.6.0-test11] Net device error logging Jim Keniston
2003-12-05 20:03 ` Jeff Garzik [this message]
2003-12-06  9:04   ` Greg KH

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).