tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

fixing mpii(4) for tls_maxphys, updated



Hi

I made progress in my understanding of what mpii(4) is unable to cope
with 512 kB transfers on tls_maxphys branch. Here is what I understand
now:

First, the request size of 512 in our driver is wrong. The controller
expects 128 bytes requests, which the following layout:
- 96 bytes of struct mpii_msg_scsi_io
- 2x12 bytes of scatter-gather entry (SGE)
- 8 unused bytes

For 512 bytes trasnfers, everything fits in the that request, and this
is why the driver works fine with 512 bytes blocks, despite the request
length being wrong.

Now if we use 512 kB transfer, there are 128 pages, which means in the
worst case scenatio, 128 non contiguous pages which require 128 SGE
describing the segments to be transfered. That does not fit in a single
request, and the transfer should now be done like this:

Request 1:
- 96 bytes of struct mpii_msg_scsi_io
- 12 bytes of SGE
- 12 bytes of chaining element to first SGE in next request

Requests 2 o 15:
- 9 x 12 bytes of SGE
- 12 bytes of chaining element to first SGE in next request

Request 16:
- 12 bytes of SGE

That does not fit at all with how the driver is written. There is a
dmamap for requests, and mpii_load_xs() uses a struct mpii_ccb for a
given transfer. That structure is asociated with a single request, while
it should be able to be associated with up to 16. 

Ideas on how to refactor the code are welcome.

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index