From: Ethan Jackson Date: Wed, 18 May 2011 18:52:08 +0000 (-0700) Subject: ofproto: Datapath statistics accounted twice. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=827ab71c97f25b77c94a1158834cdad35df6806f;p=openvswitch ofproto: Datapath statistics accounted twice. 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 --- diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index bc900dad..ee59cd02 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -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; }