[ovs-dev] [PATCH] datapath: Fix double counting of packet stats for Linux devices.

Jesse Gross jesse at nicira.com
Wed Jan 5 16:33:07 UTC 2011


The kernel augments stats for Linux devices that only provide 32-bit stats
with its own internal 64-bit counters.  When doing this it takes the error
stats from the device but uses the packet and byte values from its local
counters.  However, we were also taking the packet and byte counts from
the device, leading to double counting.

Problem introduced by commit ec61a01cd8ed73b13ffe042ddff4baf41f6b63e7
'datapath: Use "struct rtnl_link_stats64" instead of "struct odp_vport_stats".'.

Bug #4327

Reported-by: Krishna Miriyala <krishna at nicira.com>
Signed-off-by: Jesse Gross <jesse at nicira.com>
---
 datapath/vport.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/datapath/vport.c b/datapath/vport.c
index a3244a3..d7330f8 100644
--- a/datapath/vport.c
+++ b/datapath/vport.c
@@ -833,10 +833,6 @@ int vport_get_stats(struct vport *vport, struct rtnl_link_stats64 *stats)
 		spin_unlock_bh(&vport->stats_lock);
 
 		if (dev_statsp) {
-			stats->rx_packets          += dev_statsp->rx_packets;
-			stats->tx_packets          += dev_statsp->tx_packets;
-			stats->rx_bytes            += dev_statsp->rx_bytes;
-			stats->tx_bytes            += dev_statsp->tx_bytes;
 			stats->rx_errors           += dev_statsp->rx_errors;
 			stats->tx_errors           += dev_statsp->tx_errors;
 			stats->rx_dropped          += dev_statsp->rx_dropped;
-- 
1.7.1





More information about the dev mailing list