revalidator: Re-fix a flow duplication bug.
authorJoe Stringer <joestringer@nicira.com>
Wed, 21 May 2014 02:49:04 +0000 (14:49 +1200)
committerJoe Stringer <joestringer@nicira.com>
Wed, 21 May 2014 21:16:44 +0000 (09:16 +1200)
Commit 73a3c4757e59 (revalidator: Prevent handling the same flow twice.)
fixed a bug where duplicated flows could be deleted twice. Commit
7d1700980b5d (ofproto-dpif-upcall: Remove the flow_dumper thread.)
partially re-introduced this bug.

The bug would cause the logs to show messages such as
"failed to flow_get (No such file or directory) skb_priority(0),..."
"failed to flow_del (No such file or directory) skb_priority(0),..."

This patch fixes the issue again.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
ofproto/ofproto-dpif-upcall.c

index 193f4cd..64444d9 100644 (file)
@@ -1460,7 +1460,7 @@ revalidate(struct revalidator *revalidator)
         ukey = ukey_lookup(udpif, key, key_len, hash);
 
         used = stats->used;
-        if (!used && ukey) {
+        if (ukey) {
             ovs_mutex_lock(&ukey->mutex);
 
             if (ukey->mark || !ukey->flow_exists) {
@@ -1473,7 +1473,9 @@ revalidate(struct revalidator *revalidator)
                 goto next;
             }
 
-            used = ukey->created;
+            if (!used) {
+                used = ukey->created;
+            }
             ovs_mutex_unlock(&ukey->mutex);
         }