struct tbl *new_table;
new_table = tbl_expand(old_table);
- if (IS_ERR(new_table))
- return PTR_ERR(new_table);
-
- rcu_assign_pointer(dp->table, new_table);
- tbl_deferred_destroy(old_table, NULL);
+ if (IS_ERR(new_table)) {
+ if (PTR_ERR(new_table) != -ENOSPC)
+ return PTR_ERR(new_table);
+ } else {
+ rcu_assign_pointer(dp->table, new_table);
+ tbl_deferred_destroy(old_table, NULL);
+ }
return 0;
}
static void get_dp_stats(struct datapath *dp, struct odp_stats *stats)
{
int i;
+ struct tbl *table = get_table_protected(dp);
+
+ stats->n_flows = tbl_count(table);
stats->n_frags = stats->n_hit = stats->n_missed = stats->n_lost = 0;
for_each_possible_cpu(i) {