ofproto-dpif: Avoid unnecessarily counting packets.
authorBen Pfaff <blp@nicira.com>
Mon, 16 Sep 2013 18:24:30 +0000 (11:24 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 17 Sep 2013 20:47:43 +0000 (13:47 -0700)
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
ofproto/ofproto-dpif.c

index 01299e1..80874b8 100644 (file)
@@ -3241,7 +3241,7 @@ flow_miss_should_make_facet(struct flow_miss *miss)
 
     hash = flow_hash_in_wildcards(&miss->flow, &miss->xout.wc, 0);
     return governor_should_install_flow(backer->governor, hash,
-                                        list_size(&miss->upcalls));
+                                        miss->stats.n_packets);
 }
 
 /* Handles 'miss', which matches 'facet'.  May add any required datapath
@@ -3319,7 +3319,7 @@ handle_flow_miss(struct flow_miss *miss, struct flow_miss_op *ops,
 {
     struct facet *facet;
 
-    miss->ofproto->n_missed += list_size(&miss->upcalls);
+    miss->ofproto->n_missed += miss->stats.n_packets;
 
     facet = facet_lookup_valid(miss->ofproto, &miss->flow);
     if (!facet) {