[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1308606738.2701.203.camel@bwh-desktop>
Date: Mon, 20 Jun 2011 22:52:18 +0100
From: Ben Hutchings <bhutchings@...arflare.com>
To: Stephen Hemminger <shemminger@...tta.com>
Cc: davem@...emloft.net, Amit Kumar Salecha <amit.salecha@...gic.com>,
netdev@...r.kernel.org
Subject: Re: [PATCH net-next 3/5] netxen: make 64 bit stats safe on 32 bit
platform
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.)
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
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