The invention relates generally to Small Computer System Interface (SCSI) systems, and more specifically to Serial Attached SCSI (SAS) systems.
In deeply cascaded SAS topologies, it can take substantial amounts of time to establish a connection between a target and initiator. The larger the number of intervening expanders that are placed between the target and initiator, the larger the number of links that have to be occupied in order to establish a pathway for the connection. This in turn means a longer delay between initially requesting the connection at the target and actually establishing the connection at the initiator. If an initiator is presently unable to service a connection for a target, it sends an OPEN_REJECT (RETRY) primitive to the target, causing intervening expanders to tear down the pathway that has been established for the connection. When the target retries the rejected connection request, it takes time to re-establish the pathway to the initiator. During the time that the pathway to the initiator is being re-established for the connection request, the initiator might start servicing a connection request from a different target.
Systems and methods herein provide for dwell timers at SAS end devices that help to prevent premature transmission of an OPEN_REJECT (RETRY) primitive. One exemplary embodiment is a system that includes a SAS end device. The SAS end device includes a physical link (PHY) operable to receive an OPEN Address Frame (OAF) from a coupled SAS device. The SAS end device also includes a controller. The controller is able to determine that the end device is presently unable to service a connection, and to wait a period of time for a dwell timer to expire. The controller is also able to service the connection by sending an OPEN_ACCEPT response if the end device becomes able to service the connection before the dwell timer expires, and to send an OPEN_REJECT (RETRY) response if the end device does not become able to service the connection before the dwell timer expires.
Other exemplary embodiments (e.g., methods and computer readable media relating to the foregoing embodiments) are also described below.
Some embodiments of the present invention are now described, by way of example only, and with reference to the accompanying figures. The same reference number represents the same element or the same type of element on all figures.
The figures and the following description illustrate specific exemplary embodiments of the invention. It will thus be appreciated that those skilled in the art will be able to devise various arrangements that, although not explicitly described or shown herein, embody the principles of the invention and are included within the scope of the invention. Furthermore, any examples described herein are intended to aid in understanding the principles of the invention, and are to be construed as being without limitation to such specifically recited examples and conditions. As a result, the invention is not limited to the specific embodiments or examples described below, but by the claims and their equivalents.
During normal operations, connections are established and/or closed between initiator 110 and the targets in order to transfer data (e.g., on behalf of a host system). After a connection has been closed (e.g., after initiator 110 sends and receives a CLOSE primitive sequence), expander 120 assumes that initiator 110 has become immediately available for servicing another connection. However, initiator 110 can still be emptying data out of a receive buffer for physical link (PHY) 112, or can otherwise be temporarily delayed (e.g., by other operations related to the connection that just closed). This means that even though the connection is closed and PHY 112 appears to be available, initiator 110 is not actually available to service incoming connection requests, such as OPEN Address Frames (OAFs). Initiator 110 could therefore respond to an OAF with an OPEN_REJECT (RETRY) primitive, even though initiator 110 has already closed its prior connection.
In general, an OPEN_REJECT (*) causes the pathway used for an OAF to be torn down. However, an OPEN_REJECT (RETRY) creates problems in a cascaded SAS domain having a large number of expanders between the initiator and the target. Specifically, in order to re-establish the pathway, each expander in the pathway re-arbitrates and re-establishes its own portion of the pathway, and these arbitration/setup delays from the expanders stack additively.
In order to prevent the substantial arbitration and setup delays resulting from OPEN_REJECT (RETRY) messages in deeply cascaded topologies, controller 114 is capable of implementing a dwell timer that prohibits PHY 112 from sending an OPEN_REJECT (RETRY) for a period of time. If initiator 110 becomes available before the dwell timer expires, an OPEN_ACCEPT is sent to the target device by initiator 110 instead of an OPEN_REJECT (RETRY), establishing the connection without the need to re-establish the pathway by the sending of another OAF.
SAS initiator 110 comprises any suitable device or component that is compliant with SAS protocols such as Serial SCSI Protocol (SSP), SATA Tunneled Protocol (STP), Serial Management Protocol (SMP), etc. For example, in one embodiment SAS initiator 110 comprises a Host Bus Adapter (HBA) that utilizes SSP to exchange host I/O with other end devices. In order to establish a connection with a target, initiator 110 utilizes a SAS port, comprising PHY 112. Initiator 110 can include further PHYs and/or ports. However, only one PHY is shown at initiator 110 in order to enhance clarity.
Controller 114 manages the operations of initiator 110, and can be implemented for example as custom circuitry, a processor executing programmed instructions stored in program memory, or some combination thereof. Memory 116 comprises any suitable system capable of storing data in a format that is accessible to controller 114 (e.g., Random Access Memory (RAM), solid state memory, etc.).
SAS expanders 120, 130, and 140 comprise any suitable devices capable of establishing connections between PHYs of end devices in accordance with SAS protocols. Specifically, each expander includes multiple internal PHYs that can be coupled with each other via switching circuitry (e.g., a crossbar switch) in order to establish connections between different SAS and/or SATA compliant devices. When multiple expanders are located between the end devices of a connection, each expander operates its switching circuitry to establish a portion of the pathway for the connection.
While three expanders are shown in
In step 202, PHY 112 of initiator 110 receives the OAF via expander 120. The OAF is a request from a target to establish a connection with initiator 110. However, in step 204, controller 114 determines that initiator 110 is not presently able to service the connection (e.g., because the receive buffer for PHY 112 is not yet empty, or for any other suitable reason). Instead of immediately responding to the OAF with an OPEN_REJECT (RETRY) primitive, controller 114 initializes a dwell timer kept in memory 116 in step 206.
While the dwell timer is running, controller 114 checks to determine whether or not initiator 110 has become available (e.g., by emptying out the receive buffer and fully processing the data for the prior connection). If initiator 110 becomes available in step 208, then controller 114 directs PHY 112 to service the request by transmitting an OPEN_ACCEPT primitive in response to the OAF in step 210.
However, if initiator 110 has not become available, then in step 212 if the dwell timer has not yet expired, controller 114 updates the dwell timer in step 214 and returns to step 208. If the dwell timer expires in step 212 before initiator 110 becomes available, then controller 114 determines that further delay is undesirable, and it sends out an OPEN_REJECT (RETRY) primitive in step 216, resulting in the target device retrying the connection after the intervening expanders tear down the partial pathway used to transmit the OAF.
Method 200 balances undesirable delays found in cascaded topologies, because the dwell timer can give initiator 110 enough time to empty out its receive buffer before responding to an OAF. If emptying a receive buffer is preventing initiator 110 from servicing a connection, the temporary delay implemented by the dwell timer (e.g., between about 100 nanoseconds and about one microsecond) can allow an incoming OAF to be serviced. This prevents the substantial delays caused by tearing down and re-establishing a deeply cascaded connection (e.g., between about ten microseconds and about one hundred milliseconds).
Even though the steps of method 200 are described with reference to initiator 110 of
In the following examples, additional processes, systems, and methods are described with respect to dwell timers for SAS end devices.
During normal operations, if initiator 300 receives an OAF at a Ser/Des 310 of a PHY 312, the link layer 330 for that PHY checks to determine if it is still busy performing operations related to a prior connection (i.e., if a receive buffer 340 for the PHY 312 is currently full). If this is the case, the link layer checks the lookup table in memory 350 (e.g., a hardware device table for initiator 300), and proceeds to identify a period for the dwell timer value.
In a further embodiment, initiator 300 includes multiple receive buffers (e.g., four receive buffers) that are used to hold four (or more) received frames from a Link Layer servicing a given connection. In such cases, a “busy” status can be detected when all of the receive buffers are full at the same time. Then, after a receive buffer becomes available again (i.e. after a received frame is processed) for that connection, the Link Layer determines that there is no longer a busy status.
The period of the dwell timer can vary based on the Arbitration Wait Time (AWT) for the received OAF, can vary based on the number of intervening expanders between the device that sent the OAF and initiator 300, or any other suitable metric. In one embodiment, the period of the dwell timer is proportional to the AWT of the received OAF. In another embodiment, the dwell timer period is maintained in a programmable register (i.e., hardware circuitry) of initiator 300 accessible to a link layer 330. Initiator 300 waits for the dwell timer to expire, sending an OPEN_ACCEPT to the target if the PHY 312 becomes available before the dwell timer expires, and otherwise sending an OPEN_REJECT (RETRY).
Thus, the dwell timer can be set based on any combination of software/firmware and/or hardware. For example, Link layer hardware/circuitry can set a dwell timer defined by a combination of flip-flops and gates (e.g., as described by a Hardware Description Language (HDL) such as Verilog Register Transfer Level (RTL)). The flip-flops and gates can implement a dwell timer setting equation such as t=a+b*(AWT)+c*(AWT)̂2, where the constants a, b, and c are determined by programmable registers, AWT is the arbitration wait time of the OAF, and t is the period of the dwell timer. In another embodiment, a dwell timer setting equation can be implemented by an equation such as t=a+b*(numExp)+c*(numExp)̂2 where constants a, b, c are determined by programmable registers, and numExp is obtained from a hardware device table that indicates the number of expanders located between the coupled device and the end device that sourced the OPEN Address Frame.
The OAF is then forwarded along to a PHY of expander 120, and expander 120 engages in its own arbitration process. The OAF wins arbitration, and expander 120 adjusts its switching circuitry to establish an electrical link between the PHY that received the OAF and an internal PHY that is coupled with initiator 110. At this point, the OAF is forwarded to PHY 112 of initiator 110. Controller 114 determines that initiator 110 is currently unavailable to service the connection requested by the OAF. However, sending an OPEN_REJECT (RETRY) would force expander 120 and 130 and target 132 to tear down the currently established partial pathway, which in turn would require target 132 to re-send an OAF and engage in the arbitration process at both expanders a second time, causing substantial delay.
To avoid this issue, controller 114 identifies a dwell timer kept in memory, and determines a length for the dwell timer (400 nanoseconds) based on the AWT of the OAF (50 microseconds). Controller 114 then waits for the length of the dwell timer. While waiting and before the dwell timer has expired, controller 114 determines that the receive buffer at PHY 112 has been cleared, thereby enabling initiator 110 to service the connection. Therefore, controller 114 directs PHY 112 to send an OPEN_ACCEPT primitive (instead of an OPEN_REJECT (RETRY)), establishing a connection with target 132, and saving target 132 from having to establish another connection.
An initiator can be unavailable for a number of reasons. For example, initiator (or even target) firmware and/or hardware can become temporarily busy when it configures or disables hardware tables needed to process a received OAF, meaning that an OPEN_REJECT (RETRY) would be sent. A dwell timer can be used in these cases to delay the sending of an OPEN_REJECT (RETRY) until the configuration is done or the tables are re-enabled.
Embodiments disclosed herein can take the form of software, hardware, firmware, or various combinations thereof. In one particular embodiment, software is used to direct a processing system of a SAS end device to perform the various operations disclosed herein.
Computer readable storage medium 712 can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor device. Examples of computer readable storage medium 712 include a solid state memory, a magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk, and an optical disk. Current examples of optical disks include compact disk-read only memory (CD-ROM), compact disk-read/write (CD-R/W), and digital video disk (DVD).
Processing system 700, being suitable for storing and/or executing the program code, includes at least one processor 702 coupled to program and data memory 704 through a system bus 750. Program and data memory 704 can include local memory employed during actual execution of the program code, bulk storage, and cache memories that provide temporary storage of at least some program code and/or data in order to reduce the number of times the code and/or data are retrieved from bulk storage during execution.
Input/output or I/O devices 706 (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled either directly or through intervening I/O controllers. Network adapter interfaces 708 can also be integrated with the system to enable processing system 700 to become coupled to other data processing systems or storage devices through intervening private or public networks. Modems, cable modems, IBM Channel attachments, SCSI, Fibre Channel, and Ethernet cards are just a few of the currently available types of network or host interface adapters. Display device interface 710 can be integrated with the system to interface to one or more display devices, such as printing systems and screens for presentation of data generated by processor 702.