Implement OpenFlow hard timeouts.
[sliver-openvswitch.git] / datapath / table-linear.c
index b4d4a77..d2d7e3c 100644 (file)
@@ -104,10 +104,10 @@ static int table_linear_timeout(struct datapath *dp, struct sw_table *swt)
 
        mutex_lock(&dp_mutex);
        list_for_each_entry (flow, &tl->flows, node) {
-               if (flow_timeout(flow)) {
+               int reason = flow_timeout(flow);
+               if (reason >= 0) {
                        count += do_delete(swt, flow);
-                       if (dp->flags & OFPC_SEND_FLOW_EXP)
-                               dp_send_flow_expired(dp, flow);
+                       dp_send_flow_expired(dp, flow, reason);
                }
        }
        tl->n_flows -= count;
@@ -158,6 +158,7 @@ static void table_linear_stats(struct sw_table *swt,
        stats->name = "linear";
        stats->n_flows = tl->n_flows;
        stats->max_flows = tl->max_flows;
+       stats->n_matched = swt->n_matched;
 }