lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 27 Oct 2021 12:58:57 +0000
From:   Vladimir Oltean <vladimir.oltean@....com>
To:     Nikolay Aleksandrov <nikolay@...dia.com>
CC:     Ido Schimmel <idosch@...sch.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Ido Schimmel <idosch@...dia.com>,
        Jakub Kicinski <kuba@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Roopa Prabhu <roopa@...dia.com>, Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Vladimir Oltean <olteanv@...il.com>,
        Jiri Pirko <jiri@...dia.com>
Subject: Re: [PATCH net-next 6/8] net: bridge: move br_fdb_replay inside
 br_switchdev.c

On Wed, Oct 27, 2021 at 11:28:23AM +0300, Nikolay Aleksandrov wrote:
> On 27/10/2021 11:16, Ido Schimmel wrote:
> > On Tue, Oct 26, 2021 at 05:27:41PM +0300, Vladimir Oltean wrote:
> >> br_fdb_replay is only called from switchdev code paths, so it makes
> >> sense to be disabled if switchdev is not enabled in the first place.
> >>
> >> As opposed to br_mdb_replay and br_vlan_replay which might be turned off
> >> depending on bridge support for multicast and VLANs, FDB support is
> >> always on. So moving br_mdb_replay and br_vlan_replay inside
> >> br_switchdev.c would mean adding some #ifdef's in br_switchdev.c, so we
> >> keep those where they are.
> > 
> > TBH, for consistency with br_mdb_replay() and br_vlan_replay(), it would
> > have been good to keep it where it is, but ...
> > 
> >>
> >> The reason for the movement is that in future changes there will be some
> >> code reuse between br_switchdev_fdb_notify and br_fdb_replay.
> > 
> > this seems like a good reason, so:
> > 
> > Reviewed-by: Ido Schimmel <idosch@...dia.com>
> > 
> > Nik, WDYT?
> > 
> 
> Good point, it'd be nice to have them all in one place, since they all deal
> specifically with switchdev we can move them to br_switchdev.c. We can also
> rename them similar to other functions in br_switchdev, e.g. br_switchdev_fdb_replay

Looks like we cam move a surprisingly large amount of code from br_mdb.c
to br_switchdev.c. The only problem is:

                                          this used to be called br_mdb_complete
                                                         |
                                                         v
net/bridge/br_switchdev.c: In function ‘br_switchdev_mdb_complete’:
net/bridge/br_switchdev.c:437:20: error: ‘struct net_bridge’ has no member named ‘multicast_lock’; did you mean ‘multicast_ctx’?
  437 |  spin_lock_bh(&br->multicast_lock);
      |                    ^~~~~~~~~~~~~~
      |                    multicast_ctx

Would you like me to introduce a set of br_multicast_lock() and
br_multicast_unlock() helpers that have shim definitions so that they
work when CONFIG_BRIDGE_IGMP_SNOOPING is disabled?

Anyway, I'd like to do this second part of refactoring in a second patch
series, if you don't mind.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ