Skip to content

Commit 8ddd094

Browse files
Pravin B Shelarjessegross
authored andcommitted
openvswitch: 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 <pshelar@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com>
1 parent 5eb26b1 commit 8ddd094

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/openvswitch/flow_table.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ static struct sw_flow *masked_flow_lookup(struct table_instance *ti,
421421
hash = flow_hash(&masked_key, key_start, key_end);
422422
head = find_bucket(ti, hash);
423423
hlist_for_each_entry_rcu(flow, head, hash_node[ti->node_ver]) {
424-
if (flow->mask == mask &&
424+
if (flow->mask == mask && flow->hash == hash &&
425425
flow_cmp_masked_key(flow, &masked_key,
426426
key_start, key_end))
427427
return flow;

0 commit comments

Comments
 (0)