From: root Date: Fri, 23 May 2008 04:38:16 +0000 (-0700) Subject: - When deleting an entry, remove the entry from "iter_node" as well as "node". X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10d1259a9b1b7af863175464c81a682b79fe08dc;p=openvswitch - When deleting an entry, remove the entry from "iter_node" as well as "node". - Clean code up a bit to make it more consistent. --- diff --git a/datapath/hwtable-dummy/hwtable-dummy.c b/datapath/hwtable-dummy/hwtable-dummy.c index c643a4bc..cb7516f9 100644 --- a/datapath/hwtable-dummy/hwtable-dummy.c +++ b/datapath/hwtable-dummy/hwtable-dummy.c @@ -133,6 +133,7 @@ static int do_delete(struct sw_table *swt, struct sw_flow *flow) { if (flow_del(flow)) { list_del_rcu(&flow->node); + list_del_rcu(&flow->iter_node); table_dummy_flow_deferred_free(flow); return 1; } @@ -164,7 +165,7 @@ static int table_dummy_timeout(struct datapath *dp, struct sw_table *swt) struct sw_flow_dummy *sfw, *n; int del_count = 0; uint64_t packet_count = 0; - int i=0; + int i = 0; list_for_each_entry_rcu (flow, &td->flows, node) { /* xxx Retrieve the packet count associated with this entry @@ -280,7 +281,9 @@ static struct sw_table *table_dummy_create(void) td->max_flows = DUMMY_MAX_FLOW; atomic_set(&td->n_flows, 0); INIT_LIST_HEAD(&td->flows); + INIT_LIST_HEAD(&td->iter_flows); spin_lock_init(&td->lock); + tl->next_serial = 0 INIT_LIST_HEAD(&pending_free_list); spin_lock_init(&pending_free_lock);