X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=datapath%2Fdatapath.c;h=b19123975ad1cca2fec2a958a734e3e048fb2840;hb=a9a2da38941ea4d312559543a3fb813d8fe7fd4e;hp=a964c27f469e3618d854f47ff9da9068c40ea900;hpb=b85d8d61a6c3b9c2fa578fa62c795a93544764af;p=openvswitch diff --git a/datapath/datapath.c b/datapath/datapath.c index a964c27f..b1912397 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -629,11 +629,13 @@ static int expand_table(struct datapath *dp) 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; } @@ -745,6 +747,9 @@ static struct genl_ops dp_packet_genl_ops[] = { 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) {