Subject: Re: [PATCH -next] sundance: Add initial ethtool stats support

From: Jeff Garzik <[email-masked]>
Date: Sat, 09 Oct 2010 17:48:38 -0400

On 10/09/2010 03:41 PM, Denis Kirjanov wrote:
> On 10/09/2010 05:27 PM, Ben Hutchings wrote:
>> Denis Kirjanov wrote:
>>> Add initial ethtool statistics support
>> [...]
>>> +static void get_ethtool_stats(struct net_device *dev,
>>> +		struct ethtool_stats *stats, u64 *data)
>>> +{
>>> +	struct net_device_stats *netdev_stats = get_stats(dev);
>>> +	int i = 0;
>>> +
>>> +	data[i++] = netdev_stats->tx_packets;
>>> +	data[i++] = netdev_stats->tx_bytes;
>>> +	data[i++] = netdev_stats->rx_packets;
>>> +	data[i++] = netdev_stats->rx_bytes;
>>> +	data[i++] = netdev_stats->tx_errors;
>>> +	data[i++] = netdev_stats->tx_dropped;
>>> +	data[i++] = netdev_stats->rx_errors;
>>> +}
>> [...]
>>
>> There is no point in adding ethtool stats that merely mirror the baseline
>> net device stats.
>>
>> Ben.
>>
>
> [PATCH -next v2] sundance: Add ethtool stats support
>
> Add ethtool stats support
>
> Signed-off-by: Denis Kirjanov<[email-masked]>
> ---
> V2:
>   check for the ETH_SS_STATS in get_string()
>   use xstats struct for ethtool stats
>
> drivers/net/sundance.c |   90 ++++++++++++++++++++++++++++++++++++++++++++----
>   1 files changed, 83 insertions(+), 7 deletions(-)

Acked-by: Jeff Garzik <[email-masked]>

glad somebody tackled this...