Exclusive access of SCSI/ATA devices from user space
Alexander Motin
mav at FreeBSD.org
Thu Sep 20 19:23:14 UTC 2012
> Is there really no sorting of I/O requests inside cam passthrough
> driver, or cam transport layer? Say if I send one i/o request to
> selected device via cam passthrough driver and then send other one,
> before previous one is completed.
There is no sorting in pass driver, as it passes all requests to CAM
immediately. CAM transport also does not intentionally sort requests
during normal operation. In some rare error recovery cases it may be
difficult to manage original request order during requests requeueing or
retrying. CAM tries to do it right, but I am not sure it can be guarantied.
> Do I need to modify cam transport layer also, to switch ata device
> from PIO to DMA and vice versa for data transfer and to disable SATA
> NCQ, and Command tag queing ; or CAM passthrough driver will be able
> to do that.
No, you don't need to modify. CAM provides APIs to control mode setting
and command queuing via methods of the same PASS interface. If you are
using pass interface, it is actually your duty to use proper command set
(PIO/DMA/FPDMA) with the device, respecting current operation mode set
by CAM. If CAM negotiated DMA with NCQ, you are free to use any of these
kinds of commands in a mix you like.
--
Alexander Motin
More information about the freebsd-drivers
mailing list