Subject: iSCSI: Inquiry, Mode Sense, Read Capacity

From: [email-masked]
Date: Wed, 3 Oct 2001 11:24:54 -0400

These are SCSI questions that are not specific to iSCSI.

> Q1:
> Suppose an iSCSI initiator sends an iSCSI target an iSCSI 
> PDU which encapsulates a SCSI Inquiry command.  In which 
> type of PDU does the iSCSI initiator expect SCSI inquiry 
> data to be received?
> 
> - SHOULD/MUST/MAY target send SCSI inquiry data with 
>   SCSI Response PDU, or
> - SHOULD/MUST/MAY target send SCSI inquiry data with 
>   a PDU other than SCSI Response PDU?
> 
> The same questions are also for SCSI Mode Sense and 
> SCSI Read Capacity commands.

The answers are to be found in careful reading of the relevant
SCSI specs - SAM2, SBC, and SBC2 in this case.  The SCSI specs
make specific distinctions among data, status, and response,
and the T10 document editors are very good about making sure
that such terms are well-defined and used only in the manner
defined.  INQUIRY, MODE SENSE, and READ CAPACITY are all
defined to return data, and hence would use one or more iSCSI
Data-in PDUs for that purpose.  The Response PDU is there
for dealing with command completion and the like.  For example,
if one of these commands starts to transfer data and then fails
at the Target, one would see one or more Data-in PDUs followed
by a Response PDU containing CHECK CONDITION or something
like that, and the data field of the Response PDU would be
needed for the sense data (AutoSense is mandatory for iSCSI)
and the like.
 
> Q2:
> There are 10 target opcodes on page 43 of v.07, and two of 
> them are specified as:
> 
> - 0x21 SCSI Response (contains SCSI status and possibly 
>   sense information or other response information) 
> - 0x25 SCSI Data-in (for READ operations)
> 
> The question is what this "READ" is for?  Is it for reading SCSI 
> data **only**, or can it be also used to read SCSI Inquiry Data
> /Mode Sense Data/Capacity Data, etc.?

See previous answer.  Data-in transfers data for any SCSI command
that has data to transfer.  This includes all three of your examples.
"READ" actually includes any SCSI command that transfers "data" (as
that term is defined by SCSI) from Target to Initiator.  This includes
INQUIRY, MODE SENSE, and READ CAPACITY.

> Q3:
> If both SCSI Response PDU and 0x25 SCSI Data-in PDU can be 
> used to read SCSI Inquiry Data/Mode Sense Data/Capacity Data, 
> how should we specify this in the draft and make it clearer?  Adding
> a sample for SCSI Inquiry/Mode Sense could be helpful for people
> to understand this.

The assumption following the "If" is incorrect, and IMHO, this is
already sufficiently clear from the T10 SCSI specs, which MUST be
read in conjunction with the iSCSI spec to completely understand
how SCSI works over iSCSI.

OTOH, Section 3.7 of the iSCSI draft could use a couple of sentences
pointing out that the Data-in and Data-out PDUs are used for all SCSI
data transfers, not just those associated with the READ and WRITE
commands.

Thanks,
--David

---------------------------------------------------
David L. Black, Senior Technologist
EMC Corporation, 42 South St., Hopkinton, MA  01748
+1 (508) 435-1000 x75140     FAX: +1 (508) 497-8500
[email-masked]       Mobile: +1 (978) 394-7754
---------------------------------------------------

---

From: "Lee Xing" <[email-masked]>
Date: Wed, 3 Oct 2001 13:00:14 -0500

David,

Thanks for the info.  It helps.  
Please see my new question below.

> (-snip)

New Question:

on page 23 of v.08, it says "For performance reasons, iSCSI allows 
a "phase-collapse".  A command and its associated data may be 
shipped together from initiator to target and data and responses 
may be shipped together from targets."

The question is if "Data-in transfers data for any SCSI command 
that has data to transfer" (see the answer to Q2) is a true 
statement, should we clear the above sentence (on page 23 of v.08) 
a bit?

Thanks.

Lee 
Crossroads Systems, Inc.

---

From: "Julian Satran" <[email-masked]>
Date: Wed, 3 Oct 2001 22:46:44 +0300

David is right. Response doe not contain data proper.
Phase collapse is for the last DataPDU in which a target can fit a GOOD 
status (and thus avoid an additional response) and some residual counts 
(when those are not considered errors).

Julo

[email-masked]
Sent by: [email-masked]
03-10-01 20:21
Please respond to Black_David

        To:     [email-masked], [email-masked]
        cc: 
        Subject:        RE: iSCSI: Inquiry, Mode Sense, Read Capacity

The governing text is the following from p.62 of -08 on the contents of
the Response PDU:

     3.4.6 Data Segment - Sense and Response Data Segment 
 
        iSCSI targets MUST support and enable autosense.  If Status is 
CHECK

        CONDITION (0x02), then the Data Segment contains sense data for 
the 
        failed command. 
 
        For some iSCSI responses, the response data segment MAY contain 
some

        response related information, (e.g., for a target failure it may 
        contain a vendor specific detailed description of the failure). 

Julian may be able to shed more light on the intended meaning of
"phase collapse" for the response case, but the above text makes
it quite clear that data transferred by the action of a SCSI command
(including Read, Inquiry, Mode Sense, and Read Capacity) cannot be
put in the Response PDU.  A target can send the Response PDU immediately
following the last Data-In PDU for the associated command, which is
similar to the ability of an Initiator to send unsolicited Data-Out
PDUs.  There is no Target analog to the Initiator's ability to send
Immediate Data in the same PDU as the SCSI command.

Thanks,
--David

> -----Original Message-----
> From: Lee Xing [mailto:[email-masked]]
> Sent: Wednesday, October 03, 2001 2:00 PM
> To: [email-masked]; [email-masked]
> Subject: RE: iSCSI: Inquiry, Mode Sense, Read Capacity
> 
> 
> David,
>