lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1308608833.2701.204.camel@bwh-desktop>
Date:	Mon, 20 Jun 2011 23:27:13 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Stephen Hemminger <stephen.hemminger@...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 15:18 -0700, Stephen Hemminger wrote:
> > 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.

'csummed' is not.

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ