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]
Message-ID: <c1417feb-d677-4e4d-bd1a-7ccb0d838630@arinc9.com>
Date: Tue, 18 Jun 2024 22:45:44 +0300
From: Arınç ÜNAL <arinc.unal@...nc9.com>
To: Matthias Schiffer <mschiffer@...verse-factory.net>,
 Daniel Golle <daniel@...rotopia.org>, DENG Qingfang <dqfext@...il.com>,
 Sean Wang <sean.wang@...iatek.com>
Cc: Andrew Lunn <andrew@...n.ch>, Florian Fainelli <f.fainelli@...il.com>,
 Vladimir Oltean <olteanv@...il.com>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 Matthias Brugger <matthias.bgg@...il.com>,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
 netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-arm-kernel@...ts.infradead.org, linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH net-next v3 1/2] net: dsa: mt7530: factor out bridge
 join/leave logic

On 18/06/2024 10.17, Matthias Schiffer wrote:
> As preparation for implementing bridge port isolation, move the logic to
> add and remove bits in the port matrix into a new helper
> mt7530_update_port_member(), which is called from
> mt7530_port_bridge_join() and mt7530_port_bridge_leave().
> 
> Another part of the preparation is using dsa_port_offloads_bridge_dev()
> instead of dsa_port_offloads_bridge() to check for bridge membership, as
> we don't have a struct dsa_bridge in mt7530_port_bridge_flags().
> 
> The port matrix setting is slightly streamlined, now always first setting
> the mt7530_port's pm field and then writing the port matrix from that
> field into the hardware register, instead of duplicating the bit
> manipulation for both the struct field and the register.
> 
> mt7530_port_bridge_join() was previously using |= to update the port
> matrix with the port bitmap, which was unnecessary, as pm would only
> have the CPU port set before joining a bridge; a simple assignment can
> be used for both joining and leaving (and will also work when individual
> bits are added/removed in port_bitmap with regard to the previous port
> matrix, which is what happens with port isolation).
> 
> No functional change intended.
> 
> Signed-off-by: Matthias Schiffer <mschiffer@...verse-factory.net>

Great explanation, thanks a lot!

Reviewed-by: Arınç ÜNAL <arinc.unal@...nc9.com>
Tested-by: Arınç ÜNAL <arinc.unal@...nc9.com>

> ---
> 
> v2: no changes
> v3: addressed overlooked review comments:
> - Ran clang-format on the patch
> - Restored code comment
> - Extended commit message
> 
> Thanks for the clang-format pointer - last time I tried that on kernel
> code (years ago), it was rather underwhelming, but it seems it has
> improved a lot.

Cheers.
Arınç

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ