Lines Matching refs:table
115 int ovs_flow_tbl_count(const struct flow_table *table) in ovs_flow_tbl_count() argument
117 return table->count; in ovs_flow_tbl_count()
209 int ovs_flow_tbl_init(struct flow_table *table) in ovs_flow_tbl_init() argument
222 rcu_assign_pointer(table->ti, ti); in ovs_flow_tbl_init()
223 rcu_assign_pointer(table->ufid_ti, ufid_ti); in ovs_flow_tbl_init()
224 INIT_LIST_HEAD(&table->mask_list); in ovs_flow_tbl_init()
225 table->last_rehash = jiffies; in ovs_flow_tbl_init()
226 table->count = 0; in ovs_flow_tbl_init()
227 table->ufid_count = 0; in ovs_flow_tbl_init()
283 void ovs_flow_tbl_destroy(struct flow_table *table) in ovs_flow_tbl_destroy() argument
285 struct table_instance *ti = rcu_dereference_raw(table->ti); in ovs_flow_tbl_destroy()
286 struct table_instance *ufid_ti = rcu_dereference_raw(table->ufid_ti); in ovs_flow_tbl_destroy()
574 int ovs_flow_tbl_num_masks(const struct flow_table *table) in ovs_flow_tbl_num_masks() argument
579 list_for_each_entry(mask, &table->mask_list, list) in ovs_flow_tbl_num_masks()
610 void ovs_flow_tbl_remove(struct flow_table *table, struct sw_flow *flow) in ovs_flow_tbl_remove() argument
612 struct table_instance *ti = ovsl_dereference(table->ti); in ovs_flow_tbl_remove()
613 struct table_instance *ufid_ti = ovsl_dereference(table->ufid_ti); in ovs_flow_tbl_remove()
615 BUG_ON(table->count == 0); in ovs_flow_tbl_remove()
617 table->count--; in ovs_flow_tbl_remove()
620 table->ufid_count--; in ovs_flow_tbl_remove()
626 flow_mask_remove(table, flow->mask); in ovs_flow_tbl_remove()
690 static void flow_key_insert(struct flow_table *table, struct sw_flow *flow) in flow_key_insert() argument
696 ti = ovsl_dereference(table->ti); in flow_key_insert()
698 table->count++; in flow_key_insert()
701 if (table->count > ti->n_buckets) in flow_key_insert()
703 else if (time_after(jiffies, table->last_rehash + REHASH_INTERVAL)) in flow_key_insert()
707 rcu_assign_pointer(table->ti, new_ti); in flow_key_insert()
709 table->last_rehash = jiffies; in flow_key_insert()
714 static void flow_ufid_insert(struct flow_table *table, struct sw_flow *flow) in flow_ufid_insert() argument
719 ti = ovsl_dereference(table->ufid_ti); in flow_ufid_insert()
721 table->ufid_count++; in flow_ufid_insert()
724 if (table->ufid_count > ti->n_buckets) { in flow_ufid_insert()
729 rcu_assign_pointer(table->ufid_ti, new_ti); in flow_ufid_insert()
736 int ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow, in ovs_flow_tbl_insert() argument
741 err = flow_mask_insert(table, flow, mask); in ovs_flow_tbl_insert()
744 flow_key_insert(table, flow); in ovs_flow_tbl_insert()
746 flow_ufid_insert(table, flow); in ovs_flow_tbl_insert()