Merge branch "partner", to simplify partner integration.
[sliver-openvswitch.git] / switch / table-linear.c
index ea3777f..1894577 100644 (file)
@@ -36,6 +36,7 @@
 #include <stdlib.h>
 #include "flow.h"
 #include "list.h"
+#include "openflow.h"
 #include "switch-flow.h"
 #include "datapath.h"
 
@@ -74,6 +75,12 @@ static int table_linear_insert(struct sw_table *swt, struct sw_flow *flow)
         if (f->priority == flow->priority
                 && f->key.wildcards == flow->key.wildcards
                 && flow_matches_2wild(&f->key, &flow->key)) {
+            /* Keep stats from the original flow */
+            flow->used = f->used;
+            flow->created = f->created;
+            flow->packet_count = f->packet_count;
+            flow->byte_count = f->byte_count;
+
             flow->serial = f->serial;
             list_replace(&flow->node, &f->node);
             list_replace(&flow->iter_node, &f->iter_node);
@@ -182,7 +189,8 @@ static void table_linear_stats(struct sw_table *swt,
 {
     struct sw_table_linear *tl = (struct sw_table_linear *) swt;
     stats->name = "linear";
-    stats->n_flows = tl->n_flows;
+    stats->wildcards = OFPFW_ALL;
+    stats->n_flows   = tl->n_flows;
     stats->max_flows = tl->max_flows;
     stats->n_matched = swt->n_matched;
 }