ofp-util: Work on decoding OF1.1 flow_mods.
[openvswitch] / datapath / flow.h
index 36e738d65aebefe88be6e9edec3ce2a511cd2104..5be481e6b2635a796065d51085b6d19294a7fd99 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007-2011 Nicira Networks.
+ * Copyright (c) 2007-2011 Nicira, Inc.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU General Public
@@ -44,7 +44,7 @@ struct sw_flow_key {
        struct {
                __be64  tun_id;         /* Encapsulating tunnel ID. */
                u32     priority;       /* Packet QoS priority. */
-               u16     in_port;        /* Input switch port (or USHRT_MAX). */
+               u16     in_port;        /* Input switch port (or DP_MAX_PORTS). */
        } phy;
        struct {
                u8     src[ETH_ALEN];   /* Ethernet source address. */
@@ -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;
@@ -168,12 +168,16 @@ int ovs_flow_from_nlattrs(struct sw_flow_key *swkey, int *key_lenp,
 int ovs_flow_metadata_from_nlattrs(u32 *priority, u16 *in_port, __be64 *tun_id,
                                   const struct nlattr *);
 
+#define MAX_ACTIONS_BUFSIZE    (16 * 1024)
 #define TBL_MIN_BUCKETS                1024
 
 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 +196,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);