]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ip_tunnel: Report Rx dropped in ip_tunnel_get_stats64
authorAlexander Duyck <alexander.h.duyck@redhat.com>
Thu, 14 May 2015 21:31:28 +0000 (14:31 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 May 2015 02:30:54 +0000 (22:30 -0400)
The rx_dropped stat wasn't being reported when ip_tunnel_get_stats64 was
called.  This was leading to some confusing results in my debug as I was
seeing rx_errors increment but no other value which pointed me toward the
type of error being seen.

This change corrects that by using netdev_stats_to_stats64 to copy all
available dev stats instead of just the few that were hand picked.

Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_tunnel_core.c

index 3998b1822d8521ad391ac26db1e694a3cd7ad011..6a51a71a6c67a0f3e48523a37e3b559306885de9 100644 (file)
@@ -165,6 +165,8 @@ struct rtnl_link_stats64 *ip_tunnel_get_stats64(struct net_device *dev,
 {
        int i;
 
+       netdev_stats_to_stats64(tot, &dev->stats);
+
        for_each_possible_cpu(i) {
                const struct pcpu_sw_netstats *tstats =
                                                   per_cpu_ptr(dev->tstats, i);
@@ -185,22 +187,6 @@ struct rtnl_link_stats64 *ip_tunnel_get_stats64(struct net_device *dev,
                tot->tx_bytes   += tx_bytes;
        }
 
-       tot->multicast = dev->stats.multicast;
-
-       tot->rx_crc_errors = dev->stats.rx_crc_errors;
-       tot->rx_fifo_errors = dev->stats.rx_fifo_errors;
-       tot->rx_length_errors = dev->stats.rx_length_errors;
-       tot->rx_frame_errors = dev->stats.rx_frame_errors;
-       tot->rx_errors = dev->stats.rx_errors;
-
-       tot->tx_fifo_errors = dev->stats.tx_fifo_errors;
-       tot->tx_carrier_errors = dev->stats.tx_carrier_errors;
-       tot->tx_dropped = dev->stats.tx_dropped;
-       tot->tx_aborted_errors = dev->stats.tx_aborted_errors;
-       tot->tx_errors = dev->stats.tx_errors;
-
-       tot->collisions  = dev->stats.collisions;
-
        return tot;
 }
 EXPORT_SYMBOL_GPL(ip_tunnel_get_stats64);