Skip to content

net: bridge: convert bool options to bits

Nikolay Aleksandrov bridge netdev 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest9 patches 2 repliesIn review
  2. v19 patches 6 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9net: bridge: make struct opening bracket consistentnet/bridge/br_private.h+4 -80 replies
2/9net: bridge: add bitfield for options and convert vlan optsnet/bridge/br.c net/bridge/br_netlink.c net/bridge/br_private.h +2 more+49 -180 replies
3/9net: bridge: convert nf call options to bitsnet/bridge/br_netfilter_hooks.c net/bridge/br_netlink.c net/bridge/br_private.h +1 more+19 -180 replies
4/9net: bridge: convert group_addr_set option to a bitnet/bridge/br_netlink.c net/bridge/br_private.h net/bridge/br_sysfs_br.c +1 more+4 -40 replies
5/9net: bridge: convert and rename mcast disablednet/bridge/br_mdb.c net/bridge/br_multicast.c net/bridge/br_netlink.c +2 more+24 -210 replies
6/9net: bridge: convert mcast options to bitsnet/bridge/br_multicast.c net/bridge/br_netlink.c net/bridge/br_private.h +1 more+33 -320 replies
7/9net: bridge: convert neigh_suppress_enabled option to a bitnet/bridge/br_arp_nd_proxy.c net/bridge/br_device.c net/bridge/br_input.c +1 more+12 -90 replies
8/9net: bridge: convert mtu_set_by_user to a bitnet/bridge/br_device.c net/bridge/br_if.c net/bridge/br_private.h+4 -40 replies
9/9net: bridge: pack net_bridge betternet/bridge/br_private.h+2 -20 replies

Reviews trailers per patch

8 of 9 patches have a Reviewed-by or Acked-by.

PatchStephen Hemminger
1/9R-b
2/9R-b
3/9R-b
4/9R-b
5/9R-b
6/9R-b
7/9R-b
8/9R-b
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH net-next v2 0/9] net: bridge: convert bool options to bits

Hi,
A lot of boolean bridge options have been added around the net_bridge structure resulting in holes and more importantly different cache lines that need to be fetched in the fast path. This set moves all of those to bits in a bitfield which resides in a hot cache line thus reducing the size of net_bridge, the number of holes and the number of cache lines needed for the fast path.
The set is also sent in preparation for new boolean options to avoid spreading them in the structure and making new holes.
One nice side-effect is that we avoid potential race conditions by using the bitops since some of the options were bits being directly set in parallel risking hard to debug issues (has_ipv6_addr).

Before:
size: 1184, holes: 8, sum holes: 30
After:
size: 1160, holes: 3, sum holes: 7

Patch 01 is a trivial style fix
Patch 02 adds the new options bitfield and converts the vlan boolean
options to bits
Patches 03-08 convert the rest of the boolean options to bits Patch 09 re-arranges a few fields in net_bridge to further reduce size

v2: patch 09: remove the comment about offload_fwd_mark in net_bridge and
leave it in the last 4 bytes, thanks to Ido for spotting it

Stephen, I've added your reviewed-by in patches 01-08, only removed it from patch 09 as the patch has changed.

Thanks,
Nik

Nikolay Aleksandrov (9):
net: bridge: make struct opening bracket consistent
net: bridge: add bitfield for options and convert vlan opts
net: bridge: convert nf call options to bits
net: bridge: convert group_addr_set option to a bit
net: bridge: convert and rename mcast disabled
net: bridge: convert mcast options to bits
net: bridge: convert neigh_suppress_enabled option to a bit
net: bridge: convert mtu_set_by_user to a bit
net: bridge: pack net_bridge better

 net/bridge/br.c                 | 16 ++++++++++
 net/bridge/br_arp_nd_proxy.c    | 13 ++++----
 net/bridge/br_device.c          |  6 ++--
 net/bridge/br_if.c              |  4 +--
 net/bridge/br_input.c           |  2 +-
 net/bridge/br_mdb.c             |  6 ++--
 net/bridge/br_multicast.c       | 54 ++++++++++++++++-----------------
 net/bridge/br_netfilter_hooks.c |  7 +++--
 net/bridge/br_netlink.c         | 31 ++++++++++---------
 net/bridge/br_private.h         | 66 +++++++++++++++++++++++------------------
 net/bridge/br_sysfs_br.c        | 32 ++++++++++----------
 net/bridge/br_vlan.c            | 30 ++++++++++---------
 12 files changed, 151 insertions(+), 116 deletions(-)
Signature · 1 line
2.11.0