Lines Matching defs:table

102 int ovs_flow_tbl_count(const struct flow_table *table)
104 return table->count;
391 int ovs_flow_tbl_masks_cache_resize(struct flow_table *table, u32 size)
393 struct mask_cache *mc = rcu_dereference_ovsl(table->mask_cache);
407 rcu_assign_pointer(table->mask_cache, new);
413 int ovs_flow_tbl_init(struct flow_table *table)
435 rcu_assign_pointer(table->ti, ti);
436 rcu_assign_pointer(table->ufid_ti, ufid_ti);
437 rcu_assign_pointer(table->mask_array, ma);
438 rcu_assign_pointer(table->mask_cache, mc);
439 table->last_rehash = jiffies;
440 table->count = 0;
441 table->ufid_count = 0;
461 static void table_instance_flow_free(struct flow_table *table,
467 table->count--;
471 table->ufid_count--;
474 flow_mask_remove(table, flow->mask);
478 void table_instance_flow_flush(struct flow_table *table,
492 table_instance_flow_free(table, ti, ufid_ti,
498 if (WARN_ON(table->count != 0 ||
499 table->ufid_count != 0)) {
500 table->count = 0;
501 table->ufid_count = 0;
515 void ovs_flow_tbl_destroy(struct flow_table *table)
517 struct table_instance *ti = rcu_dereference_raw(table->ti);
518 struct table_instance *ufid_ti = rcu_dereference_raw(table->ufid_ti);
519 struct mask_cache *mc = rcu_dereference_raw(table->mask_cache);
520 struct mask_array *ma = rcu_dereference_raw(table->mask_array);
587 /* Insert in new table. */
724 /* Flow lookup does full lookup on flow table. It starts with
938 int ovs_flow_tbl_num_masks(const struct flow_table *table)
940 struct mask_array *ma = rcu_dereference_ovsl(table->mask_array);
944 u32 ovs_flow_tbl_masks_cache_size(const struct flow_table *table)
946 struct mask_cache *mc = rcu_dereference_ovsl(table->mask_cache);
958 void ovs_flow_tbl_remove(struct flow_table *table, struct sw_flow *flow)
960 struct table_instance *ti = ovsl_dereference(table->ti);
961 struct table_instance *ufid_ti = ovsl_dereference(table->ufid_ti);
963 BUG_ON(table->count == 0);
964 table_instance_flow_free(table, ti, ufid_ti, flow);
1037 static void flow_key_insert(struct flow_table *table, struct sw_flow *flow)
1043 ti = ovsl_dereference(table->ti);
1045 table->count++;
1047 /* Expand table, if necessary, to make room. */
1048 if (table->count > ti->n_buckets)
1050 else if (time_after(jiffies, table->last_rehash + REHASH_INTERVAL))
1054 rcu_assign_pointer(table->ti, new_ti);
1056 table->last_rehash = jiffies;
1061 static void flow_ufid_insert(struct flow_table *table, struct sw_flow *flow)
1066 ti = ovsl_dereference(table->ufid_ti);
1068 table->ufid_count++;
1070 /* Expand table, if necessary, to make room. */
1071 if (table->ufid_count > ti->n_buckets) {
1076 rcu_assign_pointer(table->ufid_ti, new_ti);
1083 int ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow,
1088 err = flow_mask_insert(table, flow, mask);
1091 flow_key_insert(table, flow);
1093 flow_ufid_insert(table, flow);
1107 void ovs_flow_masks_rebalance(struct flow_table *table)
1109 struct mask_array *ma = rcu_dereference_ovsl(table->mask_array);
1184 rcu_assign_pointer(table->mask_array, new);