+ struct table_instance *ti = NULL;
+ struct table_instance *new_ti = NULL;
+
+ ti = ovsl_dereference(table->ti);
+
+ /* Expand table, if necessary, to make room. */
+ if (table->count > ti->n_buckets)
+ new_ti = table_instance_expand(ti);
+ else if (time_after(jiffies, table->last_rehash + REHASH_INTERVAL))
+ new_ti = table_instance_rehash(ti, ti->n_buckets);
+
+ if (new_ti && !IS_ERR(new_ti)) {
+ rcu_assign_pointer(table->ti, new_ti);
+ ovs_flow_tbl_destroy(table, true);
+ ti = ovsl_dereference(table->ti);
+ table->last_rehash = jiffies;
+ }
+