From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
Vivien Didelot <vivien.didelot@gmail.com>,
Ido Schimmel <idosch@idosch.org>
Cc: "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 2/3] net: dsa: mv88e6xxx: fix duplicate vlan warning
Date: Tue, 18 Feb 2020 11:51:57 +0000 [thread overview]
Message-ID: <20200218115157.GG25745@shell.armlinux.org.uk> (raw)
In-Reply-To: <E1j41KQ-0002uy-TQ@rmk-PC.armlinux.org.uk>
On Tue, Feb 18, 2020 at 11:46:14AM +0000, Russell King wrote:
> When setting VLANs on DSA switches, the VLAN is added to both the port
> concerned as well as the CPU port by dsa_slave_vlan_add(). If multiple
> ports are configured with the same VLAN ID, this triggers a warning on
> the CPU port.
>
> Avoid this warning for CPU ports.
>
> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Note that there is still something not right. On the ZII dev rev B,
setting up a bridge across all the switch ports, I get:
[ 29.526408] device lan0 entered promiscuous mode
[ 29.812389] mv88e6085 0.1:00: p5: already a member of VLAN 1
[ 29.837032] mv88e6085 0.2:00: p5: already a member of VLAN 1
[ 29.855132] mv88e6085 0.2:00: p6: already a member of VLAN 1
[ 29.870246] mv88e6085 0.4:00: p9: already a member of VLAN 1
...
[ 30.201951] device lan1 entered promiscuous mode
[ 30.217172] mv88e6085 0.1:00: p5: already a member of VLAN 1
[ 30.226663] mv88e6085 0.2:00: p5: already a member of VLAN 1
[ 30.235366] mv88e6085 0.2:00: p6: already a member of VLAN 1
[ 30.243355] mv88e6085 0.4:00: p9: already a member of VLAN 1
[ 30.251970] mv88e6085 0.1:00: p5: already a member of VLAN 1
[ 30.262759] mv88e6085 0.2:00: p5: already a member of VLAN 1
[ 30.271104] mv88e6085 0.2:00: p6: already a member of VLAN 1
[ 30.278437] mv88e6085 0.4:00: p9: already a member of VLAN 1
...
[ 30.444394] device lan2 entered promiscuous mode
[ 30.459404] mv88e6085 0.1:00: p5: already a member of VLAN 1
[ 30.468032] mv88e6085 0.2:00: p5: already a member of VLAN 1
[ 30.476725] mv88e6085 0.2:00: p6: already a member of VLAN 1
[ 30.484390] mv88e6085 0.4:00: p9: already a member of VLAN 1
[ 30.493135] mv88e6085 0.1:00: p5: already a member of VLAN 1
[ 30.503920] mv88e6085 0.2:00: p5: already a member of VLAN 1
[ 30.512208] mv88e6085 0.2:00: p6: already a member of VLAN 1
[ 30.519546] mv88e6085 0.4:00: p9: already a member of VLAN 1
...
[ 30.685926] device lan3 entered promiscuous mode
[ 30.697173] mv88e6085 0.1:00: p5: already a member of VLAN 1
[ 30.710499] mv88e6085 0.2:00: p5: already a member of VLAN 1
[ 30.719215] mv88e6085 0.2:00: p6: already a member of VLAN 1
[ 30.727069] mv88e6085 0.4:00: p9: already a member of VLAN 1
[ 30.735674] mv88e6085 0.1:00: p5: already a member of VLAN 1
[ 30.746472] mv88e6085 0.2:00: p5: already a member of VLAN 1
[ 30.755567] mv88e6085 0.2:00: p6: already a member of VLAN 1
[ 30.762909] mv88e6085 0.4:00: p9: already a member of VLAN 1
...
[ 30.931879] device lan4 entered promiscuous mode
[ 30.942491] mv88e6085 0.1:00: p5: already a member of VLAN 1
[ 30.955862] mv88e6085 0.2:00: p5: already a member of VLAN 1
[ 30.965332] mv88e6085 0.2:00: p6: already a member of VLAN 1
[ 30.973110] mv88e6085 0.4:00: p9: already a member of VLAN 1
[ 30.981817] mv88e6085 0.1:00: p5: already a member of VLAN 1
[ 30.992666] mv88e6085 0.2:00: p5: already a member of VLAN 1
[ 31.001044] mv88e6085 0.2:00: p6: already a member of VLAN 1
[ 31.008382] mv88e6085 0.4:00: p9: already a member of VLAN 1
...
[ 31.180919] device lan5 entered promiscuous mode
[ 31.191329] mv88e6085 0.1:00: p5: already a member of VLAN 1
[ 31.205077] mv88e6085 0.2:00: p5: already a member of VLAN 1
[ 31.213782] mv88e6085 0.2:00: p6: already a member of VLAN 1
[ 31.222598] mv88e6085 0.4:00: p9: already a member of VLAN 1
[ 31.231304] mv88e6085 0.1:00: p5: already a member of VLAN 1
[ 31.243705] mv88e6085 0.2:00: p5: already a member of VLAN 1
[ 31.254125] mv88e6085 0.2:00: p6: already a member of VLAN 1
[ 31.262043] mv88e6085 0.4:00: p9: already a member of VLAN 1
...
[ 31.449715] device lan6 entered promiscuous mode
[ 31.459350] mv88e6085 0.1:00: p5: already a member of VLAN 1
[ 31.468345] mv88e6085 0.2:00: p5: already a member of VLAN 1
[ 31.477056] mv88e6085 0.2:00: p6: already a member of VLAN 1
[ 31.488690] mv88e6085 0.4:00: p9: already a member of VLAN 1
[ 31.497379] mv88e6085 0.1:00: p5: already a member of VLAN 1
[ 31.508209] mv88e6085 0.2:00: p5: already a member of VLAN 1
[ 31.516494] mv88e6085 0.2:00: p6: already a member of VLAN 1
[ 31.523956] mv88e6085 0.4:00: p9: already a member of VLAN 1
...
[ 31.670892] device lan7 entered promiscuous mode
[ 31.680315] mv88e6085 0.1:00: p5: already a member of VLAN 1
[ 31.689037] mv88e6085 0.2:00: p5: already a member of VLAN 1
[ 31.698480] mv88e6085 0.2:00: p6: already a member of VLAN 1
[ 31.709288] mv88e6085 0.4:00: p9: already a member of VLAN 1
[ 31.718807] mv88e6085 0.1:00: p5: already a member of VLAN 1
[ 31.729622] mv88e6085 0.2:00: p5: already a member of VLAN 1
[ 31.737996] mv88e6085 0.2:00: p6: already a member of VLAN 1
[ 31.745465] mv88e6085 0.4:00: p9: already a member of VLAN 1
...
[ 31.890353] device lan8 entered promiscuous mode
[ 31.899985] mv88e6085 0.1:00: p5: already a member of VLAN 1
[ 31.909517] mv88e6085 0.2:00: p5: already a member of VLAN 1
[ 31.918255] mv88e6085 0.2:00: p6: already a member of VLAN 1
[ 31.928986] mv88e6085 0.4:00: p9: already a member of VLAN 1
[ 31.937703] mv88e6085 0.1:00: p5: already a member of VLAN 1
[ 31.948657] mv88e6085 0.2:00: p5: already a member of VLAN 1
[ 31.957027] mv88e6085 0.2:00: p6: already a member of VLAN 1
[ 31.964368] mv88e6085 0.4:00: p9: already a member of VLAN 1
So there's still something not right. The setup is not non-standard,
it's just a bridge across all the lan ports.
My guess is this patch needs to be extended to DSA ports as well as
CPU ports?
> ---
> drivers/net/dsa/mv88e6xxx/chip.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index 4ec09cc8dcdc..629eb7bbbb23 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -1795,7 +1795,7 @@ static int mv88e6xxx_broadcast_setup(struct mv88e6xxx_chip *chip, u16 vid)
> }
>
> static int mv88e6xxx_port_vlan_join(struct mv88e6xxx_chip *chip, int port,
> - u16 vid, u8 member)
> + u16 vid, u8 member, bool warn)
> {
> const u8 non_member = MV88E6XXX_G1_VTU_DATA_MEMBER_TAG_NON_MEMBER;
> struct mv88e6xxx_vtu_entry vlan;
> @@ -1840,7 +1840,7 @@ static int mv88e6xxx_port_vlan_join(struct mv88e6xxx_chip *chip, int port,
> err = mv88e6xxx_vtu_loadpurge(chip, &vlan);
> if (err)
> return err;
> - } else {
> + } else if (warn) {
> dev_info(chip->dev, "p%d: already a member of VLAN %d\n",
> port, vid);
> }
> @@ -1854,6 +1854,7 @@ static void mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
> struct mv88e6xxx_chip *chip = ds->priv;
> bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
> bool pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID;
> + bool warn;
> u8 member;
> u16 vid;
>
> @@ -1867,10 +1868,15 @@ static void mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
> else
> member = MV88E6XXX_G1_VTU_DATA_MEMBER_TAG_TAGGED;
>
> + /* net/dsa/slave.c will call dsa_port_vlan_add() for the affected port
> + * and then the CPU port. Do not warn for duplicates for the CPU port.
> + */
> + warn = !dsa_is_cpu_port(ds, port);
> +
> mv88e6xxx_reg_lock(chip);
>
> for (vid = vlan->vid_begin; vid <= vlan->vid_end; ++vid)
> - if (mv88e6xxx_port_vlan_join(chip, port, vid, member))
> + if (mv88e6xxx_port_vlan_join(chip, port, vid, member, warn))
> dev_err(ds->dev, "p%d: failed to add VLAN %d%c\n", port,
> vid, untagged ? 'u' : 't');
>
> --
> 2.20.1
>
>
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up
next prev parent reply other threads:[~2020-02-18 11:52 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-18 11:45 [PATCH net-next 0/3] VLANs, DSA switches and multiple bridges Russell King - ARM Linux admin
2020-02-18 11:46 ` [PATCH net-next 1/3] net: switchdev: do not propagate bridge updates across bridges Russell King
2020-02-18 11:46 ` [PATCH net-next 2/3] net: dsa: mv88e6xxx: fix duplicate vlan warning Russell King
2020-02-18 11:51 ` Russell King - ARM Linux admin [this message]
2020-02-18 16:27 ` Andrew Lunn
2020-02-18 16:31 ` Russell King - ARM Linux admin
2020-02-20 18:12 ` Russell King - ARM Linux admin
2020-02-18 11:46 ` [PATCH net-next 3/3] net: dsa: mv88e6xxx: fix vlan setup Russell King
2020-02-18 19:09 ` Vivien Didelot
2020-02-18 19:34 ` Florian Fainelli
2020-02-18 23:48 ` Russell King - ARM Linux admin
2020-02-19 0:52 ` Vivien Didelot
2020-02-18 19:26 ` [PATCH net-next 0/3] VLANs, DSA switches and multiple bridges Florian Fainelli
2020-02-19 0:00 ` Florian Fainelli
2020-02-19 0:17 ` Russell King - ARM Linux admin
2020-02-19 0:33 ` Florian Fainelli
2020-02-19 0:58 ` Vivien Didelot
2020-02-19 3:47 ` Andrew Lunn
2020-02-19 9:19 ` Russell King - ARM Linux admin
2020-02-19 18:07 ` Vivien Didelot
2020-02-19 18:20 ` Florian Fainelli
2020-02-20 11:35 ` Russell King - ARM Linux admin
2020-02-19 18:52 ` Vladimir Oltean
2020-02-19 19:18 ` Florian Fainelli
2020-02-19 23:15 ` Russell King - ARM Linux admin
2020-02-20 18:56 ` Florian Fainelli
2020-02-21 0:21 ` Russell King - ARM Linux admin
2020-03-16 11:15 ` Russell King - ARM Linux admin
2020-03-17 12:00 ` Russell King - ARM Linux admin
2020-03-17 14:21 ` Vladimir Oltean
2020-03-17 15:12 ` Russell King - ARM Linux admin
2020-03-17 18:49 ` Vivien Didelot
2020-03-17 21:24 ` Russell King - ARM Linux admin
2020-03-18 2:26 ` 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=20200218115157.GG25745@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=idosch@idosch.org \
--cc=netdev@vger.kernel.org \
--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.