Make dpif_close() accept a null pointer.
[sliver-openvswitch.git] / datapath / table-hash.c
index 29d2059..86e1920 100644 (file)
@@ -72,7 +72,7 @@ static int table_hash_insert(struct sw_table *swt, struct sw_flow *flow)
 
 static int table_hash_modify(struct sw_table *swt, 
                const struct sw_flow_key *key, uint16_t priority, int strict,
-               const struct ofp_action *actions, int n_actions
+               const struct ofp_action_header *actions, size_t actions_len
 {
        struct sw_table_hash *th = (struct sw_table_hash *) swt;
        unsigned int count = 0;
@@ -82,7 +82,7 @@ static int table_hash_modify(struct sw_table *swt,
                struct sw_flow *flow = *bucket;
                if (flow && flow_matches_desc(&flow->key, key, strict)
                                && (!strict || (flow->priority == priority))) {
-                       flow_replace_acts(flow, actions, n_actions);
+                       flow_replace_acts(flow, actions, actions_len);
                        count = 1;
                }
        } else {
@@ -93,7 +93,7 @@ static int table_hash_modify(struct sw_table *swt,
                        struct sw_flow *flow = *bucket;
                        if (flow && flow_matches_desc(&flow->key, key, strict)
                                        && (!strict || (flow->priority == priority))) {
-                               flow_replace_acts(flow, actions, n_actions);
+                               flow_replace_acts(flow, actions, actions_len);
                                count++;
                        }
                }
@@ -220,6 +220,7 @@ static void table_hash_stats(struct sw_table *swt,
        stats->wildcards = 0;          /* No wildcards are supported. */
        stats->n_flows   = th->n_flows;
        stats->max_flows = th->bucket_mask + 1;
+       stats->n_lookup  = swt->n_lookup;
        stats->n_matched = swt->n_matched;
 }
 
@@ -289,13 +290,13 @@ static int table_hash2_insert(struct sw_table *swt, struct sw_flow *flow)
 
 static int table_hash2_modify(struct sw_table *swt, 
                const struct sw_flow_key *key, uint16_t priority, int strict,
-               const struct ofp_action *actions, int n_actions)
+               const struct ofp_action_header *actions, size_t actions_len)
 {
        struct sw_table_hash2 *t2 = (struct sw_table_hash2 *) swt;
        return (table_hash_modify(t2->subtable[0], key, priority, strict, 
-                                       actions, n_actions)
+                                       actions, actions_len)
                        + table_hash_modify(t2->subtable[1], key, priority, strict, 
-                                       actions, n_actions));
+                                       actions, actions_len));
 }
 
 static int table_hash2_delete(struct sw_table *swt,
@@ -356,6 +357,7 @@ static void table_hash2_stats(struct sw_table *swt,
        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_lookup  = swt->n_lookup;
        stats->n_matched = swt->n_matched;
 }