diff options
author | Pravin B Shelar <pshelar@nicira.com> | 2012-10-20 12:17:15 -0700 |
---|---|---|
committer | Pravin B Shelar <pshelar@nicira.com> | 2012-10-20 12:17:15 -0700 |
commit | 13e24889471cae9eb1bc25a2baf390687660513b (patch) | |
tree | 66a369a57dd07e811bdef26146899deed5600202 /datapath/flow.h | |
parent | 356af50bc2a81305002feb94f04fd0dea9e9eb8f (diff) |
datapath: Optimize flow key match for non tunnel flows.
Following patch adds start offset for sw_flow-key, so that we can
skip tunneling information in key for non-tunnel flows.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath/flow.h')
-rw-r--r-- | datapath/flow.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/datapath/flow.h b/datapath/flow.h index c52e029f..f4ef2853 100644 --- a/datapath/flow.h +++ b/datapath/flow.h @@ -42,13 +42,13 @@ struct sw_flow_actions { struct sw_flow_key { struct { + union { + struct ovs_key_ipv4_tunnel tun_key; /* Encapsulating tunnel key. */ + } tun; u32 priority; /* Packet QoS priority. */ u16 in_port; /* Input switch port (or DP_MAX_PORTS). */ } phy; struct { - struct ovs_key_ipv4_tunnel tun_key; /* Encapsulating tunnel key. */ - } tun; - struct { u8 src[ETH_ALEN]; /* Ethernet source address. */ u8 dst[ETH_ALEN]; /* Ethernet destination address. */ __be16 tci; /* 0 if no VLAN, VLAN_TAG_PRESENT set otherwise. */ @@ -170,9 +170,8 @@ u64 ovs_flow_used_time(unsigned long flow_jiffies); int ovs_flow_to_nlattrs(const struct sw_flow_key *, struct sk_buff *); int ovs_flow_from_nlattrs(struct sw_flow_key *swkey, int *key_lenp, const struct nlattr *); -int ovs_flow_metadata_from_nlattrs(u32 *priority, u16 *in_port, - struct ovs_key_ipv4_tunnel *tun_key, - const struct nlattr *); +int ovs_flow_metadata_from_nlattrs(struct sw_flow *flow, int key_len, + const struct nlattr *attr); #define MAX_ACTIONS_BUFSIZE (16 * 1024) #define TBL_MIN_BUCKETS 1024 @@ -203,9 +202,9 @@ 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_insert(struct flow_table *table, struct sw_flow *flow, + struct sw_flow_key *key, int key_len); 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); struct sw_flow *ovs_flow_tbl_next(struct flow_table *table, u32 *bucket, u32 *idx); extern const int ovs_key_lens[OVS_KEY_ATTR_MAX + 1]; |