} else {
struct sw_flow *old_flow = *bucket;
if (flow_keys_equal(&old_flow->key, &flow->key)) {
+ /* Keep stats from the original flow */
+ flow->init_time = old_flow->init_time;
+ flow->packet_count = old_flow->packet_count;
+ flow->byte_count = old_flow->byte_count;
+
rcu_assign_pointer(*bucket, flow);
flow_deferred_free(old_flow);
retval = 1;
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->init_time = f->init_time;
+ flow->packet_count = f->packet_count;
+ flow->byte_count = f->byte_count;
+
flow->serial = f->serial;
list_replace_rcu(&f->node, &flow->node);
list_replace_rcu(&f->iter_node, &flow->iter_node);
} 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;
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);