From: John Fastabend <john.fastabend@gmail.com>
To: john.fastabend@gmail.com, jhs@mojatatu.com, davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [net-next PATCH] net: pack tc_cls_u32_knode struct slighter better
Date: Wed, 17 Feb 2016 14:59:30 -0800 [thread overview]
Message-ID: <20160217225930.25736.17844.stgit@john-Precision-Tower-5810> (raw)
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 <jhs@mojatatu.com>
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
include/net/pkt_cls.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 59789ca..2121df5 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 {
next reply other threads:[~2016-02-17 22:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-17 22:59 John Fastabend [this message]
2016-02-18 2:44 ` [net-next PATCH] net: pack tc_cls_u32_knode struct slighter better David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160217225930.25736.17844.stgit@john-Precision-Tower-5810 \
--to=john.fastabend@gmail.com \
--cc=davem@davemloft.net \
--cc=jhs@mojatatu.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox