netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Hartkopp <oliver@hartkopp.net>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>,
	Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: dev->get_stats(dev) in COMPAT_NET_DEV_OPS case
Date: Thu, 08 Jan 2009 15:02:28 +0100	[thread overview]
Message-ID: <49660774.6060603@hartkopp.net> (raw)
In-Reply-To: <1231421397.3408.5.camel@hashbaz.i.decadent.org.uk>

Ben Hutchings wrote:
> On Thu, 2009-01-08 at 14:12 +0100, Oliver Hartkopp wrote:
>   
>> Hello Stephen,
>>
>> in commit eeda3fd64f75bcbfaa70ce946513abaf3f23b8e0 ("netdev: introduce dev_get_stats()")
>> you remove the setting of dev->get_stats :
>>
>> @@ -4370,7  +4384,6 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
>>  
>>         netdev_init_queues(dev);
>>  
>> -       dev->get_stats = internal_stats;
>>         netpoll_netdev_init(dev);
>>         setup(dev);
>>         strcpy(dev->name, name);
>>
>> I really appreciate your introduction of COMPAT_NET_DEV_OPS but when i 
>> try to compile and run a non-converted driver, i get a NULL pointer 
>> dereference. I tracked it down to be the call of dev->get_stats(dev).
>>
>> Did you miss something or is this behaviour intended?
>>     
>
> You should be calling dev_get_stats() now.
>
>   

I noticed that myself and besides a warning (about the const / non-const 
definition) i got it working again.
But the question remains, if it still makes sense to provide 
dev->get_stats() (referencing to dev_get_stats()) in the 
COMPAT_NET_DEV_OPS case, as i would surely not be the only one tapping 
into this problem ...

Regards,
Oliver


  reply	other threads:[~2009-01-08 14:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-08 13:12 dev->get_stats(dev) in COMPAT_NET_DEV_OPS case Oliver Hartkopp
2009-01-08 13:29 ` Ben Hutchings
2009-01-08 14:02   ` Oliver Hartkopp [this message]
2009-01-08 16:51 ` Stephen Hemminger

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=49660774.6060603@hartkopp.net \
    --to=oliver@hartkopp.net \
    --cc=bhutchings@solarflare.com \
    --cc=netdev@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).