ofproto: Iterate through exact-match rules first during expiration.
[sliver-openvswitch.git] / ofproto / ofproto.c
index be89dd2..750c50b 100644 (file)
@@ -4221,9 +4221,13 @@ ofproto_expire(struct ofproto *ofproto)
     /* Update 'used' for each flow in the datapath. */
     ofproto_update_used(ofproto);
 
-    /* Expire idle flows. */
+    /* Expire idle flows.
+     *
+     * A wildcarded flow is idle only when all of its subrules have expired due
+     * to becoming idle, so iterate through the exact-match flows first. */
     cbdata.ofproto = ofproto;
-    classifier_for_each(&ofproto->cls, CLS_INC_ALL, rule_expire, &cbdata);
+    classifier_for_each(&ofproto->cls, CLS_INC_EXACT, rule_expire, &cbdata);
+    classifier_for_each(&ofproto->cls, CLS_INC_WILD, rule_expire, &cbdata);
 
     /* Let the hook know that we're at a stable point: all outstanding data
      * in existing flows has been accounted to the account_cb.  Thus, the
@@ -4302,10 +4306,6 @@ rule_active_timeout(struct ofproto *ofproto, struct rule *rule)
         expired.used = rule->used;
 
         netflow_expire(ofproto->netflow, &rule->nf_flow, &expired);
-
-        /* Schedule us to send the accumulated records once we have
-         * collected all of them. */
-        poll_immediate_wake();
     }
 }