Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#14312 closed defect (wontfix)

802.1q bug in 12.09 on Buffalo WZR-600DHP (HP-AG300H)

Reported by: sakutz@… Owned by: developers
Priority: high Milestone: Barrier Breaker 14.07
Component: kernel Version: Trunk
Keywords: vlan, 802.1q, tag, swconfig Cc:

Description

I'm running OpenWrt 12.09 (Attitude Adjustment) on a Buffalo WZR-600DHP (which OpenWrt is documented as recognizing as an HP-AG300H).

I am trying to configure the router with two VLANs - VLAN 1 and VLAN 2:

  • VLAN 1 will have a VID of 1 and should be the default VLAN for all untagged frames.
  • VLAN 2 will have a VID of 1003 and should allow frames tagged with 1003 to be handled by all ports.

Obviously I have not managed to successfully get this configured, or else I wouldn't be posting a bug. Thus I've done a bit of research and came across to existing tickets that seem relevant:

  • #12377 - The default network configuration for the Buffalo systems has the LAN interface bridging eth0 (the LAN switch) and the WAN interfaces. Except according to the ticket the LAN interface should bridge eth0.1 (VLAN 1) and the WAN interfaces in order to allow for the existence of other VLANs on the switch.
  • #6911 - This ticket indicates, and I have seen this to be true, that tagged frames do not work with bridge configurations because of the Linux networking stack load order.
  • #10078 - Mixing tagged and untagged ports does not work unless you also set the port's default PVID value.

Per #12377 I changed the LAN interface to bind to eth0.1. And per #6911, which still appears to be an issue with the latest builds, regardless if it's an issue with Linux or OpenWrt itself, I changed the LAN interface from bridging eth0.1 to simply pointing to it. I don't use the onboard radios anyway, so it wasn't a big deal. Finally, since it still wasn't working I did what was suggested by #10078 and created definitions for the ports' default PVIDs.

Note: Before anyone asks, on this router the CPU port is 0 and the LAN ports are 1-4.

root@router:~# swconfig dev eth0 help
switch0: eth0(Atheros AR8316), ports: 5 (cpu @ 0), vlans: 128

Thus my config looks like this:

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

config interface 'lan'
    option proto 'static'
    option netmask '255.255.255.0'
    option ipaddr '192.168.0.1'
    option ifname 'eth0.1'
    option macaddr '10:6F:3F:E7:94:B2'

config interface 'guest'
    option proto 'static'
    option ifname 'eth0.1003'
    option ipaddr '192.168.3.1'
    option netmask '255.255.255.0'
    option macaddr '10:6F:3F:E7:94:B3'

config interface 'wan'
    option ifname 'eth1'
    option proto 'dhcp'
    option macaddr '00:16:B6:DA:D7:50'

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

config switch_vlan
    option device 'eth0'
    option vlan '1'
    option ports '0t 1 2 3 4'
    option vid '1'

config switch_vlan
    option device 'eth0'
    option vlan '2'
    option ports '0t 1t 2t 3t 4t'
    option vid '1003'
    
config switch_port
    option 'port' '0'
    option 'pvid' '1'

config switch_port
    option 'port' '1' 
    option 'pvid' '1'

config switch_port
    option 'port' '2' 
    option 'pvid' '1'

config switch_port
    option 'port' '3' 
    option 'pvid' '1'
        
config switch_port
    option 'port' '4' 
    option 'pvid' '1'

But the above configuration does not work. By using swconfig manually I was able to learn what was actually happening. It seems that when I try to mix tagged and untagged ports on separate VLANs the switch says "nope" and refuses to let that happen. Apparently if you set a port as tagged for VLAN Y when it is untagged on VLAN X, the switch says it can be tagged on VLAN Y, but it's going to be removed from VLAN X first.

In the following example I use swconfig to manually show the current configuration of VLANs 1 and 2. As you can see, VLAN 1's port 0 (the CPU port on this box) is tagged. But no other port is defined at all. And all of VLAN 2's ports are set to tagged.

root@router:~# swconfig dev eth0 vlan 1 show
VLAN 1:
	vid: 1
	ports: 0t 

root@router:~# swconfig dev eth0 vlan 2 show
VLAN 2:
	vid: 1003
	ports: 0t 1t 2t 3t 4t 

But watch what happens when I try to set VLAN 1's LAN ports to be untagged:

root@router:~# swconfig dev eth0 vlan 1 set ports '0t 1 2 3 4'

root@router:~# swconfig dev eth0 vlan 1 show
VLAN 1:
	vid: 1
	ports: 0t 1 2 3 4 

root@router:~# swconfig dev eth0 vlan 2 show
VLAN 2:
	vid: 1003
	ports: 0t 

It worked, but it also removed those same ports from VLAN 3 as tagged ports.

So it seems that either due to an OpenWrt bug or a limitation on this hardware you cannot have the same port(s) tagged and untagged on different VLANs. I am hoping it's a OpenWrt bug so it can be fixed. Actually, I hope it's just a ID 10 T error in my configuration. But the fact that this same configuration is reported to have worked by others makes me think that some regression may have found its way into 12.09 regarding 802.1q.

Any help is appreciated. Thanks!

Attachments (1)

dmesg (11.7 KB) - added by sakutz@… 4 years ago.
dmesg

Download all attachments as: .zip

Change History (7)

Changed 4 years ago by sakutz@…

dmesg

comment:1 Changed 4 years ago by akutz

If I'm reading the code for my router's chipset correctly, there appears to be a logic error in their reconciliation of untagged VLANs in the function at line 800 of ag71xx_ar7240.c.

Specifically, on line 822, if a VLAN is ever set to untagged it is removed from the port table for all other VLANs regardless of whether or not it is tagged for that VLAN.

It appears that the current chipset implementation of VLANs for my router says a port can simply be tagged on many ports or untagged on one, but it cannot ever be both.

Of course, my masking math is not at all what it used to be, so I could be reading it all wrong.

comment:2 Changed 4 years ago by akutz

Comparing the ag71xx source with the driver for the rtl chipset, it seems like it's an issue with the ag71xx chipset implementation in that a port is either set to tagged or untagged, regardless of whether or not the port is associated with multiple VLANs.

Line 284 of ag71xx_ar7240.h makes it pretty clear that there is a single mask controlling a value that indicates whether a port is tagged or not, irresepective of the VLAN(s) to which the port is associated.

What's less clear to me is whether this is a limitation of a hardware or simply an opportunity for a feature enhancement to this platform via a patch.

comment:3 Changed 4 years ago by akutz

Based on everything I can find, from the driver to the chipset's registers, it appears that a port is either tagged or untagged in the hardware, regardless of VLAN membership. I'm thinking that mixing tagged and untagged ports on the 600DHP is not possible, but I'll wait for a real developer to confirm this.

comment:4 Changed 4 years ago by jogo

  • Resolution set to wontfix
  • Status changed from new to closed

This is a limitation of the switch chip AR8316 that it can't do mixed traffic (tagged and untagged at the same time), so there is no way of fixing it.

comment:5 Changed 4 years ago by akutz

The issue is confused by all the people claiming they've gotten it working, but when you read those threads more closely it's people with *different* models saying they've gotten it working to people having the issue with the 600DHP. Out of curiosity, what current models exist that support mixed traffic? OpenWrt doesn't have the greatest router DB and the buyer's guide doesn't list this as a feature. I suppose I could go through the sources, but if you know off the top of your head...

comment:6 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.