diff options
| author | Pavel Emelyanov <xemul@openvz.org> | 2008-05-21 17:15:46 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2008-05-21 17:15:46 -0400 |
| commit | 4eecc107a85a5882e253bd97310d4e96300a2068 (patch) | |
| tree | 02f079cdcbcf8dd021ad76fbc196cd04e402f9f9 | |
| parent | 50f59cea075875d84018a5fc62cf2f5e6173a919 (diff) | |
sit: Use on-device stats instead of private ones.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | net/ipv6/sit.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 5a6fab95569f..b0ee96187633 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
| @@ -578,13 +578,13 @@ static int ipip6_rcv(struct sk_buff *skb) | |||
| 578 | 578 | ||
| 579 | if ((tunnel->dev->priv_flags & IFF_ISATAP) && | 579 | if ((tunnel->dev->priv_flags & IFF_ISATAP) && |
| 580 | !isatap_chksrc(skb, iph, tunnel)) { | 580 | !isatap_chksrc(skb, iph, tunnel)) { |
| 581 | tunnel->stat.rx_errors++; | 581 | tunnel->dev->stats.rx_errors++; |
| 582 | read_unlock(&ipip6_lock); | 582 | read_unlock(&ipip6_lock); |
| 583 | kfree_skb(skb); | 583 | kfree_skb(skb); |
| 584 | return 0; | 584 | return 0; |
| 585 | } | 585 | } |
| 586 | tunnel->stat.rx_packets++; | 586 | tunnel->dev->stats.rx_packets++; |
| 587 | tunnel->stat.rx_bytes += skb->len; | 587 | tunnel->dev->stats.rx_bytes += skb->len; |
| 588 | skb->dev = tunnel->dev; | 588 | skb->dev = tunnel->dev; |
| 589 | dst_release(skb->dst); | 589 | dst_release(skb->dst); |
| 590 | skb->dst = NULL; | 590 | skb->dst = NULL; |
| @@ -624,7 +624,7 @@ static inline __be32 try_6to4(struct in6_addr *v6dst) | |||
| 624 | static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | 624 | static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) |
| 625 | { | 625 | { |
| 626 | struct ip_tunnel *tunnel = netdev_priv(dev); | 626 | struct ip_tunnel *tunnel = netdev_priv(dev); |
| 627 | struct net_device_stats *stats = &tunnel->stat; | 627 | struct net_device_stats *stats = &tunnel->dev->stats; |
| 628 | struct iphdr *tiph = &tunnel->parms.iph; | 628 | struct iphdr *tiph = &tunnel->parms.iph; |
| 629 | struct ipv6hdr *iph6 = ipv6_hdr(skb); | 629 | struct ipv6hdr *iph6 = ipv6_hdr(skb); |
| 630 | u8 tos = tunnel->parms.iph.tos; | 630 | u8 tos = tunnel->parms.iph.tos; |
| @@ -638,7 +638,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 638 | int addr_type; | 638 | int addr_type; |
| 639 | 639 | ||
| 640 | if (tunnel->recursion++) { | 640 | if (tunnel->recursion++) { |
| 641 | tunnel->stat.collisions++; | 641 | stats->collisions++; |
| 642 | goto tx_error; | 642 | goto tx_error; |
| 643 | } | 643 | } |
| 644 | 644 | ||
| @@ -705,20 +705,20 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 705 | .oif = tunnel->parms.link, | 705 | .oif = tunnel->parms.link, |
| 706 | .proto = IPPROTO_IPV6 }; | 706 | .proto = IPPROTO_IPV6 }; |
| 707 | if (ip_route_output_key(dev_net(dev), &rt, &fl)) { | 707 | if (ip_route_output_key(dev_net(dev), &rt, &fl)) { |
| 708 | tunnel->stat.tx_carrier_errors++; | 708 | stats->tx_carrier_errors++; |
| 709 | goto tx_error_icmp; | 709 | goto tx_error_icmp; |
| 710 | } | 710 | } |
| 711 | } | 711 | } |
| 712 | if (rt->rt_type != RTN_UNICAST) { | 712 | if (rt->rt_type != RTN_UNICAST) { |
| 713 | ip_rt_put(rt); | 713 | ip_rt_put(rt); |
| 714 | tunnel->stat.tx_carrier_errors++; | 714 | stats->tx_carrier_errors++; |
| 715 | goto tx_error_icmp; | 715 | goto tx_error_icmp; |
| 716 | } | 716 | } |
| 717 | tdev = rt->u.dst.dev; | 717 | tdev = rt->u.dst.dev; |
| 718 | 718 | ||
| 719 | if (tdev == dev) { | 719 | if (tdev == dev) { |
| 720 | ip_rt_put(rt); | 720 | ip_rt_put(rt); |
| 721 | tunnel->stat.collisions++; | 721 | stats->collisions++; |
| 722 | goto tx_error; | 722 | goto tx_error; |
| 723 | } | 723 | } |
| 724 | 724 | ||
| @@ -728,7 +728,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 728 | mtu = skb->dst ? dst_mtu(skb->dst) : dev->mtu; | 728 | mtu = skb->dst ? dst_mtu(skb->dst) : dev->mtu; |
| 729 | 729 | ||
| 730 | if (mtu < 68) { | 730 | if (mtu < 68) { |
| 731 | tunnel->stat.collisions++; | 731 | stats->collisions++; |
| 732 | ip_rt_put(rt); | 732 | ip_rt_put(rt); |
| 733 | goto tx_error; | 733 | goto tx_error; |
| 734 | } | 734 | } |
| @@ -1003,11 +1003,6 @@ done: | |||
| 1003 | return err; | 1003 | return err; |
| 1004 | } | 1004 | } |
| 1005 | 1005 | ||
| 1006 | static struct net_device_stats *ipip6_tunnel_get_stats(struct net_device *dev) | ||
| 1007 | { | ||
| 1008 | return &(((struct ip_tunnel*)netdev_priv(dev))->stat); | ||
| 1009 | } | ||
| 1010 | |||
| 1011 | static int ipip6_tunnel_change_mtu(struct net_device *dev, int new_mtu) | 1006 | static int ipip6_tunnel_change_mtu(struct net_device *dev, int new_mtu) |
| 1012 | { | 1007 | { |
| 1013 | if (new_mtu < IPV6_MIN_MTU || new_mtu > 0xFFF8 - sizeof(struct iphdr)) | 1008 | if (new_mtu < IPV6_MIN_MTU || new_mtu > 0xFFF8 - sizeof(struct iphdr)) |
| @@ -1021,7 +1016,6 @@ static void ipip6_tunnel_setup(struct net_device *dev) | |||
| 1021 | dev->uninit = ipip6_tunnel_uninit; | 1016 | dev->uninit = ipip6_tunnel_uninit; |
| 1022 | dev->destructor = free_netdev; | 1017 | dev->destructor = free_netdev; |
| 1023 | dev->hard_start_xmit = ipip6_tunnel_xmit; | 1018 | dev->hard_start_xmit = ipip6_tunnel_xmit; |
| 1024 | dev->get_stats = ipip6_tunnel_get_stats; | ||
| 1025 | dev->do_ioctl = ipip6_tunnel_ioctl; | 1019 | dev->do_ioctl = ipip6_tunnel_ioctl; |
| 1026 | dev->change_mtu = ipip6_tunnel_change_mtu; | 1020 | dev->change_mtu = ipip6_tunnel_change_mtu; |
| 1027 | 1021 | ||
