From: Joe Stringer Date: Wed, 21 May 2014 02:49:04 +0000 (+1200) Subject: revalidator: Re-fix a flow duplication bug. X-Git-Tag: v2.3~87 X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=bce634855419fd6e9462500f786ed9aa100bdc2d 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 --- 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); }