Skip to content

Commit bb10745

Browse files
Haishuang Yandavem330
authored andcommitted
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>
1 parent 6e3bf9b commit bb10745

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

net/ipv6/ip6_vti.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -503,17 +503,9 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
503503
skb->dev = skb_dst(skb)->dev;
504504

505505
err = dst_output(t->net, skb->sk, skb);
506-
if (net_xmit_eval(err) == 0) {
507-
struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);
508-
509-
u64_stats_update_begin(&tstats->syncp);
510-
tstats->tx_bytes += pkt_len;
511-
tstats->tx_packets++;
512-
u64_stats_update_end(&tstats->syncp);
513-
} else {
514-
stats->tx_errors++;
515-
stats->tx_aborted_errors++;
516-
}
506+
if (net_xmit_eval(err) == 0)
507+
err = pkt_len;
508+
iptunnel_xmit_stats(dev, err);
517509

518510
return 0;
519511
tx_err_link_failure:

0 commit comments

Comments
 (0)