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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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@xxxxxxxxx>
> ---

...

> +	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



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux Kernel Discussion]     [Ethernet Bridging]     [Linux Wireless Networking]     [Linux Bluetooth Networking]     [Linux Networking Users]     [VLAN]     [Git]     [IETF Annouce]     [Linux Assembly]     [Security]     [Bugtraq]     [Photo]     [Singles Social Networking]     [Yosemite Information]     [MIPS Linux]     [ARM Linux Kernel]     [ARM Linux]     [Linux Virtualization]     [Linux Security]     [Linux IDE]     [Linux RAID]     [Linux SCSI]     [Free Dating]

Add to Google Powered by Linux