An upcoming commit will add more interesting uses.
{
struct cls_table *table;
- HMAP_FOR_EACH_IN_BUCKET (table, hmap_node, flow_wildcards_hash(wc),
+ HMAP_FOR_EACH_IN_BUCKET (table, hmap_node, flow_wildcards_hash(wc, 0),
&cls->tables) {
if (flow_wildcards_equal(wc, &table->wc)) {
return table;
table = xzalloc(sizeof *table);
hmap_init(&table->rules);
table->wc = *wc;
- hmap_insert(&cls->tables, &table->hmap_node, flow_wildcards_hash(wc));
+ hmap_insert(&cls->tables, &table->hmap_node, flow_wildcards_hash(wc, 0));
return table;
}
/* Returns a hash of the wildcards in 'wc'. */
uint32_t
-flow_wildcards_hash(const struct flow_wildcards *wc)
+flow_wildcards_hash(const struct flow_wildcards *wc, uint32_t basis)
{
/* If you change struct flow_wildcards and thereby trigger this
* assertion, please check that the new struct flow_wildcards has no holes
* in it before you update the assertion. */
BUILD_ASSERT_DECL(sizeof *wc == 56 + FLOW_N_REGS * 4);
- return hash_bytes(wc, sizeof *wc, 0);
+ return hash_bytes(wc, sizeof *wc, basis);
}
/* Returns true if 'a' and 'b' represent the same wildcards, false if they are
bool flow_wildcards_has_extra(const struct flow_wildcards *,
const struct flow_wildcards *);
-uint32_t flow_wildcards_hash(const struct flow_wildcards *);
+uint32_t flow_wildcards_hash(const struct flow_wildcards *, uint32_t basis);
bool flow_wildcards_equal(const struct flow_wildcards *,
const struct flow_wildcards *);
uint32_t flow_hash_symmetric_l4(const struct flow *flow, uint32_t basis);