Dynamic reallocation of data stored in buffers based on packet size
AssigneeInternational Business Machines Corporation
InventorsChristos John Georgiou, Valentina Salapura
Life of this patent
Estimating the term…
Abstract
A method and system is provided to efficiently manage memory in a network device that receives packets of variable size. The memory is allocated into portions whereby each portion, comprising multiple equally-sized buffers, receives packets of a particular size. One portion is used for smaller packet sizes and another portion is for larger packet sizes, although other portions may be created. As packets are received at the network device, they are stored into the appropriate memory portion based on their size. The number of available buffers in each portion is monitored so that, when it falls below a threshold, buffers are reallocated to the other thereby increasing the overall memory efficiency.
Claims23
A method of reallocating buffer memory, the method comprising steps of:
- allocating memory into at least a first portion and a second portion;
- creating a buffer pool in the first and second portion, each buffer in the first portion being substantially equally sized and associated with a predetermined packet size and each buffer in the second portion being substantially equally sized and associated with another predetermined packet size;
- monitoring usage of buffers in each of the first and second portions to determine whether the number of occupied buffers in at least one of the first and second portions crosses a threshold;
- and
- triggering a reallocation of the memory of the first and second portions when the number of occupied buffers in at least one of the first and second portions crosses a threshold.
A system for a network device that receives packets of variable length, comprising:
- a memory having a first portion and a second portion, the first portion storing packets having a length less than a predetermined value and the second portion storing packets greater than a predetermined value;
- and
- a memory system reallocating the memory of the first portion and the second portion when the memory of at least one of the first portion and the second portion crosses a threshold, wherein the first portion of memory contains multiple buffers, each buffer of the first portion sized to store one packet that has a length less than the predetermined value and the second portion of memory contains multiple buffers, each buffer of the second portion sized to store one packet that has a length greater than the predetermined value.
A computer program product comprising a computer usable medium having readable program code embodied in the medium, the computer program product includes:
- a first computer program code to allocate memory into at least a first portion and a second portion;
- a second computer program code to create a buffer pool in the first and second portion, each buffer in the first buffer pool being equally sized and associated with a predetermined packet size and each buffer in the second buffer pool being equally sized and associated with another predetermined packet size;
- a third computer program code to monitor usage of buffers in each buffer pool to determine whether the unused buffers in either buffer pool falls below a threshold;
- and
- a fourth computer code to trigger a reallocation of memory when the unused buffers in either buffer pool falls below a threshold.
Dependencies are inferred from the claim text.