From: Jesse Gross Date: Wed, 11 Nov 2009 19:13:37 +0000 (-0800) Subject: ofproto: Update stats for exact match flows before expiration. X-Git-Tag: v0.90.7~10 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=46d6f36f042e5a23d1548ca4d2f1c8eeca9031ca ofproto: Update stats for exact match flows before expiration. When a wildcarded flow is expired we remove all of the subrules to collect their stats before sending a flow expiration message. However, we were only removing exact match flows after the expiration message is composed. This uninstalls it first. CC: David Erickson --- diff --git a/secchan/ofproto.c b/secchan/ofproto.c index 6319b0320..cfaf0cf95 100644 --- a/secchan/ofproto.c +++ b/secchan/ofproto.c @@ -3292,14 +3292,16 @@ expire_rule(struct cls_rule *cls_rule, void *p_) } COVERAGE_INC(ofproto_expired); + + /* Update stats. This code will be a no-op if the rule expired + * due to an idle timeout. */ if (rule->cr.wc.wildcards) { - /* Update stats. (This code will be a no-op if the rule expired - * due to an idle timeout, because in that case the rule has no - * subrules left.) */ struct rule *subrule, *next; LIST_FOR_EACH_SAFE (subrule, next, struct rule, list, &rule->list) { rule_remove(p, subrule); } + } else { + rule_uninstall(p, rule); } send_flow_exp(p, rule, now,