From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Pravin B Shelar <pshelar@nicira.com>, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v2] ip_tunnel: Move stats update to iptunnel_xmit()
Date: Thu, 24 Dec 2015 10:14:02 +0100 [thread overview]
Message-ID: <567BB75A.5040408@6wind.com> (raw)
In-Reply-To: <1450914723-16452-1-git-send-email-pshelar@nicira.com>
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.
next prev parent reply other threads:[~2015-12-24 9:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 23:52 [PATCH net-next v2] ip_tunnel: Move stats update to iptunnel_xmit() Pravin B Shelar
2015-12-24 2:57 ` David Miller
2015-12-24 4:37 ` Pravin Shelar
2015-12-24 9:03 ` Nicolas Dichtel
2015-12-24 9:14 ` Nicolas Dichtel [this message]
2015-12-24 22:36 ` Pravin Shelar
2015-12-24 9:21 ` Nicolas Dichtel
2015-12-24 12:46 ` Thadeu Lima de Souza Cascardo
2015-12-24 14:17 ` Nicolas Dichtel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=567BB75A.5040408@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=netdev@vger.kernel.org \
--cc=pshelar@nicira.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).