From: Stephen Hemminger <shemminger@vyatta.com>
To: Oliver Hartkopp <oliver@hartkopp.net>
Cc: Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: dev->get_stats(dev) in COMPAT_NET_DEV_OPS case
Date: Thu, 8 Jan 2009 08:51:01 -0800 [thread overview]
Message-ID: <20090108085101.076e5c91@extreme> (raw)
In-Reply-To: <4965FBA5.2010605@hartkopp.net>
On Thu, 08 Jan 2009 14:12:05 +0100
Oliver Hartkopp <oliver@hartkopp.net> wrote:
> Hello Stephen,
>
> in commit eeda3fd64f75bcbfaa70ce946513abaf3f23b8e0 ("netdev: introduce
> dev_get_stats()
> <http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.git;a=commit;h=eeda3fd64f75bcbfaa70ce946513abaf3f23b8e0>")
> you remove the setting of dev->get_stats :
>
> @@ -4370,7
> <http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.git;a=blob;f=net/core/dev.c;h=ca14ab407b338172758bc409efd2baaf75bdee99;hb=d314774cf2cd5dfeb39a00d37deee65d4c627927#l4370>
> +4384,6
> <http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.git;a=blob;f=net/core/dev.c;h=8843f4e3f5e192eba9eb5154faa1ca4131fb01fc;hb=eeda3fd64f75bcbfaa70ce946513abaf3f23b8e0#l4384>
> @@ 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).
In most cases, drivers shouldn't be call dev->get_stat directly.
I am working to convert all the in-tree uses of get_stats for 2.6.29.
(There are a couple more left).
prev parent reply other threads:[~2009-01-08 16:51 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
2009-01-08 16:51 ` Stephen Hemminger [this message]
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=20090108085101.076e5c91@extreme \
--to=shemminger@vyatta.com \
--cc=netdev@vger.kernel.org \
--cc=oliver@hartkopp.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.