Lines Matching refs:table

103 int ovs_flow_tbl_count(const struct flow_table *table)  in ovs_flow_tbl_count()  argument
105 return table->count; in ovs_flow_tbl_count()
389 int ovs_flow_tbl_masks_cache_resize(struct flow_table *table, u32 size) in ovs_flow_tbl_masks_cache_resize() argument
391 struct mask_cache *mc = rcu_dereference_ovsl(table->mask_cache); in ovs_flow_tbl_masks_cache_resize()
405 rcu_assign_pointer(table->mask_cache, new); in ovs_flow_tbl_masks_cache_resize()
411 int ovs_flow_tbl_init(struct flow_table *table) in ovs_flow_tbl_init() argument
433 rcu_assign_pointer(table->ti, ti); in ovs_flow_tbl_init()
434 rcu_assign_pointer(table->ufid_ti, ufid_ti); in ovs_flow_tbl_init()
435 rcu_assign_pointer(table->mask_array, ma); in ovs_flow_tbl_init()
436 rcu_assign_pointer(table->mask_cache, mc); in ovs_flow_tbl_init()
437 table->last_rehash = jiffies; in ovs_flow_tbl_init()
438 table->count = 0; in ovs_flow_tbl_init()
439 table->ufid_count = 0; in ovs_flow_tbl_init()
459 static void table_instance_flow_free(struct flow_table *table, in table_instance_flow_free() argument
465 table->count--; in table_instance_flow_free()
469 table->ufid_count--; in table_instance_flow_free()
472 flow_mask_remove(table, flow->mask); in table_instance_flow_free()
476 void table_instance_flow_flush(struct flow_table *table, in table_instance_flow_flush() argument
490 table_instance_flow_free(table, ti, ufid_ti, in table_instance_flow_flush()
496 if (WARN_ON(table->count != 0 || in table_instance_flow_flush()
497 table->ufid_count != 0)) { in table_instance_flow_flush()
498 table->count = 0; in table_instance_flow_flush()
499 table->ufid_count = 0; in table_instance_flow_flush()
513 void ovs_flow_tbl_destroy(struct flow_table *table) in ovs_flow_tbl_destroy() argument
515 struct table_instance *ti = rcu_dereference_raw(table->ti); in ovs_flow_tbl_destroy()
516 struct table_instance *ufid_ti = rcu_dereference_raw(table->ufid_ti); in ovs_flow_tbl_destroy()
517 struct mask_cache *mc = rcu_dereference_raw(table->mask_cache); in ovs_flow_tbl_destroy()
518 struct mask_array *ma = rcu_dereference_raw(table->mask_array); in ovs_flow_tbl_destroy()
936 int ovs_flow_tbl_num_masks(const struct flow_table *table) in ovs_flow_tbl_num_masks() argument
938 struct mask_array *ma = rcu_dereference_ovsl(table->mask_array); in ovs_flow_tbl_num_masks()
942 u32 ovs_flow_tbl_masks_cache_size(const struct flow_table *table) in ovs_flow_tbl_masks_cache_size() argument
944 struct mask_cache *mc = rcu_dereference_ovsl(table->mask_cache); in ovs_flow_tbl_masks_cache_size()
956 void ovs_flow_tbl_remove(struct flow_table *table, struct sw_flow *flow) in ovs_flow_tbl_remove() argument
958 struct table_instance *ti = ovsl_dereference(table->ti); in ovs_flow_tbl_remove()
959 struct table_instance *ufid_ti = ovsl_dereference(table->ufid_ti); in ovs_flow_tbl_remove()
961 BUG_ON(table->count == 0); in ovs_flow_tbl_remove()
962 table_instance_flow_free(table, ti, ufid_ti, flow); in ovs_flow_tbl_remove()
1035 static void flow_key_insert(struct flow_table *table, struct sw_flow *flow) in flow_key_insert() argument
1041 ti = ovsl_dereference(table->ti); in flow_key_insert()
1043 table->count++; in flow_key_insert()
1046 if (table->count > ti->n_buckets) in flow_key_insert()
1048 else if (time_after(jiffies, table->last_rehash + REHASH_INTERVAL)) in flow_key_insert()
1052 rcu_assign_pointer(table->ti, new_ti); in flow_key_insert()
1054 table->last_rehash = jiffies; in flow_key_insert()
1059 static void flow_ufid_insert(struct flow_table *table, struct sw_flow *flow) in flow_ufid_insert() argument
1064 ti = ovsl_dereference(table->ufid_ti); in flow_ufid_insert()
1066 table->ufid_count++; in flow_ufid_insert()
1069 if (table->ufid_count > ti->n_buckets) { in flow_ufid_insert()
1074 rcu_assign_pointer(table->ufid_ti, new_ti); in flow_ufid_insert()
1081 int ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow, in ovs_flow_tbl_insert() argument
1086 err = flow_mask_insert(table, flow, mask); in ovs_flow_tbl_insert()
1089 flow_key_insert(table, flow); in ovs_flow_tbl_insert()
1091 flow_ufid_insert(table, flow); in ovs_flow_tbl_insert()
1105 void ovs_flow_masks_rebalance(struct flow_table *table) in ovs_flow_masks_rebalance() argument
1107 struct mask_array *ma = rcu_dereference_ovsl(table->mask_array); in ovs_flow_masks_rebalance()
1181 rcu_assign_pointer(table->mask_array, new); in ovs_flow_masks_rebalance()