[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <567A6E13.3080909@6wind.com>
Date: Wed, 23 Dec 2015 10:49:07 +0100
From: Nicolas Dichtel <nicolas.dichtel@...nd.com>
To: Pravin B Shelar <pshelar@...ira.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] ip_tunnel: Move stats update to iptunnel_xmit()
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 <pshelar@...ira.com>
> ---
[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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists