odp-util: Format VLAN headers more like other headers in ODP flow output.
[sliver-openvswitch.git] / datapath / datapath.c
index a964c27..b191239 100644 (file)
@@ -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) {