Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: David Miller <davem@davemloft.net>,
	Stephen Hemminger <shemminger@vyatta.com>,
	Arnd Bergmann <arnd@arndb.de>,
	netdev@vger.kernel.org, linux-net-drivers@solarflare.com
Subject: Re: [PATCHv3 2/2] sfc: Implement 64-bit net device statistics on all architectures
Date: Mon, 05 Jul 2010 20:31:22 +0200	[thread overview]
Message-ID: <1278354682.2877.639.camel@edumazet-laptop> (raw)
In-Reply-To: <1278353780.2877.620.camel@edumazet-laptop>

Le lundi 05 juillet 2010 à 20:16 +0200, Eric Dumazet a écrit :
> Le mardi 08 juin 2010 à 18:21 +0100, Ben Hutchings a écrit :
> > Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> > ---
> > This is unchanged from v1.
> > 
> > Ben.
> > 
> >  drivers/net/sfc/efx.c |    6 +++---
> >  1 files changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
> > index 26b0cc2..8ad476a 100644
> > --- a/drivers/net/sfc/efx.c
> > +++ b/drivers/net/sfc/efx.c
> > @@ -1492,11 +1492,11 @@ static int efx_net_stop(struct net_device *net_dev)
> >  }
> >  
> >  /* Context: process, dev_base_lock or RTNL held, non-blocking. */
> > -static struct net_device_stats *efx_net_stats(struct net_device *net_dev)
> > +static struct rtnl_link_stats64 *efx_net_stats(struct net_device *net_dev)
> >  {
> >  	struct efx_nic *efx = netdev_priv(net_dev);
> >  	struct efx_mac_stats *mac_stats = &efx->mac_stats;
> > -	struct net_device_stats *stats = &net_dev->stats;
> > +	struct rtnl_link_stats64 *stats = &net_dev->stats64;
> >  
> >  	spin_lock_bh(&efx->stats_lock);
> >  	efx->type->update_stats(efx);
> > @@ -1630,7 +1630,7 @@ static void efx_set_multicast_list(struct net_device *net_dev)
> >  static const struct net_device_ops efx_netdev_ops = {
> >  	.ndo_open		= efx_net_open,
> >  	.ndo_stop		= efx_net_stop,
> > -	.ndo_get_stats		= efx_net_stats,
> > +	.ndo_get_stats64	= efx_net_stats,
> >  	.ndo_tx_timeout		= efx_watchdog,
> >  	.ndo_start_xmit		= efx_hard_start_xmit,
> >  	.ndo_validate_addr	= eth_validate_addr,
> > -- 
> > 1.6.2.5
> > 
> 
> Ben, David
> 
> I believe following patch is needed after our recent commits.
> Not sure a seqlock is really needed, maybe a spinlock would be enough.
> 

One other way would be to add a rtnl_link_stats64 param to
ndo_get_stats64() method, and ask drivers to copy their stats in this
zone, instead of returning &dev->stats64 or something...

And also change dev_get_stats() with this new parameter.

Each caller would use a private copy, with no risk of concurrent
updates.




  reply	other threads:[~2010-07-05 18:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-08 17:19 [PATCHv3 1/2] net: Enable 64-bit net device statistics on 32-bit architectures Ben Hutchings
2010-06-08 17:21 ` [PATCHv3 2/2] sfc: Implement 64-bit net device statistics on all architectures Ben Hutchings
2010-06-12 22:55   ` David Miller
2010-07-05 18:16   ` Eric Dumazet
2010-07-05 18:31     ` Eric Dumazet [this message]
2010-07-05 20:05       ` [PATCH net-next-2.6 V2] net: fix 64 bit counters on 32 bit arches Eric Dumazet
2010-07-07 21:36         ` David Miller
2010-07-07 22:41           ` David Miller
2010-07-08  5:18             ` Eric Dumazet
2010-07-07 19:56       ` [PATCHv3 2/2] sfc: Implement 64-bit net device statistics on all architectures David Miller
2010-06-12 22:54 ` [PATCHv3 1/2] net: Enable 64-bit net device statistics on 32-bit architectures David Miller

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=1278354682.2877.639.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=arnd@arndb.de \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=linux-net-drivers@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