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 <pshe...@nicira.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 majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html