LINKED LIST DMA DESCRIPTOR ARCHITECTURE

Abstract: A linked list DMA descriptor (20, 30) includes an indication of a number of data pointers (22, 32) contained in a subsequent DMA descriptor. The number of data pointers contained in the subsequent DMA descriptor is preferably contained in the memory address of the subsequent DMA descriptor. The number of data pointers is stored by the DMA controller (52) and controls how many read cycles are performed when processing the subsequent DMA descriptor.

Description: LINKED LIST DMA DESCRIPTOR ARCHITECTURE Field of the Invention The present invention relates generally to computer systems and direct memory access controllers in particular. Background of the Invention In the early days of computers, data was moved in and out of memory by a central processing unit (CPU). However, as data transfer rates for mass storage devices such as hard drives or CD-ROMs increased, the CPU was too slow to handle the transfer of data and its use prevented the CPU from performing other tasks. As a result, most computers now incorporate direct memory access controllers (DMAs) to move data to and from a memory. A DMA operates by taking control of an address and data bus to either read data from or write data to a memory. To move data, a CPU gives the DMA controller an address of a DMA descriptor. The descriptor is a set of data that includes some predefined information including the size of a data block to be moved as well as a pointer with the address of the data block in memory. In the past, each descriptor contained only one or exactly two data pointers. Each time the DMA controller was to move a data block, a new descriptor had to be read, thereby reducing the rate at which data could be moved. To speed data transfer rates, there is a need for a method of reducing the number of descriptors a DMA controller must read to move data. Summary of the Invention To increase the rate at which data can be transferred by a DMA controller, a descriptor includes an address of a subsequent descriptor as well as an indication of a variable number of data pointers contained within the subsequent descriptor. The number of pointers in the subsequent descriptor is stored in the DMA controller. Upon reading a subsequent descriptor, the stored number of pointers controls a number of read cycles performed by the DMA controller. In a presently preferred embodiment of the invention, the descriptors are stored in an aligned 32-bit memory. The last two address bits of the descriptor address are not needed and are therefore used to store the number of pointers in the next descriptor. A DMA controller in accordance with the present invention includes a counter that stores a number of data pointers in a subsequent descriptor. Upon reading the descriptor, the counter controls a number of read cycles performed by the DMA controller when operating on the next descriptor. Brief Description of the Drawings The foregoing aspects and many of the attendant advantages of this invention will become more readily appreciated as the same become better understood by reference to the following detailed description, when taken in conjunction with the accompanying drawings, wherein: FIGURE 1 illustrates a link list DMA descriptor in accordance with the present invention; FIGURE 2 illustrates how each DMA descriptor includes an indication of a number of data pointers stored in a subsequent descriptor; and FIGURE 3 illustrates how a DMA controller in accordance with the present invention includes a counter to store a number of data pointers included in a subsequent descriptor. Detailed Description of the Preferred Embodiment The present invention is a method for increasing the rate of memory transfers performed by a direct memory access (DMA) controller by including an indication of a variable number of data pointers included in a subsequent descriptor. FIGURE 1 illustrates a linked list DMA descriptor 10 in accordance with an embodiment of the present invention. In the presently preferred embodiment of the invention, the descriptor is stored in memory as a series of 32-bit words. The first word 12 of the descriptor 10 contains the address of a next descriptor to be read by the DMA controller. A second word 14 contains conventional data required by the DMA controller to move the data, including a pair of bytes 15 that store the size of a data block to be moved. The third word 16 of the descriptor 10 includes a 32-bit address of the data block to be moved. Unlike the prior art wherein the description included a pointer to one or exactly two data blocks, the descriptor 10 may include up to four data pointers to data blocks which are to be moved by the DMA controller. Because the descriptor 10 is stored as a series of 32-bit words in an aligned memory, the last two bits of the 32-bit address of the next descriptor are always 00. Therefore, these last two bits 18 are preferably used to store the number of data pointers contained in a subsequent descriptor. If the descriptor is the last descriptor in a list of descriptors, the next descriptor pointer will be set to some predefined value that can be recognized by the DMA controller, such as the null character (i.e., all zeros) or some other readily recognizable code. FIGURE 2 illustrates a link list of DMA descriptors in accordance with an embodiment of the present invention. A first descriptor 20 has stored as its first 32-bit word 22, the address of a second DMA descriptor 30. As indicated above, the last two bits of the 32-bit word 22 store the number of data pointers contained within the second DMA descriptor 30. In the example shown, the last two bits of the word 22 contain the value 01, thereby indicating that the subsequent DMA descriptor 30 contains two data pointers. The second 32-bit word 24 of the first DMA descriptor 20 contains some standard information required by the DMA controller as well as an indication of the size of the data block to be moved. In the example shown, the last two bytes of the 32-bit word 24 indicate that the data block to be moved has 256 bytes. The third 32-bit word 26 of the first descriptor 20 contains a pointer to the 256 byte data block to be moved. The first 32-bit word 32 of the second DMA descriptor 30 originally has the null character stored as the address of a subsequent descriptor, thereby indicating that the second DMA descriptor 30 is the last descriptor in the list. The second DMA descriptor 30 includes two data pointers that reference two data blocks to be moved. A pair of 32-bit words 34 and 36 store the length (i.e., 256 bytes) of a first data block and its address while a second pair of 32-bit words 38 and 40 reference a second 32 byte data block and its address. To add a subsequent DMA descriptor to the link list of descriptors, the address of the next descriptor is stored in the first 32-bit word 32 of the previous DMA descriptor 30. In the example shown, the null character stored as the first 32-bit word 32 is overwritten with the address of a subsequent DMA descriptor 44. Again, the last two bits of the address contain the number of data pointers within the subsequent DMA descriptor 44. In the example shown, the last two bits are 00, indicating that the subsequent DMA descriptor 44 contains only one data pointer. The link list formed by the DMA descriptors 20, 30 and 44 can be updated independently of the operation of a DMA controller. As will be appreciated by those skilled in the art, the DMA controller contains a next descriptor address register in which the address of the next descriptor is stored by the CPU. In order to add a DMA descriptor to a linked list of DMA descriptors, the next address space of the last DMA descriptor in the list is updated to reflect the address of the new descriptor. In addition, the next descriptor address register within the DMA controller is updated to reflect the address of the new descriptor. As indicated above, the last two bits of the next DMA descriptor address contain the number of data pointers contained in the new DMA descriptor being added to the list. When adding a new DMA descriptor to a list, there are three possible states of the DMA controller. First, it is possible that the DMA controller has not yet begun operating on the last descriptor in the list of descriptors. Therefore, if the next DMA descriptor address field for the last descriptor in the list is modified before the DMA controller begins operating on the previously last descriptor, it will recognize that the next address is not null and knows to process another DMA descriptor. In addition to updating the next descriptor address field of the previously last descriptor, a CPU also writes the address of the new DMA descriptor into the next descriptor address register of the DMA controller. Therefore, if the DMA controller has already read the next address field of the last descriptor (which was set at null), the DMA controller will still detect the new descriptor by reading its next descriptor address register after handling all the data pointers contained in the last descriptor processed. Finally, if the DMA controller is finished handling the data pointers contained in the previously last descriptor, it will enter a stopped state until the address of the new DMA descriptor and the number of data pointers included in the descriptor are written into the next descriptor address register of the DMA controller. FIGURE 3 illustrates a block diagram illustrating the additional functionality that is added to a DMA controller according to one embodiment of the present invention. The DMA controller 50 is constructed in the same manner of conventional DMA controllers except that the DMA controller 50 contains a counter 52 that stores the number of pointers in a subsequent DMA descriptor as determined from the last two bits of the next descriptor address. The number of pointers stored in the counter 52 controls the number of read cycles performed by the DMA controller when processing the next DMA descriptor. That is, upon processing the next DMA descriptor referenced in the next descriptor address register 54, the DMA controller causes a number of words to be read from memory, wherein the number of words is dependent upon the number of pointers stored in the counter 52. For example, if the information stored for each data pointer requires two words of data and the register 50 indicates that there are two data pointers in a subsequent DMA descriptor, then the DMA controller will cause five words of data to be read from memory; one word for the address of the next DMA descriptor and two words for each of the two data pointers contained in the next DMA descriptor. As can be seen from the above, the present invention is a method for reducing overhead associated with DMA controllers. Although the preferred embodiment of the invention uses the previously unused bits of the next descriptor address field to store a reference to a variable number of pointers, it will be appreciated that the reference could be placed at other locations in the descriptor. However, using the previously unused bits of the next DMA descriptor address is preferred because only a single write cycle is required to the DMA in order to supply the DMA with the next address and the number of pointers.

Claims: The embodiments of the invention in which an exclusive property or privilege is claimed are defined as follows: 1. A method of moving memory blocks with a DMA controller, comprising: providing a DMA controller with an address of a DMA descriptor that indicates a block of memory to be moved by the DMA controller, the descriptor including an address of a subsequent DMA descriptor and an indication of a variable number of data pointers included in the subsequent DMA descriptor; and reading the address of the subsequent DMA descriptor and performing a number read cycles that is dependent on the number of data pointers indicated. 2. The method of Claim 1 , wherein the indication of the number of data pointers in the subsequent DMA descriptor is provided by: encoding the number of data pointers into unused bits of the subsequent DMA descriptor's address. 3. A DMA controller of the type that moves data into and out of memory in a computer system, the improvement comprising: a counter (52) that stores a number indicative of a number of data pointers included in a variable DMA descriptor to be processed by the DMA controller, the counter controlling a number of memory read cycles performed by the DMA controller when the DMA descriptor is processed. 4. A computer-readable memory device for storing a DMA descriptor, comprising: a number of computer readable bits (30) that indicate a memory address of a subsequent DMA descriptor; a number of computer-readable bits (32) that indicate a variable number of data pointers included in the subsequent DMA descriptor wherein the bits that indicate the variable number of data pointers are read by a DMA controller to determine a number of read cycles that the DMA controller performs. 5. The computer-readable memory device of Claim 4, wherein the number of bits that indicate the variable number of data pointers are included in the address of the subsequent DMA descriptor.

Inventors: SCHMIDT ANDREAS, SCHMIDT, ANDREAS
Applicants: INFINEON TECHNOLOGIES CORP, INFINEON TECHNOLOGIES NORTH AMERICA CORP.
Application year: 2000
Main classification: G06F9
IPC codes: G06F13