tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
fixing mpii(4) for tls_maxphys
Hi
I am still trying - without much success - to fix mpii(4) for tls_maxphys.
The board is known to support 512 kB blocks. I tried building a tls_maxphys
kernel with MAXPHYS set to 1024 kB, but this is not enough to get it
working. I identified two problems.
First problem: the worst case scenario for a 512 kB transfer is 128
different pages, which a bus_dmamap_t with 128 segments. I understand
mpii(4) need additional "chaining" segements, and debug printfs
have shown it uses at most 141 segments in my test case, otherwise
I get a EFBIG. Ths bus_dmamap_t segment count is set here:
if (bus_dmamap_create(sc->sc_dmat, MAXPHYS,
sc->sc_max_sgl_len, MAXPHYS, 0,
BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW,
&ccb->ccb_dmamap) != 0) {
With sc->sc_max_sgl_len set from MPII_MAX_SGL (currently 32)
minus chaining entries count. Let's say we need to set MPII_MAX_SGL to
256 segments until I understand the whole thing. The MAXPHYS here also
needs to be changed into MPII_MAXFER:
#define MPII_MAX_SGL 256
(...)
#define MPII_MAXFER (512 * 1024)
(...)
if (bus_dmamap_create(sc->sc_dmat, MPII_MAXFER,
sc->sc_max_sgl_len, MPII_MAXFER, 0,
BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW,
&ccb->ccb_dmamap) != 0) {
Second problem: MPII_MAX_SGL is used to set the size of mcb->mcb_sgl:
struct mpii_ccb_bundle {
struct mpii_msg_scsi_io mcb_io; /* sgl must follow */
struct mpii_sge mcb_sgl[MPII_MAX_SGL];
struct scsi_sense_data mcb_sense;
} __packed;
If I set it higher than 32, the adapter complains about invalid SGL,
and I do not get sense data reported anymore (it is all zeroes). This
suggests struct mpii_ccb_bundle size is mandated by the adapter. But
if that is the case, how can I manage to perform a 512 kB transfer with
4 kB pages?
Obviously I am missing something.
--
Emmanuel Dreyfus
ESPCI ParisTech - Service informatique
Emmanuel.Dreyfus%espci.fr@localhost
Home |
Main Index |
Thread Index |
Old Index