Re: [PATCH net-next] 8139too: Add 64bit statistics

Eric Dumazet
2012-03-05T13:32:09Z

Le lundi 05 mars 2012 à 19:33 +0800, Junchang Wang a écrit :
> Switch to use ndo_get_stats64 to get 64bit statistics.
> Two sync entries are used (one for Rx and one for Tx).
>
> Signed-off-by: Junchang Wang <junchangwang@gmail.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_window_errors = dev->stats.tx_window_errors;
> +
> + return stats;
> }
>

Maybe its time to export netdev_stats_to_stats64() after all, to avoid
all this duplicate code.

I'll submit a patch.

Could you repost this after netdev_stats_to_stats64() being available to
drivers ?

Thanks