Move Autoconf's macro definitions into config.h.
[openvswitch] / switch / chain.c
index 05f74b41e45c3d69ba2f24b0be6b5fb50bf80098..1e45a44b65e4914a9949e44f93ad38ba2c946a9d 100644 (file)
@@ -31,6 +31,7 @@
  * derivatives without specific, written prior permission.
  */
 
+#include <config.h>
 #include "chain.h"
 #include <assert.h>
 #include <errno.h>
@@ -65,9 +66,7 @@ struct sw_chain *chain_create(void)
     if (chain == NULL)
         return NULL;
 
-    if (add_table(chain, table_mac_create(TABLE_MAC_NUM_BUCKETS, 
-                                          TABLE_MAC_MAX_FLOWS))
-        || add_table(chain, table_hash2_create(0x1EDC6F41, TABLE_HASH_MAX_FLOWS,
+    if (add_table(chain, table_hash2_create(0x1EDC6F41, TABLE_HASH_MAX_FLOWS,
                                                0x741B8CD7, TABLE_HASH_MAX_FLOWS))
         || add_table(chain, table_linear_create(TABLE_LINEAR_MAX_FLOWS))) {
         chain_destroy(chain);
@@ -118,42 +117,37 @@ chain_insert(struct sw_chain *chain, struct sw_flow *flow)
  *
  * Expensive in the general case as currently implemented, since it requires
  * iterating through the entire contents of each table for keys that contain
- * wildcards.  Relatively cheap for fully specified keys.
- *
- * The caller need not hold any locks. */
+ * wildcards.  Relatively cheap for fully specified keys. */
 int
-chain_delete(struct sw_chain *chain, const struct sw_flow_key *key, int strict)
+chain_delete(struct sw_chain *chain, const struct sw_flow_key *key, 
+             uint16_t priority, int strict)
 {
     int count = 0;
     int i;
 
     for (i = 0; i < chain->n_tables; i++) {
         struct sw_table *t = chain->tables[i];
-        count += t->delete(t, key, strict);
+        count += t->delete(t, key, priority, strict);
     }
 
     return count;
 
 }
 
-/* Performs timeout processing on all the tables in 'chain'.  Returns the
- * number of flow entries deleted through expiration.
+/* Deletes timed-out flow entries from all the tables in 'chain' and appends
+ * the deleted flows to 'deleted'.
  *
  * Expensive as currently implemented, since it iterates through the entire
- * contents of each table.
- *
- * The caller need not hold any locks. */
-int
-chain_timeout(struct sw_chain *chain, struct datapath *dp)
+ * contents of each table. */
+void
+chain_timeout(struct sw_chain *chain, struct list *deleted)
 {
-    int count = 0;
     int i;
 
     for (i = 0; i < chain->n_tables; i++) {
         struct sw_table *t = chain->tables[i];
-        count += t->timeout(dp, t);
+        t->timeout(t, deleted);
     }
-    return count;
 }
 
 /* Destroys 'chain', which must not have any users. */