summaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/mv88e6xxx.c
diff options
context:
space:
mode:
authorAndrew Lunn2015-11-03 16:52:36 +0100
committerDavid S. Miller2015-11-03 17:29:57 +0100
commit4c7ea3c0791e971f05f78453a587a1640fe09a61 (patch)
tree7e96e87603b70b8e72f9d2c69d88f80d2caa33d6 /drivers/net/dsa/mv88e6xxx.c
parentnet/core: fix for_each_netdev_feature (diff)
downloadkernel-qcow2-linux-4c7ea3c0791e971f05f78453a587a1640fe09a61.tar.gz
kernel-qcow2-linux-4c7ea3c0791e971f05f78453a587a1640fe09a61.tar.xz
kernel-qcow2-linux-4c7ea3c0791e971f05f78453a587a1640fe09a61.zip
net: dsa: mv88e6xxx: disable SA learning for DSA and CPU ports
Frames with DSA headers passing to/from the CPU were taking place in the MAC learning on these ports, resulting in incorrect ATU entries. Disable learning on these ports. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx.c')
-rw-r--r--drivers/net/dsa/mv88e6xxx.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index 85228f44c2b5..3116990ccab9 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -2029,8 +2029,12 @@ static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port)
* a port bitmap that has only the bit for this port set and
* the other bits clear.
*/
- ret = _mv88e6xxx_reg_write(ds, REG_PORT(port), PORT_ASSOC_VECTOR,
- 1 << port);
+ reg = 1 << port;
+ /* Disable learning for DSA and CPU ports */
+ if (dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port))
+ reg = PORT_ASSOC_VECTOR_LOCKED_PORT;
+
+ ret = _mv88e6xxx_reg_write(ds, REG_PORT(port), PORT_ASSOC_VECTOR, reg);
if (ret)
goto abort;