Mysterious VLAN IDs on MT7621 device

I just updated my Xiaomi R3P to 19.07.03 and still get strange VLAN IDs when using "swconfig dev mt7530 show". This issue is existing at least since 19.07.0.

root@OpenWrt:~# swconfig dev mt7530 show
.
.
.
VLAN 1:
	vid: 1
	ports: 1 2 3 6t 
VLAN 2:
	vid: 2
	ports: 4 6t 
VLAN 297:
	vid: 297
	ports: 
VLAN 1093:
	vid: 1093
	ports: 
VLAN 1639:
	vid: 1639
	ports: 
VLAN 1901:
	vid: 1901
	ports: 
VLAN 2165:
	vid: 2165
	ports: 
VLAN 2438:
	vid: 2438
	ports: 
VLAN 2709:
	vid: 2709
	ports: 
VLAN 3803:
	vid: 3803
	ports: 
VLAN 4049:
	vid: 4049
	ports:

my "/etc/config/network" has only 2 VLAN entries

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd90:d964:0ea9::/48'

config interface 'lan'
	option type 'bridge'
	option proto 'static'
	option ipaddr '192.168.39.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ifname 'eth0.1 ra0 rai0'

config device 'lan_eth0_1_dev'
	option name 'eth0.1'
	option macaddr 'ec:41:18:0a:c1:80'

config interface 'wan'
	option ifname 'eth0.2'
	option proto 'dhcp'

config interface 'wan6'
	option ifname 'eth0.2'
	option proto 'dhcpv6'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '1 2 3 6t'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '4 6t'

strangely these "artificial VLANs" randomly change over time / every second

VLAN 1:
	vid: 1
	ports: 1 2 3 6t 
VLAN 2:
	vid: 2
	ports: 4 6t 
VLAN 112:
	vid: 112
	ports: 
VLAN 383:
	vid: 383
	ports: 
VLAN 1209:
	vid: 1209
	ports: 
VLAN 1483:
	vid: 1483
	ports: 
VLAN 1732:
	vid: 1732
	ports: 
VLAN 2004:
	vid: 2004
	ports: 
VLAN 2544:
	vid: 2544
	ports: 
VLAN 3068:
	vid: 3068
	ports: 
VLAN 3069:
	vid: 3069
	ports: 
VLAN 3313:
	vid: 3313
	ports: 

and two seconds later:

VLAN 1:
	vid: 1
	ports: 1 2 3 6t 
VLAN 2:
	vid: 2
	ports: 4 6t 
VLAN 40:
	vid: 40
	ports: 
VLAN 313:
	vid: 313
	ports: 
VLAN 835:
	vid: 835
	ports: 
VLAN 1382:
	vid: 1382
	ports: 
VLAN 1384:
	vid: 1384
	ports: 
VLAN 1642:
	vid: 1642
	ports: 
VLAN 1898:
	vid: 1898
	ports: 
VLAN 2161:
	vid: 2161
	ports: 
VLAN 3803:
	vid: 3803
	ports: 

Is there anything wrong with my config or is it a bug? Is it just a cosmetic problem or something serious?

looks some sort of swconfig read marker / spurious overflow type issue...

i'd check with other users of device / very similar device's for similar output or you could also see if it's replicatable under master...

empty ports, incremental values and presence since .0 = likely benign

Thanks for you answer! I tried several older swconfig versions back to 2015. They all show the same strange VLAN IDs. I see the same thing happening on another mt7621 device (Xiaomi R3G). I guess its something with the network driver ...

Edgerouter X, 19.07.1 not present this issue.

VLAN 1:
        vid: 1
        ports: 1 6t
VLAN 2:
        vid: 2
        ports: 0 6t
VLAN 3:
        vid: 3
        ports: 1t 6t
VLAN 4:
        vid: 4
        ports: 4 6t
VLAN 10:
        vid: 10
        ports: 4t 6t
VLAN 12:
        vid: 12
        ports: 2 6t
VLAN 13:
        vid: 13
        ports: 3 6t

It's a bug specific to the mt7530 swconfig driver. Seems it is reading uninitialized memory of some sort, experiencing the same on a Mir3G. Since master already dropped swconfig in favor to DSA on the mt7621 platform, this likely won't be fixed anymore.

1 Like

But its not present on ER-X. Maybe only affect MT7621 with MT76 wifi?

https://lists.infradead.org/pipermail/openwrt-devel/2021-April/034851.html

It's a race condition bug in swconfig driver.

2 Likes

It has been merged, it is better now?