From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Pravin B Shelar <pshelar@nicira.com>, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] ip_tunnel: Move stats update to iptunnel_xmit()
Date: Wed, 23 Dec 2015 10:49:07 +0100 [thread overview]
Message-ID: <567A6E13.3080909@6wind.com> (raw)
In-Reply-To: <1450744476-23539-1-git-send-email-pshelar@nicira.com>
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@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.
next prev parent reply other threads:[~2015-12-23 9:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-22 0:34 [PATCH net-next] ip_tunnel: Move stats update to iptunnel_xmit() Pravin B Shelar
2015-12-23 9:49 ` Nicolas Dichtel [this message]
2015-12-23 22:35 ` Pravin Shelar
-- strict thread matches above, loose matches on Subject: below --
2015-12-09 3:22 Pravin B Shelar
2015-12-09 3:41 ` David Miller
2015-12-09 22:53 ` Pravin Shelar
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=567A6E13.3080909@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.