scsi: Documentation for the SCSI protection information/DIF support Signed-off-by: Martin K. Petersen --- diff --git a/Documentation/scsi/data-integrity.txt b/Documentation/scsi/data-integrity.txt new file mode 100644 --- /dev/null +++ b/Documentation/scsi/data-integrity.txt @@ -0,0 +1,50 @@ +---------------------------------------------------------------------- +1.0 INTRODUCTION + +For a general overview of the data integrity framework please consult +Documentation/block/data-integrity.txt. + +---------------------------------------------------------------------- +2.0 SCSI LAYER IMPLEMENTATION DETAILS + +The scsi_command has been extended with a scatterlist for the +integrity metadata. Note that all SCSI mid layer changes refer to +this using the term "protection information" which is what it is +called in the T10 spec. + +The term DIF (Data Integrity Field) is specific to SCSI disks (SBC). +The SCSI midlayer doesn't know, or care, about the contents of the +protection scatterlist, except it calls blk_rq_map_integrity_sg() +during command initialization. + + +2.1 SCSI DISK SETUP + +In the case of a SCSI disk the actual DIF protection format is +contained in in result of READ CAPACITY(16). Consequently we have to +use the 16-byte READ CAPACITY variant if the device is +protection-capable (has PROTECT bit set in INQUIRY). + +If the device has DIF-enabled we'll negotiate capabilities with the +HBA. And if the HBA is capable of protection DMA, the blk_integrity +profile will be registered. + +Currently we only support Type 1 and Type 3. Type 2 is only defined +for 32-byte CDBs and is awaiting varlen CDB support. + +The controller may support checksum conversion as an optimization. +Initial benchmarks showed that calculating a 16-bit CRC for each 512 +bytes of an I/O was expensive. Emulex' hardware had the capability to +convert an IP checksum to the T10 CRC on the wire. So as part of the +negotiation process the checksum algorithm will be selected and the +blk_integrity profile set accordingly. + +---------------------------------------------------------------------- +3.0 HBA INTERFACE + +See the following doc: + +http://oss.oracle.com/projects/data-integrity/dist/documentation/linux-hba.pdf + +---------------------------------------------------------------------- +2007-12-24 Martin K. Petersen