On reset, the PVID of all ports is set to 1; if this is reset to 0,
the special cases for VLAN 1 are no longer required.
port_vlan_add is called with vid=0 when the DSA port interfaces are
enabled with no VLAN; previously the VLAN was not configured in this
case, relying on VLAN 1 being present, but with the PVID set to 0,
configuring VLAN 0 as normal works as expected.
Signed-off-by: Thomas Nixon <tom@tomn.co.uk>
for (i = 0; i < MAX_VLANS; i ++)
priv->r->vlan_set_tagged(i, &info);
for (i = 0; i < MAX_VLANS; i ++)
priv->r->vlan_set_tagged(i, &info);
+ // reset PVIDs; defaults to 1 on reset
+ for (i = 0; i <= priv->ds->num_ports; i++)
+ sw_w32(0, priv->r->vlan_port_pb + (i << 2));
+
// Set forwarding action based on inner VLAN tag
for (i = 0; i < priv->cpu_port; i++)
priv->r->vlan_fwd_on_inner(i, true);
// Set forwarding action based on inner VLAN tag
for (i = 0; i < priv->cpu_port; i++)
priv->r->vlan_fwd_on_inner(i, true);
}
for (v = vlan->vid_begin; v <= vlan->vid_end; v++) {
}
for (v = vlan->vid_begin; v <= vlan->vid_end; v++) {
/* Get port memberships of this vlan */
priv->r->vlan_tables_read(v, &info);
/* Get port memberships of this vlan */
priv->r->vlan_tables_read(v, &info);
/* remove port from both tables */
info.untagged_ports &= (~BIT_ULL(port));
/* remove port from both tables */
info.untagged_ports &= (~BIT_ULL(port));
- /* always leave vid 1 */
- if (v != 1)
- info.tagged_ports &= (~BIT_ULL(port));
+ info.tagged_ports &= (~BIT_ULL(port));
priv->r->vlan_set_untagged(v, info.untagged_ports);
pr_debug("Untagged ports, VLAN %d: %llx\n", v, info.untagged_ports);
priv->r->vlan_set_untagged(v, info.untagged_ports);
pr_debug("Untagged ports, VLAN %d: %llx\n", v, info.untagged_ports);