From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH net-next 0/9] net: bridge: convert bool options to bits Date: Wed, 26 Sep 2018 13:52:33 +0100 Message-ID: <20180926135233.06cb25dd@shemminger-XPS-13-9360> References: <20180926121802.27851-1-nikolay@cumulusnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, roopa@cumulusnetworks.com, davem@davemloft.net, bridge@lists.linux-foundation.org To: Nikolay Aleksandrov Return-path: Received: from mail-ed1-f65.google.com ([209.85.208.65]:46910 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726768AbeIZTF2 (ORCPT ); Wed, 26 Sep 2018 15:05:28 -0400 Received: by mail-ed1-f65.google.com with SMTP id k14-v6so1754020edr.13 for ; Wed, 26 Sep 2018 05:52:37 -0700 (PDT) In-Reply-To: <20180926121802.27851-1-nikolay@cumulusnetworks.com> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 26 Sep 2018 15:17:53 +0300 Nikolay Aleksandrov wrote: > 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(-) > Looks good, these flags grew over time and cleanup was overdue. Reviewed-by: Stephen Hemminger