Abstract:
A plurality of direct memory access data transfers are accomplished to transfer data from a host to an adaptor. For each transfer, an indication of locations of at least one group of storage locations associated with the host available to hold the data to be transferred to the host is provided from the host to the adaptor. An indication of the provided indication is maintained, for that transfer, by the host. Based on the indication of locations provided from the host to the adaptor, data is transferred to the at least one group of storage locations from the adaptor. An indication is provided from the adaptor to the host that the data transferring step has been completed with respect to the at least one group of storage locations. The host determines the locations corresponding to the at least one group of storage locations based on the indications maintained by the host and retrieving the data from the at least one group of storage locations based on the determination. A similar method is provided to transfer data from the adaptor to the host. Broadly speaking, the host and adaptor retain state information between DMA data transfers. As a result, absolute values of overhead items need not be transferred between the host CPU and the I/O device for each DMA data transfer, and the amount of overhead is reduced.

Description:
TECHNICAL FIELD  
         [0001]    The present patent application relates to controlling direct memory access (DMA) transfers between a host and an input/output (I/O) device. More particularly, the control is accomplished with reduced overhead.  
         BACKGROUND  
         [0002]    Direct memory access (DMA) is typically used to transfer large amounts of data between a host central processing unit (CPU) and a DMA input/output (I/O) device. Briefly, the host CPU provides the DMA I/O device with information about where to place (for input) or from where to fetch (for output) data from host memory such that the I/O device independently perform the data transfer operation. As a result of the I/O device independently performing the I/O operation, the host CPU is relieved of handling much of the processing associated with the I/O operation.  
           [0003]    The information about where to place or from where to fetch, among other information describing and/or controlling the to-be-performed data transfer, is known as “overhead information,” and the overhead information is typically transferred from the host CPU to the I/O device in association with the data transfer. For example, the volume of data to be transferred may be so large that it does not fit contiguously into the host memory. In this case, different regions of the host memory may be utilized and the locations of these different regions are conveyed to the I/O device in the transfer of overhead information from the host CPU.  
           [0004]    A fundamental metric DMA performance metric is the ratio of the amount of overhead data transferred to the amount of actual data transferred. For example, it is believed that the 21143 PCI/CardBus 10/100 Ethernet LAN Controller, from Intel Corporation of Santa Clara, Calif., requires a transfer of between 32 and 64 bytes of overhead data per DMA transfer. Thus, if a DMA transfer is about 60 bytes, then this amounts to 50% efficiency (or perhaps more properly, inefficiency) in the data transfer.  
         SUMMARY  
         [0005]    A plurality of direct memory access data transfers are accomplished to transfer data from a host to an adaptor. For each transfer, an indication of locations of at least one group of storage locations associated with the host available to hold the data to be transferred to the host is provided from the host to the adaptor. An indication of the provided indication is maintained, for that transfer, by the host. Based on the indication of locations provided from the host to the adaptor, data is transferred to the at least one group of storage locations from the adaptor. An indication is provided from the adaptor to the host that the data transferring step has been completed with respect to the at least one group of storage locations. The host determines the locations corresponding to the at least one group of storage locations based on the indications maintained by the host and retrieving the data from the at least one group of storage locations based on the determination.  
           [0006]    A similar method is provided to transfer data from the adaptor to the host.  
           [0007]    Broadly speaking, the host and adaptor retain state information between DMA data transfers. As a result, absolute values of overhead items need not be transferred between the host CPU and the I/O device for each DMA data transfer, and the amount of overhead is reduced. 
       
    
    
     BRIEF DESCRIPTION OF FIGURES  
       [0008]    [0008]FIG. 1 illustrates an embodiment of a DMA I/O device in accordance with the invention.  
         [0009]    [0009]FIG. 2 illustrates an example operating scenario of the FIG. 1 DMA I/O device.  
     
    
     DETAILED DESCRIPTION  
       [0010]    [0010]FIG. 1 is a block diagram illustrating an embodiment of a DMA I/O device in accordance with an embodiment of the invention. The shaded registers indicate clocking points to assist the interfaces in being “well-behaved” for timing purposes. All receive and transmit references in this detailed description are with respect to the “clients” of the DMA device. For example, a typical “client” is an application executing by a host CPU. The In this description, each module is denoted by a two or three letter acronym that is used in naming the related file instantiations, signals, etc.  
         [0011]    Before describing the operation of the modules, though, the bus data signals are described in the following table.  
                                       PL-Bus:   This is a simple generic, Programming Input Output       PCI Local   (PIO), bus that is used to interface to DMA device&#39;s core       Bus.   logic. This bus allows access to local registers that are           used to program the DMA device, by, e.g., a CPU or a           PCI bus. In addition, due to its asynchronous nature, this           bus shields the DMA device&#39;s core logic from the client&#39;s           clock domain.       W-Bus:   This bus is employed to transfer data and payload to/from       Wide Bus.   the DMA device&#39;s clients.       T-Bus:   This bus is employed to transfer data to/from the PCI       Target Bus.   block when the DMA device is operating as a PCI target           device. The PCI block in this case is the master of the           operation relative to the DMA device.       C-Bus:   This bus is employed to transfer data to or from any PCI       CPU Bus.   locations directly as well as read and write the head           of the Rx/Tx FIFO&#39;s. This bus provides a generic interface           to a local CPU.       D-Bus:   This bus is employed to communicate with the PCI core.       DMA Bus.   This is the main mechanism to transfer data to/from the           PCI core when the DMA device is the master of the           operation.       S-Bus:   This is a serial interface, which is used to load the       Serial Bus.   “personality” of the DMA device, at boot time for           example. The “personality” may include various reset           values and other characteristics.                  
 
         [0012]    The operation of each block of the FIG. 1 DMA device is now briefly summarized.  
         [0013]    Receive Processor (RP). The RP module receives commands from the host and processes the commands to form a free list of addresses for use by the receive DMA (RD) engine.  
         [0014]    Receive Command FIFO (RC). This block is a first-in, first-out (FIFO) buffer that holds the “well-formed” free list of addresses for use by the Receive DMA engine. There are two instances of the FIFO—RCH and RCL—one for each of high and low priority, respectively. The FIFO is 128 bytes deep, plus any necessary sidebands.  
         [0015]    Receive DMA (RD). This module provides the “receive data” to the host addresses (lengths as specified by the RC block).  
         [0016]    Transmit Command Processor (TP). This module interprets the commands from the host and forms commands for the Transmit DMA (TD) engine.  
         [0017]    Transmit Command FIFO (TC). This FIFO contains the well-formed commands for the Transmit DMA operation. There are two instances of the FIFO—TCH and TCL—one for each of high and low priority. This FIFO is 128 bytes deep, plus any necessary sidebands.  
         [0018]    Transmit DAM (CD). This module provides the “tansmit data” from the host addresses (lengths as specified by the TC block). This module also implements the Target Channel Interface (TI), that translates the Target Channel Interface protocol to FIFO write signals.  
         [0019]    Target Bus Mux (TM). This module multiplexes the target channel onto the W-Bus and also generates the T-Bus protocol.  
         [0020]    CPUBus Mux (CM). This module multiplexes the C-Bus onto and from the W-Bus.  
         [0021]    Transmit FIFO (TF). This is the “transmit elasticity” FIFO. It is preferably deep enough so as to sustain a long burst (e.g., 512 bytes deep plus sidebands).  
         [0022]    Receive FIFO (RF). This is the “receive elasticity” FIFO. It is preferably deep enough so as to sustain a long burst (e.g., 512 bytes deep plus sidebands).  
         [0023]    Wide Bus Interface (WI). The Wide Bus Interface module routes the W-Bus from the Transmit FIFO&#39;s, and to the Receive FIFO&#39;s.  
         [0024]    Status Processor (SP). The Status Processor converts the status signals from the modules into messages to the host. The status signals consist of the value of several registers in the DMA I/O device, that indicate how far the device has progressed in writing to particular host FIFO-s, and how far the device has progressed in reading from particular host FIFO&#39;s. It also handles the host interrupt logic.  
         [0025]    Rx Status Processor (RS). The Status Processor provides the Rx commands to the host, indicating where the RxDMA module wrote the data.  
         [0026]    Rx Status FIFO (RSF). This module buffers per packet, and per page status messages from the RxDMA module.  
         [0027]    Rx Command DAM (RCD). This module fetches receive free list commands from the host and handles the flow control.  
         [0028]    Tx Command DAM (TCD). This module fetches transmit commands from the host and handles the flow control.  
         [0029]    Add VLAN (AVL). This module inserts per packet VLAN (Virtual Local Area Network) information into each packet as specified by the transmit command stream. For example, in one embodiment, a two-byte VLAN packet is inserted between the 12 th  and 13 th  bytes of the packet.  
         [0030]    Receive Aligner (Rx ALN). This module accepts an arbitrary byte address from RxDMA and the data left justified. The module transfers a 64-bit aligned address to the PCI along with the data starting at the correct byte lane and the byte-enables corrected.  
         [0031]    Transmit Aligner (Tx ALN). This module accepts an arbitrary byte address from TxDMA and takes the data from the correct byte lanes and packs it left justified for use of the W-Bus.  
         [0032]    [0032]FIG. 2 illustrates an example of how the FIG. 1 embodiment operates. First the transmit operation in accordance with an embodiment is described. The transmit operation starts with the host CPU storing the user data to be transmitted in host memory transmit buffers BUF 0 , BUF 1 , BUF 2 , . . . BUFn of a pool of buffers, TxPool. The host memory transmit buffers are buffers of potentially arbitrary length, starting at potentially arbitrary addresses in a memory associated with the host. Information about the host memory transmit buffers in which the user data is held is stored in a software request queue of the host, herein referred to as transmit queue (TxQ). The TxQWrPtr register provides information about the end of the TxQ. The host notifies the adaptor to update the value of the TxQShdwWrPtr register (e.g., by doing a single PIO write to the adaptor) to be the value of the TxQWrPtr register. The adaptor, upon detecting a difference between the value in the TxQRdPtr register (which indicates from where in the TxQ the adaptor last read host memory transmit buffer information) and the QShdwWrPtr value, receives a collection of the host memory buffer information from the TxQ by, for example, direct memory access. The TxQProc processor processes the host memory buffer information to generate TxCommands, and stores the TxCommands in the TxCmdFIFO—to control the Tx DMA. The adaptor fetches the data from the host memory transmit buffers (TxPool) into the TxFIFO according to the information in the Tx commands, appropriately modifying the TxRdPtr into the TxPool as the user data is fetched.  
         [0033]    Once the data from a particular host memory buffer in TxPool is completely consumed (i.e., has been fetched), the host puts the memory locations of the consumed data on the WrFreeList. The host, which keeps a copy of all the addresses that were given to the adaptor, uses the provided TxRdPtr value to determine the addresses of locations in the TxPool that are free and places an indication of those locations on the WriteFreeList. The host periodically causes the TxQShdwWrPtr value in the adaptor to be updated from the TxQWrtPtr (which, for example, may ensure that the adaptor never runs out of commands).  
         [0034]    The adaptor from time to time refills the TxCmdFIFO from the host TxQ. The command queue refill may be periodic, with the period being programmable in the adaptor in units of bytes of data transferred. The refill may also occur immediately if TxCmdFIFO is empty when the ShadowWritePointer value is caused to be written.  
         [0035]    Now the receive operation is described. The receive operation is similar in many respects to the transmit operation. The host reserves host memory receive buffers in RxPool for to-be received data and places pointers to the reserved buffers on a software free list RxFreeList. The free list pointers are provided to the adaptor device in a fashion similar to that by which transmit commands are provided to the adaptor device in the transmit operation. The RxFLWrtPtr in the host and the RxFLRdPtr and RxFLShdwWrtPtr in the adaptor point to the RxFreeList. The host conveys the existence of receive free list information to the adapter by updating the RxFLShdwWrtPtr.  
         [0036]    RxFIFO holds the data to be received into the host from the adaptor. As the data arrives into the buffers in RxPool from the RxFIFO, the adaptor sends status information about the buffers to the host via the RxQ queue maintained by the host. The adaptor controls the RxQWrtPtr and the RxQShdwWrtPtr. For example, the RxStatProc of the adaptor causes commands to be stored to the RxQ indicating the packet boundaries and lengths. It is noted that there is no need to provide the actual addresses of buffers in RxPool. That is, the adaptor only has to indicate when it is switching buffers because the host maintains the RxFreeList which is a queue of all the free list elements issued to the adaptor. As the receive status commands in RxQ are parsed by the host, the processes the RxFreeList tp deter,ome the corresponding address in the RxPool. After the host retrieves the received data from a particular host memory receive buffer, the host puts that host memory receive buffer back onto the RdFreeList.  
         [0037]    In one example, the refill of RxQ is governed by the depth of RxQ and the amount of information data in RxQ. In one example, when RxQ drops below 32 bytes and a refill period timer has elapsed, then a DMA fetch is made to transfer status signals from the RxStatProc to RxQ.  
         [0038]    In some examples, the adaptor maintains two priority queues each for the Tx and Rx directions. This results in duplicate sets of registers, queues, and other resources in the adaptor.  
         [0039]    Deadlock issues (or, more properly, the lack thereof) are now discussed. In some examples, all Rx and Tx resources are mutually exclusive. As such, no hardware deadlock conditions exists. In addition, all the reply paths from the adaptor to the host have the highest priority and cannot be blocked. Further, there are duplicate sets of registers and other resources in the adaptor for each priority queue.  
         [0040]    With respect to interrupt handling, in some examples, the only normal mode interrupt occurs when the RxDMA process transitions from no packet transfer to the first packet transfer. In addition, the adaptor generates interrupts for error cases, as flagged by the PCI interface.  
         [0041]    Flow control in a “Switch Mode” is now discussed. In the transmit direction, if the outbound traffic is paused (e.g., by a media access controller—or MAC); the TxFIFO may eventually become full and signal the fall condition via a pin to the adaptor. At that time, the TxDMA ceases operation once it has finished its current DMA cycle. In the receive direction, if the host cannot keep up with the data traffic (i.e., retrieve the data rom the RxPool), the adaptor may eventually run out of free list elements (i.e., buffer into which it can store data) and ceases operation, which in turn results in the RxFIFO becoming full and a flow control signal being issued to the MAC. This signal will result in a PAUSE frame to be issued by the MAC with a pre-determined time value. If the traffic does not cease, the MAC will eventually drop packets.  
         [0042]    For broadcast and multicast, in the adapter mode and in the absence of a Forwarding Engine, the MAC&#39;s address match logic is used for multicast and broadcast handling.  
         [0043]    Bundling is handled entirely in software. The software sections off the data into logical groups and sends each block of data over a different link.  
         [0044]    The fail-over is handled entirely in software. The software sections off the data into logical groups and sends each block of data over a different link.  
         [0045]    Endian-ness is now discussed. In accordance with some embodiments, of the six separate entities within each adaptor that communicate with the host bus, only two of the entities directly implicate Endian-ness issues. The modules—in one example, the receive status processor (RxStatProc), status processor (StatProc), transmit command DMA (TxQProc), and receive free list DMA (RxFProc)—all generate eight-byte aligned addresses and transfer 64-bit entities and, therefore, no Endian-ness issues are implicated. In the case of the receive status processor (RxStatProc), the commands are packed with NOPs so as to make the transfer be entirely of 64-bit entries.  
         [0046]    The Receive and Transmit DMA paths (RxFIFO and TxFIFO) have a byte aligner between the adaptor and the host. This byte aligner converts from the host endian-ness to little endian format. The core runs in a little endian fashion. The host endian-ness is conveyed to the adaptor via a signal from the core.  
         [0047]    The adaptor may operate in various modes. Reference is made to U.S. Provisional Patent Application No. 60/283,286, filed Apr. 11, 2001 and incorporated herein by reference in its entirety. Particular reference is made to FIG. 1 of U.S. Provisional Patent Application No. 60/283,286 and to FIG. 1 of the present application.  
         [0048]    The Switch Mode operation is now described. The Switch Mode is a simplified manner of employing the adaptor. The notable simplification is that the TxDMA module is not used and that the RxDMA module operates in linear addressing mode.  
         [0049]    In the Switch Mode during the transmit operation, when a data packet arrives from the switch back plane, the packet arrives on the T-Bus to the adaptor. The adaptor then steers the T-Bus to the W-Bus. As such, the adaptor&#39;s TxDMA engine is completely bypassed. The raw data is routed to the W-Bus. It should be noted that the adaptor does not generate any payload to the switch fabric directly. It should be further noted that the Virtual Back Plane links (Virtual Channels) are constructed based on the existing {Base-Upr, Base-Lwr} combination and 4 consecutive 64K regions.  
         [0050]    In the Switch Mode during the receive operation, once a packet is received from the wire, the packet is written into the switch fabric. Sometime before the end of the packet, the Forwarding Engine produces an Rvec to the switch fabric for placement of the packet onto the appropriate destination queue. The packet is then submitted on the W-Bus to the appropriate adaptor. The adaptor, one per W-Bus, then transmits the packet to the proper destination node in a linear increment DMA fashion (through the switching back plane). The address to use is specific to each instantiation of adaptor. A given adaptor is one side of a virtual channel and as such, it uses a fixed address.  
         [0051]    Flow control in the Switch Mode is now described. The adaptor maintains a hold off timer, which is programmed via an access by its Virtual Channel Link Partner. When the Link Partner&#39;s adaptor detects a High Water Mark from its core logic, the Link Partner&#39;s adaptor issues a PIO write to this adaptor&#39;s hold off timer (via a 64-bit access by the status processor). This throttles down all traffic generated by this adaptor for a specified amount of time. When the counter counts down to zero, the traffic resumes.  
         [0052]    In the Switch Mode, the adaptor takes no special actions in case of Multicast and Broadcast. In addition, in the Switch Mode, the adaptor takes no special actions for bundling. Furthermore, in the Switch Mode, the adaptor takes no special actions for Fail-Over.  
         [0053]    The Network Processor Mode of operation is now described. In the Network Processor Mode of operation, the adaptor is mainly used to access the queuing system in the switch fabric. The data is read from the head of the RxFIFO into the host and is written into the head of the TxFIFO by the host. The C-Bus is effectively switched onto the W-Bus. As such, the host is relieved of overhead of packet maintenance in the switch fabric. The packet can also be automatically switched if the host prepares the Rvec (and the Rvec-vld bit is set in the header) or if the packet is explicitly switched via the Forwarding Engine. Further, the packet checksum is calculated automatically.  
         [0054]    The data is burst read and written from and to the head of the RxFIFO and TxFIFO by the processor on the C-Bus. The adaptor provides the count values of the number of entries in the FIFO&#39;s for flow control purposes, so that a continuous burst can be set up.  
         [0055]    Processor Control is now discussed. In the Network Processor mode, the visible space of the host address space of the host address space from the RxDMA&#39;s point of view is mapped into a portion of the C-Bus address space. The upper 32-bits of the host address are provided from a adaptor local register.