aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_tunnel.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-05-21 17:17:05 -0400
committerDavid S. Miller <davem@davemloft.net>2008-05-21 17:17:05 -0400
commit3dca02af38c11a970160387ab36ae6043feb03cd (patch)
treea0c9137d43f2c18bce71e34e5ae745ebe521c4ff /net/ipv6/ip6_tunnel.c
parentf56dd017c32e759bbdc88ee59d3f76235d720788 (diff)
ip6tnl: Use on-device stats instead of private ones.
This tunnel uses its own private structure and requires separate patch to switch from private stats to on-device ones. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_tunnel.c')
-rw-r--r--net/ipv6/ip6_tunnel.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 2bda3ba100b1..37814810ac49 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -711,7 +711,7 @@ static int ip6_tnl_rcv(struct sk_buff *skb, __u16 protocol,
711 } 711 }
712 712
713 if (!ip6_tnl_rcv_ctl(t)) { 713 if (!ip6_tnl_rcv_ctl(t)) {
714 t->stat.rx_dropped++; 714 t->dev->stats.rx_dropped++;
715 read_unlock(&ip6_tnl_lock); 715 read_unlock(&ip6_tnl_lock);
716 goto discard; 716 goto discard;
717 } 717 }
@@ -728,8 +728,8 @@ static int ip6_tnl_rcv(struct sk_buff *skb, __u16 protocol,
728 728
729 dscp_ecn_decapsulate(t, ipv6h, skb); 729 dscp_ecn_decapsulate(t, ipv6h, skb);
730 730
731 t->stat.rx_packets++; 731 t->dev->stats.rx_packets++;
732 t->stat.rx_bytes += skb->len; 732 t->dev->stats.rx_bytes += skb->len;
733 netif_rx(skb); 733 netif_rx(skb);
734 read_unlock(&ip6_tnl_lock); 734 read_unlock(&ip6_tnl_lock);
735 return 0; 735 return 0;
@@ -849,7 +849,7 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
849 __u32 *pmtu) 849 __u32 *pmtu)
850{ 850{
851 struct ip6_tnl *t = netdev_priv(dev); 851 struct ip6_tnl *t = netdev_priv(dev);
852 struct net_device_stats *stats = &t->stat; 852 struct net_device_stats *stats = &t->dev->stats;
853 struct ipv6hdr *ipv6h = ipv6_hdr(skb); 853 struct ipv6hdr *ipv6h = ipv6_hdr(skb);
854 struct ipv6_tel_txoption opt; 854 struct ipv6_tel_txoption opt;
855 struct dst_entry *dst; 855 struct dst_entry *dst;
@@ -1043,11 +1043,11 @@ static int
1043ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev) 1043ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
1044{ 1044{
1045 struct ip6_tnl *t = netdev_priv(dev); 1045 struct ip6_tnl *t = netdev_priv(dev);
1046 struct net_device_stats *stats = &t->stat; 1046 struct net_device_stats *stats = &t->dev->stats;
1047 int ret; 1047 int ret;
1048 1048
1049 if (t->recursion++) { 1049 if (t->recursion++) {
1050 t->stat.collisions++; 1050 stats->collisions++;
1051 goto tx_err; 1051 goto tx_err;
1052 } 1052 }
1053 1053
@@ -1289,19 +1289,6 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1289} 1289}
1290 1290
1291/** 1291/**
1292 * ip6_tnl_get_stats - return the stats for tunnel device
1293 * @dev: virtual device associated with tunnel
1294 *
1295 * Return: stats for device
1296 **/
1297
1298static struct net_device_stats *
1299ip6_tnl_get_stats(struct net_device *dev)
1300{
1301 return &(((struct ip6_tnl *)netdev_priv(dev))->stat);
1302}
1303
1304/**
1305 * ip6_tnl_change_mtu - change mtu manually for tunnel device 1292 * ip6_tnl_change_mtu - change mtu manually for tunnel device
1306 * @dev: virtual device associated with tunnel 1293 * @dev: virtual device associated with tunnel
1307 * @new_mtu: the new mtu 1294 * @new_mtu: the new mtu
@@ -1334,7 +1321,6 @@ static void ip6_tnl_dev_setup(struct net_device *dev)
1334 dev->uninit = ip6_tnl_dev_uninit; 1321 dev->uninit = ip6_tnl_dev_uninit;
1335 dev->destructor = free_netdev; 1322 dev->destructor = free_netdev;
1336 dev->hard_start_xmit = ip6_tnl_xmit; 1323 dev->hard_start_xmit = ip6_tnl_xmit;
1337 dev->get_stats = ip6_tnl_get_stats;
1338 dev->do_ioctl = ip6_tnl_ioctl; 1324 dev->do_ioctl = ip6_tnl_ioctl;
1339 dev->change_mtu = ip6_tnl_change_mtu; 1325 dev->change_mtu = ip6_tnl_change_mtu;
1340 1326