ath9k_htc: Bad performance on wireless-N networks (300mbit/s)
Hey people,
I'm an owner of a TP-Link TL-WN821N v3 WLAN-N-Stick and it's generally working fine (it is detected, firmware gets loaded correctly) But only if I'm connected to a G (54mbit/s) network. If I'm changing the tranfser mode of my router to 300mbit/s (N) I'm experiencing very high ping and unstable transfer rates. This problem occurs w/ various kernel versions (3.6.11, 3.7.2 and 3.84c3 and even w/ the new testing firmware for ath9k_htc and compat-drivers-3.7.1-3)
Here's some data:
# uname -a Linux helge-laptop 3.7.2-2-ck #1 SMP PREEMPT Sat Jan 12 07:22:00 EST 2013 x86_64 GNU/Linux
# lsusb Bus 001 Device 004: ID 0cf3:7015 Atheros Communications, Inc. TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
# Comparison of ping and iwconfig commands (192.168.1.1 is my local router)
G-Mode (54mbit/s)
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=2.48 ms 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=2.42 ms 64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=2.70 ms 64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=2.17 ms 64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=2.64 ms 64 bytes from 192.168.1.1: icmp_seq=6 ttl=64 time=2.62 ms 64 bytes from 192.168.1.1: icmp_seq=7 ttl=64 time=2.16 ms 64 bytes from 192.168.1.1: icmp_seq=8 ttl=64 time=2.66 ms 64 bytes from 192.168.1.1: icmp_seq=9 ttl=64 time=2.50 ms 64 bytes from 192.168.1.1: icmp_seq=10 ttl=64 time=2.66 ms
wlan0 IEEE 802.11bgn ESSID:"Schnegge"
Mode:Managed Frequency:2.472 GHz Access Point:
E0:46:9A:68:BC:52
Bit Rate=54 Mb/s Tx-Power=20 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Power Management:on
Link Quality=65/70 Signal level=-45 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:25 Missed beacon:0
N-Mode (300mbit/s)
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=268 ms 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=186 ms 64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=212 ms 64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=134 ms 64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=153 ms 64 bytes from 192.168.1.1: icmp_seq=6 ttl=64 time=281 ms 64 bytes from 192.168.1.1: icmp_seq=7 ttl=64 time=199 ms 64 bytes from 192.168.1.1: icmp_seq=8 ttl=64 time=13.1 ms 64 bytes from 192.168.1.1: icmp_seq=9 ttl=64 time=11.8 ms 64 bytes from 192.168.1.1: icmp_seq=10 ttl=64 time=109 ms
wlan0 IEEE 802.11bgn ESSID:"Schnegge"
Mode:Managed Frequency:2.472 GHz Access Point:
E0:46:9A:68:BC:52
Bit Rate=300 Mb/s Tx-Power=20 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Power Management:on
Link Quality=67/70 Signal level=-43 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
# dmesg (although it doesn't report anything too interesting) [ 26.694167] usb 1-1.2: new high-speed USB device number 4 using ehci_hcd [ 26.831936] usb 1-1.2: ath9k_htc: Firmware htc_7010.fw requested [ 26.832016] usbcore: registered new interface driver ath9k_htc [ 26.966501] usb 1-1.2: ath9k_htc: Transferred FW: htc_7010.fw, size: 72992 [ 27.027558] ath9k_htc 1-1.2:1.0: ath9k_htc: HTC initialized with 45 credits [ 27.156860] ath9k_htc 1-1.2:1.0: ath9k_htc: FW Version: 1.3 [ 27.156869] ath: EEPROM regdomain: 0x809c [ 27.156872] ath: EEPROM indicates we should expect a country code [ 27.156876] ath: doing EEPROM country->regdmn map search [ 27.156879] ath: country maps to regdmn code: 0x52 [ 27.156883] ath: Country alpha2 being used: CN [ 27.156886] ath: Regpair used: 0x52 [ 27.160378] ieee80211 phy1: Atheros AR9287 Rev:2 [ 27.160419] cfg80211: Calling CRDA for country: CN [ 27.169584] Registered led device: ath9k_htc-phy1 [ 27.169928] cfg80211: Current regulatory domain intersected: [ 27.169935] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) [ 27.169944] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm) [ 45.657610] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready [ 47.827177] wlan0: authenticate with e0:46:9a:68:bc:52 [ 47.925429] wlan0: send auth to e0:46:9a:68:bc:52 (try 1/3) [ 47.927288] wlan0: authenticated [ 47.928969] wlan0: associate with e0:46:9a:68:bc:52 (try 1/3) [ 47.931570] wlan0: RX AssocResp from e0:46:9a:68:bc:52 (capab=0x411 status=0 aid=1) [ 47.935053] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready [ 47.935338] wlan0: associated
I've also reported this bug @
https://bugzilla.kernel.org/show_bug.cgi?id=52731
update:
It seems to be a problem w/ power management. If I'm pinging while downloading w/ full speed (~1MB/s) i get reasonable ping times, as soon as the download stops, ping goes up again.
I obeserved the same behaviour if i enable and disable power management. Once PM is enabled, ping goes up, as soon as I disable it, the ping goes down.
Quoted 7 lines · Helge Bildhoff
update:
It seems to be a problem w/ power management. If I'm pinging while downloading w/ full speed (~1MB/s) i get reasonable ping times, as soon as the download stops, ping goes up again.
I obeserved the same behaviour if i enable and disable power management. Once PM is enabled, ping goes up, as soon as I disable it, the ping goes down.
That's to be expected (kind of.)
The question is whether:
* Is the NIC waking up when you attempt to send frames, or is it buffering?
* Is it sending the frame fine, then going to sleep and waiting for the next beacon to tell it that it has some traffic available before it wakes up to receive it?
Adrian