Abstract:
Method and system for transferring data between a computing system and a storage device is provided. The system includes a storage controller including a frame snooper module that detects a TMR and generates a pause signal to a channel that stops the channel from sending any non-data frames to a buffer memory, wherein the channel continues to receive and process data frames while the channel is stopped from sending the command frames to the buffer memory; a counter for counting TMRs; and logic for generating an interrupt if a number of TMRs received exceeds a certain threshold value. The method includes detecting a TMR generating a command to stop a channel from receiving non-data frames while continuing to receive data frames from a Fibre Channel interface; and generating an interrupt to a processor after a certain number of TMRs are received.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    This application is a continuation of U.S. patent application Ser. No. 10/989,060 filed on Nov. 15, 2004. The disclosure of the above application is incorporated herein by reference in its entirety. 
     
    
     BACKGROUND OF THE INVENTION 
       [0002]    1. Field of the Invention 
         [0003]    The present invention relates generally to storage device controllers, and more particularly, to processing frames. 
         [0004]    2. Background 
         [0005]    Conventional computer systems typically include several functional components. These components may include a central processing unit (CPU), main memory, input/output (“I/O”) devices, and streaming storage devices (for example, tape drives). 
         [0006]    In conventional systems, the main memory is coupled to the CPU via a system bus or a local memory bus. The main memory is used to provide the CPU access to data and/or program information that is stored in main memory at execution time. Typically, the main memory is composed of random access memory (RAM) circuits. A computer system with the CPU and main memory is often referred to as a host system. 
         [0007]    The storage device is coupled to the host system via a controller that handles complex details of interfacing the storage devices to the host system. Communications between the host system and the controller is usually provided using one of a variety of standard I/O bus interfaces. 
         [0008]    Typically, when data is read from a storage device, a host system sends a read command to the controller, which stores the read command into the buffer memory. Data is read from the device and stored in the buffer memory. Buffer memory may be a Synchronous Dynamic Random access Memory (“SDRAM”), or Double Data Rate-Synchronous Dynamic Random Access Memory (referred to as “DDR” or “SDRAM”)). 
         [0009]    Storage controllers use various standards to move data frames in and out of storage devices. One such standard is the Fibre Channel standard. Fibre channel (incorporated herein by reference in its entirety) is an American National Standard Institute (ANSI) set of standards, which provides a serial transmission protocol for storage and network protocols such as HIPPI, SCSI, IP, ATM and others. 
         [0010]    A storage controller may receive various types of frames, for example, data, link or command frames. Task management requests (“TMRs”) per the Fibre Channel protocol, provide an option to take action for a command thread that may be residing in buffer memory of the storage controller. A TMR is a command frame that includes task management flags. If a command buffer is full, then the TMR may also be encoded as a link frame. 
         [0011]    Some conventional storage controllers store data, link, command and TMRS in sequential order and execute and process them as they are being received. This approach has disadvantages because it results in latency and delays. 
         [0012]    Conventional storage systems may also use a timer to evaluate, execute and flush command frames from a queue. This requires additional logic and makes the process complex and expensive. 
         [0013]    Therefore, there is a need for a system and method that can efficiently handle command frames and TMRS. 
       SUMMARY OF THE INVENTION 
       [0014]    A storage controller is provided in one aspect of the present invention. The storage controller includes a frame snooper module that detects a task management request (“TMR”) and generates a pause signal to a channel that stops the channel from sending any non-data frames to a buffer memory, wherein the channel continues to receive and process data frames while the channel is stopped from sending the non-data frames to the buffer memory; a counter for counting TMRS; and logic for generating an interrupt if a number of TMRS received exceeds a certain threshold value. 
         [0015]    In yet another aspect of the present invention, a method for processing frames is provided. The method includes detecting a TMR generating a command to stop a channel from receiving non-data frames while continuing to receive data frames from a Fibre Channel interface; and generating an interrupt to a processor after a certain number of TMRs are received. 
         [0016]    In yet another aspect of the present invention, a system for transferring data between a computing system and a storage device is provided. The system includes a storage controller including a frame snooper module that detects a TMR and generates a pause signal to a channel that stops the channel from sending any non-data frames to a buffer memory, wherein the channel continues to receive and process data frames while the channel is stopped from sending the command frames to the buffer memory; a counter for counting TMRs; and logic for generating an interrupt if a number of TMRs received exceeds a certain threshold value. 
         [0017]    This brief summary has been provided so that the nature of the invention may be understood quickly. A more complete understanding of the invention can be obtained by reference to the following detailed description of the preferred embodiments thereof concerning the attached drawings. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0018]    The foregoing features and other features of the present invention will now be described with reference to the drawings of a preferred embodiment. In the drawings, the same components have the same reference numerals. The illustrated embodiment is intended to illustrate, but not to limit the invention. The drawings include the following Figures: 
           [0019]      FIG. 1A  is an example of a storage system having a storage controller according to one aspect of the present invention; 
           [0020]      FIG. 1B  shows a layout of a buffer memory for storing command, data and link frames, and TMRs, according to one aspect of the present invention; 
           [0021]      FIGS. 2A-2B  (referred to as  FIG. 2 ) show a block diagram of Channel  1 , according to one aspect of the present invention; and 
           [0022]      FIG. 3  is a process flow diagram for processing non-data frames, according to one aspect of the present invention. 
       
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
       [0023]    To facilitate an understanding of the preferred embodiment, the general architecture and operation of a controller will initially be described. The specific architecture and operation of the preferred embodiment will then be described with reference to the general architecture. 
         [0024]    The system of  FIG. 1A  is an example of a storage drive system (with an optical disk or tape drive), included in (or coupled to) a computer system. The host computer (not shown) and the storage device  110  (also referred to herein as disk  110 ) communicate via a port using a disk formatter “DF”  104 . Storage device  110  may be connected to the host computer via a data bus. The data bus, for example, is a bus in accordance with a Small Computer System Interface (SCSI) specification. Those skilled in the art will appreciate that other communication buses known in the art can be used to transfer data between the drive and the host system. 
         [0025]    As shown in  FIG. 1A , the system includes controller  101 , which is coupled to buffer memory  111  and microprocessor (may also be referred to as “MP”)  100 . Interface  109  serves to couple microprocessor bus  107  to microprocessor  100  and a micro-controller (may also be referred to as “MC”)  102 . 
         [0026]    Controller  101  can be an integrated circuit (IC) that comprises of various functional modules, which provide for the writing and reading of data stored on storage device  110 . Microprocessor  100  is coupled to controller  101  via interface  109  to facilitate transfer of data, address, timing and control information. 
         [0027]    A read only memory (“ROM”) omitted from the drawing is used to store firmware code executed by microprocessor  100 . 
         [0028]    Fibre Channel interface  103  interfaces with host interface  104 A and processes Fibre Channel frames. The frames received by Fibre Channel Interface  103  are sent to Channel  1  (CH 1 )  105  and then to buffer memory  111  via a buffer controller (also referred to as BC)  108 . CH 1   105  is a channel that is used for transferring frames/information from Fibre Channel interface  103  to BC  108 . 
         [0029]    BC  108  connects buffer memory  111  to CH 1   105 , error correction code (“ECC”) module  106  and to bus  107 . BC  108  regulates data movement into and out of buffer memory  111 . ECC module  106  generates the ECC that is saved on disk  110  writes and provides correction mask to BC  108  for disk  110  read operation. 
         [0030]    Buffer memory  111  is coupled to controller  101  via ports to facilitate transfer of data, timing and address information. Buffer memory  111  may be a DDR or SDRAM or any other type of memory.  FIG. 1B  shows a layout of buffer memory  111  for storing command, data, link frames and TMRs. Command frames containing TMRs are stored in command buffer  111 A. Link frames are stored in link buffer  111 C and data frames are stored in data buffer  111 B. Command frames containing TMRs may also be stored in link buffer  111 C, if the command buffer  111 A is full. 
         [0031]      FIG. 2  shows a block diagram of CH 1   105  logic for handling frames, according to one aspect of the present invention. Frames  105 A from Fibre Channel I/F  103  are received by CH 1  FIFO  105 B, which is a first-in-first-out memory structure for holding the frames. CH 1  pipe  105 C is used to stage frames before they are moved to BC  108  (shown as  105 D). 
         [0032]    While frames are in CH 1  pipe  105 C, frame snooper module  105 E detects the different types of frames. The frames are shown as command frame  105 K, link frame  105 J, data frame  105 H and a TMR frame  105 G. TMR frame  105 G is detected by decoding the following values in a Fibre Channel Frame: 
         [0033]    Field R CTL (defined by Fibre Channel standards)=6; 
         [0034]    TYPE (Fibre Channel Standard defined field)=08; and 
         [0035]    The payload byte  10  is equal to a non-zero value. 
         [0036]    In one aspect of the present inventions, when frame snooper module  105 E detects a command frame  105 K, link frame  105 J or a TMR frame  105 G, then via signal  105 F, the receive operation for other frames may be stopped. It is noteworthy that frame snooper module  105 E may be configured to continue to receive data frames  105 H after a stop “event” (i.e. receipt of command frame  105 K, link frame  105 J or a TMR frame  105 G). 
         [0037]    A TMR counter  201  is used to count all TMR frames  105 G. In one aspect of the present invention, the TMR counter  201  may be 9-bits wide. It is noteworthy that other size counter(s) may also be used to count TMR frames and the present invention is not limited to any particular counter size. 
         [0038]    TMR counter  201  is enabled by firmware using a TMR counter enable bit  212 . The TMR count  201 A is fed into a compare module  202 . If count  201 A is greater than a certain number then an interrupt is set (shown as  201 B). Logic  203  is used to send an interrupt signal  204  to processor  100  via an interrupt pin/logic (not shown). TMR based interrupts may be masked by using a mask bit value  209  that is input to logic  203 . 
         [0039]    A register, shown as TMR/Frame snooper register  206  (may also be referred to as register  206 ) is used to store various bit values that are used to process frames, according to one aspect of the present invention. The following describes the various bit settings. 
         [0040]    Allow Data Frames Through bit  207 : When this bit is set, data frames are received and sent to buffer memory via CH  1   105 , even after the Frame Snooper module  105 E generates a pause signal/command  105 F. 
         [0041]    Snoop Reset bit  208 : When this bit is set (for example, to 1), it creates a pulse that resets all snoop related hardware. 
         [0042]    TMR Interrupt Mask bit  209 : As discussed above, when this bit is set, the TMR interrupt is masked. 
         [0043]    “Stop on Link Frame” bit  210 : Setting this bit instructs the Frame Snooper module  105 E to stop CH 1   105  receive operations after a link frame has been sent to buffer memory  111 . 
         [0044]    “Stop on Command Frame” bit  211 : Setting this bit instructs the Frame Snooper module  105 E to stop CH 1   105  receive operations after a command frame has been sent to buffer memory  111 . 
         [0045]    “Stop on TMR”  212 A: Setting this bit instructs the Frame Snooper module to stop CH 1   105  receive operations after a Command frame containing task management flag bits has been sent to buffer memory  111 . 
         [0046]    Task Management Counter Enable bit  212 : When this bit is set, counter  201  will increment every time a TMR frame ( 105 G) is received. 
         [0047]    Task Management Request Interrupt  213 : When this bit is set it denotes that a Task Management Request has been received. 
         [0048]    Next Frame Link bit  214 : If set, this bit indicates that the next Frame from CH 1  FIFO  105 B will be sent to a Link Buffer (shown in  FIG. 1B  for storing link frames). 
         [0049]    Next Frame Command bit  215 : If set, this bit indicates that the next frame from CH 1  FIFO  105 B will be sent to the Command Buffer. 
         [0050]    Next Frame Data bit  216 : If set, this bit indicates that the next frame from CH 1  FIFO  105 B will be sent to the Data Buffer. 
         [0051]    Found Link Frame bit  217 : If this bit is set, it indicates that the frame snooper module  105 E stopped CH 1   105  receive operations after a link frame was sent to buffer memory  111 . 
         [0052]    Found Command Frame bit  218 : If this bit is set, it indicates that the frame snooper module  105 E stopped CH 1   105  receive operations after a command frame was sent to the buffer. 
         [0053]    Found Task Management Request Frame bit  219 : If this bit is set, it indicates that the frame snooper module  105 E stopped CH 1   105  receive operations after a 25 task management request frame was sent to buffer memory ill. 
         [0054]      FIG. 3  shows a process flow diagram for processing frames, according to one aspect of the present invention. The process assumes that various configuration bits, described above with respect to register  206  are set so that frame snooper module  105  can generate pause signal  105 F to stop certain receive operations. 
         [0055]    Turning in detail to  FIG. 3 , in step S 300 , frame snooper module  105 E detects certain frame types. Frame types include command frame  105 K, link frame  105 J, data frame  105 H and TMR frame  105 G. 
         [0056]    In step S 302 , a pause signal  105 F is generated to stop CH 1  pipe  105 C to transmit frames to buffer memory  111  via BC  108 . For example, if a “Stop on TMR frame” bit  212 A is set then CH 1  pipe  105 C does not send any more frames to BC  108  after receiving a TMR. 
         [0057]    In step S 304 , an interrupt is generated if a TMR frame  105 G is received. It is noteworthy that firmware for controller  101  may generate an interrupt after a TMR counter  201  reaches a certain value. 
         [0058]    In step S 306 , data frames are still received while CH 1  pipe  105 C stops sending command or link frames to BC  108 , after the pause signal is generated in step S 302 . 
         [0059]    Because receive operations stop when a TMR frame  105 G is received, it allows processor  100  to complete the execution of previously received command frames. This is more efficient because a TMR  105 G may request processor  100  to discard previously received command frame, or select certain command frames to execute in a certain order or priority. This improves performance and reduces latency. Also, no timers are needed to manage command frames. 
         [0060]    Although the present invention has been described with reference to specific embodiments, these embodiments are illustrative only and not limiting. Many other applications and embodiments of the present invention will be apparent in light of this disclosure.