All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: Russell King <rmk+kernel@armlinux.org.uk>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Ivan Vecera <ivecera@redhat.com>, Jiri Pirko <jiri@resnulli.us>,
	Vivien Didelot <vivien.didelot@gmail.com>
Subject: Re: [RFC 1/3] net: switchdev: do not propagate bridge updates across bridges
Date: Tue, 24 Dec 2019 10:39:31 +0200	[thread overview]
Message-ID: <20191224083931.GB895380@splinter> (raw)
In-Reply-To: <E1ij6pf-00083v-Sl@rmk-PC.armlinux.org.uk>

On Sun, Dec 22, 2019 at 07:24:03PM +0000, Russell King wrote:
> When configuring a tree of independent bridges, propagating changes
> from the upper bridge across a bridge master to the lower bridge
> ports brings surprises.
> 
> For example, a lower bridge may have vlan filtering enabled.  It
> may have a vlan interface attached to the bridge master, which may
> then be incorporated into another bridge.  As soon as the lower
> bridge vlan interface is attached to the upper bridge, the lower
> bridge has vlan filtering disabled.

Interesting topology :) The change looks OK to me. I'll add the patch to
our internal tree and let it go through regression to make sure I didn't
miss anything. Will report the results tomorrow.

> 
> This occurs because switchdev recursively applies its changes to
> all lower devices no matter what.
> 
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> ---
>  net/switchdev/switchdev.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
> index 3a1d428c1336..d881e5e4a889 100644
> --- a/net/switchdev/switchdev.c
> +++ b/net/switchdev/switchdev.c
> @@ -475,6 +475,9 @@ static int __switchdev_handle_port_obj_add(struct net_device *dev,
>  	 * necessary to go through this helper.
>  	 */
>  	netdev_for_each_lower_dev(dev, lower_dev, iter) {
> +		if (netif_is_bridge_master(lower_dev))
> +			continue;
> +
>  		err = __switchdev_handle_port_obj_add(lower_dev, port_obj_info,
>  						      check_cb, add_cb);
>  		if (err && err != -EOPNOTSUPP)
> @@ -526,6 +529,9 @@ static int __switchdev_handle_port_obj_del(struct net_device *dev,
>  	 * necessary to go through this helper.
>  	 */
>  	netdev_for_each_lower_dev(dev, lower_dev, iter) {
> +		if (netif_is_bridge_master(lower_dev))
> +			continue;
> +
>  		err = __switchdev_handle_port_obj_del(lower_dev, port_obj_info,
>  						      check_cb, del_cb);
>  		if (err && err != -EOPNOTSUPP)
> @@ -576,6 +582,9 @@ static int __switchdev_handle_port_attr_set(struct net_device *dev,
>  	 * necessary to go through this helper.
>  	 */
>  	netdev_for_each_lower_dev(dev, lower_dev, iter) {
> +		if (netif_is_bridge_master(lower_dev))
> +			continue;
> +
>  		err = __switchdev_handle_port_attr_set(lower_dev, port_attr_info,
>  						       check_cb, set_cb);
>  		if (err && err != -EOPNOTSUPP)
> -- 
> 2.20.1
> 

  reply	other threads:[~2019-12-24  8:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-22 19:22 [RFC 0/3] VLANs, DSA switches and multiple bridges Russell King - ARM Linux admin
2019-12-22 19:24 ` [RFC 1/3] net: switchdev: do not propagate bridge updates across bridges Russell King
2019-12-24  8:39   ` Ido Schimmel [this message]
2019-12-25  7:41     ` Ido Schimmel
2019-12-22 19:24 ` [RFC 2/3] net: dsa: mv88e6xxx: fix duplicate vlan warning Russell King
2019-12-23 17:49   ` Florian Fainelli
2019-12-22 19:24 ` [RFC 3/3] net: dsa: mv88e6xxx: fix vlan setup Russell King
2019-12-23 18:02   ` Florian Fainelli
2019-12-24  8:30     ` Ido Schimmel
2019-12-23 11:16 ` [RFC 0/3] VLANs, DSA switches and multiple bridges Andrew Lunn
2019-12-31 16:10 ` Pali Rohár
2019-12-31 18:06   ` Ido Schimmel
2020-01-01  1:10     ` Pali Rohár
2020-01-01 17:30       ` Russell King - ARM Linux admin
2020-01-01 18:07         ` Pali Rohár
2020-01-01 18:29           ` Russell King - ARM Linux admin
2020-01-02  4:53           ` Florian Fainelli
2020-01-02 15:40             ` Pali Rohár
2020-01-02 12:54         ` Andrew Lunn

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=20191224083931.GB895380@splinter \
    --to=idosch@idosch.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=ivecera@redhat.com \
    --cc=jiri@resnulli.us \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.