netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "Hans Ulli Kroll" <ulli.kroll@googlemail.com>,
	"Stephen Hemminger" <stephen.hemminger@vyatta.com>,
	"Ben Hutchings" <bhutchings@solarflare.com>,
	"Michał Mirosław" <mirq-linux@rere.qmqm.pl>,
	gemini-board-dev@lists.berlios.de, netdev@vger.kernel.org,
	"Christoph Biedl" <linux-kernel.bfrz@manchmal.in-ulm.de>
Subject: Re: [RFC PATCH v2] Gemini: Gigabit ethernet driver
Date: Wed, 29 Dec 2010 11:28:27 -0800	[thread overview]
Message-ID: <20101229112827.203469c2@nehalam> (raw)
In-Reply-To: <1293647441.2413.2.camel@edumazet-laptop>

On Wed, 29 Dec 2010 19:30:41 +0100
Eric Dumazet <eric.dumazet@gmail.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.

-- 

  reply	other threads:[~2010-12-29 19:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-27 10:32 [RFC PATCH v2] Gemini: Gigabit ethernet driver Michał Mirosław
2010-12-27 19:21 ` Hans Ulli Kroll
2010-12-28  4:37   ` Ben Hutchings
2010-12-28  5:12     ` Stephen Hemminger
2010-12-29 16:56       ` Hans Ulli Kroll
2010-12-29 18:30         ` Eric Dumazet
2010-12-29 19:28           ` Stephen Hemminger [this message]
2010-12-29 19:52             ` Eric Dumazet
2010-12-29 19:57               ` Stephen Hemminger
2010-12-29 21:42               ` Ben Hutchings
2010-12-28 11:45   ` Michał Mirosław

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=20101229112827.203469c2@nehalam \
    --to=shemminger@vyatta.com \
    --cc=bhutchings@solarflare.com \
    --cc=eric.dumazet@gmail.com \
    --cc=gemini-board-dev@lists.berlios.de \
    --cc=linux-kernel.bfrz@manchmal.in-ulm.de \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=netdev@vger.kernel.org \
    --cc=stephen.hemminger@vyatta.com \
    --cc=ulli.kroll@googlemail.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).