From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Hamilton Date: Thu, 5 Jun 2014 19:12:18 -0700 Subject: [ath9k-devel] Stable Version for ath9k_htc in AP Mode? In-Reply-To: References: <5367E75D.1070601@rempel-privat.de> <53688D75.9040006@rempel-privat.de> <536DF0AF.1030306@rempel-privat.de> <53707FE6.3030204@rempel-privat.de> <20140512131119.30298.qmail@stuge.se> <5370DF02.2070808@rempel-privat.de> <53880731.90107@rempel-privat.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org I tried running ping tests again while capturing USB traffic, and in doing so I set the hostapd beacon interval to roughly 5 seconds. While doing this, I noticed the ping latency somehow correlates with the beacon interval. Here's an example: Ping from AP to client device with beacon interval ~5 seconds: # ping 192.168.2.194 PING 192.168.2.194 (192.168.2.194): 56 data bytes 64 bytes from 192.168.2.194: seq=0 ttl=64 time=21549.225 ms 64 bytes from 192.168.2.194: seq=1 ttl=64 time=20535.767 ms 64 bytes from 192.168.2.194: seq=2 ttl=64 time=19535.339 ms 64 bytes from 192.168.2.194: seq=3 ttl=64 time=18528.473 ms 64 bytes from 192.168.2.194: seq=4 ttl=64 time=17517.608 ms 64 bytes from 192.168.2.194: seq=5 ttl=64 time=16510.559 ms 64 bytes from 192.168.2.194: seq=6 ttl=64 time=15508.789 ms 64 bytes from 192.168.2.194: seq=7 ttl=64 time=14502.075 ms 64 bytes from 192.168.2.194: seq=20 ttl=64 time=1377.839 ms 64 bytes from 192.168.2.194: seq=21 ttl=64 time=370.208 ms 64 bytes from 192.168.2.194: seq=22 ttl=64 time=189.728 ms ^C --- 192.168.2.194 ping statistics --- 52 packets transmitted, 33 packets received, 36% packet loss round-trip min/avg/max = 189.728/11757.569/21574.890 ms # Here are pings from the AP to the client with the beacon interval ~100ms: # ping 192.168.2.194 PING 192.168.2.194 (192.168.2.194): 56 data bytes 64 bytes from 192.168.2.194: seq=0 ttl=64 time=347.351 ms 64 bytes from 192.168.2.194: seq=1 ttl=64 time=366.669 ms 64 bytes from 192.168.2.194: seq=2 ttl=64 time=380.005 ms 64 bytes from 192.168.2.194: seq=3 ttl=64 time=393.005 ms 64 bytes from 192.168.2.194: seq=4 ttl=64 time=221.405 ms 64 bytes from 192.168.2.194: seq=5 ttl=64 time=429.749 ms 64 bytes from 192.168.2.194: seq=6 ttl=64 time=453.522 ms 64 bytes from 192.168.2.194: seq=7 ttl=64 time=264.465 ms 64 bytes from 192.168.2.194: seq=8 ttl=64 time=72.845 ms ^C --- 192.168.2.194 ping statistics --- 22 packets transmitted, 21 packets received, 4% packet loss round-trip min/avg/max = 72.845/252.105/453.522 ms # When I ping from the client to the AP, the pings are consistently 10 to 15ms. Any idea why latency would be low in one direction, but not the other? And why it would correlate with the beacon interval? If it helps, I've attached the USB capture from the first ping test. On Wed, Jun 4, 2014 at 11:06 AM, Aaron Hamilton wrote: > > I'll see if I can do some monitoring on the USB port. One thing I noticed: If pinging from just the AP to the client device, the latency is high. But as soon as pings are made from the client device to the AP, the latency drops. > > In case this is a kernel configuration issue, can someone point me to an ARM kernel config they've used successfully with the ath9k_htc? > > On Thu, May 29, 2014 at 9:21 PM, Oleksij Rempel wrote: >> >> Am 28.05.2014 07:36, schrieb Aaron Hamilton: >> > If one device has 7ms pings while the other consistently has 200 to >> > 1500ms pings, then wouldn't this rule out an interrupt issue? I'd assume >> > if the latency was caused by delays in interrupt processing, that both >> > devices would have similar latency problems? >> > >> > The only difference I can see between the PC (no latency) and the >> > embedded device (high latency) is that the PC is also sending other >> > traffic over the interface while the embedded device is simply >> > responding to pings. If it helps, this is a station dump for the two >> > devices: >> > >> > Station 10:0b:a9:a5:46:e4 (on wlan0) <--- low latency PC >> > inactive time:35 ms >> > rx bytes:345250 >> > rx packets:2488 >> > tx bytes:4568941 >> > tx packets:3258 >> > tx retries:0 >> > tx failed:0 >> > signal: -55 dBm >> > signal avg:-54 dBm >> > tx bitrate:2.0 MBit/s >> > Station 00:22:52:02:20:b1 (on wlan0) <--- high latency embedded device >> > inactive time:20136 ms >> > rx bytes:40968 >> > rx packets:364 >> > tx bytes:18713 >> > tx packets:127 >> > tx retries:0 >> > tx failed:0 >> > signal: -52 dBm >> > signal avg:-52 dBm >> > tx bitrate:2.0 MBit/s >> > >> > I've also attached packet captures using tcpdump on the AP. >> >> IP level capture is not interesting. More interesting is radio level >> capture - should be made in monitore mode with radiotap enabled. And >> probably more important usb traffic capture - usbmonitore module should >> be enabled. >> >> > On Mon, May 12, 2014 at 7:47 AM, Oleksij Rempel > > > wrote: >> > >> > Am 12.05.2014 15:11, schrieb Peter Stuge: >> > > Oleksij Rempel wrote: >> > >> From dmesg i see that, to one USB 1.1 root-hub attached two device, >> > >> ath9k_htc and GobiNet. GobiNet was recognised as eth1 + 3 x ttyUSB. >> > >> IMO, it is a lot for one USB 1.1. >> > > >> > > True as that may be, if there is a bandwidth requirement for the >> > > interface to function correctly and the USB protocol being used does >> > > not guarantee that bandwidth (only control+interrupt transfers could >> > > do it in a meaningful way, and they are rather low bandwidth) then >> > > the USB stack would have to allow the driver to reserve bus time, and >> > > the driver would have to make a reservation to successfully handle >> > > worst-case load. >> > > >> > > That's not neccessarily a small change. :\ >> > >> > I tested ath9k-htc on many different usb host controllers (not usb 1.1), >> > and noticed that most USB 2.0 controllers need some *msecs* to transfer >> > one Interrupt package to the adapter or at least to get ACK signal. USB >> > 3.0 was transferring same package in some *usecs*. The results should be >> > similar for both controller, but it is not the case. Even different USB >> > 2.0 controller was performing differently. >> > >> > This big difference is responsible for extremely long scan time on >> > ath9k_htc on USB 2.0. Since Interrupt Endpoints are heavily used on this >> > devices, reducing bandwidth and/or increasing transfer time for >> > Interrupt traffic will be critical. >> > >> > Best indicator for this issue would be, disabling LED subsystem to get >> > better stability. What, according to Aaron, is the case. >> > >> > -- >> > Regards, >> > Oleksij >> > >> > >> > >> > >> > _______________________________________________ >> > ath9k-devel mailing list >> > ath9k-devel at lists.ath9k.org >> > https://lists.ath9k.org/mailman/listinfo/ath9k-devel >> > >> >> >> -- >> Regards, >> Oleksij >> > -------------- next part -------------- A non-text attachment was scrubbed... Name: usblog.pcap Type: application/octet-stream Size: 513892 bytes Desc: not available Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20140605/09236c0c/attachment-0001.obj