Date: Nov 5, 1990 X3T9.2/90-169 Rev 0 To: X3T9.2 Committee (SCSI) From: George Penokie (IBM) Subject: SCSI-2 Rules for Multiple Active I/O Processes The following is the interpretation of the SCSI-2 rules for allowing multiple active I/O processes from a single initiator. Nothing in this document deviates from the SCSI-2 Revision 10c standard. Some examples of what multiple active I/O processes allow SCSI devices to accomplish are; back-to-back writes, preseeking, etc. This document first lists excerpts taken directly from the SCSI-2 standard rev 10c. The location of the excerpts is noted by rev 10c section numbers at the beginning each excerpt. After the excerpts is the interpretation of what is required to implement multiple active I/O processes on a target device. What follows is taken directly from the SCSI-2 standard rev 10c: Section 3.1 active I/O process: An I/O process that is presently in execution (not queued). command queue: This term refers to the queue used to store the tagged I/O processes. current I/O process: The I/O process that is presently connected on the SCSI bus. I/O process: An I/O process consists of one initial connection and zero or more reconnections, all pertaining to a single command or a group of linked commands. More specifically, the connection(s) pertain to a nexus as defined below in which zero or more command descriptor blocks are transferred. An I/O process begins with the establishment of a nexus. An I/O process normally ends with the BUS FREE phase following successful transfer of a COMMAND COMPLETE or a RELEASE RECOVERY message. An I/O process also ends with the BUS FREE phase following an ABORT, ABORT TAG, BUS DEVICE RESET, or CLEAR QUEUE message or when a hard RESET condition or an unexpected disconnect occurs. I_T_L nexus: A nexus which exists between an initiator, a target, and a logical unit. This relationship replaces the prior I_T nexus. I_T_L_Q nexus: A nexus between an initiator, a target, a logical unit, and a queue tag following the successful receipt of one of the queue tag messages. This relationship replaces the prior I_T_L nexus. nexus: A relationship that begins with the establishment of an initial connection and ends with the completion of the I/O process. The relationship may be restricted to specify a single logical unit or target routine by the successful transfer of an IDENTIFY message. The relationship may be further restricted by the successful transfer of a queue tag message. queue tag: The value associated with an I/O process that uniquely identifies it from other queued I/O processes on the logical unit for the same initiator. queued I/O process: An I/O process that is in the command queue and has not begun execution. reconnect: The act of reviving a nexus to continue an I/O process. A target reconnects to an initiator by using the RESELECTION and MESSAGE IN phases after winning arbitration. An initiator reconnects to a target by using the SELECTION and MESSAGE OUT phases after winning arbitration. Section 6.5.2 Incorrect Initiator Connection An incorrect initiator connection occurs on a reconnection if: (1) an initiator attempts to reconnect to an I/O process, and (2) a soft reset condition has not occurred, and (3) the initiator does not send an ABORT, ABORT TAG, BUS DEVICE RESET, CLEAR QUEUE, or TERMINATE I/O PROCESS message during the same MESSAGE OUT phase as the IDENTIFY message. An incorrect initiator connection also occurs on an initial connection when an initiator: (1) attempts to establish an I_T_L_Q nexus when an I_T_L nexus already exists from a previous connection, or (2) attempts to establish an I_T_L nexus when an I_T_L_Q nexus already exists unless there is a contingent allegiance or extended contingent allegiance condition present for the logical unit or target routine. Section 6.8.2 Tagged Queuing Tagged queuing allows a target to accept multiple I/O processes from the same or different initiators until the logical unit's command queue is full. The queue tag messages allow the initiator to establish a unique I_T_L_Q nexus to identify each I/O process. The I_T_L_Q nexus allows the target to reconnect to a specific I/O process and allows the initiator to restore the set of pointers for that I/O process. An initiator may have several I/O processes ongoing to the same or different logical units or target routines as long as each has a unique nexus. An I/O process received without a queue tag message while there are any tagged I/O commands in the command queue from the same initiator is an incorrect initiator connection unless there is a contingent allegiance or extended contingent allegiance condition. Interpretation: The reason interpretation is needed on multiple active I/O processes is because the SCSI-2 standard does not explicitly state that this function is allowed nor does it directly indicate how to handle the sense data. The best way to start to answer the question: What types of initiator/target connections are explicitly not allowed? The answer is found in section 6.5.4 and can be restated as follows: -An error will occur if an initiator attempts to issue a tagged command to a target to which that initiator has previously issued an untagged command that has not started execution or is currently executing. -An error will occur if an initiator attempts to issue an untagged command to a target to which that initiator has previously issued a tagged command that has not started execution or is currently executing. (There are cases where this condition is allowed but that is not an issue for this document.) -An error will occur if an initiator attempts to issue a second tagged command which has the same tag as a previously issued tagged command that has not started execution or is currently executing. What is not discussed in section 6.5.4, or anywhere else in the SCSI-2 standard, is a description of multiple active I/O processes. Because multiple active I/O processes are not disallowed in section 6.5.4 it is safe to assume this type of initiator connection is allowed. Multiple active I/O processes definition: Because there is no guidance for putting multiple active I/O processes on a device care must be taken to not violate any of the rules called out in the SCSI-2 standard. What follows is what should be used as the rules for implementing multiple active I/O processes. Glossary multiple active I/O processes: Having more than one active I/O that is presently in execution (not queued). Section 6.5.x Multiple Active I/O Processes Implementation of multiple active I/O processes is optional. The multiple active I/O processes allows devices to have more than one active I/O process executing at once. The control of multiple active I/O processing of commands is contained in the vendor unique (Page 0) mode page. For a device to support multiple active I/O processes it shall maintain a separate sense area for each active I/O process. Each sense area shall be identified such that if an contingent allegiance condition occurs the target will, when requested, return the sense information relating to the I/O processes in error. If a contingent allegiance occurs in one of the multiple active I/O processes all active I/O processes shall be suspended until the contingent allegiance is cleared. The target returns BUSY status to other initiators while the contingent allegiance condition exists. During this time all commands in the queue are suspended for the affected I_T_L nexus. All commands used for recovery operations shall be untagged commands. The queue may be modified by removing all or selected commands in the queue as part of the recovery procedure. If commands are combined by the queuing algorithm such that the error affects more than one command, then a contingent allegiance condition shall be generated for all affected commands. Section 7 Mode Sense/Select Control Page 0 byte x bit y The disable multiple active I/O processes (DMAIOP) bit of one specifies that the target shall not execute more than one active I/O process at a time.