X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=switch%2Fchain.c;h=1e45a44b65e4914a9949e44f93ad38ba2c946a9d;hb=f730dded18218f869c3c316b98912ff19d8fb71c;hp=e2ac53c6b4ea2ff3b6144649c74c92091ce90aaa;hpb=666158e792ab53cf80aad7c27c1805cfefc4daa6;p=sliver-openvswitch.git diff --git a/switch/chain.c b/switch/chain.c index e2ac53c6b..1e45a44b6 100644 --- a/switch/chain.c +++ b/switch/chain.c @@ -31,6 +31,7 @@ * derivatives without specific, written prior permission. */ +#include #include "chain.h" #include #include @@ -41,13 +42,6 @@ #define THIS_MODULE VLM_chain #include "vlog.h" -/* Set of tables chained together in sequence from cheap to expensive. */ -#define CHAIN_MAX_TABLES 4 -struct sw_chain { - int n_tables; - struct sw_table *tables[CHAIN_MAX_TABLES]; -}; - /* Attempts to append 'table' to the set of tables in 'chain'. Returns 0 or * negative error. If 'table' is null it is assumed that table creation failed * due to out-of-memory. */ @@ -72,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); @@ -127,14 +119,15 @@ chain_insert(struct sw_chain *chain, struct sw_flow *flow) * iterating through the entire contents of each table for keys that contain * 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;