netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kok, Auke" <auke-jan.h.kok@intel.com>
To: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: netdev@vger.kernel.org, jeff@garzik.org, davem@davemloft.net,
	arjan@linux.intel.com, joe@perches.com
Subject: Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family
Date: Mon, 11 Jun 2007 15:43:14 -0700	[thread overview]
Message-ID: <466DD002.9070103@intel.com> (raw)
In-Reply-To: <20070611151915.398add18@localhost.localdomain>

Stephen Hemminger wrote:
> On Mon, 11 Jun 2007 14:37:21 -0700
> Auke Kok <auke-jan.h.kok@intel.com> 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.
>>
>> This patch implements a standard ndev_printk and derivatives
>> such as ndev_err, ndev_info, ndev_warn that allows drivers to
>> transparently use both the msg_enable and a generic netdevice
>> message layout. It moves the msg_enable over to the net_device
>> struct and allows drivers to obsolete ethtool handling code of
>> the msg_enable value.
>>
>> The current code has each driver contain a copy of msg_enable and
>> handle the setting/changing through ethtool that way. Since the
>> netdev name is stored in the net_device struct, those two are
>> not coherently available in a uniform way across all drivers (a
>> single macro or function would not work since all drivers name
>> their net_device members differently). This makes netdevice
>> driver writes reinvent the wheel over and over again.
>>
>> It thus makes sense to move msg_enable to the net_device. This
>> gives us the opportunity to (1) initialize it by default with a
>> globally sane value, (2) remove msg_enable handling code w/r
>> ethtool for drivers that know and use the msg_enable member
>> of the net_device struct. (3) Ethtool code can just modify the
>> net_device msg_enable for drivers that do not have custom
>> msg_enable get/set handlers so converted drivers lose some
>> code for that as well.
>>
>> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
>> ---
>>
>>  include/linux/netdevice.h |   38 ++++++++++++++++++++++++++++++++++++++
>>  net/core/dev.c            |    5 +++++
>>  net/core/ethtool.c        |   14 +++++++-------
>>  3 files changed, 50 insertions(+), 7 deletions(-)
>>
>> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>> index 3a70f55..d185f41 100644
>> --- a/include/linux/netdevice.h
>> +++ b/include/linux/netdevice.h
>> @@ -540,6 +540,8 @@ struct net_device
>>  	struct device		dev;
>>  	/* space for optional statistics and wireless sysfs groups */
>>  	struct attribute_group  *sysfs_groups[3];
>> +
>> +	int			msg_enable;
>>  };
> 
> Since msg_enable is used as bits, it should be unsigned (probably unsigned long).

ack, but the long is really not needed here I think - we're only using the first 15.

Auke

  reply	other threads:[~2007-06-11 22:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-11 21:37 [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family Auke Kok
2007-06-11 21:37 ` [PATCH 2/2] [RFC] NET: Convert several drivers to ndev_printk Auke Kok
2007-06-11 21:52 ` [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family Kok, Auke
2007-06-11 21:54 ` Joe Perches
2007-06-11 22:01   ` Kok, Auke
2007-06-11 22:24     ` Joe Perches
2007-06-11 22:00 ` Randy Dunlap
2007-06-11 22:04   ` Kok, Auke
2007-06-11 22:19 ` Stephen Hemminger
2007-06-11 22:43   ` Kok, Auke [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-06-08 22:00 Auke Kok
2007-06-08 23:24 ` Stephen Hemminger
2007-06-08 23:42   ` Kok, Auke
2007-06-09  0:10     ` Stephen Hemminger
2007-06-09  3:06       ` Kok, Auke
2007-06-09  3:18       ` Kok, Auke
2007-06-11 17:30       ` Kok, Auke
2007-06-11 17:50         ` Stephen Hemminger
2007-06-11 18:28           ` Joe Perches
2007-06-11 20:28             ` Kok, Auke

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=466DD002.9070103@intel.com \
    --to=auke-jan.h.kok@intel.com \
    --cc=arjan@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=jeff@garzik.org \
    --cc=joe@perches.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.org \
    /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;
as well as URLs for NNTP newsgroup(s).