Subject: Re: [PATCH net-next] ip_tunnel: Move stats update to iptunnel_xmit()

From: Nicolas Dichtel <[email-masked]>
Date: Wed, 23 Dec 2015 10:49:07 +0100

Le 22/12/2015 01:34, Pravin B Shelar a écrit :
> By moving stats update into iptunnel_xmit(), we can simplify
> iptunnel_xmit() usage. With this change there is no need to
> call another function (iptunnel_xmit_stats()) to update stats
> in tunnel xmit code path.
>
> Signed-off-by: Pravin B Shelar <[email-masked]>
> ---
[snip]
> +static inline void iptunnel_xmit_stats(struct net_device *dev, int err)
>   {
>   	if (err > 0) {
> -		struct pcpu_sw_netstats *tstats = get_cpu_ptr(stats);
> +		struct pcpu_sw_netstats *tstats = get_cpu_ptr(dev->tstats);
>
>   		u64_stats_update_begin(&tstats->syncp);
>   		tstats->tx_bytes += err;
>   		tstats->tx_packets++;
>   		u64_stats_update_end(&tstats->syncp);
>   		put_cpu_ptr(tstats);
> -	} else if (err < 0) {
> +	} else {
> +		struct net_device_stats *err_stats = &dev->stats;
> +
>   		err_stats->tx_errors++;
>   		err_stats->tx_aborted_errors++;
> -	} else {
> -		err_stats->tx_dropped++;
>   	}
>   }
Why do you remove the case 'err == 0'?
At least, it needs an explanation in the commit log.