From bce634855419fd6e9462500f786ed9aa100bdc2d Mon Sep 17 00:00:00 2001 From: Joe Stringer Date: Wed, 21 May 2014 14:49:04 +1200 Subject: [PATCH] revalidator: Re-fix a flow duplication bug. 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 Acked-by: Alex Wang --- ofproto/ofproto-dpif-upcall.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index 193f4cd4f..64444d9ef 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -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); } -- 2.20.1