[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: [PATCH] virtio-scsi: fixes to protection information
pi_bytesin is in the device-readable section. Document lack of residual field. Use le32 instead of u32. This matches the new patch series that Nicholas sent for vhost-scsi. Cc: <nab@daterainc.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- content.tex | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/content.tex b/content.tex index 6d6a756..c35c700 100644 --- a/content.tex +++ b/content.tex @@ -4542,7 +4542,8 @@ struct virtio_scsi_req_cmd { u8 cdb[cdb_size]; // The next two fields are only present if VIRTIO_SCSI_F_T10_PI // is negotiated. - u32 pi_bytesout; + le32 pi_bytesout; + le32 pi_bytesin; u8 pi_out[pi_bytesout]; u8 dataout[]; @@ -4555,7 +4556,6 @@ struct virtio_scsi_req_cmd { u8 sense[sense_size]; // The next two fields are only present if VIRTIO_SCSI_F_T10_PI // is negotiated - u32 pi_bytesin; u8 pi_in[pi_bytesin]; u8 datain[]; }; @@ -4610,8 +4610,9 @@ always device-readable. \field{pi_bytesout} determines the size of the \field{pi_out} field in bytes. If it is nonzero, the \field{pi_out} field contains outgoing -protection information for write operations. Both fields are only -present if VIRTIO_SCSI_F_T10_PI has been negotiated. +protection information for write operations. \field{pi_bytesin} determines +the size of the \field{pi_in} field in the device-writable section, in bytes. +All three fields are only present if VIRTIO_SCSI_F_T10_PI has been negotiated. The remainder of the device-readable part is the data output buffer, \field{dataout}. @@ -4630,10 +4631,13 @@ exceeds the size of \field{datain} means that \field{dataout} was processed partially and \field{datain} was not processed at all. -\field{pi_bytesin} determines the size of the \field{pi_in} field -in bytes. If it is nonzero, the \field{pi_in} field contains incoming -protection information for read operations. Both fields are only present -if VIRTIO_SCSI_F_T10_PI has been negotiated. +If the \field{pi_bytesin} is nonzero, the \field{pi_in} field contains +incoming protection information for read operations. \field{pi_in} is +only present if VIRTIO_SCSI_F_T10_PI has been negotiated\footnote{There + is no separate residual size for \field{pi_bytesout} and + \field{pi_bytesin}. It can be computed from the \field{residual} field, + the size of the data integrity information per sector, and the sizes + of \field{pi_out}, \field{pi_in}, \field{dataout} and \field{datain}.}. The remainder of the device-writable part is the data input buffer, \field{datain}. -- 1.9.0
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]