Method and device for flexible buffering in networking system
First Claim
Patent Images
1. A method for flexible buffering in a networking system, comprising:
- allocating a first buffer set having a first number of buffers and a second buffer set having a second number of buffers, wherein each buffer in the first buffer set has a first equal size, each buffer in the second buffer set has a second equal size, the first equal size and the second equal size are different;
allocating a first descriptor set and a second descriptor set with first and second descriptors pointing to the buffers in the first and second buffer sets;
buffering an input packet into a buffer in one of the first and second buffer sets based on a packet size;
counting a first usage rate of the first buffer set and a second usage rate of the second buffer set;
re-calculating descriptor amounts in the first and second descriptor sets and the buffer amounts in the first and second buffer sets based on the first and the second usage rates; and
re-allocating or releasing the descriptors in the first and second descriptor sets and the buffers in the first and second buffer sets based on the re-calculated descriptor amounts and buffer amounts.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and device for flexible, dynamic and optimal buffering in a networking system are provided. Sizes of incoming packets are recognized and the packets are buffered into buffers of appropriate sizes. Usage times of buffers are counted, and during an idle state of the networking system, buffer number and descriptor number are re-calculated based on usage times. Then, buffers and descriptors are re-allocated based on the re-calculated number. By re-allocation, buffer sets with higher usage times are allocated with more buffers, and vice versa, so memory waste is lowered and the overall performance of the networking system is improved.
-
Citations
13 Claims
-
1. A method for flexible buffering in a networking system, comprising:
-
allocating a first buffer set having a first number of buffers and a second buffer set having a second number of buffers, wherein each buffer in the first buffer set has a first equal size, each buffer in the second buffer set has a second equal size, the first equal size and the second equal size are different; allocating a first descriptor set and a second descriptor set with first and second descriptors pointing to the buffers in the first and second buffer sets; buffering an input packet into a buffer in one of the first and second buffer sets based on a packet size; counting a first usage rate of the first buffer set and a second usage rate of the second buffer set; re-calculating descriptor amounts in the first and second descriptor sets and the buffer amounts in the first and second buffer sets based on the first and the second usage rates; and re-allocating or releasing the descriptors in the first and second descriptor sets and the buffers in the first and second buffer sets based on the re-calculated descriptor amounts and buffer amounts. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A networking system for receiving packets, comprising:
-
a main memory, allocated with a first buffer set having a first number of buffers and a second buffer set having a second number of buffers, wherein each buffer in the first buffer set has a first equal size, each buffer in the second buffer set has a second equal size, the first equal size and the second equal size are different, the main memory further allocates a first descriptor set and a second descriptor set with first and second descriptors pointing to the buffers in the first and second buffer sets; and a networking controller, receiving and buffering an input packet into a buffer in one of the first and second buffer sets based on a packet size; wherein when the networking system is idling, descriptor amounts in the first and second descriptor sets and the buffer amounts in the first and second buffer sets are recalculated based on usage rates of the first and the second buffer sets, the descriptors in the first and second descriptor sets and the buffers in the first and second buffer sets are re-allocated or released based on the recalculated descriptor and buffer amounts. - View Dependent Claims (7, 8, 9, 10)
-
-
11. A networking interface in a networking system with a main memory, receiving and moving packets to the main memory, the main memory allocated with a first buffer set having a first number of buffers and a second buffer set having a second number of buffers and a first and a second descriptor sets with descriptors pointing to the buffers of the first and the second buffer sets, the networking interface comprising:
-
a networking controller, receiving and buffering an input packet into a buffer in one of the first and second buffer sets based on a packet size, the networking controller comprising; a status register, indicating whether packets are stored in the buffers; and a counter, counting the usage rates of the buffers in the first and second buffer sets; wherein each buffer in the first buffer set has a first equal size, each buffer in the second buffer set has a second equal size, the first equal size and the second equal size are different, the networking controller re-calculates descriptor amounts in the first and second descriptor sets and buffer amounts in the first and second buffer sets based on the usage rates counted by the counter; and
the networking controller re-allocates or releases the descriptors in the first and second descriptor sets and the buffers in the first and second buffer sets based on the re-calculated descriptor amounts and buffer amounts. - View Dependent Claims (12, 13)
-
Specification