From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
Jakub Kicinski <kuba@kernel.org>,
Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH net-next v2 3/5] net: skbuff: move alloc_cpu into a potential hole
Date: Mon, 17 Apr 2023 08:53:48 -0700 [thread overview]
Message-ID: <20230417155350.337873-4-kuba@kernel.org> (raw)
In-Reply-To: <20230417155350.337873-1-kuba@kernel.org>
alloc_cpu is currently between 4 byte fields, so it's almost
guaranteed to create a 2B hole. It has a knock on effect of
creating a 4B hole after @end (and @end and @tail being in
different cachelines).
None of this matters hugely, but for kernel configs which
don't enable all the features there may well be a 2B hole
after the bitfield. Move alloc_cpu there.
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
include/linux/skbuff.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 98d6b48f4dcf..2595b2cfba0d 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -991,6 +991,8 @@ struct sk_buff {
__u16 tc_index; /* traffic control index */
#endif
+ u16 alloc_cpu;
+
union {
__wsum csum;
struct {
@@ -1014,7 +1016,6 @@ struct sk_buff {
unsigned int sender_cpu;
};
#endif
- u16 alloc_cpu;
#ifdef CONFIG_NETWORK_SECMARK
__u32 secmark;
#endif
--
2.39.2
next prev parent reply other threads:[~2023-04-17 15:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-17 15:53 [PATCH net-next v2 0/5] net: skbuff: hide some bitfield members Jakub Kicinski
2023-04-17 15:53 ` [PATCH net-next v2 1/5] net: skbuff: hide wifi_acked when CONFIG_WIRELESS not set Jakub Kicinski
2023-04-18 7:45 ` Johannes Berg
2023-04-17 15:53 ` [PATCH net-next v2 2/5] net: skbuff: hide csum_not_inet when CONFIG_IP_SCTP " Jakub Kicinski
2023-04-17 15:53 ` Jakub Kicinski [this message]
2023-04-17 15:53 ` [PATCH net-next v2 4/5] net: skbuff: push nf_trace down the bitfield Jakub Kicinski
2023-04-17 15:53 ` [PATCH net-next v2 5/5] net: skbuff: hide nf_trace and ipvs_property Jakub Kicinski
2023-04-17 19:26 ` [PATCH net-next v2 0/5] net: skbuff: hide some bitfield members Jakub Kicinski
2023-04-19 12:10 ` patchwork-bot+netdevbpf
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=20230417155350.337873-4-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).