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/ipv4 | |
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/ipv4')
-rw-r--r-- | net/ipv4/Kconfig | 1 | ||||
-rw-r--r-- | net/ipv4/ip_vti.c | 40 |
2 files changed, 2 insertions, 39 deletions
diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig index 053b53e9e3c3..8603ca827104 100644 --- a/net/ipv4/Kconfig +++ b/net/ipv4/Kconfig | |||
@@ -319,6 +319,7 @@ config SYN_COOKIES | |||
319 | config NET_IPVTI | 319 | config NET_IPVTI |
320 | tristate "Virtual (secure) IP: tunneling" | 320 | tristate "Virtual (secure) IP: tunneling" |
321 | select INET_TUNNEL | 321 | select INET_TUNNEL |
322 | select NET_IP_TUNNEL | ||
322 | depends on INET_XFRM_MODE_TUNNEL | 323 | depends on INET_XFRM_MODE_TUNNEL |
323 | ---help--- | 324 | ---help--- |
324 | Tunneling means encapsulating data of one protocol type within | 325 | Tunneling means encapsulating data of one protocol type within |
diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c index 6a628fb3349f..9d2bdb2c1d3f 100644 --- a/net/ipv4/ip_vti.c +++ b/net/ipv4/ip_vti.c | |||
@@ -82,44 +82,6 @@ static int vti_tunnel_bind_dev(struct net_device *dev); | |||
82 | } while (0) | 82 | } while (0) |
83 | 83 | ||
84 | 84 | ||
85 | static struct rtnl_link_stats64 *vti_get_stats64(struct net_device *dev, | ||
86 | struct rtnl_link_stats64 *tot) | ||
87 | { | ||
88 | int i; | ||
89 | |||
90 | for_each_possible_cpu(i) { | ||
91 | const struct pcpu_tstats *tstats = per_cpu_ptr(dev->tstats, i); | ||
92 | u64 rx_packets, rx_bytes, tx_packets, tx_bytes; | ||
93 | unsigned int start; | ||
94 | |||
95 | do { | ||
96 | start = u64_stats_fetch_begin_bh(&tstats->syncp); | ||
97 | rx_packets = tstats->rx_packets; | ||
98 | tx_packets = tstats->tx_packets; | ||
99 | rx_bytes = tstats->rx_bytes; | ||
100 | tx_bytes = tstats->tx_bytes; | ||
101 | } while (u64_stats_fetch_retry_bh(&tstats->syncp, start)); | ||
102 | |||
103 | tot->rx_packets += rx_packets; | ||
104 | tot->tx_packets += tx_packets; | ||
105 | tot->rx_bytes += rx_bytes; | ||
106 | tot->tx_bytes += tx_bytes; | ||
107 | } | ||
108 | |||
109 | tot->multicast = dev->stats.multicast; | ||
110 | tot->rx_crc_errors = dev->stats.rx_crc_errors; | ||
111 | tot->rx_fifo_errors = dev->stats.rx_fifo_errors; | ||
112 | tot->rx_length_errors = dev->stats.rx_length_errors; | ||
113 | tot->rx_errors = dev->stats.rx_errors; | ||
114 | tot->tx_fifo_errors = dev->stats.tx_fifo_errors; | ||
115 | tot->tx_carrier_errors = dev->stats.tx_carrier_errors; | ||
116 | tot->tx_dropped = dev->stats.tx_dropped; | ||
117 | tot->tx_aborted_errors = dev->stats.tx_aborted_errors; | ||
118 | tot->tx_errors = dev->stats.tx_errors; | ||
119 | |||
120 | return tot; | ||
121 | } | ||
122 | |||
123 | static struct ip_tunnel *vti_tunnel_lookup(struct net *net, | 85 | static struct ip_tunnel *vti_tunnel_lookup(struct net *net, |
124 | __be32 remote, __be32 local) | 86 | __be32 remote, __be32 local) |
125 | { | 87 | { |
@@ -597,7 +559,7 @@ static const struct net_device_ops vti_netdev_ops = { | |||
597 | .ndo_start_xmit = vti_tunnel_xmit, | 559 | .ndo_start_xmit = vti_tunnel_xmit, |
598 | .ndo_do_ioctl = vti_tunnel_ioctl, | 560 | .ndo_do_ioctl = vti_tunnel_ioctl, |
599 | .ndo_change_mtu = vti_tunnel_change_mtu, | 561 | .ndo_change_mtu = vti_tunnel_change_mtu, |
600 | .ndo_get_stats64 = vti_get_stats64, | 562 | .ndo_get_stats64 = ip_tunnel_get_stats64, |
601 | }; | 563 | }; |
602 | 564 | ||
603 | static void vti_dev_free(struct net_device *dev) | 565 | static void vti_dev_free(struct net_device *dev) |