Subject: [alpine-devel] Extreme latency on rt2x00 + hostapd + multi-BSS

From: "Isan/Matt/Koryn" <[email-masked]>
Date: Thu, 23 Jan 2014 19:48:41 -0600

Hello all,
Recently I noticed that I was unable to view videos without constant
buffering on my wireless connection. I seem to have been having this
problem off and on for a while, however it became much worse recently,
with my ping exceeding 1000ms, right now it's averaging about 500ms,
which is much better than it was, although that's when pinging my
alpine box (which acts as the gateway/router/firewall for my network)
which should be much lower (~1ms). Checking the logs, I realized the
kernel is throwing the same error related to the
rt2x00queue_write_tx_frame symbol, as follows:

Jan 23 18:40:59 security kern.err kernel: [16896.045803] ieee80211
phy0: rt2x00queue_write_tx_frame: Error - Dropping frame due to full
tx queue 2
Jan 23 18:40:59 security kern.err kernel: [16896.045809] ieee80211
phy0: rt2x00queue_write_tx_frame: Error - Dropping frame due to full
tx queue 2
Jan 23 18:40:59 security kern.err kernel: [16896.045815] ieee80211
phy0: rt2x00queue_write_tx_frame: Error - Dropping frame due to full
tx queue 2
Jan 23 18:40:59 security kern.err kernel: [16896.045821] ieee80211
phy0: rt2x00queue_write_tx_frame: Error - Dropping frame due to full
tx queue 2
Jan 23 18:40:59 security kern.err kernel: [16896.045827] ieee80211
phy0: rt2x00queue_write_tx_frame: Error - Dropping frame due to full
tx queue 2
Jan 23 18:40:59 security kern.err kernel: [16896.045833] ieee80211
phy0: rt2x00queue_write_tx_frame: Error - Dropping frame due to full
tx queue 2
Jan 23 18:40:59 security kern.err kernel: [16896.045839] ieee80211
phy0: rt2x00queue_write_tx_frame: Error - Dropping frame due to full
tx queue 2
Jan 23 18:40:59 security kern.err kernel: [16896.045845] ieee80211
phy0: rt2x00queue_write_tx_frame: Error - Dropping frame due to full
tx queue 2
Jan 23 18:40:59 security kern.err kernel: [16896.045850] ieee80211
phy0: rt2x00queue_write_tx_frame: Error - Dropping frame due to full
tx queue 2

I am using the linux-grsec kernel, and this occurs whether I'm using
the kernel from stable or edge.

Current 'uname -a':
Linux security 3.12.8-0-grsec #1-Alpine SMP Thu Jan 23 01:54:32 CST
2014 i686 Linux

My hostapd.conf is as follows:
interface=wlan0
bridge=br0
driver=nl80211
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
dump_file=/tmp/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=QMX-Private
country_code=US
ieee80211d=1
hw_mode=g
channel=6
beacon_int=100
dtim_period=2
max_num_sta=255
rts_threshold=2347
fragm_threshold=2346
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wmm_enabled=1
wmm_ac_bk_cwmin=4
wmm_ac_bk_cwmax=10
wmm_ac_bk_aifs=7
wmm_ac_bk_txop_limit=0
wmm_ac_bk_acm=0
wmm_ac_be_aifs=3
wmm_ac_be_cwmin=4
wmm_ac_be_cwmax=10
wmm_ac_be_txop_limit=0
wmm_ac_be_acm=0
wmm_ac_vi_aifs=2
wmm_ac_vi_cwmin=3
wmm_ac_vi_cwmax=4
wmm_ac_vi_txop_limit=94
wmm_ac_vi_acm=0
wmm_ac_vo_aifs=2
wmm_ac_vo_cwmin=2
wmm_ac_vo_cwmax=3
wmm_ac_vo_txop_limit=47
wmm_ac_vo_acm=0
ieee80211n=1
ht_capab=[HT40-][SHORT-GI-40][RX-STBC12]
require_ht=0
ieee8021x=1
eapol_version=2
eap_server=1
eap_user_file=/etc/hostapd/hostapd.eap_user
ca_cert=/etc/ssl/cacrlbundle.pem
server_cert=/etc/ssl/certs/hostcert.pem
private_key=/etc/ssl/certs/hostkey.pem
check_crl=0
dh_file=/etc/ssl/private/dh1024.pem
own_ip_addr=127.0.0.1
wpa=2
wpa_key_mgmt=WPA-EAP
wpa_pairwise=CCMP

bss=wlan0_0
bssid=00:22:6b:a6:bb:4d
ssid=QMX-Public
wpa=0
bridge=br1
hw_mode=g
wmm_enabled=1
ieee80211n=1
ht_capab=[HT40-][SHORT-GI-40][RX-STBC12]
require_ht=0

note: yes I am using EAP-TLS on my private network, and yes I am using
multi-bss to provide free wireless to my neighbors.

My 'lspci' is as follows:
00:00.0 Class 0600: 1039:0746
00:01.0 Class 0604: 1039:0002
00:02.0 Class 0601: 1039:0964
00:02.5 Class 0101: 1039:5513
00:03.0 Class 0c03: 1039:7001
00:03.1 Class 0c03: 1039:7001
00:03.2 Class 0c03: 1039:7001
00:03.3 Class 0c03: 1039:7002
00:09.0 Class 0200: 8086:1229
00:0a.0 Class 0200: 8086:100c
00:0d.0 Class 0280: 1814:0701
00:0e.0 Class 0200: 10ec:8169
01:00.0 Class 0300: 10de:0322

iw phy0 info:
Wiphy phy0
        max # scan SSIDs: 4
        max scan IEs length: 2257 bytes
        Coverage class: 0 (up to 0m)
        Device supports RSN-IBSS.
        Supported Ciphers:
                * WEP40 (00-0f-ac:1)
                * WEP104 (00-0f-ac:5)
                * TKIP (00-0f-ac:2)
                * CCMP (00-0f-ac:4)
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * AP/VLAN
                 * WDS
                 * monitor
        Band 1:
                Capabilities: 0x272
                        HT20/HT40
                        Static SM Power Save
                        RX Greenfield
                        RX HT20 SGI
                        RX HT40 SGI
                        RX STBC 2-streams
                        Max AMSDU length: 3839 bytes
                        No DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 2 usec (0x04)
                HT RX MCS rate indexes supported: 0-15, 32
                TX unequal modulation not supported
                HT TX Max spatial streams: 1
                HT TX MCS rate indexes supported may differ
                Bitrates (non-HT):
                        * 1.0 Mbps
                        * 2.0 Mbps (short preamble supported)
                        * 5.5 Mbps (short preamble supported)
                        * 11.0 Mbps (short preamble supported)
                        * 6.0 Mbps
                        * 9.0 Mbps
                        * 12.0 Mbps
                        * 18.0 Mbps
                        * 24.0 Mbps
                        * 36.0 Mbps
                        * 48.0 Mbps
                        * 54.0 Mbps
                Frequencies:
                        * 2412 MHz [1] (20.0 dBm)
                        * 2417 MHz [2] (20.0 dBm)
                        * 2422 MHz [3] (20.0 dBm)
                        * 2427 MHz [4] (20.0 dBm)
                        * 2432 MHz [5] (20.0 dBm)
                        * 2437 MHz [6] (20.0 dBm)
                        * 2442 MHz [7] (20.0 dBm)
                        * 2447 MHz [8] (20.0 dBm)
                        * 2452 MHz [9] (20.0 dBm)
                        * 2457 MHz [10] (20.0 dBm)
                        * 2462 MHz [11] (20.0 dBm)
                        * 2467 MHz [12] (20.0 dBm) (passive scanning, no IBSS)
                        * 2472 MHz [13] (20.0 dBm) (passive scanning, no IBSS)
                        * 2484 MHz [14] (20.0 dBm) (passive scanning, no IBSS)
        Supported commands:
                 * new_interface
                 * set_interface
                 * new_key
                 * start_ap
                 * new_station
                 * set_bss
                 * authenticate
                 * associate
                 * deauthenticate
                 * disassociate
                 * join_ibss
                 * set_tx_bitrate_mask
                 * frame
                 * frame_wait_cancel
                 * set_wiphy_netns
                 * set_channel
                 * set_wds_peer
                 * probe_client
                 * set_noack_map
                 * register_beacons
                 * start_p2p_device
                 * set_mcast_rate
                 * connect
                 * disconnect
        Supported TX frame types:
                 * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80
0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70
0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80
0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70
0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70
0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70
0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70
0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-device: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70
0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
        Supported RX frame types:
                 * IBSS: 0x40 0xb0 0xc0 0xd0
                 * managed: 0x40 0xd0
                 * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * mesh point: 0xb0 0xc0 0xd0
                 * P2P-client: 0x40 0xd0
                 * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * P2P-device: 0x40 0xd0
        software interface modes (can always be added):
                 * AP/VLAN
                 * monitor
        valid interface combinations:
                 * #{ AP } <= 8,
                   total <= 8, #channels <= 1
        HT Capability overrides:
                 * MCS: ff ff ff ff ff ff ff ff ff ff
                 * maximum A-MSDU length
                 * supported channel width
                 * short GI for 40 MHz
                 * max A-MPDU length exponent
                 * min MPDU start spacing
        Device supports TX status socket option.
        Device supports HT-IBSS.
        Device supports low priority scan.
        Device supports scan flush.
        Device supports AP scan.

I have tried to use every patch I could find on the subject, and every
one I found seems to not be compatible with the GRSEC patches or other
patches included in these kernels. I am ready and willing to test and
build any patches that anybody can provide.

Note: this seems to be related to multi-BSS, I just tested on my
public network and it pings at ~50ms

Any assistance in resolving this issue would be greatly appreciated.
--Matt

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Natanael Copa <[email-masked]>
Date: Fri, 24 Jan 2014 15:03:56 +0100

On Thu, 23 Jan 2014 19:48:41 -0600

> phy0: rt2x00queue_write_tx_frame: Error - Dropping frame due to full
...

> the kernel from stable or edge.

Can you test linux-vanilla too? If it happens with vanilla kernel then
its an upstream issue otherwise it is likely introduced with grsecurity
patch.

-nc

---

---

From: "Isan/Matt/Koryn" <[email-masked]>
Date: Mon, 27 Jan 2014 00:55:51 -0600

> its an upstream issue otherwise it is likely introduced with grsecurity

The problem does occur in vanilla, so it is an upstream issue. Perhaps
this is fixed in 3.13? Otherwise I'll have to message the rt2x00 list
unless it's already been reported to them. Thanks.

---