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:	Wed, 23 Jan 2013 11:41:16 -0400
From:	Jamie Gloudon <jamie.gloudon@...il.com>
To:	netdev@...r.kernel.org
Cc:	Eric Dumazet <eric.dumazet@...il.com>, davem@...emloft.net
Subject: Re: [PATCH net-next] via-rhine: add 64bit statistics.

On Wed, Jan 23, 2013 at 06:38:04AM -0800, Eric Dumazet wrote:
> On Wed, 2013-01-23 at 10:31 -0400, Jamie Gloudon wrote:
> > Switch to use ndo_get_stats64 to get 64bit statistics.
> > 
> > Signed-off-by: Jamie Gloudon <jamie.gloudon@...il.com>
> > ---
> 
> > +
> > +	stats->rx_errors = dev->stats.rx_errors;
> > +	stats->tx_errors = dev->stats.tx_errors;
> > +	stats->rx_dropped = dev->stats.rx_dropped;
> > +	stats->tx_dropped = dev->stats.tx_dropped;
> > +	stats->collisions = dev->stats.collisions;
> > +
> > +	stats->rx_length_errors = dev->stats.rx_length_errors;
> > +	stats->rx_crc_errors = dev->stats.rx_crc_errors;
> > +	stats->rx_frame_errors = dev->stats.rx_frame_errors;
> > +	stats->rx_fifo_errors = dev->stats.rx_fifo_errors;
> > +	stats->rx_missed_errors = dev->stats.rx_missed_errors;
> > +
> > +	stats->tx_aborted_errors = dev->stats.tx_aborted_errors;
> > +	stats->tx_carrier_errors = dev->stats.tx_carrier_errors;
> > +	stats->tx_fifo_errors = dev->stats.tx_fifo_errors;
> > +	stats->tx_heartbeat_errors = dev->stats.tx_heartbeat_errors;
> > +	stats->tx_window_errors = dev->stats.tx_window_errors;
> > +
> > +	return stats;
> >  }
> >  
> 
> Hi Jamie
> 
> Please use netdev_stats_to_stats64() for this block
> 
> commit 77a1abf54f4b003ad6e59c535045b2ad89fedfeb
> Author: Eric Dumazet <eric.dumazet@...il.com>
> Date:   Mon Mar 5 04:50:09 2012 +0000
> 
>     net: export netdev_stats_to_stats64
>     
>     Some drivers use internal netdev stats member to store part of their
>     stats, yet advertize ndo_get_stats64() to implement some 64bit fields.
>     
>     Allow them to use netdev_stats_to_stats64() helper to make the copy of
>     netdev stats before they compute their 64bit counters.
> 
>

Definitely looks cleaner now. Thanks!

View attachment "0001-via-rhine-add-64bit-statistics-v2.patch" of type "text/plain" (4401 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ