[FS#347] VLANs with number > 7 broken after changes to ar8216.c

LEDE Bugs lede-bugs at lists.infradead.org
Thu Dec 22 07:39:08 PST 2016


A new Flyspray task has been opened.  Details are below. 

User who did this - André Paul (flux) 

Attached to Project - LEDE Project
Summary - VLANs with number > 7 broken after changes to ar8216.c
Task Type - Bug Report
Category - Base system
Status - Unconfirmed
Assigned To - 
Operating System - All
Severity - High
Priority - Very Low
Reported Version - Trunk
Due in Version - Undecided
Due Date - Undecided
Details - A VLAN configuration in /etc/config/network that formerly worked on TP-Link WDR4300 devices does not work anymore with the current trunk version:


config switch_vlan 'VLAN_TEST1'
        option vlan '127'
        option vid '100'
        option device 'switch0'
        option ports '0t 2t 3t 4t 5t'



The issue is caused by high VLAN numbers (127 in this case) as the following swconfig command shows:


root at lede:~# swconfig dev switch0 vlan 127 set vid 100
Failed to set attribute: Invalid input data or parameter


Only VLAN numbers (not VLAN IDs!!) below 8 are accepted by swconfig, while the command

root at lede:~# swconfig dev switch0 help

still outputs the correct maximum number of VLANs, which is 128.

This config


config switch_vlan 'VLAN_TEST1'
        option vlan '7'
        option vid '100'
        option device 'switch0'
        option ports '0t 2t 3t 4t 5t'


_does_ work with the modifications made in commit 5a69f596027ff45d9daf7c6584a8a9d4f7ea0770 and the VLANs are configured correctly, but any VLAN number higher than 7 does _not_ work, so the number of VLANs is limited to 8 which is a bit low compared to the 128 supported by hardware.

The issue can be fixed by replacing AR8X16_MAX_PORTS with AR8X16_MAX_VLANS in line 978 of ar8216.c (commit 5a69f596027ff45d9daf7c6584a8a9d4f7ea0770) so that it looks like this:


if (val->port_vlan >= AR8X16_MAX_VLANS)



More information can be found at the following URL:
https://bugs.lede-project.org/index.php?do=details&task_id=347



More information about the lede-bugs mailing list