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]
Date:	Mon, 20 Jun 2011 15:18:32 -0700 (PDT)
From:	Stephen Hemminger <stephen.hemminger@...tta.com>
To:	Ben Hutchings <bhutchings@...arflare.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.)

Since they are error counters, just changing them to unsigned long is
easier.
--
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