public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
To: "Svenning Sørensen" <sss@secomea.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Oleksij Rempel <o.rempel@pengutronix.de>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: Sv: FAILED: patch "[PATCH] net: dsa: microchip: fix bridging with more than two member" failed to apply to 5.16-stable tree
Date: Mon, 28 Feb 2022 11:58:25 +0100	[thread overview]
Message-ID: <Yhyq0c3aVhqNMF2P@kroah.com> (raw)
In-Reply-To: <DB7PR08MB38675030606F175301EDE48AB53F9@DB7PR08MB3867.eurprd08.prod.outlook.com>

On Sat, Feb 26, 2022 at 01:17:11PM +0000, Svenning Sørensen wrote:
> Commit b3612ccdf284 ("net: dsa: microchip: implement multi-bridge support")
> plugged a packet leak between ports that were members of different bridges.
> Unfortunately, this broke another use case, namely that of more than two
> ports that are members of the same bridge.
> 
> After that commit, when a port is added to a bridge, hardware bridging
> between other member ports of that bridge will be cleared, preventing
> packet exchange between them.
> 
> Fix by ensuring that the Port VLAN Membership bitmap includes any existing
> ports in the bridge, not just the port being added.
> 
> Upstream commit 3d00827a90db6f79abc7cdc553887f89a2e0a184, backported to 5.16.
> 
> Fixes: b3612ccdf284 ("net: dsa: microchip: implement multi-bridge support")
> Signed-off-by: Svenning Sørensen <sss@secomea.com>
> Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
>  drivers/net/dsa/microchip/ksz_common.c | 26 +++++++++++++++++++++++---
>  1 file changed, 23 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
> index 8a04302018dc..7ab9ab58de65 100644
> --- a/drivers/net/dsa/microchip/ksz_common.c
> +++ b/drivers/net/dsa/microchip/ksz_common.c
> @@ -26,7 +26,7 @@ void ksz_update_port_member(struct ksz_device *dev, int port)
>         struct dsa_switch *ds = dev->ds;
>         u8 port_member = 0, cpu_port;
>         const struct dsa_port *dp;
> -       int i;
> +       int i, j;
> 
>         if (!dsa_is_user_port(ds, port))
>                 return;
> @@ -45,13 +45,33 @@ void ksz_update_port_member(struct ksz_device *dev, int port)
>                         continue;
>                 if (!dp->bridge_dev || dp->bridge_dev != other_dp->bridge_dev)
>                         continue;
> +               if (other_p->stp_state != BR_STATE_FORWARDING)
> +                       continue;
> 
> -               if (other_p->stp_state == BR_STATE_FORWARDING &&
> -                   p->stp_state == BR_STATE_FORWARDING) {
> +               if (p->stp_state == BR_STATE_FORWARDING) {
>                         val |= BIT(port);
>                         port_member |= BIT(i);
>                 }
> 
> +               /* Retain port [i]'s relationship to other ports than [port] */
> +               for (j = 0; j < ds->num_ports; j++) {
> +                       const struct dsa_port *third_dp;
> +                       struct ksz_port *third_p;
> +
> +                       if (j == i)
> +                               continue;
> +                       if (j == port)
> +                               continue;
> +                       if (!dsa_is_user_port(ds, j))
> +                               continue;
> +                       third_p = &dev->ports[j];
> +                       if (third_p->stp_state != BR_STATE_FORWARDING)
> +                               continue;
> +                       third_dp = dsa_to_port(ds, j);
> +                       if (third_dp->bridge_dev == dp->bridge_dev)
> +                               val |= BIT(j);
> +               }
> +
>                 dev->dev_ops->cfg_port_member(dev, i, val | cpu_port);
>         }
> 
> --
> 2.20.1
> 

Patch is whitespace corrupted (tabs -> spaces) and can not be applied at
all :(

Please fix up and resend.

thanks,

greg k-h

      reply	other threads:[~2022-02-28 10:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-25 16:16 FAILED: patch "[PATCH] net: dsa: microchip: fix bridging with more than two member" failed to apply to 5.16-stable tree gregkh
2022-02-25 17:14 ` Svenning Sørensen
2022-02-26  7:38   ` gregkh
     [not found]     ` <DB7PR08MB3867F9A962DA7A3B13408C12B53F9@DB7PR08MB3867.eurprd08.prod.outlook.com>
2022-02-26 13:17       ` Sv: " Svenning Sørensen
2022-02-28 10:58         ` gregkh [this message]

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=Yhyq0c3aVhqNMF2P@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=o.rempel@pengutronix.de \
    --cc=sss@secomea.com \
    --cc=stable@vger.kernel.org \
    /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