When process_upcall() passes a miss upcall to upcall_xlate(), the new
ukey's dump_seq member is initialized from the current dump_seq.  Later,
when udpif_revalidator() calls revalidate(), any dumped flow for which
ukey->dump_seq equals the current dump_seq is skipped.  However, until now
the current dump_seq was only incremented *after* a revalidation run is
completed.  That means that, if a ukey added is added between revalidation
runs, it will be skipped on the subsequent revalidation run.  This commit
fixes the problem by incrementing dump_seq just before a revalidation run
instead of just after.

Found with OFTest pktact.SingleWildcardMatchPriority test for OpenFlow 1.0.

CC: Joe Stringer <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
---
This is messing about in code I don't fully understand.  It really needs
critical review from an expert.

diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 3f5b5e8..8d533d0 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -759,10 +759,9 @@ udpif_revalidator(void *arg)
 
             start_time = time_msec();
             if (!udpif->reval_exit) {
-                bool terse_dump;
-
-                terse_dump = udpif_use_ufid(udpif);
-                udpif->dump = dpif_flow_dump_create(udpif->dpif, terse_dump);
+                seq_change(udpif->dump_seq);
+                udpif->dump = dpif_flow_dump_create(udpif->dpif,
+                                                    udpif_use_ufid(udpif));
             }
         }
 
@@ -787,7 +786,6 @@ udpif_revalidator(void *arg)
             atomic_read_relaxed(&udpif->flow_limit, &flow_limit);
 
             dpif_flow_dump_destroy(udpif->dump);
-            seq_change(udpif->dump_seq);
 
             duration = MAX(time_msec() - start_time, 1);
             udpif->dump_duration = duration;
-- 
2.1.3

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to