All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
To: netdev@vger.kernel.org
Cc: roopa@cumulusnetworks.com, davem@davemloft.net,
	stephen@networkplumber.org, bridge@lists.linux-foundation.org,
	Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Subject: [PATCH net-next 0/9] net: bridge: convert bool options to bits
Date: Wed, 26 Sep 2018 15:17:53 +0300	[thread overview]
Message-ID: <20180926121802.27851-1-nikolay@cumulusnetworks.com> (raw)

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: 2, sum holes: 3

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 avoid fetching one
         extra cache line in fast path and to further reduce size

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         | 74 +++++++++++++++++++++++------------------
 net/bridge/br_sysfs_br.c        | 32 +++++++++---------
 net/bridge/br_vlan.c            | 30 +++++++++--------
 12 files changed, 155 insertions(+), 120 deletions(-)

-- 
2.11.0

WARNING: multiple messages have this Message-ID (diff)
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
To: netdev@vger.kernel.org
Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>,
	roopa@cumulusnetworks.com, bridge@lists.linux-foundation.org,
	davem@davemloft.net
Subject: [Bridge] [PATCH net-next 0/9] net: bridge: convert bool options to bits
Date: Wed, 26 Sep 2018 15:17:53 +0300	[thread overview]
Message-ID: <20180926121802.27851-1-nikolay@cumulusnetworks.com> (raw)

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: 2, sum holes: 3

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 avoid fetching one
         extra cache line in fast path and to further reduce size

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         | 74 +++++++++++++++++++++++------------------
 net/bridge/br_sysfs_br.c        | 32 +++++++++---------
 net/bridge/br_vlan.c            | 30 +++++++++--------
 12 files changed, 155 insertions(+), 120 deletions(-)

-- 
2.11.0


             reply	other threads:[~2018-09-26 18:31 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26 12:17 Nikolay Aleksandrov [this message]
2018-09-26 12:17 ` [Bridge] [PATCH net-next 0/9] net: bridge: convert bool options to bits Nikolay Aleksandrov
2018-09-26 12:17 ` [PATCH net-next 1/9] net: bridge: make struct opening bracket consistent Nikolay Aleksandrov
2018-09-26 12:17   ` [Bridge] " Nikolay Aleksandrov
2018-09-26 12:17 ` [PATCH net-next 2/9] net: bridge: add bitfield for options and convert vlan opts Nikolay Aleksandrov
2018-09-26 12:17   ` [Bridge] " Nikolay Aleksandrov
2018-09-26 14:48   ` Andrew Lunn
2018-09-26 14:48     ` [Bridge] " Andrew Lunn
2018-09-26 14:55     ` Nikolay Aleksandrov
2018-09-26 14:55       ` [Bridge] " Nikolay Aleksandrov
2018-09-26 15:01       ` Andrew Lunn
2018-09-26 15:01         ` [Bridge] " Andrew Lunn
2018-09-26 12:17 ` [PATCH net-next 3/9] net: bridge: convert nf call options to bits Nikolay Aleksandrov
2018-09-26 12:17   ` [Bridge] " Nikolay Aleksandrov
2018-09-26 12:17 ` [PATCH net-next 4/9] net: bridge: convert group_addr_set option to a bit Nikolay Aleksandrov
2018-09-26 12:17   ` [Bridge] " Nikolay Aleksandrov
2018-09-26 12:17 ` [PATCH net-next 5/9] net: bridge: convert and rename mcast disabled Nikolay Aleksandrov
2018-09-26 12:17   ` [Bridge] " Nikolay Aleksandrov
2018-09-26 12:17 ` [PATCH net-next 6/9] net: bridge: convert mcast options to bits Nikolay Aleksandrov
2018-09-26 12:17   ` [Bridge] " Nikolay Aleksandrov
2018-09-26 12:18 ` [PATCH net-next 7/9] net: bridge: convert neigh_suppress_enabled option to a bit Nikolay Aleksandrov
2018-09-26 12:18   ` [Bridge] " Nikolay Aleksandrov
2018-09-26 12:18 ` [PATCH net-next 8/9] net: bridge: convert mtu_set_by_user " Nikolay Aleksandrov
2018-09-26 12:18   ` [Bridge] " Nikolay Aleksandrov
2018-09-26 12:18 ` [PATCH net-next 9/9] net: bridge: pack net_bridge better Nikolay Aleksandrov
2018-09-26 12:18   ` [Bridge] " Nikolay Aleksandrov
2018-09-26 13:30   ` Ido Schimmel
2018-09-26 13:30     ` [Bridge] " Ido Schimmel
2018-09-26 13:35     ` Nikolay Aleksandrov
2018-09-26 13:35       ` [Bridge] " Nikolay Aleksandrov
2018-09-26 12:52 ` [PATCH net-next 0/9] net: bridge: convert bool options to bits Stephen Hemminger
2018-09-26 12:52   ` [Bridge] " Stephen Hemminger

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=20180926121802.27851-1-nikolay@cumulusnetworks.com \
    --to=nikolay@cumulusnetworks.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=roopa@cumulusnetworks.com \
    --cc=stephen@networkplumber.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.