I am using a 2.6.32 kernel (linux-2.6.32.17-psp03.01.01.39) in combination with the backports driver package, version 3.12.2-1, to enable wl1271 support on a DM365 based platform.
The kernel modules are loaded correctly (mac80211, cfg80211, wlcore, wl12xx, wlcore_sdio), the interface gets configured correctly (ifconfig wlan0 up), it's able to scan (iw wlan0 scan) and connect to an AP (iw wlan0 connect).
I'm now running some performance/endurance tests using iperf but I encounter that the CPU utilization is rather high. In my PC I'm running the command:
iperf -s -i 2 -w 1024k &
And in the board I'm running:
iperf -c $SERVER_IP -t 240 -i 5 -w 212k
This is the iperf output:
Client connecting to 192.168.1.18, TCP port 5001
TCP window size: 212 KByte (WARNING: requested 1.00 MByte)
------------------------------------------------------------
[ 3] local 192.168.1.5 port 55058 connected with 192.168.1.18 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 5.0 sec 5.12 MBytes 8.60 Mbits/sec
[ 3] 5.0-10.0 sec 5.25 MBytes 8.81 Mbits/sec
[ 3] 10.0-15.0 sec 5.00 MBytes 8.39 Mbits/sec
...
But the CPU load is high:
Mem: 36540K used, 8312K free, 0K shrd, 952K buff, 25376K cached
CPU: 1% usr 55% sys 0% nic 5% idle 0% io 14% irq 23% sirq
Load average: 1.52 0.49 0.21 3/46 2329
PID PPID USER STAT VSZ %MEM %CPU COMMAND
1161 2 root SW 0 0% 44% [irq/56-wl12xx]
1155 2 root SW 0 0% 19% [wl12xx_wq]
2178 2176 root S 19876 44% 17% iperf -c 192.168.1.18 -t 240 -i 5 -w 1024k
1163 2 root SW 0 0% 12% [phy0]
Here, if we take out iperf, the wifi related processes are taking 75% of CPU ([irq/56-wl12xx] + [wl12xx_wq] + [phy0]) for 8.6Mbps of bandwidth. I've also detected that if the bandwidth decreases (for example If I'm further away from the AP), then CPU utilization also decreases. This matches the results in the Omap Wireless Connectivity CPU Utilization wiki (71% reported).
The process [irq/56-wl12xx] is taking most of the CPU (44%), and is related to the GIO56 where WLAN_IRQ is connected in my platform. So I've also measured the rate at which I receive MMC1 (SDIO bus) and WLAN_IRQ interrupts per second, and here are the results.
/ # cat /proc/interrupts
CPU0
...
27: 102426966 AINTC mmc1
...
56: 30716597 AINTC wl12xx
Interrupts per second:
# 1 sec
wifi interrupts: 1070
mmc interrupts: 5895
# 2 sec
wifi interrupts: 1420
mmc interrupts: 5739
# 3 sec
wifi interrupts: 1402
mmc interrupts: 6193
...
So, it seems that the wl12xx interrupts (betwen 1,000 and 1,400 per second) are causing the high cpu usage in the [irq/56-wl12xx] process.
I found a similar problem in the SDIO IRQ mode for hsmmc driver post for OMAPs (I'm in a DM365), but the link to the patch that supposedly solves the issue is broken, and a secondary needed patch is only explained in prose. Also, it seems to me that I'm not able to use SDIO IRQ for wifi interrupts as described in this post: WL1271 SDIO IRQ.
I'm looking out for ideas to improve the CPU utilization, any help is greatly appreciated.