X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fofproto.c;h=45621e9626942ff625888b867dbe040e1db4da7a;hb=6d56c1f19fe9facea0eabc4a39ad01cfc8d7971d;hp=e691bb93d5497066bff9756ff7f76b8a1c9fac34;hpb=c76f25b5bc5b9856a2fa243bc48e4e5763029f4f;p=sliver-openvswitch.git diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index e691bb93d..45621e962 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -1451,19 +1451,23 @@ ofproto_run(struct ofproto *p) } ovs_mutex_lock(&ofproto_mutex); - HEAP_FOR_EACH (evg, size_node, &table->eviction_groups_by_size) { - heap_rebuild(&evg->rules); - } - fat_rwlock_rdlock(&table->cls.rwlock); cls_cursor_init(&cursor, &table->cls, NULL); CLS_CURSOR_FOR_EACH (rule, cr, &cursor) { - if (!rule->eviction_group - && (rule->idle_timeout || rule->hard_timeout)) { - eviction_group_add_rule(rule); + if (rule->idle_timeout || rule->hard_timeout) { + if (!rule->eviction_group) { + eviction_group_add_rule(rule); + } else { + heap_raw_change(&rule->evg_node, + rule_eviction_priority(p, rule)); + } } } fat_rwlock_unlock(&table->cls.rwlock); + + HEAP_FOR_EACH (evg, size_node, &table->eviction_groups_by_size) { + heap_rebuild(&evg->rules); + } ovs_mutex_unlock(&ofproto_mutex); } }