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 2/2] net: dsa: mt7530: add support for bridge port isolation
Date: Sun, 16 Jun 2024 10:02:07 +0300 [thread overview]
Message-ID: <6f70da58-b68b-4a93-b369-2cc86e9158d4@arinc9.com> (raw)
In-Reply-To: <4eaf2bcb-4fad-4211-a48e-079a5c2a6767@arinc9.com>
On 16/06/2024 09:52, Arınç ÜNAL wrote:
> On 15/06/2024 01:21, Matthias Schiffer wrote:
>> Remove a pair of ports from the port matrix when both ports have the
>> isolated flag set.
>>
>> Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
>> ---
>> drivers/net/dsa/mt7530.c | 21 ++++++++++++++++++---
>> drivers/net/dsa/mt7530.h | 1 +
>> 2 files changed, 19 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
>> index ecacaefdd694..44939379aba8 100644
>> --- a/drivers/net/dsa/mt7530.c
>> +++ b/drivers/net/dsa/mt7530.c
>> @@ -1303,7 +1303,8 @@ mt7530_stp_state_set(struct dsa_switch *ds, int port, u8 state)
>> }
>> static void mt7530_update_port_member(struct mt7530_priv *priv, int port,
>> - const struct net_device *bridge_dev, bool join)
>> + const struct net_device *bridge_dev,
>> + bool join)
>
> Run git clang-format on this patch as well please.
>
>> __must_hold(&priv->reg_mutex)
>> {
>> struct dsa_port *dp = dsa_to_port(priv->ds, port), *other_dp;
>> @@ -1311,6 +1312,7 @@ static void mt7530_update_port_member(struct mt7530_priv *priv, int port,
>> struct dsa_port *cpu_dp = dp->cpu_dp;
>> u32 port_bitmap = BIT(cpu_dp->index);
>> int other_port;
>> + bool isolated;
>> dsa_switch_for_each_user_port(other_dp, priv->ds) {
>> other_port = other_dp->index;
>> @@ -1327,7 +1329,9 @@ static void mt7530_update_port_member(struct mt7530_priv *priv, int port,
>> if (!dsa_port_offloads_bridge_dev(other_dp, bridge_dev))
>> continue;
>> - if (join) {
>> + isolated = p->isolated && other_p->isolated;
>> +
>> + if (join && !isolated) {
>> other_p->pm |= PCR_MATRIX(BIT(port));
>> port_bitmap |= BIT(other_port);
>> } else {
>
> Why must other_p->isolated be true as well? If I understand correctly, when
> a user port is isolated, non isolated ports can't communicate with it
> whilst the CPU port can. If I were to isolate a port which is the only
> isolated one at the moment, the isolated flag would not be true. Therefore,
> the isolated port would not be removed from the port matrix of other user
> ports. Why not only check for p->isolated?
The concept of port isolation is that the isolated port can only
communicate with non-isolated ports so the current implementation looks ok.
Which switch models did you test this on; MT7530, MT7531, MT7988 SoC
switch? I will test it on MT7530 and MT7531 tomorrow evening.
Arınç
next prev parent reply other threads:[~2024-06-16 7:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-14 22:21 [PATCH net-next 1/2] net: dsa: mt7530: factor out bridge join/leave logic Matthias Schiffer
2024-06-14 22:21 ` [PATCH net-next 2/2] net: dsa: mt7530: add support for bridge port isolation Matthias Schiffer
2024-06-16 6:52 ` Arınç ÜNAL
2024-06-16 7:02 ` Arınç ÜNAL [this message]
2024-06-16 8:39 ` Matthias Schiffer
2024-06-16 15:35 ` Andrew Lunn
2024-06-16 16:35 ` Matthias Schiffer
2024-06-16 6:49 ` [PATCH net-next 1/2] net: dsa: mt7530: factor out bridge join/leave logic Arınç ÜNAL
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=6f70da58-b68b-4a93-b369-2cc86e9158d4@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