mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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>
This commit is contained in:
parent
dd41d33f0b
commit
316d4d78cf
4 changed files with 39 additions and 34 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue