diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2015-11-03 10:52:52 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-11-03 11:30:17 -0500 |
commit | 3d131f070948e4ad93189cb379b3a45d53dce71b (patch) | |
tree | 950f9574ee542c7334433d699bb54c90bb72c906 | |
parent | 4c7ea3c0791e971f05f78453a587a1640fe09a61 (diff) |
net: dsa: mv88e6xxx: include DSA ports in VLANs
DSA ports must be members of a VLAN in order to ensure frame bridging
between chained switch chips.
Thus tag them in addition to the CPU port when adding a VLAN, and skip
them when deleting a VLAN and reporting VLAN members.
Also use the UNMODIFIED egress policy, so that frames egress on these
ports as they ingress, tagged or untagged.
Fixes: 0d3b33e60206 ("net: dsa: mv88e6xxx: add VLAN Load support")
Reported-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/dsa/mv88e6xxx.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c index 3116990ccab9..04cff58d771b 100644 --- a/drivers/net/dsa/mv88e6xxx.c +++ b/drivers/net/dsa/mv88e6xxx.c | |||
@@ -1418,11 +1418,11 @@ static int _mv88e6xxx_vlan_init(struct dsa_switch *ds, u16 vid, | |||
1418 | }; | 1418 | }; |
1419 | int i; | 1419 | int i; |
1420 | 1420 | ||
1421 | /* exclude all ports except the CPU */ | 1421 | /* exclude all ports except the CPU and DSA ports */ |
1422 | for (i = 0; i < ps->num_ports; ++i) | 1422 | for (i = 0; i < ps->num_ports; ++i) |
1423 | vlan.data[i] = dsa_is_cpu_port(ds, i) ? | 1423 | vlan.data[i] = dsa_is_cpu_port(ds, i) || dsa_is_dsa_port(ds, i) |
1424 | GLOBAL_VTU_DATA_MEMBER_TAG_TAGGED : | 1424 | ? GLOBAL_VTU_DATA_MEMBER_TAG_UNMODIFIED |
1425 | GLOBAL_VTU_DATA_MEMBER_TAG_NON_MEMBER; | 1425 | : GLOBAL_VTU_DATA_MEMBER_TAG_NON_MEMBER; |
1426 | 1426 | ||
1427 | if (mv88e6xxx_6097_family(ds) || mv88e6xxx_6165_family(ds) || | 1427 | if (mv88e6xxx_6097_family(ds) || mv88e6xxx_6165_family(ds) || |
1428 | mv88e6xxx_6351_family(ds) || mv88e6xxx_6352_family(ds)) { | 1428 | mv88e6xxx_6351_family(ds) || mv88e6xxx_6352_family(ds)) { |
@@ -1545,7 +1545,7 @@ static int _mv88e6xxx_port_vlan_del(struct dsa_switch *ds, int port, u16 vid) | |||
1545 | /* keep the VLAN unless all ports are excluded */ | 1545 | /* keep the VLAN unless all ports are excluded */ |
1546 | vlan.valid = false; | 1546 | vlan.valid = false; |
1547 | for (i = 0; i < ps->num_ports; ++i) { | 1547 | for (i = 0; i < ps->num_ports; ++i) { |
1548 | if (dsa_is_cpu_port(ds, i)) | 1548 | if (dsa_is_cpu_port(ds, i) || dsa_is_dsa_port(ds, i)) |
1549 | continue; | 1549 | continue; |
1550 | 1550 | ||
1551 | if (vlan.data[i] != GLOBAL_VTU_DATA_MEMBER_TAG_NON_MEMBER) { | 1551 | if (vlan.data[i] != GLOBAL_VTU_DATA_MEMBER_TAG_NON_MEMBER) { |
@@ -1624,7 +1624,7 @@ unlock: | |||
1624 | clear_bit(port, ports); | 1624 | clear_bit(port, ports); |
1625 | clear_bit(port, untagged); | 1625 | clear_bit(port, untagged); |
1626 | 1626 | ||
1627 | if (dsa_is_cpu_port(ds, port)) | 1627 | if (dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port)) |
1628 | continue; | 1628 | continue; |
1629 | 1629 | ||
1630 | if (next.data[port] == GLOBAL_VTU_DATA_MEMBER_TAG_TAGGED || | 1630 | if (next.data[port] == GLOBAL_VTU_DATA_MEMBER_TAG_TAGGED || |