From: Ido Schimmel <idosch@mellanox.com>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<kernel@savoirfairelinux.com>,
"David S. Miller" <davem@davemloft.net>,
Jiri Pirko <jiri@resnulli.us>, Scott Feldman <sfeldma@gmail.com>,
Nikolay Aleksandrov <nikolay@cumulusnetworks.com>,
Stephen Hemminger <stephen@networkplumber.org>,
Florian Fainelli <f.fainelli@gmail.com>,
Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH RFC 2/3] net: bridge: set forwarding state on port removal
Date: Sat, 13 Feb 2016 22:37:38 +0200 [thread overview]
Message-ID: <20160213203738.GB17193@colbert.idosch.org> (raw)
In-Reply-To: <1455312860-24666-3-git-send-email-vivien.didelot@savoirfairelinux.com>
Fri, Feb 12, 2016 at 11:34:19PM IST, vivien.didelot@savoirfairelinux.com wrote:
Hi Vivien,
>When a port leaves a bridge, the bridge layer puts its STP state to
>Disabled. If the port is part of an hardware switch, the mode needs to
>be set to Forwarding in order to restore communication with the CPU.
>
>Call br_set_state() in del_nbp(), which only affects switchdev users.
>
>Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
>---
If you have a LAG device in the bridge and one of the ports leaves the
LAG, then the bridge's teardown sequence isn't invoked and you need to
do the cleanup yourself, by calling your dsa_slave_bridge_port_leave()
function (just an example, I know you don't currently support this).
With this change, you'll have to call both the
dsa_slave_bridge_port_leave() function and dsa_slave_stp_update()
instead of always calling the same one when leaving a bridge.
Also, I think this kind of things should be done by drivers, as it's
specific to them. For example, in the case of a physical port, this
wouldn't benefit mlxsw at all, as STP state is a per-VLAN setting and
since VLANs were already flushed in nbp_vlan_flush(), then nothing would
happen.
Thanks!
> net/bridge/br_if.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
>diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
>index c367b3e..93e7b24 100644
>--- a/net/bridge/br_if.c
>+++ b/net/bridge/br_if.c
>@@ -251,6 +251,11 @@ static void del_nbp(struct net_bridge_port *p)
>
> nbp_vlan_flush(p);
> br_fdb_delete_by_port(br, p, 0, 1);
>+
>+ /* If the port is part of an hardware switch, set its STP state to
>+ * forwarding to restore communication with the CPU port.
>+ */
>+ br_set_state(p, BR_STATE_FORWARDING);
> switchdev_deferred_process();
>
> nbp_update_port_count(br);
>--
>2.7.1
>
next prev parent reply other threads:[~2016-02-13 20:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-12 21:34 [PATCH RFC 0/3] net: bridge: set forwarding state when unbridging switchdev ports Vivien Didelot
2016-02-12 21:34 ` [PATCH RFC 1/3] net: bridge: log state when setting it Vivien Didelot
2016-02-13 20:03 ` Ido Schimmel
2016-02-13 21:49 ` Vivien Didelot
2016-02-12 21:34 ` [PATCH RFC 2/3] net: bridge: set forwarding state on port removal Vivien Didelot
2016-02-13 20:37 ` Ido Schimmel [this message]
2016-02-13 21:48 ` Vivien Didelot
2016-02-12 21:34 ` [PATCH RFC 3/3] net: dsa: remove dsa_slave_stp_update Vivien Didelot
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=20160213203738.GB17193@colbert.idosch.org \
--to=idosch@mellanox.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=jiri@resnulli.us \
--cc=kernel@savoirfairelinux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
--cc=sfeldma@gmail.com \
--cc=stephen@networkplumber.org \
--cc=vivien.didelot@savoirfairelinux.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
all inboxes | Powered by JetHome®