Skip to contentSkip to conversation

net: dsa: felix: accept VLAN config regardless of bridge VLAN awareness state

PATCH Applied Vladimir Oltean 3 participants 3 messages May 27, 2020

Subsystems (4)
lore
Share & tools
lore

Vladimir Oltean

author maintainer
#0 lore raw

PATCH 1/1 net: dsa: felix: accept VLAN config regardless of bridge VLAN awareness state

From: Vladimir Oltean <[email protected]>

The ocelot core library is written with the idea in mind that the VLAN table is populated by the bridge. Otherwise, not even a sane default pvid is provided: in standalone mode, the default pvid is 0, and the core expects the bridge layer to change it to 1.

So without this patch, the VLAN table is completely empty at the end of the commands below, and traffic is broken as a result:

ip link add dev br0 type bridge vlan_filtering 0 && ip link set dev br0 up for eth in $(ls /sys/bus/pci/devices/0000\:00\:00.5/net/); do
ip link set dev $eth master br0
ip link set dev $eth up
done
ip link set dev br0 type bridge vlan_filtering 1

---
 drivers/net/dsa/ocelot/felix.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/dsa/ocelot/felix.c +1 -0
index 18c23ffd6b40..a6e272d2110d 100644
@@ -594,6 +594,7 @@ static int felix_setup(struct dsa_switch *ds)
 				 ANA_FLOODING, tc);
 
 	ds->mtu_enforcement_ingress = true;
+	ds->configure_vlan_while_not_filtering = true;
 	/* It looks like the MAC/PCS interrupt register - PM0_IEVENT (0x8040)
 	 * isn't instantiated for the Felix PF.
 	 * In-band AN may take a few ms to complete, so we need to poll.
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Vladimir Oltean

From: Vladimir Oltean <[email protected]>

The ocelot core library is written with the idea in mind that the VLAN table is populated by the bridge. Otherwise, not even a sane default pvid is provided: in standalone mode, the default pvid is 0, and the core expects the bridge layer to change it to 1.

So without this patch, the VLAN table is completely empty at the end of the commands below, and traffic is broken as a result:

Quoted 8 lines

ip link add dev br0 type bridge vlan_filtering 0 && ip link set dev br0 up for eth in $(ls /sys/bus/pci/devices/0000\:00\:00.5/net/); do
ip link set dev $eth master br0
ip link set dev $eth up
done
ip link set dev br0 type bridge vlan_filtering 1

Signature · 1 line
Florian
maintainer Applied
#2 lore raw
In reply to Vladimir Oltean

From: Vladimir Oltean <[email protected]>
Date: Wed, 27 May 2020 19:45:38 +0300

Quoted 10 lines

From: Vladimir Oltean <[email protected]>

The ocelot core library is written with the idea in mind that the VLAN table is populated by the bridge. Otherwise, not even a sane default pvid is provided: in standalone mode, the default pvid is 0, and the core expects the bridge layer to change it to 1.

So without this patch, the VLAN table is completely empty at the end of the commands below, and traffic is broken as a result:

Quoted 8 lines

ip link add dev br0 type bridge vlan_filtering 0 && ip link set dev br0 up for eth in $(ls /sys/bus/pci/devices/0000\:00\:00.5/net/); do
ip link set dev $eth master br0
ip link set dev $eth up
done
ip link set dev br0 type bridge vlan_filtering 1

Applied, thanks.