]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: dsa: mv88e6xxx: Allow dsa and cpu ports in multiple vlans
authorAndrew Lunn <andrew@lunn.ch>
Mon, 25 Sep 2017 21:32:20 +0000 (23:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Oct 2017 09:56:05 +0000 (11:56 +0200)
[ Upstream commit db06ae41945b14feb7f696dcafe8048cc37e8a20 ]

Ports with the same VLAN must all be in the same bridge. However the
CPU and DSA ports need to be in multiple VLANs spread over multiple
bridges. So exclude them when performing this test.

Fixes: b2f81d304cee ("net: dsa: add CPU and DSA ports as VLAN members")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/dsa/mv88e6xxx/chip.c

index 5bcdd33101b00d0b492f87b2a3dc3e67bcf14f09..74e72fdea9a27368ad257fe511843ad93a89fb59 100644 (file)
@@ -1184,6 +1184,10 @@ static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch *ds, int port,
        };
        int i, err;
 
+       /* DSA and CPU ports have to be members of multiple vlans */
+       if (dsa_is_dsa_port(ds, port) || dsa_is_cpu_port(ds, port))
+               return 0;
+
        if (!vid_begin)
                return -EOPNOTSUPP;