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, 05 Aug 2003 12:47:33 -0400
X-Sieve: CMU Sieve 2.2
Received: from osgood.ece.cmu.edu (OSGOOD.ECE.CMU.EDU [128.2.129.25])
	by newbox.ece.cmu.edu (Postfix) with ESMTP id 0537C32CD
	for <ipsml@ece.cmu.edu>; Tue,  5 Aug 2003 12:47:33 -0400 (EDT)
Received: by osgood.ece.cmu.edu (Postfix, from userid 953)
	id 9E62DA0; Tue,  5 Aug 2003 12:47:32 -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 55E718F; Tue,  5 Aug 2003 12:47:24 -0400 (EDT)
Received: by sos.ece.cmu.edu (Postfix)
	id 0372389F1; Tue,  5 Aug 2003 12:47:08 -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 DD7D789F0
	for <ips-outgoing@sos.ece.cmu.edu>; Tue,  5 Aug 2003 12:47:07 -0400 (EDT)
Received: by osgood.ece.cmu.edu (Postfix)
	id 9D8EF88; Tue,  5 Aug 2003 12:47:07 -0400 (EDT)
Delivered-To: ips-outgoing@ece.cmu.edu
Received: by osgood.ece.cmu.edu (Postfix, from userid 953)
	id 6DA1B9E; Tue,  5 Aug 2003 12:47:07 -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 C4E8F88
	for <ips-outgoing@ece.cmu.edu>; Tue,  5 Aug 2003 12:47:02 -0400 (EDT)
Received: by sos.ece.cmu.edu (Postfix, from userid 363)
	id 99FD389F2; Tue,  5 Aug 2003 12:47:02 -0400 (EDT)
X-Original-To: ips@sos.ece.cmu.edu
Delivered-To: ips@sos.ece.cmu.edu
Received: from hazard.ece.cmu.edu (HAZARD.ECE.CMU.EDU [128.2.129.24])
	by sos.ece.cmu.edu (Postfix) with ESMTP id 1546F89F0
	for <ips@sos.ece.cmu.edu>; Tue,  5 Aug 2003 12:47:01 -0400 (EDT)
Received: by hazard.ece.cmu.edu (Postfix)
	id 97027161; Tue,  5 Aug 2003 12:47:00 -0400 (EDT)
Delivered-To: ips@ece.cmu.edu
Received: by hazard.ece.cmu.edu (Postfix, from userid 953)
	id 70111149; Tue,  5 Aug 2003 12:47:00 -0400 (EDT)
Received: from mailhub.lss.emc.com (unknown [168.159.2.31])
	by hazard.ece.cmu.edu (Postfix) with ESMTP id 25105162
	for <ips@ece.cmu.edu>; Tue,  5 Aug 2003 12:46:58 -0400 (EDT)
Received: from mxic1.corp.emc.com (mxic1.isus.emc.com [168.159.129.100])
	by mailhub.lss.emc.com (Switch-2.2.5/Switch-2.2.0) with ESMTP id h75GkiG08028;
	Tue, 5 Aug 2003 12:46:44 -0400 (EDT)
Received: by mxic1.corp.emc.com with Internet Mail Service (5.5.2653.19)
	id <P86CLGSR>; Tue, 5 Aug 2003 12:46:43 -0400
Message-ID: <B459CE1AFFC52D4688B2A5B842CA35EA7A4DD4@corpmx14.us.dg.com>
From: Black_David@emc.com
To: dcuddihy@attotech.com, ips@ece.cmu.edu
Subject: RE: StatSN and overlapped commands
Date: Tue, 5 Aug 2003 12:46:39 -0400 
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain
Sender: owner-ips@ece.cmu.edu
Precedence: bulk
X-Spam-Status: No, hits=-8.0 required=5.0
	tests=BAYES_10,NO_REAL_NAME,QUOTED_EMAIL_TEXT
	version=2.50
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp)

Dave,

> Put simply, is a SCSI task considered completed when status is returned to
> the initiator, or when status is acknowledged via ExpStatSN?

The former, in fact, SCSI considers the task complete when status is
generated at the target.  See sections 7.3 and 7.6 of SAM-2; a completed
task transitions to the "Ended" state and is removed from the task set.

ExpStatSN an iSCSI retransmission mechanism for SCSI status in case it
didn't get through the first time.

> This causes a difference in behavior for untagged SCSI 
> commands.  Consider:
> 
> Initiator: SCSI Command = Write: Attr = Untagged (0) : 
> InitiatorTaskTag=5:
> CmdSN=4: ExpStatSn = 3
> Target:  R2T: InitiatorTaskTag = 5
> Initiator: SCSI Data: Initiator Task Tag = 5
> Target: SCSI Status = Good:  Initiator Task Tag = 5: StatSn = 3
> Initiator: Scsi Command = Write: Attr = Untagged (0) : 
> Initiator Task Tag
> = 6: CmdSN=5: ExpStatSn = 3
> .
> .
> (Somewhere down the line a scsi command with ExpStatSN of 4 
> is sent, ACKing
> the Status to ITT #5)
> .
> .
> 
> Is this an overlapped command error, since the SCSI task is still
> oustanding until the status is acknowledge?
> Or -- is the SCSI command considered completed as soon as status is
> attempted (much like the clearing of a Congingent Allegiance 
> as soon as status is started to the host)?  That would mean that this is a
legal
> exchange.

The latter - as described, I believe it's legal.

> If so, does this cause problems with command recovery as
> described in section 3.2.2.2 ?

No, iSCSI at the target is retaining the SCSI status of the completed
command for retransmission.  SCSI believes the command to be completed,
and any retransmission request (e.g., Status SNACK) is not visible to
SCSI at the target.  In this case "command recovery" does not execute
any commands at the target; it just causes retransmission of the saved
status.

Thanks,
--David
----------------------------------------------------
David L. Black, Senior Technologist
EMC Corporation, 176 South St., Hopkinton, MA  01748
+1 (508) 293-7953             FAX: +1 (508) 293-7786
black_david@emc.com        Mobile: +1 (978) 394-7754
----------------------------------------------------
