From: John Fastabend Date: Wed, 17 Feb 2016 22:59:30 +0000 (-0800) Subject: net: pack tc_cls_u32_knode struct slighter better X-Git-Tag: next-20160301~76^2~58 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e014860e31e2a66b1a94088504360a6ebc023564;p=karo-tx-linux.git net: pack tc_cls_u32_knode struct slighter better By packing the structure we can remove a few holes as Jamal suggests. before: struct tc_cls_u32_knode { struct tcf_exts * exts; /* 0 8 */ u8 fshift; /* 8 1 */ /* XXX 3 bytes hole, try to pack */ u32 handle; /* 12 4 */ u32 val; /* 16 4 */ u32 mask; /* 20 4 */ u32 link_handle; /* 24 4 */ /* XXX 4 bytes hole, try to pack */ struct tc_u32_sel * sel; /* 32 8 */ /* size: 40, cachelines: 1, members: 7 */ /* sum members: 33, holes: 2, sum holes: 7 */ /* last cacheline: 40 bytes */ }; after: struct tc_cls_u32_knode { struct tcf_exts * exts; /* 0 8 */ struct tc_u32_sel * sel; /* 8 8 */ u32 handle; /* 16 4 */ u32 val; /* 20 4 */ u32 mask; /* 24 4 */ u32 link_handle; /* 28 4 */ u8 fshift; /* 32 1 */ /* size: 40, cachelines: 1, members: 7 */ /* padding: 7 */ /* last cacheline: 40 bytes */ }; Suggested-by: Jamal Hadi Salim Signed-off-by: John Fastabend Signed-off-by: David S. Miller --- diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index 59789ca6e2c8..2121df574262 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h @@ -360,12 +360,12 @@ tcf_match_indev(struct sk_buff *skb, int ifindex) struct tc_cls_u32_knode { struct tcf_exts *exts; - u8 fshift; + struct tc_u32_sel *sel; u32 handle; u32 val; u32 mask; u32 link_handle; - struct tc_u32_sel *sel; + u8 fshift; }; struct tc_cls_u32_hnode {