PCI bus master with Prism2.5 (was: High CPU utilization of hostap)


From: Jouni Malinen (jkmaline_at_cc.hut.fi)
Date: 2002-05-06 18:42:52 UTC



On Sun, May 05, 2002 at 06:14:05PM +0300, Jouni Malinen wrote:

> 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..

It looks like this can be done on Prism2.5 PCI cards. However, it is more or less undocumented and unsupported.. After some guesses and testing, I managed to find (apparently ;-) proper control bits for reading and writing data from BAPs using bus master (i.e., driver just gives a memory address to the Prism2.5 and asks it to move N words of data from/to BAP to/from memory). I would assume that this would be a great performance improvement as far as host CPU is considered.

My current test version has a divided prism2_rx() function. RX event handler gets rxdesc using normal BAP access and if the data length is above a given threshold, it uses bus master to move the payload to host memory. After bus master has completed the move, another interrupt is generated and the remaining prism2_rx() functionality is completed. This seems to work (and similar division could be done also for TX path). However, there seems to be some stability problems..

The card seems to handle ping floods for some time, but continued ping flood (or even short UDP flood with more packets) seems to be enough to kill it. This causes hwreset, which seems to success but the host dies shortly after this for some unknown reason..

I'll try to check if this stability problem (or at least the complete hang) can be fixed and also implement TX side. Since Intersil does not seem to support PCI bus master stuff, I do not even know whether it is supposed to works with the current hardware/firmware.. So the crash may be due to bug in that or the driver. In addition, guessing suitable bits for control registers does not necessarily end up in best possible configuration ;-).

-- 
Jouni Malinen                                            PGP id EFC895FA


This archive was generated by hypermail 2.1.4.