Lines Matching refs:table
114 int ovs_flow_tbl_count(const struct flow_table *table) in ovs_flow_tbl_count() argument
116 return table->count; in ovs_flow_tbl_count()
207 int ovs_flow_tbl_init(struct flow_table *table) in ovs_flow_tbl_init() argument
220 rcu_assign_pointer(table->ti, ti); in ovs_flow_tbl_init()
221 rcu_assign_pointer(table->ufid_ti, ufid_ti); in ovs_flow_tbl_init()
222 INIT_LIST_HEAD(&table->mask_list); in ovs_flow_tbl_init()
223 table->last_rehash = jiffies; in ovs_flow_tbl_init()
224 table->count = 0; in ovs_flow_tbl_init()
225 table->ufid_count = 0; in ovs_flow_tbl_init()
281 void ovs_flow_tbl_destroy(struct flow_table *table) in ovs_flow_tbl_destroy() argument
283 struct table_instance *ti = rcu_dereference_raw(table->ti); in ovs_flow_tbl_destroy()
284 struct table_instance *ufid_ti = rcu_dereference_raw(table->ufid_ti); in ovs_flow_tbl_destroy()
572 int ovs_flow_tbl_num_masks(const struct flow_table *table) in ovs_flow_tbl_num_masks() argument
577 list_for_each_entry(mask, &table->mask_list, list) in ovs_flow_tbl_num_masks()
608 void ovs_flow_tbl_remove(struct flow_table *table, struct sw_flow *flow) in ovs_flow_tbl_remove() argument
610 struct table_instance *ti = ovsl_dereference(table->ti); in ovs_flow_tbl_remove()
611 struct table_instance *ufid_ti = ovsl_dereference(table->ufid_ti); in ovs_flow_tbl_remove()
613 BUG_ON(table->count == 0); in ovs_flow_tbl_remove()
615 table->count--; in ovs_flow_tbl_remove()
618 table->ufid_count--; in ovs_flow_tbl_remove()
624 flow_mask_remove(table, flow->mask); in ovs_flow_tbl_remove()
688 static void flow_key_insert(struct flow_table *table, struct sw_flow *flow) in flow_key_insert() argument
694 ti = ovsl_dereference(table->ti); in flow_key_insert()
696 table->count++; in flow_key_insert()
699 if (table->count > ti->n_buckets) in flow_key_insert()
701 else if (time_after(jiffies, table->last_rehash + REHASH_INTERVAL)) in flow_key_insert()
705 rcu_assign_pointer(table->ti, new_ti); in flow_key_insert()
707 table->last_rehash = jiffies; in flow_key_insert()
712 static void flow_ufid_insert(struct flow_table *table, struct sw_flow *flow) in flow_ufid_insert() argument
717 ti = ovsl_dereference(table->ufid_ti); in flow_ufid_insert()
719 table->ufid_count++; in flow_ufid_insert()
722 if (table->ufid_count > ti->n_buckets) { in flow_ufid_insert()
727 rcu_assign_pointer(table->ufid_ti, new_ti); in flow_ufid_insert()
734 int ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow, in ovs_flow_tbl_insert() argument
739 err = flow_mask_insert(table, flow, mask); in ovs_flow_tbl_insert()
742 flow_key_insert(table, flow); in ovs_flow_tbl_insert()
744 flow_ufid_insert(table, flow); in ovs_flow_tbl_insert()