[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101229112827.203469c2@nehalam>
Date: Wed, 29 Dec 2010 11:28:27 -0800
From: Stephen Hemminger <shemminger@...tta.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Hans Ulli Kroll <ulli.kroll@...glemail.com>,
Stephen Hemminger <stephen.hemminger@...tta.com>,
Ben Hutchings <bhutchings@...arflare.com>,
Michał Mirosław <mirq-linux@...e.qmqm.pl>,
gemini-board-dev@...ts.berlios.de, netdev@...r.kernel.org,
Christoph Biedl <linux-kernel.bfrz@...chmal.in-ulm.de>
Subject: Re: [RFC PATCH v2] Gemini: Gigabit ethernet driver
On Wed, 29 Dec 2010 19:30:41 +0100
Eric Dumazet <eric.dumazet@...il.com> wrote:
> Le mercredi 29 décembre 2010 à 17:56 +0100, Hans Ulli Kroll a écrit :
> >
> > On Mon, 27 Dec 2010, Stephen Hemminger wrote:
> >
> > >
> > >
> > > ----- Original Message -----
> > > > On Mon, 2010-12-27 at 20:21 +0100, Hans Ulli Kroll wrote:
> > > > [...]
> > > > > BTW:
> > > > >
> > > > > Why u64_stats ?
> > > > > I see only a few driver are using u64_stats.
> > > > > vlan, br_device and some intel driver
> > > > > no gigabit driver for marvell devices uses u64_stats
> > > >
> > > > All new net drivers should implement 64-bit stats. net_device_stats is
> > > > kept for backward compatibility because we couldn't change all the
> > > > existing drivers at once (it's not a simple change for all of them).
> > > >
> > > > Ben.
> > >
> > > BS. drivers with old stats are fine. 64 bit only really matters
> > > at higher speed. Anyway, it is the kind of thing that can easily
> > > be fixed later after driver is merged.
> > >
> > >
> >
> > I've readed the Intel driver.
> >
> > So we must also implement to old net_stats interface, for backward
> > compatibility ?
>
> If you implement new (64bit) stats, old one is not used at all.
>
> Check net/core/dev.c : dev_get_stats()
>
> If ndo_get_stats64() method is implemented, its called, and legacy
> interfaces are ignored.
It looks like the comment/documentation in netdevice.h is incorrect.
* struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
* Called when a user wants to get the network device usage
* statistics. Drivers must do one of the following:
* 1. Define @ndo_get_stats64 to fill in a zero-initialised
* rtnl_link_stats64 structure passed by the caller.
* 2. Define @ndo_get_stats to update a net_device_stats structure
* (which should normally be dev->stats) and return a pointer to
* it. The structure may be changed asynchronously only if each
* field is written atomically.
* 3. Update dev->stats asynchronously and atomically, and define
* neither operation.
--
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists