|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] RE: CDB/PDU inconsistencies and residual countsAnother example of this is when you want to read 1 byte from a disk. The CDB is in blocks but the buffer (specified by the ExpectedDataTransferLength) is in bytes. FYI, SCO Unix used to do this during its install process. Eddy -----Original Message----- From: dcuddihy@attotech.com [mailto:dcuddihy@attotech.com] Sent: Tuesday, July 22, 2003 1:51 PM To: Dean Scoville Cc: ips@ece.cmu.edu Subject: Re: CDB/PDU inconsistencies and residual counts Dean, I'm taking my queues from our FCP experience, but it seems to me that the residual should be the difference between the iSCSI and SCSI layers. > For example, suppose an initiator sends a 4 block SCSI Read command > but for some reason thinks the block size is 1024 bytes when in actuality > the disk has 512 byte blocks. The SCSI Command PDU would have an >"expected data transfer length" of value of 4096 bytes, but the target would > actually return 2048 bytes (based on the true block size). Should the target > set the underflow bit and return a residual count (based on the iSCSI PDU), > or should it return no underflow and no residual count (based on the SCSI CDB)? In this case it is a 2048 byte underflow. > Another example would be if the "allocation length" field in the CDB for > an Inquiry command doesn't match the "expected data transfer length" field > in the SCSI Command PDU. That's a pretty cool test case... In most cases where there is an allocation length, the overflow is reflectedin the SCSI response, so there's no residual. (IE if there's more data in the inquiry response than the allocation length will allow, just report the length in the SCSI response but don't indicate an overflow.) In the case where allocation length would allow for a transfer larger than the "expected data transfer length" at the ISCSI layer this should report an overflow and residual, since everything in the SCSI response could not be transferred by the ISCSI layer. btw: Report Luns works similarly, where underflow is reported, but overflow is handled by the length field in the SCSI response -- as long as the allocation length and the "expected data transfer length" match. regards, David David J Cuddihy Principal Engineer ATTO Technology, Inc. http://www.attotech.com/fcbridge.html dcuddihy@attotech.com "Dean Scoville" <dean.scoville@q To: "Julian Satran" <Julian_Satran@il.ibm.com> logic.com> cc: <ips@ece.cmu.edu> Sent by: Subject: CDB/PDU inconsistencies and residual counts owner-ips@ece.cm u.edu 07/22/03 12:43 PM Julian, The overflow/underflow and residual count values in Data-in and SCSI Response PDUs are set by the target based on the expected transfer length for the command, but should these values be set based on the CDB (SCSI layer) or based on the PDU "expected data transfer length" field (iSCSI layer)? For example, suppose an initiator sends a 4 block SCSI Read command but for some reason thinks the block size is 1024 bytes when in actuality the disk has 512 byte blocks. The SCSI Command PDU would have an "expected data transfer length" of value of 4096 bytes, but the target would actually return 2048 bytes (based on the true block size). Should the target set the underflow bit and return a residual count (based on the iSCSI PDU), or should it return no underflow and no residual count (based on the SCSI CDB)? The question comes up because I was running some iSCSI protocol test scripts where the PDU "expected transfer length" and the transfer length in the CDB were inconsistent in one of the scripts. Another example would be if the "allocation length" field in the CDB for an Inquiry command doesn't match the "expected data transfer length" field in the SCSI Command PDU. The script was in error and should be fixed, is there a desired target behavior in such situations, given that the CDB fields are not typically parsed by the iSCSI layer, the SCSI device may know nothing about iSCSI PDUs, and some middle-layer may or may not know about both. If the initiator detects that an underflow has occurred, based solely on the amount of data received and the "expected data transfer field" in the iSCSI PDU, but the target did not report an underflow or residual count in the SCSI response, is the initiator allowed/expected to report an underflow to the upper layers? Thanks, Dean Scoville
Home Last updated: Tue Aug 05 12:46:11 2003 12771 messages in chronological order |