On Wed, Dec 23, 2015 at 1:49 AM, Nicolas Dichtel
<nicolas.dich...@6wind.com> wrote:
> 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.

I wanted to unify all ip_out() error stats under single count, But now
I think it is better to separate that change into another patch. I
will send updated patch without this change.
--
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

Reply via email to