Setting tag sliver-openvswitch-2.2.90-1
[sliver-openvswitch.git] / datapath / flow_table.h
index 4db5f78..ee86953 100644 (file)
 
 #include "flow.h"
 
+struct mask_cache_entry {
+       u32 skb_hash;
+       u32 mask_index;
+};
+
+struct mask_array {
+       struct rcu_head rcu;
+       int count, max;
+       struct sw_flow_mask __rcu *masks[];
+};
+
 struct table_instance {
        struct flex_array *buckets;
        unsigned int n_buckets;
@@ -47,11 +58,14 @@ struct table_instance {
 
 struct flow_table {
        struct table_instance __rcu *ti;
-       struct list_head mask_list;
+       struct mask_cache_entry __percpu *mask_cache;
+       struct mask_array __rcu *mask_array;
        unsigned long last_rehash;
        unsigned int count;
 };
 
+extern struct kmem_cache *flow_stats_cache;
+
 int ovs_flow_init(void);
 void ovs_flow_exit(void);
 
@@ -66,8 +80,13 @@ int ovs_flow_tbl_flush(struct flow_table *flow_table);
 int ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow,
                        struct sw_flow_mask *mask);
 void ovs_flow_tbl_remove(struct flow_table *table, struct sw_flow *flow);
+int  ovs_flow_tbl_num_masks(const struct flow_table *table);
 struct sw_flow *ovs_flow_tbl_dump_next(struct table_instance *table,
                                       u32 *bucket, u32 *idx);
+struct sw_flow *ovs_flow_tbl_lookup_stats(struct flow_table *,
+                                         const struct sw_flow_key *,
+                                         u32 skb_hash,
+                                         u32 *n_mask_hit);
 struct sw_flow *ovs_flow_tbl_lookup(struct flow_table *,
                                    const struct sw_flow_key *);