Date: Oct 18, 1992 X3T9.2/92-141 Rev 5 To: X3T9.2 Committee (SCSI) From: George Penokie (IBM) Subject: SCSI-3 Queuing Model Note: The following list of words are barred from SCSI-3: - execution -executing -execute - Active I/O Process - - Queued I/O Process - Note: The acceptance of this queuing model will remove from SCSI-3 CA and ECA. They will be replaced with Automatic Contingent Allegiance. 0. Queue A task set of I/O Processes contained within a device which have not completed. 0.1 Suspended Information Information stored within a device which is not available to any pending I/O Processes. Messages shall not be suspended. 0.2 SCSI Device Anything which is connected to a SCSI physical transport system and supports the SCSI protocol. 0.31 I/O Process Completion (SIP document) An I/O Process is complete following the next BUS FREE phase after a successful transfer of a COMMAND COMPLETE message. An I/O Process also completes with the next BUS FREE phase following an ABORT, ABORT TAG, BUS DEVICE RESET, CLEAR QUEUE, CLEAR AUTO CONTINGENT ALLEGIANCE CONDITION message, a hard RESET condition, or an unexpected disconnect. 0.4 Task Set One or more I/O Processes which are grouped by the target so that their interaction is dependent on the queuing and Auto Contingent Allegiance rules. 1. I/O Process Management 1.1 Task Set Management (SAM document) A target that can accept more than one I/O Process is capable of queuing. The number of I/O Processes that may exist in a task set depends on the design of the target. If an initiator attempts to send more I/O Processes to a target than can be managed, each is rejected with an indication that the task set is full. Several commands may be linked together to form a single I/O Process. 1.1.1 Task Set Full Indication (SIP) The target shall return a QUEUE FULL status if an initiator attempts to start more I/O Processes than a target can manage within a task set. 1.2 Untagged Untagged queuing allows a target to accept one untagged I/O process at a time per task set from each Initiator. The target shall allow tagged and untagged I/O Processes to be contained within a single task set. 1.3 Untagged I/O Processes An Untagged I/O Process is one which establishes an I_T_x nexus. The target shall handle untagged I/O Processes in a way which allows tagged and untagged I/O Processes to be contained within a single task set. Untagged I/O Processes shall be treated by the target as simple I/O Processes. 1.4 Tagged An initiator may have more than one Tagged I/O Process within each task set under control of the target. The target has the freedom to optimize the sequence of I/O Process completion within a task set unless the initiator chooses to override the optimization. 1.5 Tagged I/O Processes Tagged I/O Processes are those which establish an I_T_L_Q nexus. The target shall handle tagged I/O Processes in a way which allows tagged and untagged I/O Processes to be contained within a single task set. 2. I/O Process Ordering Boundaries An I/O Process ordering boundary defines the scope over which a group of simple I/O Processes within a task set may be reordered. The target shall manage all the I/O Processes from all initiators on all ports accepted for each logical unit as a single task set. Each task set of I/O Processes shall be managed independent of all other task sets. Table 1 shows how task sets are managed in a target with three logical units (i.e. task sets) attached to three initiators. Table 1 - Per logical unit ordering boundaries ------------ ------------ ------------ | L U N 0 | | L U N 1 | | L U N 2 | ------------ ------------ ------------ ******************* ******************* ******************* ----------I1L0H---- * | | | | * * | | | | * * | | | | * ----I3L1H---------- * | | | | * * | | | | * * | | | | * ----I2L2H---------- *I1L0S | | | * * | | | | * * | | | | * * | I2L0S| | * * | | | | * * | | | | * ------------|I3L0O- * | | | | * * | | | | * * | | | | * * | | | I3L1S* * | | | | * * | | | | * * | |I2L1S | * * | | | | * * | | | | * *I1L1S| | | * * | | | | * * | | | | * * | | | | * * | |I2L2S | * * | | | | * * | | | | * * | | | I3L2S* * | | | | * * | | | | * *I1L2S| | | * ------------|I3L0O- * | | | | * * | | | | * * | | | | * ------|I2L1O------- * | | | | * *I1L0S | | | * * | | | | * * | | | | * * | | | | * * | | | I3L1S* * | | | | * * | I2L0S| | * * | | | | * * | | | | * * | | | | * * | | | | * * | |I2L2S | * * | | | | * * | | | | * *I1L2S| | | * * | | | | * *I1L1S| | | * * | | | | * * | | | | * * | | | | * ------|------I3L2O- -------I2L0O|------ * | | | | * * | | | | * * | I2L0S| | * * | | | | * * | | | | * * | | | | * *I1L1S| | | * * | | | | * * | | | | * -I1L1O|------------ * | | | | * * | | | | * *I1L1S| | | * * | | | | * * | | | | * * | | | | * * | | | I3L2S* * | | | | * * | | | | * * | | | I3L2S* * | | | | * ------|------I3L1O- * | | | | * *I1L0S | | | * * | | | | * * | | | | * ************|****** ******|************ ******|************ I1L0H-- | | |I2L2H --------------- ---------------------I3L1H ------------------------------------------------------- | T A R G E T | ------------------------------------------------------- ------------ ------------ ------------ |INITIATOR1| |INITIATOR2| |INITIATOR3| ------------ ------------ ------------ ***** * * - Task Set Boundary ***** ----- - Ordered Blocking Boundary 3. Exception Handling 3.1 Auto Contingent Allegiance Condition (ACA) 3.1.1 Auto Contingent Allegiance Condition (ACA) (SAM document) The Auto Contingent Allegiance Condition shall exist within the task set for an I_T_x_y nexus following the return of an error indication. The Auto Contingent Allegiance Condition shall not cross task set boundaries. The Auto Contingent Allegiance Condition shall be preserved within the task set until it is cleared. If a condition which would create an Auto Contingent Allegiance Condition occurs during an Auto Contingent Allegiance Condition, the original Auto Contingent Allegiance Condition shall remain. Sense data shall be available for the new Auto Contingent Allegiance Condition. Implememtors Note: There are issues outside the scope of this standard which occur in multi-initiator systems which should be considered when error recovery is needed. 3.1.1.1 Reporting Auto Contingent Allegiance Condition (ACA) (SIP) The Auto Contingent Allegiance Condition is reported by the successful transfer of a Check Condition status or a Command Terminated status. 3.1.2 Response to Auto Contingent Allegiance Condition (SAM document) While the Auto Contingent Allegiance exists the target shall only allow one ACA I/O Process to become a Pending I/O Process per task set. The target shall respond to any other I/O Process which attempts to create an I_T_x_y nexus to the task set with an ACA Active status. The target shall not allow any Pending non-ACA I/O Processes within the task set to become current I/O Processes until the Auto Contingent Allegiance is cleared. 3.1.2.1 Identification of an ACA I/O Process (SIP) An ACA I/O Process is fully identified by the ACA Tag message immediately following the Identify message after a Selection or a Reselection. 3.1.3 Auto Contingent Allegiance Processing Only fully identified ACA I/O Processes to the I_T_x_y nexus within a task set which has an Auto Contingent Allegiance Condition shall become pending I/O Processes. All SCSI operations are permitted while processing an ACA I/O Process. 3.1.3.1 Acquiring Sense Data (SIP) The sense data for a task set shall be cleared after completion of the first command of an ACA I/O Process for the task set which contains the Auto Contingent Allegiance Condition. 3.1.4 Clearing Auto Contingent Allegiance Condition (ACA) (SAM document) The Auto Contingent Allegiance Condition shall be cleared after: -a power on condition, -performing a hard reset, -a Clear Auto Contingent Allegiance Condition message to the I_T_x_y nexus within the affected task set, or -a Bus Device Reset message. The Auto Contingent Allegiance shall not be cleared for any reason other than those listed above. Implementors Note: In order to maintain compatibility with SCSI-2: -the receipt of any non-ACA I/O Processes for the I_T_x_y nexus which has the Auto Contingent Allegiance should clear the Auto Contingent Allegiance Condition. -the clearing non-ACA I/O Process should be handled as described under Contingent Allegiance in the SCSI-2 standard. 3.2 Duplicate Nexus Handling If an I/O Process has a duplicate nexus an Auto Contingent Allegiance Condition with a key of Illegal Request, an ASC of Tagged Overlapped Commands, and an ASCQ which contains the value of the queue tag of the duplicate nexus shall be created for the task set. The target shall abort all I/O Processes within the task set for the Initiator which sent the duplicate nexus. The target shall create a single Auto Contingent Allegiance for the I_T_L_Q nexus for the task set in which the duplicate nexus error occurred regardless of how many I/O Processes are aborted. 4. Current I/O Process 4.1 Current I/O Process (SAM document) A Current I/O Process is an I/O Process which has information being sent or received on a physical transport system. - More than one Current I/O Process may exist at a time on a physical transport system. (e.g. multiport systems) - A SCSI device on a physical transport system may have a Current I/O Process which is not the same Current I/O Process as another device on the same physical transport system. - A SCSI device may simultaneously send information for one or more I/O Processes and accept information for one or more I/O Processes. 4.2 Current I/O Process (SIP document) A Current I/O Process begins when arbitration is won and ends when the SCSI bus next goes to the BUS FREE phase. 5. Pending I/O Process An I/O Process which is not a Current I/O Process and has not yet completed. 6. Simple I/O Process (Simple Tag) A Simple I/O Process is one that is tagged with a Simple Queue Tag. If the task set only contains Simple I/O Processes, then any Simple I/O Process may become a Current I/O Process at any time. 7. Ordered I/O Process (Ordered Tag) When an I/O Process is tagged as an Ordered I/O Process any information the target has or accepts for the Ordered I/O Process shall be suspended and the Ordered I/O Process shall not complete until all I/O Processes which were accepted into the task set before the Ordered I/O Process have completed. If Simple or Ordered I/O Processes are accepted into the task set after an Ordered I/O Process the target shall suspend any information accepted for the new I/O Process and shall not complete any of the new I/O Processes before the Ordered I/O Process completes. 8. Head Of Queue I/O Process (Head of Queue Tag) When an I/O Process is tagged as a Head Of Queue I/O Process the target shall suspend any information accepted for any I/O Processes accepted into the task set after the Head Of Queue I/O Process, except for another Head Of Queue I/O Process. The target shall not complete any of the new I/O Processes, except a Head Of Queue I/O Processes, before the most recent Head Of Queue I/O Process completes. Any I/O Process which was accepted into the task set before a Head Of Queue I/O Process may complete before the Head Of Queue I/O Process completes. 9. ACA I/O Process (ACA Queue Tag) An ACA I/O Process is tagged with an ACA tag. An ACA I/O Process is not associated with the I/O Process which caused an Auto Contingent Allegiance Condition. The ACA I/O Process shall complete before any other I/O Processes within the task set. If an ACA I/O Process is accepted for a task set which does not have an Auto Contingent Allegiance Condition the target shall return a Check Condition status with a sense key of Illegal Request and an additional sense code of Invalid Message Error. While the Auto Contingent Allegiance exists the target shall only allow one ACA I/O Process per task set to become a Pending I/O Process. The target shall respond to any other I/O Process which attempts to create an I_T_x_y nexus to the task set with an ACA Active status. The target shall create a duplicate nexus for an ACA I/O Process if the tag value is not unique for the task set. The target shall respond to the duplicate nexus as described in the duplicate nexus handling section (see 3.2). 11 Clear Auto Contingent Allegiance Condition The Clear Auto Contingent Allegiance Condition is sent from an initiator to a target to clear an Auto Contingent Allegiance Condition from the affected task set. The target shall clear the Auto Contingent Allegiance and immediately complete the current I/O Process on acceptance of this message. If the target accepts a Clear Auto Contingent Allegiance Condition when no Auto Contingent Allegiance Condition exists for the task set the target shall immediately complete the current I/O Process. After the target accepts the Clear Auto Contingent Allegiance Condition any Pending I/O Process within the task set may become a Current I/O Process, subject to the ordering rules. 11.1 Clear Auto Contingent Allegiance Condition Message (SIP) The Clear Auto Contingent Allegiance Condition message shall immediately follow an Identify message. 12. New ASC/ASCQ code BYTE 12 13 DTLPWRSOMC DESCRIPTION -- -- -------------------------- 4D NN DTLPWRSOMC Tagged Overlapped Commands (NN = Queue Tag) 13. New Message Codes (SIP) Code Description ---- ----------- 24h ACA Queue Tag 16h Clear ACA 14. New Status code Code Description ---- ----------- 30h Auto Contingent Allegiance Active AUTO CONTINGENT ALLEGIANCE ACTIVE. This status shall be returned when an Auto Contingent Allegiance exists and an initiator attempts an initial connection for a non-Auto Contingent Allegiance I/O Process for a task set which has an Auto Contingent Allegiance outstanding. Appendix A - Ordering Boundaries A.1. Ordering Boundary Disclaimer This appendix recognizes that there are other ways to order boundaries than the one chosen by the Standards Committee. Described below are four different ordering boundaries. Any of these ordering boundaries could be implemented by a SCSI device using the rules for task sets as defined throughout this standard. The standard, however, requires that SCSI devices use the per logical unit ordering boundary. .pa A.3 Per Initiator/Logical Unit Ordering Boundaries When the ordering boundary is per initiator/logical unit the target manages all the I/O Processes accepted from a initiator/logical unit combination on all ports as a single task set. Each task set of I/O Processes shall be independent of all other task sets. Table 2 - Per initiator/logical unit ordering boundaries ------------ ------------ ------------ | L U N 0 | | L U N 1 | | L U N 2 | ------------ ------------ ------------ ******** ******* ******* ******* ******* ******** ******* ******** ******* -I1L0H-- * | * * | * * | * * | * *| | * * | * *| | * * | * *| | * * | * * | * * | * * | * -I3L1H-- * | * *| | * * | * *| | * * | * * | * * | * * | * *| | * * | * -I2L2H-- * | * *|I1L0S* * | * * | * * | * * | * *| | * * | * *| | * * | * *| | * *I2L0S* * | * * | * * | * *| | * * | * *| | * * | * *| | * * | * -I3L0O- * | * * | * *| | * * | * *| | * * | * *| | * * | * * | * * | * * | * *|I3L1S* * | * *| | * * | * *| | * * | * * | * * | * *I2L1S* *| | * * | * *| | * * | * *| | * * | * * | * *I1L1S* * | * *| | * * | * *| | * * | * *| | * * | * * | * * | * * | * *| | * * | * *|I2L2S* * | * *| | * * | * * | * * | * * | * *| | * * | * *| | * *I3L2S* *| | * * | * * | * * | * * | * *| | * *I1L2S* *| | * * | * *| | * * | * -I3L0O- * | * * | * *| | * * | * *| | * * | * *| | * * | * * | * * | * -I2L1O- *| | * * | * *| | * * | * *|I1L0S* * | * * | * * | * * | * *| | * * | * *| | * * | * *| | * * | * * | * * | * * | * *|I3L1S* * | * *| | * * | * *| | * *I2L0S* * | * * | * * | * *| | * * | * *| | * * | * *| | * * | * * | * * | * * | * *| | * * | * *|I2L2S* * | * *| | * * | * * | * * | * * | * *| | * *I1L2S* *| | * * | * *| | * * | * * | * *I1L1S* * | * *| | * * | * *| | * * | * *| | * * | * * | * * | * * | * *| | * * | * *| | * -I3L2O- *| | * -I2L0O- * | * * | * * | * *| | * * | * *| | * * | * *| | * *I2L0S* * | * * | * * | * *| | * * | * *| | * * | * *| | * * | * * | * *I1L1S* * | * *| | * * | * *| | * * | * *| | * * | * * | * -I1L1O- * | * *| | * * | * *| | * * | * *| | * * | * * | * *I1L1S* * | * *| | * * | * *| | * * | * *| | * * | * * | * * | * * | * *| | * * | * *| | * *I3L2S* *| | * * | * * | * * | * * | * *| | * * | * *| | * *I3L2S* *| | * * | * * | * * | * * | * -|I3L1O- * | * *| | * * | * *|I1L0S* * | * * | * * | * * | * *| | * * | * *| | * * | * *|****** ******* ******* ******* ******* *|****** ******* *|****** ******* ---- I1L0H | | ------I3L1H | I2L2H -------------------------- -------------------------------------------------------------------------- | T A R G E T | -------------------------------------------------------------------------- ------------ ------------ ------------ |INITIATOR1| |INITIATOR2| |INITIATOR3| ------------ ------------ ------------ ***** * * - Task Set Boundary ***** ----- - Ordered Blocking Boundary .pa A.4 Per Target Ordering Boundaries When the ordering boundary is per target the target manages all the I/O Processes from all initiators on all ports as a single task set. Table 3 - Per target ordering boundaries ------------ ------------ ------------ | L U N 0 | | L U N 1 | | L U N 2 | ------------ ------------ ------------ ************************************************** ------|--------------------|-------------I3L1H---- ------|------------------I2L2H-------------|------ ----I1L0H------------------|---------------------- *I1L0S| | | | | | | | | | | * * | |I2L0S | | | | | | | | | * ------|-----I3L0O----------|---------------|------ * | | | | | | |I3L1S | | | | * * | | | | | I2L1S| | | | | | * * | | | | I1L1S | | | | | | | * * | | | | | | | | | I2L2S| | * * | | | | | | | | | | |I3L2S* * | | | | | | | | I1L2S | | | * ------|-----I3L0O----------|---------------|------ ------|---------------I2L1O|---------------|------ *I1L0S| | | | | | | | | | | * * | | | | | | |I3L1S | | | | * * | |I2L0S | | | | | | | | | * * | | | | | | | | | I2L2S| | * * | | | | | | | | I1L2S | | | * * | | | | I1L1S | | | | | | | * ------|--------------------|---------------|I3L2O- ------|I2L0O---------------|---------------|------ * | |I2L0S | | | | | | | | | * * | | | | I1L1S | | | | | | | * ------|----------I1L1O-----|---------------|------ * | | | | I1L1S | | | | | | | * * | | | | | | | | | | |I3L2S* * | | | | | | | | | | |I3L2S* ------|--------------------|I3L1O----------|------ *I1L0S| | | | | | | | | | | * ******|********************|***************|****** ----I1L0H | | I2L2H | I3L1H ---------------------------------------------------- | T A R G E T | ---------------------------------------------------- ------------ ------------ ------------ |INITIATOR1| |INITIATOR2| |INITIATOR3| ------------ ------------ ------------ ***** * * - Task Set Boundary ***** ----- - Ordered Blocking Boundary .pa A.5 Per Initiator Ordering Boundaries The target manages all the I/O Processes from each initiator, on all ports, as a single task set. Each task set of I/O Processes shall be independent of all other task sets. Table 4 - Per initiator ordering boundaries ------------ ------------ ------------ | L U N 0 | | L U N 1 | | L U N 2 | ------------ ------------ ------------ ****************** ****************** ****************** ----I1L0H--------- * | | | | * * | | | | * * | | | | * ----I2L2H--------- * | | | | * * | | | | * * | | | | * ----I3L1H--------- *I1L0S| | | * * | | | | * * | | | | * * | | | | * *I2L0S| | | * * | | | | * * | | | | * * | | | | * -I3L0O------------ * | | | | * * | | | | * * | |I3L1S | * * | | | | * * | |I2L1S | * * | | | | * * | |I1L1S | * * | | | | * * | | | | * * | | | | * * | | | I2L2S* * | | | | * * | | | | * * | | | | * * | | | I3L2S* * | | | I1L2S* * | | | | * * | | | | * * | | | | * * | | | | * -I3L0O------------ * | | | | * -------I2L1O------ * | | | | * *I1L0S| | | * * | | | | * * | | | | * * | | | | * * | | | | * * | |I3L1S | * * | | | | * *I2L0S| | | * * | | | | * * | | | | * * | | | I2L2S* * | | | | * * | | | I1L2S* * | | | | * * | | | | * * | |I1L1S | * * | | | | * * | | | | * * | | | | * * | | | | * ------------I3L2O- * | | | | * -I2L0O------------ * | | | | * * | | | | * *I2L0S| | | * * | | | | * * | |I1L1S | * * | | | | * * | | | | * -------I1L1O------ * | | | | * * | | | | * * | |I1L1S | * * | | | | * * | | | | * * | | | | * * | | | | * * | | | I3L2S* * | | | | * * | | | | * * | | | I3L2S* * | | | | * * | | | | * -------I3L1O------ *I1L0S| | | * * | | | | * * | | | | * * | | | | * * | | | | * * | | | | * ******|*********** ******|*********** ******|*********** -I1L0H | | -I2L2H | -I3L1H ------------------------------------------------------- | T A R G E T | ------------------------------------------------------- ------------ ------------ ------------ |INITIATOR1| |INITIATOR2| |INITIATOR3| ------------ ------------ ------------ ***** * * - Task Set Boundary ***** ----- - Ordered Blocking Boundary