Memory management in a network adapter
AssigneeQLOGIC, Corporation
InventorsYing P. Lok, Shashank Pandhare
Life of this patent
Estimating the term…
Abstract
A method and system for processing a received network packet includes providing a network adapter using a predetermined number of buffer sets in a buffer queue. A buffer queue with a plurality of buffer sets less than the predetermined number of buffer sets is provided. Each buffer set includes a plurality of buffers to store and retrieve data indicative of the storage location of the received packet. A buffer set is assigned to store data. After all the data from the assigned buffer set is retrieved, the buffer set is released to the buffer queue for subsequent assignment.
Claims20
A method for processing a packet received from a network, the network including a network adapter having a predetermined number of buffer sets in a buffer queue, the method comprising:
- the network adapter advertising to a computing system an advertised number of buffer sets available in the buffer queue, the advertised number of buffer sets being greater than the predetermined number of buffer sets so that it appears to the computing system that more buffer sets are available in the network adapter than actually are available, each buffer set including a plurality of buffers to store and retrieve data, the data indicative of a storage location of the received packet;
- wherein a first pointer points to a first one of the buffer sets for use by a consuming process and a second pointer points to a second one of the buffer sets for use by a producing process;
- wherein the first pointer and the second pointer at an initial stage are separated by at least two of the buffer sets;
- by using the first pointer, assigning the first buffer set to store and retrieve data;
- storing the data indicative of the storage location of the received packet in the assigned buffer set;
- and
- upon retrieving all the data from the assigned buffer set, releasing the assigned buffer set to the buffer queue for subsequent assignment;
- wherein the first pointer and the second pointer are adjusted when data is written to the assigned buffer set and read from the assigned buffer set.
A network system to process a packet received from a network, the network system comprising:
- a computing system with a processor for executing a driver for interfacing with a network adapter for receiving packets from a network device and sending packets from the computing system to the network device, wherein the network adapter uses a predetermined number of buffer sets in a buffer queue, the network adapter advertising to the computing system an advertised number of buffer sets available in the buffer queue, the advertised number of buffer sets being greater than the predetermined number of buffer sets so that it appears to the computing system that more buffer sets are available in the network adapter than actually are available, each buffer set including a plurality of buffers to store and retrieve data, the data indicative of the location of a storage location of the received packet;
- and
- wherein a first pointer points to a first one of the buffer sets for use by a consuming process and a second pointer points to a second one of the buffer sets for use by a producing process;
- wherein the first pointer and the second pointer at an initial stage are separated by at least two of the buffer sets;
- by using the first pointer, the first buffer set is assigned to store and retrieve data;
- the data indicative of the storage location of the received packet is stored in the assigned buffer set;
- and
- upon retrieving all data from the assigned buffer set, the assigned buffer set is released to the buffer queue for subsequent assignment;
- wherein the first pointer and the second pointer are adjusted when data is written to the assigned buffer set and read from the assigned buffer set.
Dependencies are inferred from the claim text.