* [net-next PATCH v3] ip_tunnel: Report Rx dropped in ip_tunnel_get_stats64
@ 2015-05-14 21:31 Alexander Duyck
2015-05-14 21:55 ` Eric Dumazet
2015-05-15 2:33 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Alexander Duyck @ 2015-05-14 21:31 UTC (permalink / raw)
To: netdev; +Cc: davem, eric.dumazet
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>
---
v2: Replaced manual copy with netdev_stats_to_stats64
v3: Moved netdev_stats_to_stats64 to start of function to avoid overwriting
stats updated in for_each_possible_cpu loop.
net/ipv4/ip_tunnel_core.c | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c
index 3998b1822d85..6a51a71a6c67 100644
--- a/net/ipv4/ip_tunnel_core.c
+++ b/net/ipv4/ip_tunnel_core.c
@@ -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);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [net-next PATCH v3] ip_tunnel: Report Rx dropped in ip_tunnel_get_stats64
2015-05-14 21:31 [net-next PATCH v3] ip_tunnel: Report Rx dropped in ip_tunnel_get_stats64 Alexander Duyck
@ 2015-05-14 21:55 ` Eric Dumazet
2015-05-15 2:33 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2015-05-14 21:55 UTC (permalink / raw)
To: Alexander Duyck; +Cc: netdev, davem
On Thu, 2015-05-14 at 14:31 -0700, Alexander Duyck wrote:
> 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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [net-next PATCH v3] ip_tunnel: Report Rx dropped in ip_tunnel_get_stats64
2015-05-14 21:31 [net-next PATCH v3] ip_tunnel: Report Rx dropped in ip_tunnel_get_stats64 Alexander Duyck
2015-05-14 21:55 ` Eric Dumazet
@ 2015-05-15 2:33 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-05-15 2:33 UTC (permalink / raw)
To: alexander.h.duyck; +Cc: netdev, eric.dumazet
From: Alexander Duyck <alexander.h.duyck@redhat.com>
Date: Thu, 14 May 2015 14:31:28 -0700
> 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>
Applied, thanks Alexander.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-15 2:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-14 21:31 [net-next PATCH v3] ip_tunnel: Report Rx dropped in ip_tunnel_get_stats64 Alexander Duyck
2015-05-14 21:55 ` Eric Dumazet
2015-05-15 2:33 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).