ofproto: Datapath statistics accounted twice.
authorEthan Jackson <ethan@nicira.com>
Wed, 18 May 2011 18:52:08 +0000 (11:52 -0700)
committerEthan Jackson <ethan@nicira.com>
Wed, 18 May 2011 18:52:08 +0000 (11:52 -0700)
Due to an error introduced in  Commit 6f1435f "ofproto: Resubmit
statistics improperly account during failover." Flow statistics
could be double accounted when removed from the datapath.

Reported-by: KK Yap <yapkke@stanford.edu>
ofproto/ofproto.c

index bc900dadff928f9a3e12e8b6072a48f2223c95b9..ee59cd02dd24259fe139a3368f6a39ffb1bd4f3e 100644 (file)
@@ -1744,8 +1744,8 @@ facet_is_controller_flow(struct facet *facet)
 static void
 facet_reset_dp_stats(struct facet *facet, struct dpif_flow_stats *stats)
 {
-    if (stats && facet->dp_packet_count < stats->n_packets
-        && facet->dp_byte_count < stats->n_bytes) {
+    if (stats && facet->dp_packet_count <= stats->n_packets
+        && facet->dp_byte_count <= stats->n_bytes) {
         stats->n_packets -= facet->dp_packet_count;
         stats->n_bytes -= facet->dp_byte_count;
     }