[OpenWrt-Devel] qca8k: ipqess: ipq40xx: Kernel Panic on Adding VLAN Sub-Interface to Bridge

Florian Fainelli f.fainelli at gmail.com
Tue Mar 19 14:17:27 EDT 2019

On 3/19/19 11:14 AM, Christian Lamparter wrote:
> Cc: Florian. I hope you don't mind.
> On Tuesday, March 19, 2019 5:50:01 PM CET Jeff Kletsky wrote:
>> Working with 4.19 / qca8k / ipqess patches from staging/chunkeey[1]
>> on an IPQ4019-based device, I can get basic connectivity either manually,
>> or with a "standard" UCI definition of the "lan" bridge[2].
>> (I'm aware that this is not "production" code and expect "challenges".)
>> However, I'm puzzled as how to manage VLANs and tagging, even using
>> `ip` and `bridge` (iproute2, from ip-bridge and ip-full packages).
>> It appears that the qca8k driver doesn't support `bridge` VLAN-related
>> commands. Checking the source doesn't show implementation of the
>> `port_vlan_*` functions described in the Linux DSA doc[3].
>> Setting aside my suspicion that a port-based VLAN approach seems
>> unlikely to be able to handle trunking of VLANs, I tried adding a
>> sub-interface of one of the otherwise unused phy interfaces (renamed
>> in my DTS as "wan0" to not conflict with the OpenWrt OS usage of "wan").
> At first glance, I think you are running into what's described in section
> "Design limitations" of DSA in [3]:"
> - inability to configure specific VLAN IDs / trunking VLANs between switches
>   when using a cascaded setup". (Sadly there isn't a link to a possible
> patch or discussion so I don't know the state of it).
> However...
>> This unfortunately results in a kernel panic when trying to add to the
>> bridge.
>> Bridge br-lan initially set up with "default" UCI config[2]
>> Full serial log available[4]
>>    ip link add link wan0 name wan0.100 type vlan id 100
>>    ip link set wan0 up
>>    ip link set wan0.100 up
>>    ip link set wan0.100 master br-lan
>>    (kernel panics)
>> I've traced this to passing of a null pointer to br_vlan_enabled()
>> with the diagnostic patch shown in [5]
> Yes, this shouldn't crash. I think Florian has already a patch for this
> upstream [6].

Right, this specific commit omitted two key details which were that:

- not all drivers support port_vlan_{add,del}
- not all drivers support programming VID 0

This is fixed upstream with d6af21a4fb5fff2f6640feb011902212e658414d
("net: dsa: Use prepare/commit phase in dsa_slave_vlan_rx_add_vid()")

> commit 061f6a505ac33659eab007731c0f6374df39ab55
> Author: Florian Fainelli <f.fainelli at gmail.com>
> Date:   Wed Feb 20 14:35:39 2019 -0800
>     net: dsa: Add ndo_vlan_rx_{add, kill}_vid implementation
> That should help with the NPEs since it now checks whenever the
> bridge_dev is valid or not.
> [3] https://www.kernel.org/doc/Documentation/networking/dsa/dsa.txt
> [6] <https://patchwork.ozlabs.org/patch/1026172/>


openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list