mt7530 cannot delete fdb self entries with vlan other then vlan number 1

Eric Woudstra ericwouds at gmail.com
Sat Jun 19 05:35:36 PDT 2021


About: drivers/net/dsa/mt7530.c

Where do I go with this bug report?

It was discussed here: http://forum.banana-pi.org/t/vlan-enabled
-bridge-bug/12254

The mt7530 driver does not seem te be able to delete fdb 'self' entries,
for vlan numbers other then 1. This affects wlan roaming when vlan
is enabled.

Tested on kernel 5.12. In all cases the kernel is compiled with
CONFIG_BRIDGE_VLAN_FILTERING=y.


Here is a more complete description:

Network setup with vlan:

ip link set eth0 up
ip link add name br0 type bridge vlan_filtering 1 vlan_default_pvid 3
ip link set br0 up
ip link set lan0 master br0
ip link set lan0 up

Network setup without vlan:

ip link set eth0 up
ip link add name br0 type bridge
ip link set br0 up
ip link set lan0 master br0
ip link set lan0 up

Both:

ip addr add 192.168.1.33/24 broadcast 192.168.1.255 dev br0
ip route add 192.168.1.0/24 dev br0
ip route add default via 192.168.1.1


The BPI-R64 is connected with lan0 to a lan port of my router. Then I
connect my phone with mac aa:bb:cc:dd:ee:ff to my router. Then I
disable the wifi of my phone so no more packets with this mac are sent
on the network.

Bridge created with vlan_filtering 1 vlan_default_pvid 3

root at bpi-r64:~# bridge fdb | grep aa:bb:cc:dd:ee:ff
aa:bb:cc:dd:ee:ff dev lan0 vlan 3 master br0
aa:bb:cc:dd:ee:ff dev lan0 vlan 3 self
root at bpi-r64:~# bridge fdb del aa:bb:cc:dd:ee:ff dev lan0 vlan 3 self
root at bpi-r64:~# bridge fdb | grep aa:bb:cc:dd:ee:ff
aa:bb:cc:dd:ee:ff dev lan0 vlan 3 self
root at bpi-r64:~#

Bridge created without vlan_filtering 1 vlan_default_pvid 3

root at bpi-r64:~# bridge fdb | grep aa:bb:cc:dd:ee:ff
aa:bb:cc:dd:ee:ff dev lan0 master br0
aa:bb:cc:dd:ee:ff dev lan0 vlan 1 self
root at bpi-r64:~# bridge fdb del aa:bb:cc:dd:ee:ff dev lan0 vlan 1 self
root at bpi-r64:~# bridge fdb | grep aa:bb:cc:dd:ee:ff
root at bpi-r64:~#

Later I found out that the fdb self entry can be deleted with
vlan_filtering enabled, but with vlan number 1 only.

Now I have tested wifi roaming on a home network connected
router-lan to bpir64-lan.

This is with enabled vlan, vlan 1. First command, phone connected to
remote router, second command, phone roamed to BPI-R64.

root at bpi-r64:~# bridge fdb | grep aa:bb:cc:dd:ee:ff
aa:bb:cc:dd:ee:ff dev lan0 vlan 1 master brlan
aa:bb:cc:dd:ee:ff dev lan0 vlan 1 self
root at bpi-r64:~# bridge fdb | grep aa:bb:cc:dd:ee:ff
aa:bb:cc:dd:ee:ff dev wlan0 vlan 1 master brlan

Phone has good internet connectivity :slight_smile:

Now the same setup but with vlan 2

root at bpi-r64:~# bridge fdb | grep aa:bb:cc:dd:ee:ff
aa:bb:cc:dd:ee:ff dev lan0 vlan 2 master brlan
aa:bb:cc:dd:ee:ff dev lan0 vlan 2 self
root at bpi-r64:~# bridge fdb | grep aa:bb:cc:dd:ee:ff
aa:bb:cc:dd:ee:ff dev lan0 vlan 2 self
aa:bb:cc:dd:ee:ff dev wlan0 vlan 2 master brlan

This last result makes the phone not able to reach the dhcp
server (on the remote router). No connectivity.

The fix ‘net: dsa: mt7530: fix roaming from DSA user ports’ does not work
anymore when vlan id does not equal 1.

I guess it suffers from the same bug that fdb ‘seff’ entries with vlan’s
other than 1 cannot be deleted.



More information about the Linux-mediatek mailing list