[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALnjE+r1RA-20SE_h=uTYQyuKAFbohkHM9L9PtqgK2FZQKhASA@mail.gmail.com>
Date: Thu, 24 Dec 2015 14:36:32 -0800
From: Pravin Shelar <pshelar@...ira.com>
To: Nicolas Dichtel <nicolas.dichtel@...nd.com>
Cc: netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next v2] ip_tunnel: Move stats update to iptunnel_xmit()
On Thu, Dec 24, 2015 at 1:14 AM, Nicolas Dichtel
<nicolas.dichtel@...nd.com> wrote:
> Le 24/12/2015 00:52, Pravin B Shelar a écrit :
> [snip]
>>
>> @@ -83,22 +84,12 @@ int ip6_tnl_get_iflink(const struct net_device *dev);
>> static inline void ip6tunnel_xmit(struct sock *sk, struct sk_buff *skb,
>> struct net_device *dev)
>> {
>> - struct net_device_stats *stats = &dev->stats;
>> int pkt_len, err;
>>
>> pkt_len = skb->len - skb_inner_network_offset(skb);
>> err = ip6_local_out(dev_net(skb_dst(skb)->dev), sk, skb);
>> -
>> - if (net_xmit_eval(err) == 0) {
>> - struct pcpu_sw_netstats *tstats =
>> get_cpu_ptr(dev->tstats);
>> - u64_stats_update_begin(&tstats->syncp);
>> - tstats->tx_bytes += pkt_len;
>> - tstats->tx_packets++;
>> - u64_stats_update_end(&tstats->syncp);
>> - put_cpu_ptr(tstats);
>> - } else {
>> - stats->tx_errors++;
>> - stats->tx_aborted_errors++;
>> - }
>> + if (likely(!net_xmit_eval(err)))
>> + err = pkt_len;
>> + iptunnel_xmit_stats(dev, err);
>
> I don't think this is an equivalent change.
> For example, if err == NET_XMIT_DROP, then '!net_xmit_eval(err)' is false
> and
> iptunnel_xmit_stats() is called with err set to a positive value
> (NET_XMIT_DROP
> value is 0x01), ie not an error.
I have sent out updated patch handle it correctly.
Thanks.
--
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