The present invention relates to interface controllers, and more particularly to memory interface controllers for networking devices.
Referring now to
In the network device 10, the low latency memory 14 generally has higher performance than the high latency memory 16. For example, the low latency memory 14 can be static random access memory (SRAM), which has relatively fast read/write access times and a relatively high cost. The low latency memory 14 can be embedded or external. The high latency memory 16 has slower read/write access times and is typically less expensive than the low latency memory. For example, the high latency memory 16 can be dynamic random access memory (DRAM).
Due to the cost difference, the memory capacity of the low latency memory 14 is usually substantially lower than the memory capacity of the high latency memory 16. In other words, while it is desirable to have as much of the low latency memory 14 as possible to improve performance, the cost of the low latency memory 14 usually requires a trade-off between system cost and performance. Usually, substantially more of the high latency memory 16 is used due to its lower cost. In addition, the smaller physical size of the low latency memory 14 allows it to be located near the interface controller 20 or embedded on the same chip as the interface controller 20. The proximity of the low latency memory 14 further improves data access times.
Referring now to
When the CPU and/or the network adaptor 32 read from or write to the high latency memory 16, the interface controller 20 uses two conventional approaches. In a first approach, a base address and a buffer pool size are specified by a descriptor control structure and are stored in registers of the interface controller 20. In a second approach, a base address register and mask are specified by the descriptor control structure and are stored in registers of the interface controller.
The values stored in the base address register and the buffer pool size or mask register are used by the CPU 12 and the interface controller 20 when storing and retrieving the packets from the high latency memory 16. The descriptor control structure is prepared by the driver software that runs the CPU 12. The descriptor control structure is used by the hardware-based direct memory access (DMA) engine to read/write data packets to/from the high latency memory 16.
In
The network adaptor 32 receives instructions from the CPU 12 based on the registers 49 or 49′. The CPU 12 instructs the network adaptor 32 where to write the data packets in the high latency memory. The data packets 44 are sent from the network 40 through the network adaptor 32 to the network device 10. The data packets 44 are then stored in the high latency memory 16 based on the instructions from the CPU 12.
The low latency memory 14 is not used for the data packets 44 due to the large size of the data packets 44 and the relatively-low capacity of the low latency memory 14. Reading and writing access times that are required by the CPU 12 are adversely impacted by the relatively low data read/write speeds of the high latency memory 16.
A network device according to the present invention receives data packets. A low latency memory has a first read/write performance. A high latency memory has a second read/write performance that is slower than the first read/write performance of the low latency memory. An interface controller communicates with the low latency memory and the high latency memory, receives the data packets, and stores header portions of the data packets in the low latency memory and data portions of the data packets in the high latency memory.
In other features, a central processing unit (CPU) and a network adaptor communicate with the interface controller and read from and write to the data packets. The interface controller further includes an address check circuit that determines whether a read address from the CPU or the network adaptor is associated with one of the header portions that is stored in the low latency memory. If the read address is associated with one of the header portions, the interface controller reads the header portion from the low latency memory.
In still other features, the address check circuit determines whether a write address from the CPU or the network adaptor is associated with a header portion. If the write address is associated with the header portion, the interface controller writes the header portion to the low latency memory.
In yet other features, the address check circuit uses registers of the interface controller to identify addresses corresponding to the header portions. The registers include a base address register, a buffer pool size register, a maximum individual buffer size register, and a header size register. Alternately, the registers include a base address register, a mask register, a maximum individual buffer size register, and a header size register.
Further areas of applicability of the present invention will become apparent from the detailed description provided hereinafter. It should be understood that the detailed description and specific examples, while indicating the preferred embodiment of the invention, are intended for purposes of illustration only and are not intended to limit the scope of the invention.
The present invention will become more fully understood from the detailed description and the accompanying drawings, wherein:
The following description of the preferred embodiment(s) is merely exemplary in nature and is in no way intended to limit the invention, its application, or uses. For purposes of clarity, the same reference numbers will be used in the drawings to identify similar elements.
In networking applications, the header portion 46 of the data packet 44 provides information that is required by the CPU 12 for making routing and protocol decisions and additional processing of the data packet 44. The header portion 46 is relatively small as compared to the overall size of the data packet 44. The CPU 12 frequently reads the header portions 46 of the data packets 44. Performance is significantly improved if the CPU 12 can access the header portion 46 of the data packet 44 more quickly. The improved performance is particularly advantageous in switches and routers that make decisions on L2 and L3 information in the data packet 44.
The network device includes an interface controller that writes the header portions 46 of the data packets 44 to and/or reads the header portions 46 from the low latency memory 14. The data portion 48 of the data packet 44 is written to and read from the high latency memory 16. The low latency memory 14 has faster read/write access times than the high latency memory 16. As a result, the CPU 12 can access the header portions 46 more quickly.
The interface controller according to the present invention preferably uses a continuous buffer pool. The interface controller allocates a maximum size individual buffer for each buffer. By knowing a header portion size and the buffer pool size or mask of the buffer memory, the interface controller can determine whether a read/write address is associated with a header portion. If it is, the interface controller reads/writes the header portion from/to the low latency memory.
The network device according to the present invention does not require modification to the network adaptor 32 or the network adaptor driver software. As a result, the cost of implementing the improved network device according to the present invention is reduced. The present invention improves the performance of switches, routers and other network devices based on existing network adaptors and network adaptor driver software.
Referring now to
The interface controller 66 includes an address check circuit 68 that monitors read and/or write addresses from the CPU 12 and/or the network adaptor 32. If the read and/or write address is associated with the header portion 46 (or the header portion 46 and the data portion 48), the header portion 46 is written to and/or read from the low latency memory 14 (or the header portion 46 is written to or read from the low latency memory 14 and the data portion is read from or written to the high latency memory 16). Otherwise, the data portion 48 is read from and/or written to the high latency memory 16. The address check circuit 68 can be implemented in combinatorial logic, software that is executed by a processor, one or more discrete circuits or in any other suitable manner.
The interface controller 66 according to the present invention modifies the two conventional approaches described above. In a first modified approach, the maximum individual buffer size and the header size values are stored in registers along with the base address and the buffer pool size values that are specified by the descriptor control structure and are also stored in registers. In a second modified approach, the maximum individual buffer size and the header size values are stored in registers along with the base address and the memory mask values that are specified by the descriptor control structure and are also stored in registers. As can be appreciated, the buffer pool size may be specified in any way that will allow the size of the buffer pool to be determined. For example, the number of buffers can be specified (the buffer pool size is equal to the number of buffers times the maximum individual buffer size) or an end address of the buffer memory can be specified.
In
The maximum individual buffer size register 80 contains the maximum individual buffer size for each data packet 70. Preferably, the maximum individual buffer size is a multiple of 2n. However, other maximum individual buffer sizes can be used. The maximum individual buffer size can have several modes. For example, a maximum individual buffer size can have the following modes: 256, 512, and 2048 bytes, although other sizes are contemplated. The header size register 82 contains the size of the header portion 72. For example, the header size can be 32, 64 or 128 bytes, although other header sizes are contemplated.
The interface controller 66 monitors read or write requests received from the CPU 12 or the network adaptor 32. If read or write access to the header portion 46 is requested as determined by the address check circuit 68, the interface controller 66 automatically reads or writes from/to the header portion 46 in the low latency memory 14 in a manner that is transparent to the CPU 12 and the network adaptor 32.
For example, data packets 44 received via the network adaptor 32 have a size that varies between 64 B and 1.536 kbytes (commonly referred to as 1.5 kB). The header size is 64 B. 1,024 packet buffers with 2,048 B are assigned in the high latency memory 16. In other words, the interface controller 66 assigns 1,024×2,048 B=2,091,752 B (or 2 MB) of space in the high latency memory 16 for the data packets 44. The interface controller 66 assigns 64 B×1024=65,536 B (or 64 kB) in the low latency memory 14.
As the data packets 44 are received from the network adaptor 32, the interface controller 66 monitors the addresses to determine whether a header read or write to a header portion is involved. When the network adaptor 32 is writing data packets 44 that include header portions 46, the address check circuit 69 of the interface controller 66 recognizes the write addresses of the header portions 46. The interface controller 66 stores the header portions in the low latency memory 14 and the data portions 48 in the high latency memory 16.
When the CPU 12 or the network adaptor 32 subsequently read from and/or write to the data packets 44, the address check circuit 68 determines whether the read/write address corresponds to a header portion 46. If it does, the header portion 46 is read from and/or written to the low latency memory 14.
Referring now to
Referring now to
If step 104 is false, the interface controller 66 returns to step 104. If step 104 is true, the interface controller 66 continues with step 106. In step 106, the address check circuit 68 of the interface controller 66 determines whether the read or write address from the CPU 12 or the network adaptor 32 is associated with the header portion 46. If step 106 is false, the interface controller 66 reads data from or writes data to high latency memory 16 in step 108. If step 106 is true, the interface controller 66 reads a header portion 46 from or writes a header portion 46 to the low latency memory 14 in step 110. The interface controller 66 also reads the data portion 48 from or writes the data portion to the high latency memory if needed in step 112.
In a preferred embodiment, the header size is preferably set equal to an integer multiple of a word or cache line size of the CPU. The header locations are also preferably aligned with the word or cache lines of the CPU. For example, for a 64-bit CPU, the header size is set equal to x*64 where x is an integer. Suitable bit size values for the header include 64, 128, 192, 256, . . . .
Those skilled in the art can now appreciate from the foregoing description that the broad teachings of the present invention can be implemented in a variety of forms. Therefore, while this invention has been described in connection with particular examples thereof, the true scope of the invention should not be so limited since other modifications will become apparent to the skilled practitioner upon a study of the drawings, the specification and the following claims.
This application claims the benefit of U.S. Provisional Application No. 60/370,645, filed Apr. 8, 2002, which is hereby incorporated by reference.
Number | Name | Date | Kind |
---|---|---|---|
5398245 | Harriman, Jr. | Mar 1995 | A |
5752078 | Delp et al. | May 1998 | A |
5778414 | Winter et al. | Jul 1998 | A |
5787255 | Parlan et al. | Jul 1998 | A |
5948079 | Tsai et al. | Sep 1999 | A |
5999981 | Willenz et al. | Dec 1999 | A |
6678746 | Russell et al. | Jan 2004 | B1 |
Number | Date | Country | |
---|---|---|---|
60370645 | Apr 2002 | US |