Merge branch "partner", to simplify partner integration.
[sliver-openvswitch.git] / switch / table-hash.c
index 175b840..ba8ebff 100644 (file)
@@ -82,6 +82,12 @@ static int table_hash_insert(struct sw_table *swt, struct sw_flow *flow)
     } else {
         struct sw_flow *old_flow = *bucket;
         if (!flow_compare(&old_flow->key.flow, &flow->key.flow)) {
+            /* Keep stats from the original flow */
+            flow->used = old_flow->used;
+            flow->created = old_flow->created;
+            flow->packet_count = old_flow->packet_count;
+            flow->byte_count = old_flow->byte_count;
+
             *bucket = flow;
             flow_free(old_flow);
             retval = 1;
@@ -199,7 +205,8 @@ static void table_hash_stats(struct sw_table *swt,
 {
     struct sw_table_hash *th = (struct sw_table_hash *) swt;
     stats->name = "hash";
-    stats->n_flows = th->n_flows;
+    stats->wildcards = 0;        /* No wildcards are supported. */
+    stats->n_flows   = th->n_flows;
     stats->max_flows = th->bucket_mask + 1;
     stats->n_matched = swt->n_matched;
 }
@@ -324,7 +331,8 @@ static void table_hash2_stats(struct sw_table *swt,
     for (i = 0; i < 2; i++)
         table_hash_stats(t2->subtable[i], &substats[i]);
     stats->name = "hash2";
-    stats->n_flows = substats[0].n_flows + substats[1].n_flows;
+    stats->wildcards = 0;        /* No wildcards are supported. */
+    stats->n_flows   = substats[0].n_flows + substats[1].n_flows;
     stats->max_flows = substats[0].max_flows + substats[1].max_flows;
     stats->n_matched = swt->n_matched;
 }