IP Library Granted Patent US 7,970,963
Granted Patent B2
US 7,970,963 · App. 12/493,570 · Granted Jun 28, 2011

Efficient buffer management in a multi-threaded network interface

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,970,963
App. No.
12/493,570
Granted
Jun 28, 2011
Kind
B2
Abstract

Some embodiments of the present invention provide a system for receiving packets on a multi-threaded computing device which uses a memory-buffer-usage scorecard (MBUS) to enable multiple hardware threads to share a common pool of memory buffers. During operation, the system can identify a memory-descriptor location for posting a memory descriptor for a memory buffer. Next, the system can post the memory descriptor for the memory buffer at the memory-descriptor location. The system can then update the MBUS to indicate that the memory buffer is in use. Next, the system can store a packet in the memory buffer, and post a completion descriptor in a completion-descriptor location to indicate that the packet is ready to be processed. If the completion-descriptor indicates that the memory buffer is ready to be reclaimed, the system can reclaim the memory buffer, and update the MBUS to indicate that the memory buffer has been reclaimed.

Claims (47)

1. A method for receiving a packet on a multi-threaded computing device which uses a memory-buffer-usage scorecard to enable multiple hardware threads to share a common pool of memory buffers, the method comprising:

identifying a memory-descriptor location for posting a memory descriptor for a memory buffer;

posting the memory descriptor for the memory buffer at the memory-descriptor location;

updating the memory-buffer-usage scorecard to indicate that the memory buffer is in use;

storing a packet in the memory buffer;

posting a completion descriptor in a completion-descriptor location to indicate that the packet is ready to be processed; and

in response to determining that the completion descriptor indicates that the memory buffer is ready to be reclaimed,

reclaiming the memory buffer, and

updating the memory-buffer-usage scorecard to indicate that the memory buffer has been reclaimed;

wherein the memory-descriptor location is a receive buffer ring (RBR) entry and the completion-descriptor location is a receive completion ring (RCR) entry, and wherein the memory-buffer-usage scorecard is a buffer-posting and reclaim array (BPRA) which is partitioned into multiple regions so that a BPRA entry in each BPRA region is associated with an RPR entry.

2. The method of claim 1 , wherein the memory descriptor includes a memory buffer address field.

3. The method of claim 1 , wherein the memory descriptor includes a buffer index field which specifies an offset into a buffer address lookup table.

4. The method of claim 1 , wherein the memory descriptor includes a BPRA region field.

5. The method of claim 1 , wherein updating the memory-buffer-usage scorecard to indicate that the memory buffer is in use comprises:

identifying a first BPRA entry in a first BPRA region which is associated with the RBR entry where the memory descriptor for the memory buffer is desired to be posted;

in response to determining that the first BPRA entry indicates that a memory buffer associated with the first BPRA entry has not been reclaimed, identifying a second BPRA entry in a second BPRA region which is associated with the first RBR entry, wherein the second BPRA entry indicates that a memory buffer associated with the second BPRA entry has been reclaimed; and

modifying the second BPRA entry to indicate that a memory buffer associated with the second BPRA entry has not been reclaimed.

6. The method of claim 5 , wherein in response to determining that the first BPRA entry indicates that a memory buffer associated with the first BPRA entry has not been reclaimed, the method further comprises storing an indicator which indicates the first BPRA entry's location in the first BPRA region.

7. The method of claim 6 , wherein the indicator is used to determine which BPRA region to use when a BPRA entry in a current BPRA region is unavailable.

8. The method of claim 1 , wherein the completion descriptor includes a memory-buffer-type field which indicates the size of the packets that are stored in the memory buffer.

9. The method of claim 1 , wherein the completion descriptor includes a packet offset field which indicates the packet's location in the first memory buffer.

10. The method of claim 1 , wherein the completion descriptor includes a packet length field which indicates the packet's length.

11. The method of claim 1 , wherein the completion descriptor includes a packet status field which indicates the packet's status.

12. The method of claim 1 , wherein the completion descriptor includes a buffer index field which specifies an offset into a buffer address lookup table.

13. A non-transitory computer storage medium storing instructions that when executed by a computer cause the computer to perform a method for receiving a packet on a multi-threaded computing device which uses a memory-buffer-usage scorecard to enable multiple hardware threads to share a common pool of memory buffers, the method comprising:

identifying a memory-descriptor location for posting memory descriptor for a memory buffer;

posting the memory descriptor for the memory buffer at the memory-descriptor location;

updating the memory-buffer-usage scorecard to indicate that the memory buffer is in use;

storing a packet in the memory buffer;

posting a completion descriptor in a completion-descriptor location to indicate that the packet is ready to be processed; and

in response to determining that the completion descriptor indicates that the memory buffer is ready to be reclaimed,

reclaiming the memory buffer, and

updating the memory-buffer-usage scorecard to indicate that the memory buffer has been reclaimed;

wherein the memory-descriptor location is a receive buffer ring (RBR) entry and the completion-descriptor location is a receive completion ring (RCR) entry, and wherein the memory-buffer-usage scorecard is a buffer-posting and reclaim array (BPRA) which is partitioned into multiple regions so that a BPRA entry in each BPRA region is associated with an RPR entry.

14. An apparatus for receiving a packet on a multi-threaded computing device which uses a memory-buffer-usage scorecard to enable multiple hardware threads to share a common pool of memory buffers, the apparatus comprising:

a memory;

a buffer posting mechanism configured to:

identify a memory-descriptor location for posting a memory descriptor for a memory buffer;

post the memory descriptor for the memory buffer at the memory-descriptor location; and

update the memory-buffer-usage scorecard to indicate that the memory buffer is in use; and

a packet processing and buffer reclaiming mechanism to:

store a packet in the memory buffer;

post a completion descriptor in a completion-descriptor location to indicate that the packet is ready to be processed; and

in response to determining that the completion descriptor indicates that the memory buffer is ready to be reclaimed,

reclaim the memory buffer, and

update the memory-buffer-usage scorecard to indicate that the memory buffer has been reclaimed;

wherein the memory-descriptor location is a receive buffer ring (RBR) entry and the completion-descriptor location is a receive completion ring (RCR) entry, and wherein the memory-buffer-usage scorecard is a buffer-posting and reclaim array (BPRA) which is partitioned into multiple regions so that a BPRA entry in each BPRA region is associated with an RPR entry.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037311/0101 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 27, 2009
From: MULLER, SHIMON
To: SUN MICROSYSTEMS, INC.
Reel/Frame 023010/0900 →