linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Arınç ÜNAL" <arinc.unal@arinc9.com>
To: Matthias Schiffer <mschiffer@universe-factory.net>,
	Daniel Golle <daniel@makrotopia.org>,
	DENG Qingfang <dqfext@gmail.com>,
	Sean Wang <sean.wang@mediatek.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH net-next v3 1/2] net: dsa: mt7530: factor out bridge join/leave logic
Date: Tue, 18 Jun 2024 22:45:44 +0300	[thread overview]
Message-ID: <c1417feb-d677-4e4d-bd1a-7ccb0d838630@arinc9.com> (raw)
In-Reply-To: <15c28e5ed5fa02ca7904c71540e254617d571eb8.1718694181.git.mschiffer@universe-factory.net>

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@universe-factory.net>

Great explanation, thanks a lot!

Reviewed-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Tested-by: Arınç ÜNAL <arinc.unal@arinc9.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ç


  parent reply	other threads:[~2024-06-18 19:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-18  7:17 [PATCH net-next v3 1/2] net: dsa: mt7530: factor out bridge join/leave logic Matthias Schiffer
2024-06-18  7:17 ` [PATCH net-next v3 2/2] net: dsa: mt7530: add support for bridge port isolation Matthias Schiffer
2024-06-18 13:18   ` Wojciech Drewek
2024-06-18 19:46   ` Arınç ÜNAL
2024-06-18 13:16 ` [PATCH net-next v3 1/2] net: dsa: mt7530: factor out bridge join/leave logic Wojciech Drewek
2024-06-18 19:45 ` Arınç ÜNAL [this message]
2024-06-19 12:20 ` patchwork-bot+netdevbpf

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=c1417feb-d677-4e4d-bd1a-7ccb0d838630@arinc9.com \
    --to=arinc.unal@arinc9.com \
    --cc=andrew@lunn.ch \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=dqfext@gmail.com \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mschiffer@universe-factory.net \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=sean.wang@mediatek.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).