From: Pravin B Shelar Date: Wed, 30 Oct 2013 16:43:49 +0000 (-0700) Subject: datapath: Use flow hash during flow lookup operation. X-Git-Tag: sliver-openvswitch-2.0.90-1~6^2~53 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=61ed018a6bb5e8857a285ea391a028c38c766846 datapath: Use flow hash during flow lookup operation. Flow->hash can be used to detect hash collisions and avoid flow key compare in flow lookup. Signed-off-by: Pravin B Shelar Acked-by: Jesse Gross --- diff --git a/datapath/flow_table.c b/datapath/flow_table.c index c2a7aa5b6..ddb14dae3 100644 --- a/datapath/flow_table.c +++ b/datapath/flow_table.c @@ -426,7 +426,7 @@ static struct sw_flow *masked_flow_lookup(struct table_instance *ti, hash = flow_hash(&masked_key, key_start, key_end); head = find_bucket(ti, hash); hlist_for_each_entry_rcu(flow, head, hash_node[ti->node_ver]) { - if (flow->mask == mask && + if (flow->mask == mask && flow->hash == hash && flow_cmp_masked_key(flow, &masked_key, key_start, key_end)) return flow;