netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen.hemminger@vyatta.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: davem@davemloft.net, Amit Kumar Salecha <amit.salecha@qlogic.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next 3/5] netxen: make 64 bit stats safe on 32 bit platform
Date: Mon, 20 Jun 2011 15:18:32 -0700 (PDT)	[thread overview]
Message-ID: <1528961426.419.1308608312735.JavaMail.root@tahiti.vyatta.com> (raw)
In-Reply-To: <1308606738.2701.203.camel@bwh-desktop>


> On Mon, 2011-06-20 at 13:35 -0700, Stephen Hemminger wrote:
> 
> > Use stats_update wrapper to avoid problems where 64 bit statistic
> > update is not atomic on 32 bit platform.
> [...]
> > @@ -2115,11 +2117,17 @@ static struct rtnl_link_stats64 *netxen_
> >  						      struct rtnl_link_stats64 *stats)
> >  {
> >  	struct netxen_adapter *adapter = netdev_priv(netdev);
> > + unsigned int start;
> > + + do {
> > + start = u64_stats_fetch_begin(&adapter->stats.syncp);
> > + + stats->rx_packets = adapter->stats.rx_pkts +
> > adapter->stats.lro_pkts; + stats->tx_packets =
> > adapter->stats.xmitfinished; + stats->rx_bytes =
> > adapter->stats.rxbytes; + stats->tx_bytes = adapter->stats.txbytes;
> > + } while (u64_stats_fetch_retry(&adapter->stats.syncp, start));
> >
> > - stats->rx_packets = adapter->stats.rx_pkts +
> > adapter->stats.lro_pkts; - stats->tx_packets =
> > adapter->stats.xmitfinished; - stats->rx_bytes =
> > adapter->stats.rxbytes; - stats->tx_bytes = adapter->stats.txbytes;
> >  	stats->rx_dropped = adapter->stats.rxdropped;
> >  	stats->tx_dropped = adapter->stats.txdropped;
> 
> netxen_nic_get_ethtool_stats() should also be fixed.
> 
> The 'txdropped' and 'csummed' stats are also 64-bit and updated on the
> data path. ('rxdropped' isn't updated at all, AFAICS.)

Since they are error counters, just changing them to unsigned long is
easier.

  reply	other threads:[~2011-06-20 22:18 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-20 20:35 [PATCH net-next 0/5] more statistics updates Stephen Hemminger
2011-06-20 20:35 ` [PATCH net-next 1/5] vxge: fix 64 bit access on 32 bit platforms Stephen Hemminger
2011-06-21 22:56   ` David Miller
2011-06-20 20:35 ` [PATCH net-next 2/5] niu: fix 64 bit statistics on 32 bit platform Stephen Hemminger
2011-06-20 21:45   ` Ben Hutchings
2011-06-20 21:52     ` Stephen Hemminger
2011-06-20 22:02       ` Eric Dumazet
2011-06-20 20:35 ` [PATCH net-next 3/5] netxen: make 64 bit stats safe " Stephen Hemminger
2011-06-20 21:50   ` Eric Dumazet
2011-06-20 21:52   ` Ben Hutchings
2011-06-20 22:18     ` Stephen Hemminger [this message]
2011-06-20 22:27       ` Ben Hutchings
2011-06-20 20:35 ` [PATCH net-next 4/5] xen: convert to 64 bit stats interface Stephen Hemminger
2011-06-21 14:05   ` [Xen-devel] " Ian Campbell
2011-06-21 15:29     ` Stephen Hemminger
2011-06-21 15:35     ` Stephen Hemminger
2011-06-21 15:38       ` Ian Campbell
2011-06-21 22:57         ` David Miller
2011-06-20 20:56 ` [PATCH net-next 0/5] more statistics updates David Miller
2011-06-20 21:12   ` [PATCH net-next 5/5] ifb: convert to 64 bit stats Stephen Hemminger
2011-06-20 21:23     ` Eric Dumazet
2011-06-20 21:27       ` Eric Dumazet
2011-06-20 21:38         ` Stephen Hemminger
2011-06-20 21:42           ` Eric Dumazet
2011-06-20 21:42         ` [PATCH net-next 5/5] ifb: convert to 64 bit stats (v3) Stephen Hemminger
2011-06-20 21:44           ` Eric Dumazet
2011-06-21  0:04             ` jamal
2011-06-21 22:55               ` 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=1528961426.419.1308608312735.JavaMail.root@tahiti.vyatta.com \
    --to=stephen.hemminger@vyatta.com \
    --cc=amit.salecha@qlogic.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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).