summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2011-02-24 13:53:02 -0800
committerEthan Jackson <ethan@nicira.com>2011-02-24 14:33:16 -0800
commita2c6a63cc06f4edbce32b6ae5f500b89b3dcd1a6 (patch)
tree6a503a8ec38cf21d95614e5050efa051c5f95d5b /ofproto
parent5e1b32141734bf944c63de8ab15538135bf3f8fd (diff)
downloadopenvswitch-a2c6a63cc06f4edbce32b6ae5f500b89b3dcd1a6.tar.gz
ofproto: Guarantee uninstalled facets have no dp_packet_count.
facet_push_stats() implicitly assumes that uninstalled facets have no dp_[packet|byte]_count. This commit guarantees and enforces this invariant. Bug #4732.
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 456dcb197..61d08ea48 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -1526,6 +1526,8 @@ ofproto_flush_flows(struct ofproto *ofproto)
* individually since we are about to blow away all the facets with
* dpif_flow_flush(). */
facet->installed = false;
+ facet->dp_packet_count = 0;
+ facet->dp_byte_count = 0;
facet_remove(ofproto, facet);
}
@@ -2401,6 +2403,9 @@ facet_uninstall(struct ofproto *p, struct facet *facet)
facet->installed = false;
facet->dp_packet_count = 0;
facet->dp_byte_count = 0;
+ } else {
+ assert(facet->dp_packet_count == 0);
+ assert(facet->dp_byte_count == 0);
}
}