Flow->hash can be used to detect hash collisions and avoid flow key compare in flow lookup.
Unified · Split
| @@ -421,7 +421,7 @@ static struct sw_flow *masked_flow_lookup(struct table_instance *ti, · 420 unmodified lines | |||
| 421 | hash = flow_hash(&masked_key, key_start, key_end); | 421 | hash = flow_hash(&masked_key, key_start, key_end); |
| 422 | head = find_bucket(ti, hash); | 422 | head = find_bucket(ti, hash); |
| 423 | hlist_for_each_entry_rcu(flow, head, hash_node[ti->node_ver]) { | 423 | 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 && |
| 425 | flow_cmp_masked_key(flow, &masked_key, | 425 | flow_cmp_masked_key(flow, &masked_key, |
| 426 | key_start, key_end)) | 426 | key_start, key_end)) |
| 427 | return flow; | 427 | return flow; |