From: Ethan Jackson Date: Wed, 18 May 2011 18:52:08 +0000 (-0700) Subject: ofproto: Datapath statistics accounted twice. X-Git-Tag: v1.2.0~330 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;ds=sidebyside;h=827ab71c97f25b77c94a1158834cdad35df6806f;p=sliver-openvswitch.git 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 bc900dadf..ee59cd02d 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; }