← Prev in month ← Prev in thread
Next in thread → Next in month →

[PATCH] content.tex: add support for protection information (VIRTIO-108)

From
Paolo Bonzini
Date
2014-05-07T09:59:00+00:00
ID
Thread
[PATCH] content.tex: add support for protection information (VIRTIO-108)
This is a new feature that was suggested by Nicholas Bellinger, who also provided a prototype implementation for vhost-scsi.  Signed-off-by: Paolo Bonzini <> ---  content.tex
41 +++++++++++++++++++++++++++++++++++++----  1 file changed, 37 insertions(+), 4 deletions(-)  diff --git a/content.tex b/content.tex index 8b570ef..0cf56d7 100644 --- a/content.tex +++ b/content.tex @@ -4381,6 +4381,9 @@ This section relies on definitions from hyperref[intro:SAM]{SAM}.  item[VIRTIO_SCSI_F_CHANGE (2)] The host will report changes to LUN
parameters via a VIRTIO_SCSI_T_PARAM_CHANGE event; the guest
SHOULD handle them. + +item[VIRTIO_SCSI_F_T10_PI (3)] The extended fields for T10 protection +
information (DIF/DIX) are included in the SCSI request header.  end{description}
subsection{Device configuration layout}label{sec:Device Types / SCSI Host Device / Device configuration layout} @@ -4496,7 +4499,12 @@ struct virtio_scsi_req_cmd {
u8 prio;
u8 crn;
u8 cdb[cdb_size]; +
// The next two fields are only present if VIRTIO_SCSI_F_T10_PI +
// is negotiated. +
u32 pi_bytesout; +
u8 pi_out[pi_bytesout];
u8 dataout[]; +
// Device-writable part
le32 sense_len;
le32 residual; @@ -4504,6 +4512,10 @@ struct virtio_scsi_req_cmd {
u8 status;
u8 response;
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[];  };
@@ -4549,13 +4561,25 @@ because whether the ORDERED task attribute is honored is vendor-specific.  to be 0. The maximum CRN value defined by the protocol is 255, since  CRN is stored in an 8-bit integer.
-All of these fields are defined in hyperref[intro:SAM]{SAM}. They are always -device-readable, as are field{cdb} and field{dataout}. field{cdb_size} is -taken from the configuration space. +The CDB is included in field{cdb} and its size, field{cdb_size}, +is taken from the configuration space. + +All of these fields are defined in hyperref[intro:SAM]{SAM} and are +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. + +The remainder of the device-readable part is the data output buffer, +field{dataout}.
field{sense} and subsequent fields are always device-writable. field{sense_len}  indicates the number of bytes actually written to the sense -buffer. field{residual} indicates the residual size, +buffer. + +field{residual} indicates the residual size,  calculated as ``data_length - number_of_transferred_bytes'', for  read or write operations. For bidirectional commands, the  number_of_transferred_bytes includes both read and written bytes. @@ -4565,6 +4589,15 @@ 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. + +The remainder of the device-writable part is the data input buffer, +field{datain}. + +  devicenormative{paragraph}{Device Operation: Request Queues}{Device Types / SCSI Host Device / Device Operation / Device Operation: Request Queues}
The device MUST write the field{status} byte as the status code as --  1.9.0
← Prev in month ← Prev in thread
Next in thread → Next in month →