summaryrefslogtreecommitdiff
path: root/datapath/flow.h
diff options
context:
space:
mode:
authorJarno Rajahalme <jarno@ovn.org>2017-02-09 11:22:01 -0800
committerAndy Zhou <azhou@ovn.org>2017-04-19 12:58:06 -0700
commit1963a8854110284b5762a3666c057310fe9910a6 (patch)
tree66eb64a651ddadf63a46518aaffe5d7137960154 /datapath/flow.h
parent000ea3352d085b65976484570e3f6e0afb95bfd0 (diff)
downloadopenvswitch-1963a8854110284b5762a3666c057310fe9910a6.tar.gz
datapath: Pack struct sw_flow_key.
Upstream commit: openvswitch: Pack struct sw_flow_key. struct sw_flow_key has two 16-bit holes. Move the most matched conntrack match fields there. In some typical cases this reduces the size of the key that needs to be hashed into half and into one cache line. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org> Acked-by: Pravin B Shelar <pshelar@ovn.org> Signed-off-by: David S. Miller <davem@davemloft.net> Upstream: 316d4d78cf9b ("openvswitch: Pack struct sw_flow_key.") Signed-off-by: Joe Stringer <joe@ovn.org> Signed-off-by: Andy Zhou <azhou@ovn.org>
Diffstat (limited to 'datapath/flow.h')
-rw-r--r--datapath/flow.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/datapath/flow.h b/datapath/flow.h
index 0cb29c9f7..07af912e2 100644
--- a/datapath/flow.h
+++ b/datapath/flow.h
@@ -85,6 +85,11 @@ struct sw_flow_key {
struct vlan_head cvlan;
__be16 type; /* Ethernet frame type. */
} eth;
+ /* Filling a hole of two bytes. */
+ u8 ct_state;
+ u8 ct_orig_proto; /* CT original direction tuple IP
+ * protocol.
+ */
union {
struct {
__be32 top_lse; /* top label stack entry */
@@ -96,6 +101,7 @@ struct sw_flow_key {
u8 frag; /* One of OVS_FRAG_TYPE_*. */
} ip;
};
+ u16 ct_zone; /* Conntrack zone. */
struct {
__be16 src; /* TCP/UDP/SCTP source port. */
__be16 dst; /* TCP/UDP/SCTP destination port. */
@@ -138,16 +144,12 @@ struct sw_flow_key {
} ipv6;
};
struct {
- /* Connection tracking fields. */
- u8 state;
- u8 orig_proto; /* CT orig tuple IP protocol. */
- u16 zone;
- u32 mark;
+ /* Connection tracking fields not packed above. */
struct {
__be16 src; /* CT orig tuple tp src port. */
__be16 dst; /* CT orig tuple tp dst port. */
} orig_tp;
-
+ u32 mark;
struct ovs_key_ct_labels labels;
} ct;