Re: High CPU utilization of hostap


From: Jouni Malinen (jkmaline_at_cc.hut.fi)
Date: 2002-05-05 15:14:05 UTC



On Tue, Apr 30, 2002 at 10:27:46PM +0300, Jouni Malinen wrote:

> Not likely--CPU time is most probably spent (busy) waiting something
> and 25% of CPU time would be used regardless of the CPU speed. Anyway,
> this is of course not very nice and I have to take a closer look at
> it.

I did some profiling of BAP operations with Prism2/2.5 cards--and the results do not certainly look that nice. I thought that 150 usec busy wait after transmit command was a bit much, but moving the packets to and from the card takes even more time. Single 1024 byte frame copying from BAP to host took from 383 usec (Prism2.5 on Pentium 166 MHz) to 943 usec (Addtron PC Card using PLX9052 based adapter). Assuming a throughput of 6 Mbps, this means CPU usage of 29% to 72% just for copying the data.. These were all on Intel platform; I saw a bit better numbers with PowerPC, but also these were quite near the Prism2.5 results on Intel.

The sad part is, that there is not much that can be done with PC Cards without changing hardware design.. Data copying should be offloaded to something other than CPU doing in/out loop. I'm not sure whether this can be done without extra hardware. Prism2.5 PCI cards might have better change of using DMA or bus master or something..

I'm not very familiar on how to use this kind of mechanisms, but it might be worth experimenting a bit. It would be enough to be able to tell something to copy N words (reading 16-bits at a time from the same memory address) to memory and interrupt when copying is done. This would add an extra interrupt, but it could free CPU during the 500 usec or so copying per packet..

-- 
Jouni Malinen                                            PGP id EFC895FA


This archive was generated by hypermail 2.1.4.