2021-03-16 16:39:12

by Cedric VONCKEN

[permalink] [raw]
Subject: WMM doesn't work for VLAN frame

Hi all,

I have an issue with vlan frames and WMM management.
I use an AP and a STA. The AP have a basic setings (wifi is bridged with lan interface).
On the sta, I add a 802.1q device on wlan interface (vconfig add wlan0 7) and this interface is routed with the LAN. The settings works correctly I can ping the computer connected to the AP from a computer connect to the sta.

On the computer connected to the sta I launch iperf with the parameter -S0xc0, with wireshark I checked the frame on the air, and the WMM priority is set to Best effort.
I added some printk in my kernel, and the call order is
[ 64.134443] __dev_queue_xmit called
[ 64.137935] validate_xmit_vlan called
[ 64.144290] ieee80211_subif_start_xmit: called
[ 64.151343] cfg80211_classify8021d: called

Explantation of the issue
1. The validate_xmit_vlan function add the the vlan tag in the skb frame, set skb->protocol to VLAN protocol (0x8100) and set skb->vlan_tci to 0.
2. The cfg80211_classify8021d use these fields to determine the frame priority, but the skb->protocol value (0x8100) is not handled byt this function and this function return a default value 0.

I found this issue with the backport 5.4-rc8-1 from openwrt and the kernel 4.9

With an older backport (2017-11-01) and the same kernel version the call order is differant
[ 536.195431] __dev_queue_xmit called
[ 536.198922] cfg80211_classify8021d called
[ 536.205799] validate_xmit_vlan called

With this order the cfg80211_classify8021d work correctly and my traffic use the correct WMM class.

Do you have any idea to fix this issue?
Regards

Cedric Voncken


2021-03-18 17:07:14

by Johannes Berg

[permalink] [raw]
Subject: Re: WMM doesn't work for VLAN frame

On Tue, 2021-03-16 at 15:15 +0000, Cedric VONCKEN wrote:
>
> Explantation of the issue
> 1. The validate_xmit_vlan function add the the vlan tag in the skb frame, set skb->protocol to VLAN protocol (0x8100) and set skb->vlan_tci to 0.
> 2. The cfg80211_classify8021d use these fields to determine the frame priority, but the skb->protocol value (0x8100) is not handled byt this function and this function return a default value 0.

(some line breaks would've been nice)

Well, since your own commit (!) c6ca5e28bc005 the VLAN TCI is used. If
the VLAN TCI is 0, then you don't get anything else?

Not sure what you were expecting different now?


Oh. You're saying that somehow the order of functions changed? But
validate_xmit_vlan() only pushes a hw offload vlan tag into the frame
(wifi devices aren't offload capable)?

johannes