diff options
author | Pravin B Shelar <pshelar@nicira.com> | 2013-03-25 10:50:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-26 12:27:19 -0400 |
commit | f61dd388a9b76f273bb0de9786600fd64e34ba09 (patch) | |
tree | 8487c6d6f12951178a093c95bf72d6a7915884c6 /net/ipv6/sit.c | |
parent | 206aaafcd279e2cb836d772282517540c6cb3814 (diff) |
Tunneling: use IP Tunnel stats APIs.
Use common function get calculate rtnl_link_stats64 stats.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/sit.c')
-rw-r--r-- | net/ipv6/sit.c | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index ee4fc570cf2c..335363478bbf 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -87,41 +87,6 @@ struct sit_net { | |||
87 | struct net_device *fb_tunnel_dev; | 87 | struct net_device *fb_tunnel_dev; |
88 | }; | 88 | }; |
89 | 89 | ||
90 | static struct rtnl_link_stats64 *ipip6_get_stats64(struct net_device *dev, | ||
91 | struct rtnl_link_stats64 *tot) | ||
92 | { | ||
93 | int i; | ||
94 | |||
95 | for_each_possible_cpu(i) { | ||
96 | const struct pcpu_tstats *tstats = per_cpu_ptr(dev->tstats, i); | ||
97 | u64 rx_packets, rx_bytes, tx_packets, tx_bytes; | ||
98 | unsigned int start; | ||
99 | |||
100 | do { | ||
101 | start = u64_stats_fetch_begin_bh(&tstats->syncp); | ||
102 | rx_packets = tstats->rx_packets; | ||
103 | tx_packets = tstats->tx_packets; | ||
104 | rx_bytes = tstats->rx_bytes; | ||
105 | tx_bytes = tstats->tx_bytes; | ||
106 | } while (u64_stats_fetch_retry_bh(&tstats->syncp, start)); | ||
107 | |||
108 | tot->rx_packets += rx_packets; | ||
109 | tot->tx_packets += tx_packets; | ||
110 | tot->rx_bytes += rx_bytes; | ||
111 | tot->tx_bytes += tx_bytes; | ||
112 | } | ||
113 | |||
114 | tot->rx_errors = dev->stats.rx_errors; | ||
115 | tot->rx_frame_errors = dev->stats.rx_frame_errors; | ||
116 | tot->tx_fifo_errors = dev->stats.tx_fifo_errors; | ||
117 | tot->tx_carrier_errors = dev->stats.tx_carrier_errors; | ||
118 | tot->tx_dropped = dev->stats.tx_dropped; | ||
119 | tot->tx_aborted_errors = dev->stats.tx_aborted_errors; | ||
120 | tot->tx_errors = dev->stats.tx_errors; | ||
121 | |||
122 | return tot; | ||
123 | } | ||
124 | |||
125 | /* | 90 | /* |
126 | * Must be invoked with rcu_read_lock | 91 | * Must be invoked with rcu_read_lock |
127 | */ | 92 | */ |
@@ -1202,7 +1167,7 @@ static const struct net_device_ops ipip6_netdev_ops = { | |||
1202 | .ndo_start_xmit = ipip6_tunnel_xmit, | 1167 | .ndo_start_xmit = ipip6_tunnel_xmit, |
1203 | .ndo_do_ioctl = ipip6_tunnel_ioctl, | 1168 | .ndo_do_ioctl = ipip6_tunnel_ioctl, |
1204 | .ndo_change_mtu = ipip6_tunnel_change_mtu, | 1169 | .ndo_change_mtu = ipip6_tunnel_change_mtu, |
1205 | .ndo_get_stats64= ipip6_get_stats64, | 1170 | .ndo_get_stats64 = ip_tunnel_get_stats64, |
1206 | }; | 1171 | }; |
1207 | 1172 | ||
1208 | static void ipip6_dev_free(struct net_device *dev) | 1173 | static void ipip6_dev_free(struct net_device *dev) |