Skip to content

net: skbuff: hide some bitfield members

Jakub Kicinski netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 2 repliesApplied 5/5
  2. v15 patches 14 repliesSuperseded

Changes in v2 from the cover letter

- use IS_ENABLED() for nf_trace
v1: https://lore.kernel.org/all/[email protected]/

Patches in v2 All 5 applied

#Subject and filesSizeRepliesApplied
1/5net: skbuff: hide wifi_acked when CONFIG_WIRELESS not setinclude/linux/skbuff.h include/net/sock.h net/core/skbuff.c +1 more+16 -11 replyApplied
2/5net: skbuff: hide csum_not_inet when CONFIG_IP_SCTP not setinclude/linux/skbuff.h net/core/dev.c net/sched/act_csum.c+16 -40 repliesApplied
3/5net: skbuff: move alloc_cpu into a potential holeinclude/linux/skbuff.h+2 -10 repliesApplied
4/5net: skbuff: push nf_trace down the bitfieldinclude/linux/skbuff.h+3 -30 repliesApplied
5/5net: skbuff: hide nf_trace and ipvs_propertyinclude/linux/skbuff.h+4 -00 repliesApplied

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchFlorian FainelliEric DumazetFlorian WestphalSimon HormanJohannes Berg
SeriesA-b
1/5R-b R-b A-b
2/5R-b R-b
3/5R-b R-b
4/5R-b R-b A-b
5/5R-b A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v2 thread

Cover letter [PATCH net-next v2 0/5] net: skbuff: hide some bitfield members

There is a number of protocol or subsystem specific fields in struct sk_buff which are only accessed by one subsystem. We can wrap them in ifdefs with minimal code impact.

This gives us a better chance to save a 2B and a 4B holes resulting with the following savings (assuming a lucky kernel config):

- /* size: 232, cachelines: 4, members: 28 */
- /* sum members: 227, holes: 1, sum holes: 4 */
- /* sum bitfield members: 8 bits (1 bytes) */
+ /* size: 224, cachelines: 4, members: 28 */
/* forced alignments: 2 */
- /* last cacheline: 40 bytes */
+ /* last cacheline: 32 bytes */

I think that the changes shouldn't be too controversial. The only one I'm not 100% sure of is the SCTP one, 12 extra LoC for one bit.. But it did fit squarely in the "this bit has only one user" category.

v2:
- use IS_ENABLED() for nf_trace
v1: https://lore.kernel.org/all/[email protected]/

Jakub Kicinski (5):
net: skbuff: hide wifi_acked when CONFIG_WIRELESS not set
net: skbuff: hide csum_not_inet when CONFIG_IP_SCTP not set
net: skbuff: move alloc_cpu into a potential hole
net: skbuff: push nf_trace down the bitfield
net: skbuff: hide nf_trace and ipvs_property

 include/linux/skbuff.h | 38 ++++++++++++++++++++++++++++++++++----
 include/net/sock.h     |  2 +-
 net/core/dev.c         |  3 +--
 net/core/skbuff.c      |  2 ++
 net/sched/act_csum.c   |  3 +--
 net/socket.c           |  2 ++
 6 files changed, 41 insertions(+), 9 deletions(-)
Signature · 1 line
2.39.2