netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: Russell King <rmk+kernel@armlinux.org.uk>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net] net: dsa: fix unintended change of bridge interface STP state
Date: Wed, 20 Feb 2019 18:27:15 +0100	[thread overview]
Message-ID: <20190220172715.GL13075@lunn.ch> (raw)
In-Reply-To: <b7f73796-8545-c953-d71b-c0b0adb85965@gmail.com>

On Wed, Feb 20, 2019 at 09:22:30AM -0800, Florian Fainelli wrote:
> On 2/20/19 2:32 AM, Russell King wrote:
> > When a DSA port is added to a bridge and brought up, the resulting STP
> > state programmed into the hardware depends on the order that these
> > operations are performed.  However, the Linux bridge code believes that
> > the port is in disabled mode.
> > 
> > If the DSA port is first added to a bridge and then brought up, it will
> > be in blocking mode.  If it is brought up and then added to the bridge,
> > it will be in disabled mode.
> > 
> > This difference is caused by DSA always setting the STP mode in
> > dsa_port_enable() whether or not this port is part of a bridge.  Since
> > bridge always sets the STP state when the port is added, brought up or
> > taken down, it is unnecessary for us to manipulate the STP state.
> > 
> > Apparently, this code was copied from Rocker, and the very next day a
> > similar fix for Rocker was merged but was not propagated to DSA.  See
> > e47172ab7e41 ("rocker: put port in FORWADING state after leaving bridge")
> > 
> > Fixes: b73adef67765 ("net: dsa: integrate with SWITCHDEV for HW bridging")
> > Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> 
> Nice example of cargo cult programming, thanks for fixing this!

Maybe now would be a good time to look at other drivers. Does the
Microsemi Ocelot driver have the same issue?

	  Andrew

  reply	other threads:[~2019-02-20 17:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-20 10:32 [PATCH net] net: dsa: fix unintended change of bridge interface STP state Russell King
2019-02-20 16:38 ` Vivien Didelot
2019-02-20 17:22 ` Florian Fainelli
2019-02-20 17:27   ` Andrew Lunn [this message]
2019-02-20 18:38     ` Florian Fainelli
2019-02-20 19:09 ` David Miller

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=20190220172715.GL13075@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=vivien.didelot@gmail.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).