net: dsa: assign a CPU port to DSA port
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Tue, 5 Dec 2017 20:34:12 +0000 (15:34 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Dec 2017 23:01:34 +0000 (18:01 -0500)
DSA ports also need to have a dedicated CPU port assigned to them,
because they need to know where to egress frames targeting the CPU,
e.g. To_Cpu frames received on a Marvell Tag port.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/dsa2.c

index 1e287420ff49116ff96f7cac21016d6e2713a0b6..21f9bed11988937313f096a58c8b10340e24d052 100644 (file)
@@ -241,7 +241,7 @@ static int dsa_tree_setup_default_cpu(struct dsa_switch_tree *dst)
                for (port = 0; port < ds->num_ports; port++) {
                        dp = &ds->ports[port];
 
-                       if (dsa_port_is_user(dp))
+                       if (dsa_port_is_user(dp) || dsa_port_is_dsa(dp))
                                dp->cpu_dp = dst->cpu_dp;
                }
        }