Subject: Re: [PATCH RFC 1/3] tun: ethtool stats

From: Stephen Hemminger <[email-masked]>
Date: Fri, 6 Oct 2017 15:30:59 -0700

On Fri,  6 Oct 2017 18:25:14 -0400
Willem de Bruijn <[email-masked]> wrote:

> From: Willem de Bruijn <[email-masked]>
> 
> Support ethtool -S on tun devices. This interface allows exporting
> device-specific stats not present in rtnl stats.
> 
> Signed-off-by: Willem de Bruijn <[email-masked]>
> ---
>  drivers/net/tun.c | 38 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 38 insertions(+)
> 
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index 57e4c31fa84a..df6ef9670d05 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -194,6 +194,15 @@ struct tun_flow_entry {
>  
>  #define TUN_NUM_FLOW_ENTRIES 1024
>  
> +static const struct {
> +	const char string[ETH_GSTRING_LEN];
> +} tun_ethtool_stats_keys[] = {
> +	{ "rx_packets" },
> +	{ "tx_packets" },
> +	{ "rx_bytes" },
> +	{ "tx_bytes" }

It looks like you are just exporting the statistics taht are already
through normal path. The purpose of ethtool stats is to provide
statistics unique to the device, not to repeat what is available throug
ip, ifconfig, etc.