Return-Path: <owner-ips-outgoing@ece.cmu.edu>
Received: from newbox.ece.cmu.edu (localhost [127.0.0.1])
	by newbox.ece.cmu.edu (Cyrus v2.1.12) with LMTP; Tue, 22 Jul 2003 14:23:15 -0400
X-Sieve: CMU Sieve 2.2
Received: from hazard.ece.cmu.edu (HAZARD.ECE.CMU.EDU [128.2.129.24])
	by newbox.ece.cmu.edu (Postfix) with ESMTP id 4A56F32F9
	for <ipsml@ece.cmu.edu>; Tue, 22 Jul 2003 14:23:15 -0400 (EDT)
Received: by hazard.ece.cmu.edu (Postfix, from userid 953)
	id D5C0B135; Tue, 22 Jul 2003 14:23:14 -0400 (EDT)
Received: from sos.ece.cmu.edu (SOS.ECE.CMU.EDU [128.2.129.27])
	by hazard.ece.cmu.edu (Postfix) with ESMTP
	id 105FA12F; Tue, 22 Jul 2003 14:23:04 -0400 (EDT)
Received: by sos.ece.cmu.edu (Postfix)
	id D333989E4; Tue, 22 Jul 2003 14:22:43 -0400 (EDT)
Delivered-To: ips-outgoing@sos.ece.cmu.edu
Received: from osgood.ece.cmu.edu (OSGOOD.ECE.CMU.EDU [128.2.129.25])
	by sos.ece.cmu.edu (Postfix) with ESMTP id BD6C389E2
	for <ips-outgoing@sos.ece.cmu.edu>; Tue, 22 Jul 2003 14:22:43 -0400 (EDT)
Received: by osgood.ece.cmu.edu (Postfix)
	id 819EBA0; Tue, 22 Jul 2003 14:22:43 -0400 (EDT)
Delivered-To: ips-outgoing@ece.cmu.edu
Received: by osgood.ece.cmu.edu (Postfix, from userid 953)
	id 5C01F8C; Tue, 22 Jul 2003 14:22:43 -0400 (EDT)
Received: from sos.ece.cmu.edu (SOS.ECE.CMU.EDU [128.2.129.27])
	by osgood.ece.cmu.edu (Postfix) with ESMTP id DC254A4
	for <ips-outgoing@ece.cmu.edu>; Tue, 22 Jul 2003 14:22:26 -0400 (EDT)
Received: by sos.ece.cmu.edu (Postfix, from userid 363)
	id C424989E6; Tue, 22 Jul 2003 14:22:26 -0400 (EDT)
X-Original-To: ips@sos.ece.cmu.edu
Delivered-To: ips@sos.ece.cmu.edu
Received: from bache.ece.cmu.edu (BACHE.ECE.CMU.EDU [128.2.129.23])
	by sos.ece.cmu.edu (Postfix) with ESMTP id 337F689E2
	for <ips@sos.ece.cmu.edu>; Tue, 22 Jul 2003 14:22:25 -0400 (EDT)
Received: by bache.ece.cmu.edu (Postfix)
	id D19127F; Tue, 22 Jul 2003 14:22:24 -0400 (EDT)
Delivered-To: ips@ece.cmu.edu
Received: by bache.ece.cmu.edu (Postfix, from userid 953)
	id 8B09F72; Tue, 22 Jul 2003 14:22:24 -0400 (EDT)
Received: from mail.ivivity.com (unknown [64.238.111.99])
	by bache.ece.cmu.edu (Postfix) with ESMTP id 8DF8592
	for <ips@ece.cmu.edu>; Tue, 22 Jul 2003 14:22:09 -0400 (EDT)
Received: by atlops.ivivity.com with Internet Mail Service (5.5.2653.19)
	id <PN7469QD>; Tue, 22 Jul 2003 14:22:08 -0400
Message-ID: <AEC4671C8179D61194DE0002B328BDD27C34F2@atlops.ivivity.com>
From: Eddy Quicksall <eddy_quicksall@ivivity.com>
To: Alex Iannicelli <alex.iannicelli@trebia.com>,
	Eddy Quicksall <eddy_quicksall@ivivity.com>,
	Dean Scoville <dean.scoville@qlogic.com>,
	Julian Satran <Julian_Satran@il.ibm.com>
Cc: ips@ece.cmu.edu
Subject: RE: CDB/PDU inconsistencies and residual counts
Date: Tue, 22 Jul 2003 14:22:07 -0400
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C3507E.286F73C0"
Sender: owner-ips@ece.cmu.edu
Precedence: bulk
X-Spam-Status: No, hits=-11.9 required=5.0
	tests=BAYES_10,HTML_60_70,HTML_FONT_COLOR_BLUE,ORIGINAL_MESSAGE
	version=2.50
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp)

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C3507E.286F73C0
Content-Type: text/plain

When I said "determined", I did not mean "implemented". I meant that the
SCSI layer is what interprets the CDB. I didn't mean to answer to an
implementation.
 
Eddy
 
-----Original Message-----
From: Alex Iannicelli [mailto:alex.iannicelli@trebia.com] 
Sent: Tuesday, July 22, 2003 1:37 PM
To: Eddy Quicksall; Dean Scoville; Julian Satran
Cc: ips@ece.cmu.edu
Subject: RE: CDB/PDU inconsistencies and residual counts
 
My take:
 
The overflow/underflow is determined by the iSCSI layer. The SCSI layer
simply tries to satisfy the CDB. If the SCSI layer hands the iSCSI layer too
much data (more than ExpectedDataTransferLength) the iSCSI layer will mark
it as overflow. If the SCSI layer does not hand the iSCSI layer enough data
(very common when sending INQUIRY) then the iSCSI layer must mark it as an
underflow.
 
Also, the target must NEVER send too much data even if the SCSI layer tries
to issue more than ExpectedDataTransferLength. This data should be truncated
by the iSCSI layer and marked as overflow. Overflow does NOT indicate that
the target just sent more data then was requested in the
ExpectedDataTransferLength.
 
Alex
-----Original Message-----
From: Eddy Quicksall [mailto:eddy_quicksall@ivivity.com]
Sent: Tuesday, July 22, 2003 1:26 PM
To: Dean Scoville; Julian Satran
Cc: ips@ece.cmu.edu
Subject: RE: CDB/PDU inconsistencies and residual counts
My take is this:
 
The overflow/underflow is determined by the SCSI layer. This is because the
"expected data transfer length" gives the size of the initiators buffer and
the CDB gives the size of the "attempted transfer". If the target is
attempting to transfer too much, that would be an overflow.
 
In some transports (like parallel SCSI) this is not determined by the target
but is determined by the initiator driver or host adapter. In this case the
target will try to stay in data-in phase to transfer all of the data. The
initiator sees this as an overflow.
 
Eddy
 
-----Original Message-----
From: Dean Scoville [mailto:dean.scoville@qlogic.com] 
Sent: Tuesday, July 22, 2003 12:43 PM
To: Julian Satran
Cc: ips@ece.cmu.edu
Subject: CDB/PDU inconsistencies and residual counts
 
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 

------_=_NextPart_001_01C3507E.286F73C0
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">


<meta name=3DProgId content=3DWord.Document>
<meta name=3DGenerator content=3D"Microsoft Word 10">
<meta name=3DOriginator content=3D"Microsoft Word 10">
<link rel=3DFile-List href=3D"cid:filelist.xml@01C3505C.A0578750">
<title>CDB/PDU inconsistencies and residual counts</title>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
 name=3D"time"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
 name=3D"date"/>
<!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:DoNotRelyOnCSS/>
 </o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:SpellingState>Clean</w:SpellingState>
  <w:DocumentKind>DocumentEmail</w:DocumentKind>
  <w:EnvelopeVis/>
 </w:WordDocument>
</xml><![endif]--><!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Verdana;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:536871559 0 0 0 415 0;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:1627421319 -2147483648 8 0 66047 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
p
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
span.EmailStyle18
	{mso-style-type:personal;
	mso-style-noshow:yes;
	mso-ansi-font-size:10.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:Arial;
	mso-ascii-font-family:Arial;
	mso-hansi-font-family:Arial;
	mso-bidi-font-family:Arial;
	color:navy;}
span.spelle
	{mso-style-name:spelle;}
span.EmailStyle20
	{mso-style-type:personal-reply;
	mso-style-noshow:yes;
	mso-ansi-font-size:10.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:Arial;
	mso-ascii-font-family:Arial;
	mso-hansi-font-family:Arial;
	mso-bidi-font-family:Arial;
	color:navy;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */=20
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin:0in;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";}
</style>
<![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple =
style=3D'tab-interval:.5in'>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>When I said "determined", I
did not mean "implemented". I meant that the SCSI layer is what
interprets the CDB. I didn't mean to answer to an =
implementation.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>=


<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Eddy<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>=


<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>-----Original =
Message-----<br>
<b><span style=3D'font-weight:bold'>From:</span></b> Alex Iannicelli
[mailto:alex.iannicelli@trebia.com] <br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> =
</span></font><st1:date
Month=3D"7" Day=3D"22" Year=3D"2003"><font size=3D2 face=3DTahoma><span =
style=3D'font-size:
 10.0pt;font-family:Tahoma'>Tuesday, July 22, =
2003</span></font></st1:date><font
size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma'> </span></font><st1:time
Hour=3D"13" Minute=3D"37"><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
 font-family:Tahoma'>1:37 PM</span></font></st1:time><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'><br>
<b><span style=3D'font-weight:bold'>To:</span></b> Eddy Quicksall; Dean =
Scoville;
Julian Satran<br>
<b><span style=3D'font-weight:bold'>Cc:</span></b> ips@ece.cmu.edu<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> RE: CDB/PDU
inconsistencies and residual counts</span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
color=3Dblue
face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;color:blue'>My
take:</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
color=3Dblue
face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;color:blue'>The
overflow/underflow is determined by the iSCSI layer. The SCSI layer =
simply
tries to satisfy the CDB. If the SCSI layer hands the iSCSI layer too =
much data
(more than </span></font><span class=3Dspelle><font size=3D2 =
color=3Dnavy face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>ExpectedDataTran=
sferLength)
</span></font></span><font size=3D2 color=3Dblue face=3DVerdana><span
style=3D'font-size:10.0pt;font-family:Verdana;color:blue'>the iSCSI =
layer will
mark it as overflow. If the SCSI layer&nbsp;does not&nbsp;hand the =
iSCSI layer
enough data (very common when sending INQUIRY) then the iSCSI layer =
must mark
it as an underflow.</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
color=3Dblue
face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;color:blue'>Also,
the target must NEVER send too much data even if the SCSI layer tries =
to issue
more than </span></font><span class=3Dspelle><font size=3D2 =
color=3Dnavy face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>ExpectedDataTran=
sferLength</span></font></span><font
size=3D2 color=3Dblue face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;
color:blue'>. This data should be truncated by the iSCSI layer and =
marked as
overflow. Overflow does NOT indicate that the target just sent more =
data then
was requested in the </span></font><span class=3Dspelle><font size=3D2 =
color=3Dnavy
face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>ExpectedDataTran=
sferLength</span></font></span><font
size=3D2 color=3Dblue face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;
color:blue'>.</span></font><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
color=3Dblue
face=3DVerdana><span =
style=3D'font-size:10.0pt;font-family:Verdana;color:blue'>Alex</span></f=
ont><o:p></o:p></p>

</div>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:.5in'><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma'>-----Original Message-----<br>
<b><span style=3D'font-weight:bold'>From:</span></b> Eddy Quicksall
[mailto:eddy_quicksall@ivivity.com]<br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> =
</span></font><st1:date
Month=3D"7" Day=3D"22" Year=3D"2003"><font size=3D2 face=3DTahoma><span =
style=3D'font-size:
 10.0pt;font-family:Tahoma'>Tuesday, July 22, =
2003</span></font></st1:date><font
size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma'> </span></font><st1:time
Hour=3D"13" Minute=3D"26"><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
 font-family:Tahoma'>1:26 PM</span></font></st1:time><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'><br>
<b><span style=3D'font-weight:bold'>To:</span></b> Dean Scoville; =
Julian Satran<br>
<b><span style=3D'font-weight:bold'>Cc:</span></b> ips@ece.cmu.edu<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> RE: CDB/PDU
inconsistencies and residual counts</span></font><o:p></o:p></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
color=3Dnavy face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'><!-- Converted =
from text/rtf format -->My
take is this:<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
color=3Dnavy face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p=
></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
color=3Dnavy face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>The =
overflow/underflow is
determined by the SCSI layer. This is because the &quot;expected data =
transfer
length&quot; gives the size of the initiators buffer and the CDB gives =
the size
of the &quot;attempted transfer&quot;. If the target is attempting to =
transfer
too much, that would be an overflow.<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
color=3Dnavy face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p=
></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
color=3Dnavy face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>In some =
transports (like
parallel SCSI) this is not determined by the target but is determined =
by the
initiator driver or host adapter. In this case the target will try to =
stay in
data-in phase to transfer all of the data. The initiator sees this as =
an
overflow.<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
color=3Dnavy face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p=
></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
color=3Dnavy face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>Eddy<o:p></o:p><=
/span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
color=3Dnavy face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p=
></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:1.0in'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>-----Original =
Message-----<br>
<b><span style=3D'font-weight:bold'>From:</span></b> Dean Scoville
[mailto:dean.scoville@qlogic.com] <br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> =
</span></font><st1:date
Month=3D"7" Day=3D"22" Year=3D"2003"><font size=3D2 face=3DTahoma><span =
style=3D'font-size:
 10.0pt;font-family:Tahoma'>Tuesday, July 22, =
2003</span></font></st1:date><font
size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma'> </span></font><st1:time
Hour=3D"12" Minute=3D"43"><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
 font-family:Tahoma'>12:43 PM</span></font></st1:time><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'><br>
<b><span style=3D'font-weight:bold'>To:</span></b> Julian Satran<br>
<b><span style=3D'font-weight:bold'>Cc:</span></b> ips@ece.cmu.edu<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> CDB/PDU =
inconsistencies
and residual counts</span></font><o:p></o:p></p>

<p class=3DMsoNormal style=3D'margin-left:1.0in'><font size=3D3 =
face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p style=3D'margin-left:1.0in'><font size=3D2 face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial'>Julian,</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>The
overflow/underflow and residual count values in Data-in and =
</span></font><br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>SCSI
Response PDUs are set by the target based on the expected</span></font> =
<br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>transfer
length for the command, but should these values be set =
based</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>on the
CDB (SCSI layer) or based on the PDU &quot;expected data transfer =
length&quot;</span></font>
<br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>field
(iSCSI layer)?</span></font> <o:p></o:p></p>

<p style=3D'margin-left:1.0in'><font size=3D2 face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial'>For example, suppose an initiator sends a 4 =
block
SCSI Read command</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>but
for some reason thinks the block size is 1024 bytes when in =
actuality</span></font>
<br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>the
disk has 512 byte blocks. The SCSI Command PDU would have an =
</span></font><br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>&quot;expected
data transfer length&quot; of value of 4096 bytes, but the target =
would</span></font>
<br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>actually
return 2048 bytes (based on the true block size). Should the =
target</span></font>
<br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>set
the underflow bit and return a residual count (based on the iSCSI =
PDU),</span></font>
<br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>or
should it return no underflow and no residual count (based on the SCSI =
CDB)?</span></font>
<o:p></o:p></p>

<p style=3D'margin-left:1.0in'><font size=3D2 face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial'>The question comes up because I was running =
some
iSCSI protocol test</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>scripts
where the PDU &quot;expected transfer length&quot; and the transfer =
length </span></font><br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>in the
CDB were inconsistent in one of the scripts.</span></font> =
<o:p></o:p></p>

<p style=3D'margin-left:1.0in'><font size=3D2 face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial'>Another example would be if the =
&quot;allocation
length&quot; field in the CDB for</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>an
Inquiry command doesn't match the &quot;expected data transfer =
length&quot;
field</span></font> <br>
<font size=3D2 face=3DArial><span style=3D'font-size:10.0pt;font-family:=
Arial'>in the
SCSI Command PDU.</span></font> <o:p></o:p></p>

<p style=3D'margin-left:1.0in'><font size=3D2 face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial'>The script was in error and should be fixed, =
is there
a desired target </span></font><br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>behavior
in such situations, given that the CDB fields are not typically =
parsed</span></font>
<br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>by the
iSCSI layer, the SCSI device may know nothing about iSCSI =
PDUs,</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>and
some middle-layer may or may not know about both.</span></font> =
<o:p></o:p></p>

<p style=3D'margin-left:1.0in'><font size=3D2 face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial'>If the initiator detects that an underflow =
has
occurred, based solely on the</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>amount
of data received and the &quot;expected data transfer field&quot; in =
the iSCSI
PDU,</span></font> <br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>but
the target did not report an underflow or residual count in the SCSI =
response,</span></font>
<br>
<font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>is the
initiator allowed/expected to report an underflow to the upper =
layers?</span></font>
<o:p></o:p></p>

<p style=3D'margin-left:1.0in'><font size=3D2 face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial'>Thanks,</span></font> <o:p></o:p></p>

<p style=3D'margin-left:1.0in'><font size=3D2 face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial'>Dean Scoville</span></font> <o:p></o:p></p>

</div>

</body>

</html>

------_=_NextPart_001_01C3507E.286F73C0--
