Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packets dropped on raspberry-pi #1

Open
ilvalle opened this issue Aug 19, 2013 · 26 comments
Open

packets dropped on raspberry-pi #1

ilvalle opened this issue Aug 19, 2013 · 26 comments

Comments

@ilvalle
Copy link

ilvalle commented Aug 19, 2013

I've been using this driver with a raspberry pi (last firmware and kernel build #524 https://github.com/raspberrypi/firmware) and I haven't been able to use an open wifi, while iwconfig shows that I am connected, ifconfig shows all packages dropped.
What can I do to debug it more?
Hope it helps.

@lwfinger
Copy link
Owner

Do you know what the git commit number is for the 8188eu code that you are using? Admittedly, I have not tested with an unencrypted AP, which is what I think you mean by an "open wifi".

@ilvalle
Copy link
Author

ilvalle commented Aug 19, 2013

You are right, I meant un-encrypted with 'open'. I used the last one of today, it should be 7446992.

@lwfinger
Copy link
Owner

That was my fault. I created the bug that broke all B/G connections, not just unencrypted ones. It is fixed with commit commit 993b021.

Thanks for reporting the problem.

@ilvalle
Copy link
Author

ilvalle commented Aug 20, 2013

thanks for the quickness in looking into the issue. iwconfig shows almost 100% quality and I finally successfully received the ip from the AP, the connection is really very slow though. The dropped messages are still a lot, at least an order of magnitude against RX packages, rx packages are almost 1100 with 21000 dropped after a few minutes of uptime.

@lwfinger
Copy link
Owner

That could be something in the USB stack on the Pi. On x86_64, I get about 40 Mbps throughput on an 802.11n connection with the following packet/drop stats from ifconfig:

      RX packets:595047 errors:0 dropped:242 overruns:0 frame:0
      TX packets:525328 errors:0 dropped:2 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:715872837 (682.7 Mb)  TX bytes:443794174 (423.2 Mb)

@ilvalle
Copy link
Author

ilvalle commented Aug 20, 2013

Actually I've the same thought concerning the raspberry-pi as the main cause. For your experience is it still related to the wifi driver or into the rpi's kernel instead?
How should I start to debug the this issue?

@lwfinger
Copy link
Owner

I do not think it is the 8188eu driver as it performs fine on my laptop. It could be something caused by the slow CPU on the Pi, or it could be in the USB drivers. What distribution are you using on the Pi, and what kernel version? I guess it is time for me to get out my Pi and do some testing with it.

@ilvalle
Copy link
Author

ilvalle commented Aug 20, 2013

I use rasbian, kernel 3.6.11+ (latest available)

Paolo

2013/8/20 lwfinger notifications@github.com

I do not think it is the 8188eu driver as it performs fine on my laptop.
It could be something caused by the slow CPU on the Pi, or it could be in
the USB drivers. What distribution are you using on the Pi, and what kernel
version? I guess it is time for me to get out my Pi and do some testing
with it.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-22976139
.

@ilvalle
Copy link
Author

ilvalle commented Aug 21, 2013

Actually, iwconfig doesn't show 802.11n. How should I enable it?

pi@raspberrypi ~ $ iwconfig wlan0
wlan0     IEEE 802.11bg  ESSID:"APD"  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency:2.447 GHz  Access Point: 00:18:4D:80:F1:B6   
          Bit Rate:54 Mb/s   Sensitivity:0/0  
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=100/100  Signal level=87/100  Noise level=0/100
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

@lwfinger
Copy link
Owner

Many AP's will not advertise 802.11n capabilities unless WPA2 (AES/CCMP) encryption is selected. Yours may be one of them, or it may not support 802.11n under any circumstances.

@lwfinger
Copy link
Owner

The r8188eu driver was accepted into the staging kernel on August 22. After that acceptance, I added it to the raspberrypi/linux git repo and built a kernel. Initial testing looks good with version 3.6.11+. That code is available at http://github.com/lwfinger/linux. It is now being considered for addition to the standard http:/github.com/raspberrypi/linux repo.

I have not yet measured the speed using my standard netperf scripts, but I ran an long-term ping to a Netgear WNDR3200 router. Out of a total of 292,000 ping attempts, only 2 were lost. The RTL8188EU was plugged into a powered USB hub and was about 1.5 m from the AP. My next step will be to build and test 3.8, 3.9, and 3.10 kernels with the new driver added.

@lwfinger
Copy link
Owner

I now have longer-term results for the RTL8188EU on the Pi as follows:

wlan0 Link encap:Ethernet HWaddr a0:f3:c1:15:41:cf
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4533639 errors:0 dropped:21397 overruns:0 frame:0
TX packets:4990270 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1478376622 (1.3 GiB) TX bytes:1390008535 (1.2 GiB)

That packet drop rate seems normal to me. I still have not measured the transfer rate.

@ilvalle
Copy link
Author

ilvalle commented Aug 26, 2013

Have you used an un-encrypted AP?
Have you tried without a powered USB HUB?
For the sake of clarity, I compiled the driver as described in http://tech.enekochan.com/2013/05/29/compile-and-install-driver-for-tp-link-tl-wn725n-version-2-in-raspbian/

@lwfinger
Copy link
Owner

That reference is for a different source than mine. Why are you using it? Of course, I have no idea what might be wring!

You should
git clone http://github.com/lwfinger/rtl8188eu.git
cd rtl8188eu
make && sudo make install

All my hubs are powered and I cannot run without one as I have the wifi device, the keyboard, and a mouse. The keyboard fails when plugged into the hub, thus it needs one of the primary ports.

I finally measured the throughput with netperf and got 43 Mbps for RX and 68 Mbps for TX.

@ilvalle
Copy link
Author

ilvalle commented Aug 27, 2013

Of course, I followed the instructions in the reference but with your driver.

@lwfinger
Copy link
Owner

I have no idea what to say. The driver just works for me.

BTW, the driver code is now available in the standard repo at http://github.com/raspberrypi/linux.git in all branches for versions 3.6+. I expect it will also be included in the standard firmware derived from that.

@oldsharp
Copy link

I also experienced a package drop issue with rtl8188eu, ifconfig showed as below:

wlan0     Link encap:Ethernet  HWaddr 0c:82:68:10:58:76  
          ...
          RX packets:8734 errors:0 dropped:17089 overruns:0 frame:0
          TX packets:6680 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1367164 (1.3 MB)  TX bytes:5713074 (5.7 MB)

The commit version I used to compile is 993b021.
My environment is Ubuntu 12.04 with i386:

$ uname -rvi
3.2.0-52-generic-pae #78-Ubuntu SMP Fri Jul 26 16:43:19 UTC 2013 i386

@lwfinger
Copy link
Owner

Please provide more info regarding AP in use, encryption method, distance to AP, indicated signal strength and method used to obtain it, etc. Unless I can duplicate your result, it will be exceedingly difficult to fix.

What is the make/model of your device?

@ilvalle
Copy link
Author

ilvalle commented Aug 29, 2013

Tested on an ubuntu 64bit:

uname -rvi
3.5.0-39-generic #60~precise1-Ubuntu SMP Wed Aug 14 15:38:41 UTC 2013 x86_64

Packets dropped are an order of magnitude more those received.
un-encrypted AP (Model WPN802v2 the same used with the raspberry).
I am 5m far from the AP

Link Quality=100/100  Signal level=84/100  Noise level=0/100

@lwfinger
Copy link
Owner

lwfinger commented Sep 1, 2013

I increased the maximum RX gain. Does it help?

With this change at a distance of ~3m from the AP and going through a floor, I get

wlan1 Link encap:Ethernet HWaddr A0:F3:C1:15:41:CF
inet addr:192.168.1.41 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a2f3:c1ff:fe15:41cf/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:51790 errors:0 dropped:228 overruns:0 frame:0
TX packets:32715 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:71789176 (68.4 Mb) TX bytes:11675417 (11.1 Mb)

@oldsharp
Copy link

oldsharp commented Sep 1, 2013

Hi Larry, the AP is built via a Macbook Air and the encryption method is WPA2-PSK, my device model is Mercury MW150US, the distance to MBA is about 2 meters, and signal strength is 100/100.

I will re-build the driver and run some tests more seriously since some changes was made.

@oldsharp
Copy link

oldsharp commented Sep 4, 2013

Tested in PC with Ubuntu 13.04 x86_64, kernel version 3.8.x

Set rtl8188eu 0.5 meter away from AP, the AP info:

Cell 01 - Address: 0C:82:68:10:58:76
                    ESSID:"octocat"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.422 GHz (Channel 3)
                    Encryption key:on
                    Bit Rates:108 Mb/s
                    Extra:rsn_ie =30140100000fac040100000fac040100000fac020c00
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Quality=0/100  Signal level=100/100

With commit verison 9e9f549:

wlan0     Link encap:Ethernet  HWaddr 0c:82:68:15:71:32  
          inet addr:192.168.0.13  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::e82:68ff:fe15:7132/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1148010 errors:0 dropped:162 overruns:0 frame:0
          TX packets:677267 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1776759941 (1.7 GB)  TX bytes:66528545 (66.5 MB)

With commit version 993b021:

wlan0     Link encap:Ethernet  HWaddr 0c:82:68:15:71:32  
          inet addr:192.168.0.13  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::e82:68ff:fe15:7132/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1149783 errors:0 dropped:565 overruns:0 frame:0
          TX packets:659471 errors:0 dropped:1 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1780057113 (1.7 GB)  TX bytes:63848426 (63.8 MB)

Looks like everything is OK now.
Does the package drop issue related to kernel version? Or the i386/x86_64 architecture?

@lwfinger
Copy link
Owner

lwfinger commented Sep 4, 2013

What issue with kernel version? As far as I know, the git repo should work with any relatively new kernel. At least the code has conditional compilation for old kernels. There was a report of a fatal oops on an old kernel, but the details were never reported.

I develop the driver on x86_64 architecture, and I have tested on Raspberry Pi. What do you mean with the last question?

@oldsharp
Copy link

oldsharp commented Sep 4, 2013

I experiencing package drop issue on my i386 PC with relatively lower(3.2.0) kernel version while everything goes well on my x86_64 PC with 3.8.x kernel version.
So I wonder if kernel version and/or architecture matters.

@lwfinger
Copy link
Owner

lwfinger commented Sep 4, 2013

That will be something in the rest of the kernel. The only differences between the 8188eu code on the two versions is what is required to handle the API changes for other parts of the kernel.

@kuisathaverat
Copy link

Today version look like solve drop packets on raspberry pi, it drop only a 0.2% of rx packets

Linux raspberry pi 3.6.11+ #538
raspberrypi/linux@1587f77
raspberrypi/firmware@d4f5315
Git revision aa4ccbe

lwfinger pushed a commit that referenced this issue Jan 22, 2016
@songsen songsen mentioned this issue Nov 1, 2018
githubris referenced this issue Nov 9, 2020
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
lwfinger added a commit that referenced this issue Jun 30, 2023
The code issues a warning as follows:

[ 817.111258] WARNING: CPU: 5 PID: 772 at createbss_hdl+0x120/0x148 [8188eu]
[ 817.111502] Modules linked in: 8188eu(O) cfg80211 lib80211 [last unloaded: 8188eu]
[ 817.111520] CPU: 5 PID: 772 Comm: RTW_CMD_THREAD Tainted: G WC O 5.10.145-rt74+g1594b25154a2 #1
[ 817.111527] Hardware name: NXP S32G399A-RDB3 (DT)
[ 817.111531] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO BTYPE=--)
[ 817.111537] pc : createbss_hdl+0x120/0x148 [8188eu]
[ 817.111672] lr : rtw_cmd_thread+0x454/0x548 [8188eu]
[ 817.111806] sp : ffffffc013db3da0
[ 817.111808] x29: ffffffc013db3da0 x28: ffffffc0089c9168
[ 817.111815] x27: ffffffc008909f74 x26: 0000000000001400
[ 817.111821] x25: ffffffc0089c90f8 x24: ffffffc011010320
[ 817.111827] x23: ffffffc011010400 x22: 000000010001f8f3
[ 817.111833] x21: ffffffc011010350 x20: ffffffc01100f000
[ 817.111839] x19: ffffffc01100f000 x18: 0000000000000000
[ 817.111845] x17: 0000000000000001 x16: 0000000000000000
[ 817.111851] x15: 001fffffffffffff x14: 00000000001d7000
[ 817.111857] x13: 0000000000000370 x12: 0000000000000000
[ 817.111863] x11: 0000000000000370 x10: 00000000000008e0
[ 817.111868] x9 : ffffffc013db3960 x8 : ffffff880230eb00
[ 817.111874] x7 : 0000000000000001 x6 : ffffff8804ea9206
[ 817.111880] x5 : 0000800020000000 x4 : 0000000000000000
[ 817.111886] x3 : 000000000000ffff x2 : 0000000000000006
[ 817.111893] x1 : ffffff8804ea9200 x0 : 0000000000000000
[ 817.111900] Call trace:
[ 817.111903] createbss_hdl+0x120/0x148 [8188eu]
[ 817.112037] rtw_cmd_thread+0x454/0x548 [8188eu]
[ 817.112170] kthread+0x178/0x180
[ 817.112184] ret_from_fork+0x10/0x30
[ 817.112193] ---[ end trace 00f853683c01e7a3 ]---

My investigation shows that the test for an invalid length was placed after
the memcpy() call that generates this warning.

The fix is to move the test above the memcpy, and to increase the maximum
size of the IE buffer.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
lwfinger added a commit that referenced this issue Jul 1, 2023
The code issues a warning as follows:

[ 817.111258] WARNING: CPU: 5 PID: 772 at createbss_hdl+0x120/0x148 [8188eu]
[ 817.111502] Modules linked in: 8188eu(O) cfg80211 lib80211 [last unloaded: 8188eu]
[ 817.111520] CPU: 5 PID: 772 Comm: RTW_CMD_THREAD Tainted: G WC O 5.10.145-rt74+g1594b25154a2 #1
[ 817.111527] Hardware name: NXP S32G399A-RDB3 (DT)
[ 817.111531] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO BTYPE=--)
[ 817.111537] pc : createbss_hdl+0x120/0x148 [8188eu]
[ 817.111672] lr : rtw_cmd_thread+0x454/0x548 [8188eu]
[ 817.111806] sp : ffffffc013db3da0
[ 817.111808] x29: ffffffc013db3da0 x28: ffffffc0089c9168
[ 817.111815] x27: ffffffc008909f74 x26: 0000000000001400
[ 817.111821] x25: ffffffc0089c90f8 x24: ffffffc011010320
[ 817.111827] x23: ffffffc011010400 x22: 000000010001f8f3
[ 817.111833] x21: ffffffc011010350 x20: ffffffc01100f000
[ 817.111839] x19: ffffffc01100f000 x18: 0000000000000000
[ 817.111845] x17: 0000000000000001 x16: 0000000000000000
[ 817.111851] x15: 001fffffffffffff x14: 00000000001d7000
[ 817.111857] x13: 0000000000000370 x12: 0000000000000000
[ 817.111863] x11: 0000000000000370 x10: 00000000000008e0
[ 817.111868] x9 : ffffffc013db3960 x8 : ffffff880230eb00
[ 817.111874] x7 : 0000000000000001 x6 : ffffff8804ea9206
[ 817.111880] x5 : 0000800020000000 x4 : 0000000000000000
[ 817.111886] x3 : 000000000000ffff x2 : 0000000000000006
[ 817.111893] x1 : ffffff8804ea9200 x0 : 0000000000000000
[ 817.111900] Call trace:
[ 817.111903] createbss_hdl+0x120/0x148 [8188eu]
[ 817.112037] rtw_cmd_thread+0x454/0x548 [8188eu]
[ 817.112170] kthread+0x178/0x180
[ 817.112184] ret_from_fork+0x10/0x30
[ 817.112193] ---[ end trace 00f853683c01e7a3 ]---

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants