openvswitch: Use flow hash during flow lookup operation.
authorPravin B Shelar <pshelar@nicira.com>
Wed, 30 Oct 2013 06:10:58 +0000 (23:10 -0700)
committerJesse Gross <jesse@nicira.com>
Sat, 2 Nov 2013 01:43:46 +0000 (18:43 -0700)
Flow->hash can be used to detect hash collisions and avoid flow key
compare in flow lookup.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
net/openvswitch/flow_table.c

index 536b4d2..e425427 100644 (file)
@@ -421,7 +421,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;