diff options
author | Haishuang Yan <yanhaishuang@cmss.chinamobile.com> | 2018-08-18 16:43:48 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-18 22:46:54 +0200 |
commit | bb107456ba5a85e50567d56b0c8050c2ad199e9b (patch) | |
tree | 8f7e6dbebebdd52027025a535b802922dd684b46 /net | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf (diff) | |
download | linux-bb107456ba5a85e50567d56b0c8050c2ad199e9b.tar.xz linux-bb107456ba5a85e50567d56b0c8050c2ad199e9b.zip |
ip6_vti: simplify stats handling in vti6_xmit
Same as ip_vti, use iptunnel_xmit_stats to updates stats in tunnel xmit
code path.
Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/ip6_vti.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c index c72ae3a4fe09..65d4a8044cb0 100644 --- a/net/ipv6/ip6_vti.c +++ b/net/ipv6/ip6_vti.c @@ -503,17 +503,9 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl) skb->dev = skb_dst(skb)->dev; err = dst_output(t->net, skb->sk, skb); - if (net_xmit_eval(err) == 0) { - struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats); - - u64_stats_update_begin(&tstats->syncp); - tstats->tx_bytes += pkt_len; - tstats->tx_packets++; - u64_stats_update_end(&tstats->syncp); - } else { - stats->tx_errors++; - stats->tx_aborted_errors++; - } + if (net_xmit_eval(err) == 0) + err = pkt_len; + iptunnel_xmit_stats(dev, err); return 0; tx_err_link_failure: |