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


From: Jouni Malinen (jkmaline_at_cc.hut.fi)
Date: 2002-05-09 21:31:06 UTC



On Tue, May 07, 2002 at 05:10:28PM +0300, Jouni Malinen wrote:

> TX path needs some more work with locking since BAP0 was previously
> not used at all from hard interrupts. Otherwise separating BAP
> transfer from prism2_tx() should be quite easy.

Alas, this brought new problems.. I may have either found the reason Intersil is not supporting bus mastering or alternatively I'm using incorrect control flags somewhere.

RX with bus mastering works fine, but TX (i.e., copy from host memory to Prism2.5 memory) does not. To be more exact, TX with bus mastering works fine as long as _no_ RX packets (with or without bus mastering) are received.. This is of course not quite useful. However, I managed to find a way to overcome this--although, TX path with bus mastering is starting to be a huge kludge..

Performing enable command seems to fix bus mastering for TX, but it needs to be completed before every TX packets transfer since there might have been some RX packets that would have broken something. I used command completion event (just like with transmit command) to avoid host CPU used for busy waiting. These adds yet another interrupt for the TX path (total being 4 now), but the performance improvement seems to be worth this.

My current testing version of the driver uses bus mastering for both RX and TX. System load of the host CPU was about 40-45% with the newest released Host AP driver. This has dropped to about 5-7% for RX and 9-10% for TX with PCI bus mastering.

I'm not certain whether the extra enable commands cause any problems. Anyway, I didn't notice anything odd during testing. In addition, I added separate RX/TX packet length thresholds for bus mastering (i.e., how long the packet has to be for bus mastering to be used). These values can also be used to disable TX bus mastering.

It should also be noted that station firmware version 1.3.5 and primary firmware version 1.0.7 has some fixes to PCI corruption problems (i.e., RX/TX packets getting corrupted). These seem to occur especially with bus mastering (but also without), so updating Prism2.5-based PCI cards to at least these versions would be recommended.

-- 
Jouni Malinen                                            PGP id EFC895FA


This archive was generated by hypermail 2.1.4.