aboutsummaryrefslogtreecommitdiff
path: root/datapath/flow.h
diff options
context:
space:
mode:
authorPravin B Shelar <pshelar@nicira.com>2012-01-04 17:23:03 -0800
committerPravin B Shelar <pshelar@nicira.com>2012-01-04 17:23:03 -0800
commitacd051f1761569205827dc9b037e15568a8d59f8 (patch)
tree972b15debb64da253c70be5417f5a9f084cab1f3 /datapath/flow.h
parent16d650e5a47cd0aa0430ab252330f0e66f3420c6 (diff)
datapath: Implement flow table re-hashing.
Following patch introduces a timer based event to rehash flow-hash table. It makes finding collisions difficult to for an attacker. Suggested-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'datapath/flow.h')
-rw-r--r--datapath/flow.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/datapath/flow.h b/datapath/flow.h
index 36e738d6..61310d06 100644
--- a/datapath/flow.h
+++ b/datapath/flow.h
@@ -96,7 +96,7 @@ struct sw_flow_key {
struct sw_flow {
struct rcu_head rcu;
- struct hlist_node hash_node;
+ struct hlist_node hash_node[2];
u32 hash;
struct sw_flow_key key;
@@ -174,6 +174,9 @@ struct flow_table {
struct flex_array *buckets;
unsigned int count, n_buckets;
struct rcu_head rcu;
+ int node_ver;
+ u32 hash_seed;
+ bool keep_flows;
};
static inline int ovs_flow_tbl_count(struct flow_table *table)
@@ -192,6 +195,7 @@ void ovs_flow_tbl_destroy(struct flow_table *table);
void ovs_flow_tbl_deferred_destroy(struct flow_table *table);
struct flow_table *ovs_flow_tbl_alloc(int new_size);
struct flow_table *ovs_flow_tbl_expand(struct flow_table *table);
+struct flow_table *ovs_flow_tbl_rehash(struct flow_table *table);
void ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow);
void ovs_flow_tbl_remove(struct flow_table *table, struct sw_flow *flow);
u32 ovs_flow_hash(const struct sw_flow_key *key, int key_len);