udp: align udp_encap_t_ to 2 cachelines
Based on the comments in the struct, udp_encap_t_ is meant to span 2 cachelines. Due to the 64 bit alignment of dpo_id_t, the struct spanned 3 cachelines. This caused fetching ue_ip_proto to trigger an additional cache miss. This patch rearranges the ordering of the struct fields so that udp_encap_t_ only spans 2 cachelines as intended. before: (gdb) print (int)&((struct udp_encap_t_*)0)->cacheline1 $8 = 128 after: (gdb) print (int)&((struct udp_encap_t_*)0)->cacheline1 $1 = 64 Type: fix Signed-off-by: Vadym Martsynovskyy <vmartsyn@fb.com> Change-Id: I066c08654d4a8ef3e2d3954e957d4c5d382b209f (cherry picked from commit 42386fc974148f812ef3eb73ff09a603caa23565)
This commit is contained in:
Vadym Martsynovskyy
committed by
Andrew Yourtchenko
parent
86a5a5d5c2
commit
347a225866
@ -67,16 +67,16 @@ typedef struct udp_encap_t_
|
|||||||
} __attribute__ ((packed)) ip6;
|
} __attribute__ ((packed)) ip6;
|
||||||
} __attribute__ ((packed)) ue_hdrs;
|
} __attribute__ ((packed)) ue_hdrs;
|
||||||
|
|
||||||
/**
|
|
||||||
* Flags controlling fixup behaviour
|
|
||||||
*/
|
|
||||||
udp_encap_fixup_flags_t ue_flags;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The DPO used to forward to the next node in the VLIB graph
|
* The DPO used to forward to the next node in the VLIB graph
|
||||||
*/
|
*/
|
||||||
dpo_id_t ue_dpo;
|
dpo_id_t ue_dpo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flags controlling fixup behaviour
|
||||||
|
*/
|
||||||
|
udp_encap_fixup_flags_t ue_flags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the protocol of the IP header imposed
|
* the protocol of the IP header imposed
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user