Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1321099 > unrolled thread

[PATCH net] net: dsa: mv88e6xxx: fix port VLAN maps

Started byVivien Didelot <vivien.didelot@savoirfairelinux.com>
First post2016-01-28 23:10 +0100
Last post2016-01-30 04:50 +0100
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH net] net: dsa: mv88e6xxx: fix port VLAN maps Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-01-28 23:10 +0100
    Re: [PATCH net] net: dsa: mv88e6xxx: fix port VLAN maps Andrew Lunn <andrew@lunn.ch> - 2016-01-29 03:20 +0100
      Re: [PATCH net] net: dsa: mv88e6xxx: fix port VLAN maps Kevin Smith <kevin.smith@elecsyscorp.com> - 2016-01-29 16:30 +0100
    Re: [PATCH net] net: dsa: mv88e6xxx: fix port VLAN maps David Miller <davem@davemloft.net> - 2016-01-30 04:50 +0100

#1321099 — [PATCH net] net: dsa: mv88e6xxx: fix port VLAN maps

FromVivien Didelot <vivien.didelot@savoirfairelinux.com>
Date2016-01-28 23:10 +0100
Subject[PATCH net] net: dsa: mv88e6xxx: fix port VLAN maps
Message-ID<qW2Vm-1tm-21@gated-at.bofh.it>
Currently the port based VLAN maps should be configured to allow every
port to egress frames on all other ports, except themselves.

The debugfs interface shows that they are misconfigured. For instance, a
7-port switch has the following content in the related register 0x06:

       GLOBAL GLOBAL2 SERDES   0    1    2    3    4    5    6
    ...
    6:  1fa4    1f0f       4   7f   7e   7d   7c   7b   7a   79
    ...

This means that port 3 is allowed to talk to port 2-6, but cannot talk
to ports 0 and 1. With this fix, port 3 can correctly talk to all ports
except 3 itself:

       GLOBAL GLOBAL2 SERDES   0    1    2    3    4    5    6
    ...
    6:  1fa4    1f0f       4   7e   7d   7b   77   6f   5f   3f
    ...

Fixes: ede8098d0fef ("net: dsa: mv88e6xxx: bridges do not need an FID")
Reported-by: Kevin Smith <kevin.smith@elecsyscorp.com>
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
 drivers/net/dsa/mv88e6xxx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index b03f746..d365007 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -2153,7 +2153,8 @@ static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port)
 	 * database, and allow every port to egress frames on all other ports.
 	 */
 	reg = BIT(ps->num_ports) - 1; /* all ports */
-	ret = _mv88e6xxx_port_vlan_map_set(ds, port, reg & ~port);
+	reg &= ~BIT(port); /* except itself */
+	ret = _mv88e6xxx_port_vlan_map_set(ds, port, reg);
 	if (ret)
 		goto abort;
 
-- 
2.7.0

[toc] | [next] | [standalone]


#1321391

FromAndrew Lunn <andrew@lunn.ch>
Date2016-01-29 03:20 +0100
Message-ID<qW6Pi-4bG-59@gated-at.bofh.it>
In reply to#1321099
On Thu, Jan 28, 2016 at 04:54:37PM -0500, Vivien Didelot wrote:
> Currently the port based VLAN maps should be configured to allow every
> port to egress frames on all other ports, except themselves.
> 
> The debugfs interface shows that they are misconfigured. For instance, a
> 7-port switch has the following content in the related register 0x06:
> 
>        GLOBAL GLOBAL2 SERDES   0    1    2    3    4    5    6
>     ...
>     6:  1fa4    1f0f       4   7f   7e   7d   7c   7b   7a   79
>     ...
> 
> This means that port 3 is allowed to talk to port 2-6, but cannot talk
> to ports 0 and 1. With this fix, port 3 can correctly talk to all ports
> except 3 itself:
> 
>        GLOBAL GLOBAL2 SERDES   0    1    2    3    4    5    6
>     ...
>     6:  1fa4    1f0f       4   7e   7d   7b   77   6f   5f   3f
>     ...
> 
> Fixes: ede8098d0fef ("net: dsa: mv88e6xxx: bridges do not need an FID")
> Reported-by: Kevin Smith <kevin.smith@elecsyscorp.com>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Thanks
	Andrew

[toc] | [prev] | [next] | [standalone]


#1321831

FromKevin Smith <kevin.smith@elecsyscorp.com>
Date2016-01-29 16:30 +0100
Message-ID<qWj9M-553-19@gated-at.bofh.it>
In reply to#1321391
On 01/28/2016 08:18 PM, Andrew Lunn wrote:
> On Thu, Jan 28, 2016 at 04:54:37PM -0500, Vivien Didelot wrote:
>> Currently the port based VLAN maps should be configured to allow every
>> port to egress frames on all other ports, except themselves.
>>
>> The debugfs interface shows that they are misconfigured. For instance, a
>> 7-port switch has the following content in the related register 0x06:
>>
>>         GLOBAL GLOBAL2 SERDES   0    1    2    3    4    5    6
>>      ...
>>      6:  1fa4    1f0f       4   7f   7e   7d   7c   7b   7a   79
>>      ...
>>
>> This means that port 3 is allowed to talk to port 2-6, but cannot talk
>> to ports 0 and 1. With this fix, port 3 can correctly talk to all ports
>> except 3 itself:
>>
>>         GLOBAL GLOBAL2 SERDES   0    1    2    3    4    5    6
>>      ...
>>      6:  1fa4    1f0f       4   7e   7d   7b   77   6f   5f   3f
>>      ...
>>
>> Fixes: ede8098d0fef ("net: dsa: mv88e6xxx: bridges do not need an FID")
>> Reported-by: Kevin Smith <kevin.smith@elecsyscorp.com>
>> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Kevin Smith <kevin.smith@elecsyscorp.com>

[toc] | [prev] | [next] | [standalone]


#1322251

FromDavid Miller <davem@davemloft.net>
Date2016-01-30 04:50 +0100
Message-ID<qWuHT-56u-1@gated-at.bofh.it>
In reply to#1321099
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Date: Thu, 28 Jan 2016 16:54:37 -0500

> Currently the port based VLAN maps should be configured to allow every
> port to egress frames on all other ports, except themselves.
> 
> The debugfs interface shows that they are misconfigured. For instance, a
> 7-port switch has the following content in the related register 0x06:
> 
>        GLOBAL GLOBAL2 SERDES   0    1    2    3    4    5    6
>     ...
>     6:  1fa4    1f0f       4   7f   7e   7d   7c   7b   7a   79
>     ...
> 
> This means that port 3 is allowed to talk to port 2-6, but cannot talk
> to ports 0 and 1. With this fix, port 3 can correctly talk to all ports
> except 3 itself:
> 
>        GLOBAL GLOBAL2 SERDES   0    1    2    3    4    5    6
>     ...
>     6:  1fa4    1f0f       4   7e   7d   7b   77   6f   5f   3f
>     ...
> 
> Fixes: ede8098d0fef ("net: dsa: mv88e6xxx: bridges do not need an FID")
> Reported-by: Kevin Smith <kevin.smith@elecsyscorp.com>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web