Hello,
I got the following problem using the AM3358EVM and the WL1835 wifi module, both with the old 3.2 kernel, but also with the new one (3.12). The setup looks like this:
DeviceX <---(eth)---> AM3358EVM <- - -(wifi)- - - > CiscoAP <---(eth)---> PC
- PC sends a bunch of small UDP packets to DeviceX (just 1byte of payload).
- DeviceX responds to PC with another bunch of small UDP packets.
- 1 and 2 repeat few times.
- If 1, 2 and 3 finish successfully, DeviceX starts sending continuously bigger UDP packets to the PC (most are ~= max size).
AM3358EVM is connected to CiscoAP with the following script, which also increases the UDP-related buffers:
sysctl -w net.core.rmem_max=8388608 sysctl -w net.core.wmem_max=8388608 sysctl -w net.core.rmem_default=1048576 sysctl -w net.core.wmem_default=1048576 sysctl -w net.core.optmem_max=8388608 sysctl -w net.ipv4.udp_mem='1048576 4194304 8388608' sysctl -w net.ipv4.udp_rmem_min=1048576 sysctl -w net.ipv4.udp_wmem_min=1048576 wpa_supplicant -d Dnl80211 -c/etc/wpa_supplicant.conf -iwlan0 -B wpa_cli -iwlan0 disconnect for i in `wpa_cli -iwlan0 list_networks | grep ^[0-9] | cut -f1`; do wpa_cli -iwlan0 remove_network $i; done wpa_cli -iwlan0 add_network wpa_cli -iwlan0 set_network 0 auth_alg OPEN wpa_cli -iwlan0 set_network 0 key_mgmt NONE wpa_cli -iwlan0 set_network 0 mode 0 wpa_cli -iwlan0 set_network 0 ssid '"LAPTOP178_Network"' wpa_cli -iwlan0 select_network 0 wpa_cli -iwlan0 enable_network 0 wpa_cli -iwlan0 reassociate udhcpc -i wlan0 ethtool -C eth0 rx-usecs 500
and it is configured as an ETH-WLAN bridge by running:
echo 1 > /proc/sys/net/ipv4/ip_forward iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
I have verified that the setup works, by:
- running iperfs in the two ends (I replaced DeviceX with another PC). I can reach almost 100Mbps through WL1835 !
- but also by running the above steps, with DeviceX in a different mode (testing mode from now on), which only requires much less traffic back and forth and it doesn't send continuously after that, but only for a couple of seconds. This mode NEVER fails.
The problem is that in the real scenario some UDP packets don't make it through the AM3358EVM in the step 1, meaning the PC->DeviceX direction. I've seen it work perfectly FEW times, but most of the times (99%) it just fails. I am monitoring the traffic at the PC's eth with wireshark and also with a wifi sniffer. I 've also used tcpdump on AM3358EVM and have been checking the statistics of ifconfig. When the problem occurs I see all of the packets getting out of the router, but not all of them received by AM3358EVM's wlan interface. There are no packet drops reported neither in the wlan, nor in the eth interface.
One clue that maybe is helpful is that after a failure, if I just rerun the script which connects the EVM to the router the testing mode is working again.
As I 've already said, the same failure is there with kernel 3.2 and drivers ol_r8.a6.02
, with kernel 3.2 and drivers ol_r8.a8.10 and with kernel 3.12 and the new drivers.
I also checked the driver debug info (3.12 kernel) and got the following results:
echo 8 > /proc/sys/kernel/printk echo 0x3820 > /sys/module/wlcore/parameters/debug_level cat /proc/kmsg
[ 2449.284843] wlcore: mac80211 ampdu action 0 tid 4 [ 2449.290392] wlcore: mac80211 ampdu: Rx tid 4 action 0 [ 2449.295780] wlcore: acx ba receiver session setting <7>[ 2449.284843] wlcore: mac80211 ampdu action [ 2449.301192] wlcore: cmd configure (47) 0 tid 4 <7>[ 2449.290392] wlcore: mac80211 ampd[ 2449.310217] wlcore: EVENT on mbox 0 u: Rx tid 4 action 0 <7>[ 2449.295780] wlcore: [ 2449.317315] wlcore: MBOX vector: 0x2000 acx ba receiver session setting [ 2449.325388] wlcore: DUMMY_PACKET_ID_EVENT_ID [ 2449.385400] wlcore: EVENT on mbox 1 [ 2449.389266] wlcore: MBOX vector: 0x2000 [ 2449.393350] wlcore: DUMMY_PACKET_ID_EVENT_ID [ 2449.514369] wlcore: EVENT on mbox 0 [ 2449.518124] wlcore: MBOX vector: 0x2000 [ 2449.522239] wlcore: DUMMY_PACKET_ID_EVENT_ID
I only show the results for 0x3820, because the rest parameters didn't output anything OR the system didn't work when I was testing them. Specifically the ones that broke the system were:
- 0x1 (DEBUG_IRQ)
- 0x40 (DEBUG_TX)
- 0x80 (DEBUG_RX)
and their outputs are in the attachment.1464.driver_debug.txt
When I looked into the results of 0x3820, I found out that it has to do with the AMPDU_AGGREGATION feature. So, then I built the drivers with this feature disabled (by setting the flag IEEE80211_HW_AMPDU_AGGREGATION equal to 0 in drivers/net/wireless/mac80211_hwsim.c and drivers/net/wireless/ti/wlcore/main.c files). Indeed they worked and I got no message at all now for 0x3820, BUT the problem is still here and the speed of the connection is only the half now (iperfs). So I 'm gonna enable aggregation again.
I also compiled a custom kernel, adding some networking features, without any success. I included the dynamic debug feature in that one, but I think I need some advice on where to look now using them.
So any ideas?
Any proposed tests with driver dynamic debug?
Any question?
That issue has been bothering me for weeks and it seems that the problem lays 100% on the AM3358EVM side. I would really appreciate any help : )
Brgds,
Giorgos