WO2016202120A1 - 一种队列存储空间管理方法及装置、计算机存储介质 - Google Patents

一种队列存储空间管理方法及装置、计算机存储介质 Download PDF

Info

Publication number
WO2016202120A1
WO2016202120A1 PCT/CN2016/081542 CN2016081542W WO2016202120A1 WO 2016202120 A1 WO2016202120 A1 WO 2016202120A1 CN 2016081542 W CN2016081542 W CN 2016081542W WO 2016202120 A1 WO2016202120 A1 WO 2016202120A1
Authority
WO
WIPO (PCT)
Prior art keywords
pointer
queue
group
storage space
pointer group
Prior art date
Application number
PCT/CN2016/081542
Other languages
English (en)
French (fr)
Inventor
徐东国
郭樑
王闯
安康
Original Assignee
深圳市中兴微电子技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市中兴微电子技术有限公司 filed Critical 深圳市中兴微电子技术有限公司
Publication of WO2016202120A1 publication Critical patent/WO2016202120A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Definitions

  • the present invention relates to a related art of queue management in the field of communication technologies, and in particular, to a queue storage space management method and apparatus, and a computer storage medium.
  • QoS quality of service
  • queue management includes two basic operations: enqueue and dequeue.
  • enqueue When a packet is queued, the packet can be stored in the corresponding queue storage space according to the queue number contained in the packet.
  • the packet stored in the queue is read from the queue storage space.
  • packets are generally stored in external memory.
  • the external memory of the stored message grows larger, it is more and more important to cache and manage the external memory.
  • the external memory is divided according to a fixed size, each unit is a block block, and one block block can store 512B or other fixed-size message fragments.
  • Each block corresponds to an address pointer, which points to the address stored in the message fragment.
  • RAM Random Access Memory
  • the existing queue management method is generally a linked list based queue management method. Due to the large number of addresses, a RAM is usually required for storage. Each queue of the queue dequeues a message, and needs to refresh the head pointer of the queue. The address of the next message of the queue is read from the RAM, and then the address of the next message is updated to the queue head pointer.
  • the refresh of the head pointer requires a lot of clock cycles, and the queue cannot send the next message until the head pointer is refreshed, which seriously affects the speed of the queued message.
  • the linked list information is generally stored in off-chip 4 times data rate (QDR) memory or 2 times data rate (DDR, Double Data Rate) memory, QDR.
  • QDR time rate
  • DDR Double Data Rate
  • the read and write latency is about 8 clock cycles, the read and write latency of DDR is larger, and the excessive read and write latency greatly limits the performance of queue management.
  • an embodiment of the present invention provides a queue storage space management method and apparatus, and a computer storage medium, which at least solves the problem of high read and write latency of an external memory.
  • the pointer group includes at least one message pointer field, and each message pointer field stores a message pointer;
  • the queue storage space is read and written.
  • the reading and writing operations on the queue storage space by using the packet pointer group include:
  • the queue storage space is subjected to idle pointer application, queue enqueue, queue dequeuing, idle pointer recovery, and idle pointer linked list storage and queue linked list storage operations.
  • the request for the idle pointer to the queue storage space by using the pointer group includes:
  • the queueing operation of the queue storage space by using the pointer group includes:
  • the pointer group When the pointer group is saturated, or the enqueue pointer of the same queue waits for a timeout, the pointer group is queued into the queue operation.
  • the queue dequeuing operation of the queue storage space by using the pointer group includes:
  • the pointer that needs to be dequeued is written into the pre-departure first-in first-out queue, and the pre-departed first-in-first-out queue is queued for queue operation.
  • the performing idle pointer recovery on the queue storage space by using the pointer group includes:
  • the pointer group When the pointer group is saturated, the pointer group is subjected to idle pointer recovery.
  • the queue storage space management device provided by the embodiment of the present invention includes: a pointer group creation unit and an operation unit, where
  • the pointer group creation unit is configured to create a pointer group, the pointer group includes at least one message pointer field, and each message pointer field stores a message pointer;
  • the operating unit is configured to perform a read and write operation on the queue storage space by using the pointer group.
  • the operating unit is further configured to:
  • the queue storage space is subjected to idle pointer application, queue enqueue, queue dequeuing, idle pointer recovery, and idle pointer linked list storage and queue linked list storage operations.
  • the operating unit is further configured to:
  • the operating unit is further configured to:
  • the pointer group When the pointer group is saturated, or the enqueue pointer of the same queue waits for a timeout, the pointer group is queued into the queue operation.
  • the operating unit is further configured to:
  • the pointer that needs to be dequeued is written into the pre-departure first-in first-out queue, and the pre-departed first-in-first-out queue is queued for queue operation.
  • the operating unit is further configured to:
  • the pointer group When the pointer group is saturated, the pointer group is subjected to idle pointer recovery.
  • the computer storage medium provided by the embodiment of the present invention stores a computer program for executing the foregoing queue storage space management method.
  • the queue storage space management method and device and the computer storage medium provided by the embodiment of the present invention first create a pointer group, the pointer group includes at least one message pointer field, and each message pointer field stores a message pointer; Through the pointer group, the queue storage space is read and written. In this way, when the queue storage space is queued, dequeued, and idle pointer managed, the access to the external memory at one time can obtain the N message pointer, which can be used for multiple times, thereby reducing the number of accesses to the external memory and solving the external
  • the high memory read and write latency problem improves the processing performance of the queue management unit, saves the number of reads and writes of the external memory, and reduces power consumption.
  • FIG. 1 is a schematic structural diagram of a pointer group according to an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of a method for managing a queue storage space according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a link structure of a free pointer list according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a link chain table link structure according to an embodiment of the present invention.
  • FIG. 5 is a schematic flowchart of a method for applying a idle pointer to a queue storage space according to an embodiment of the present invention
  • FIG. 6 is a schematic flowchart of a queue enqueue operation method for a queue storage space according to an embodiment of the present invention
  • FIG. 7 is a schematic flowchart of a method for performing queue dequeuing operation on a queue storage space according to an embodiment of the present invention
  • FIG. 8 is a schematic flowchart of a method for pre-queuing a queue according to an embodiment of the present invention.
  • FIG. 9 is a schematic flowchart of a method for collecting a free pointer in a queue storage space according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of a method for splicing a team leader according to an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of a queue storage space management apparatus according to an embodiment of the present invention.
  • a pointer group is first created, wherein the pointer group includes at least one message pointer field, and each message pointer field stores a message pointer; and the queue storage space is further used by the pointer group. Read and write operations.
  • the schematic diagram of the structure of the pointer group is as shown in FIG. 1.
  • the real pointer of the message is not used for management, and the pointer group is used for management, and the pointer group is not used as the actual packet.
  • the pointer is stored, just as the address to store the message pointer.
  • the pointers stored in the message are sequentially stored in the message pointer field of the pointer group in the order of enqueue.
  • the number of the packet pointer fields included in the pointer group is determined when the pointer group is created.
  • the number of the packet pointer fields in the pointer group is unchanged. .
  • a pointer group may include N message pointer fields, and store N actual message descriptors, and the message descriptor includes an actual pointer of the message, a memory bank information, and the like.
  • the N actual message pointer domain addresses are independent of each other and have no address association.
  • one pointer group is read or written at a time in units of pointer groups; since the pointer group includes multiple actual packet descriptors, corresponding to N actual message pointers Therefore, when the queue storage space is queued, dequeued, and idle pointer managed, accessing the external memory at a time can obtain an N message pointer, which can be used for multiple times, thereby reducing the number of accesses to the external memory.
  • FIG. 2 is a schematic flowchart of a method for managing a queue storage space according to an embodiment of the present invention.
  • the queue storage space management method includes the following steps:
  • Step 201 Create a pointer group.
  • the pointer group includes at least one message pointer field, and each message pointer field stores a message pointer; the address of the message pointer field in the pointer group is independent of each other, and there is no address association relationship.
  • the contents of the pointer group are all free pointers, and are initialized in order, after the pointer group is repeatedly dequeued, the actual pointers stored by the pointer group are all scrambled, and the actual pointer There is no longer an association between pointers in the domain.
  • Step 202 Perform read and write operations on the queue storage space by using the pointer group.
  • the idle pointer application, queue enqueue, queue dequeue, idle pointer recovery, and idle pointer linked list storage and queue linked list storage operations are performed on the queue storage space by using the packet pointer group.
  • the idle pointer list when the idle pointer list is stored in the queue storage space, the idle pointer list is linked by the pointer group, and one pointer group stores N actual idle pointers, and there is no relationship between the actual idle pointers.
  • the pointer group is just the address that stores the actual free pointer.
  • the head and tail virtual pointer of the free pointer list is stored in the chip, and the free pointer chain header Nodes, tail nodes, and intermediate nodes are all stored in external memory.
  • Each pointer group has N actual idle pointers, and a schematic diagram of the link structure of the idle pointer list is shown in FIG.
  • FIG. 4 is a schematic diagram of a queue link table link structure according to an embodiment of the present invention; each queue has its own Independent virtual linked list, a pointer group stores N actual queue pointers, the pointer group only serves as an address for storing the actual queue pointer; the head and tail virtual pointer of the queue state table is stored in the chip, the queue chain header node, the tail node and the intermediate node Both are stored in external memory.
  • Each queue list has independent non-empty status information, which is stored in the chip to indicate whether the queue status is non-empty, and only the non-empty status update is performed.
  • the requesting the idle pointer to the queue storage space by using the pointer group includes: determining whether there is a free pointer in the current pointer group; when there is no free pointer in the current pointer group, applying for a new idle pointer group As the current pointer group, and read the free pointer in the current pointer group; when there is a free pointer in the current pointer group, the free pointer in the current pointer group is read.
  • FIG. 5 is a schematic flowchart of a method for applying a free pointer to a queue storage space according to an embodiment of the present invention. As shown in FIG. 5, in the embodiment of the present invention, the applying for a idle pointer to a queue storage space includes the following steps:
  • Step A1 receiving a free pointer application request
  • Step A2 determining whether there is a free pointer in the current pointer group; if there is no free pointer in the current pointer group, step A3 is performed; otherwise, step A4 is performed;
  • Step A3 Applying a new idle pointer group as the current pointer group, and performing step A4;
  • a new idle pointer group is applied as the current pointer group, and the idle virtual pointer first in first out queue FIFO is re-initiated; specifically, once from the external memory Read a pointer group pin, use the next pointer group nextptr to update the head pointer headptr, apply to N actual idle pointers stored in the first-in first-out queue, in case the queue is actually used in the queue.
  • Step A4 Read the free pointer in the current pointer group.
  • the idle pointer update operation is performed using the remaining free pointers in the current virtual pointer; the header of the current pointer group is used.
  • the pointer reads the external memory, obtains the content of the current pointer group and the next pointer group nextptr, updates the idle queue state header pointer headptr using the nextptr of the pointer group, and stores the N actual idle pointers in the current pointer group to be stored in the pointer group FIFO.
  • the first-in first-out queue FIFO is empty, and the virtual idle pointer is updated until the idle pointer first-in first-out FIFO is filled.
  • the queueing operation of the queue storage space by the pointer group includes: filling a pointer that needs to be enqueued into a free pointer in the pointer group; when the pointer group is saturated, or the same The queue pointer of the queue waits for a timeout, and the pointer group is queued for operation.
  • FIG. 6 is a schematic flowchart of a method for performing queue enqueue operation on a queue storage space according to an embodiment of the present invention. As shown in FIG. 6 , in the embodiment of the present invention, the queue queue storage operation includes the following steps:
  • Step B1 receiving the enqueue pointer
  • Step B2 Filling a pointer that needs to be enqueued into a free pointer in the pointer group;
  • Step B3 determining whether the current pointer group is saturated; when the current pointer group is not saturated, step B4 is performed; otherwise, step B6 is performed;
  • Step B4 continue to wait for the enqueue pointer of the same queue
  • Step B5 judging whether the enqueue pointer of the same queue waits for timeout; when the enqueue pointer of the same queue waits for timeout, step B6 is performed; when the enqueue pointer of the same queue does not wait for timeout, When receiving the enqueue pointer of the same queue, return to step B2;
  • step B3-B5 after receiving the enqueue pointer message of the message, it is determined whether the current virtual pointer has a free pointer field available, and if so, the enqueue pointer group is spliced, and then the pointer of the current pointer group is determined. Whether the domain is saturated. If there is no saturation, it will continue to wait for the next pointer of the same queue. If the next queue of the same queue is not received within the preset time, it is considered to wait for the timeout. If the timeout condition is reached, even if the pointer group is not spliced and saturated. Also, force the enlistment and record the number of pointers in the pointer group.
  • Step B6 Initiating a queue into the queue operation of the pointer group
  • Step B7 updating the actual pointer of the current node linked list and the next pointer group nextptr;
  • Step B8 writing an external memory through the pointer group
  • Step B9 updating the current enqueue pointer group to the tail pointer tailptr;
  • Step B10 Update the queue status table
  • the tail pointer tailptr of the queue state is used as the address to write the external memory, and the nextptr of the incoming queue is updated to be the tailptr pointer of the current queue.
  • the current pointer group of the enqueue is used as the address to write the external memory, and the actual pointer of the current node list and the next pointer group nextptr are updated, and each queue is in the queue group.
  • the current pointer enters the queue you need to provide the next pointer group.
  • the advantage of this is that you can reduce the reading of the linked list stored in the external memory, and update the current list at the same time.
  • the team virtual pointer is the tail pointer tailptr of the current queue. At the same time, the non-empty state of the virtual queue state table is updated to be non-empty.
  • the queue dequeuing operation of the queue storage space by using the pointer group includes: forming a pointer group that needs to be dequeued into a pointer group, and performing the queue dequeuing operation on the pointer group.
  • FIG. 7 is a schematic flowchart of a method for performing a queue dequeuing operation on a queue storage space according to an embodiment of the present invention. As shown in FIG. 7 , in the embodiment of the present invention, the queue storage space is queued out. The steps include the following steps:
  • Step C1 Write the pointer that needs to be dequeued to the pre-departure first-in first-out queue
  • FIG. 8 is a queue pre-departure method according to an embodiment of the present invention.
  • the flow diagram, as shown in Figure 8, includes the following steps:
  • Step D1 determining to start the pre-departure process
  • Step D2 determining whether the state of the queue state table is non-empty; when the state of the queue state table is not non-empty, that is, the queue state is empty, step D3 is performed; otherwise, step D4 is performed;
  • Step D3 Waiting for the enqueue process, and after the message pointer is enqueued, return to step D1;
  • Step D4 reading the external memory according to the queue head pointer headptr;
  • Step D5 receiving data returned by the external memory
  • Step D6 updating the queue status table
  • steps D4-D6 the external memory is read according to each queue Queue head pointer headptr, and the current N actual dequeue pointers are obtained;
  • Step D7 Write the message pointer into the PD/Unit Descriptor (CD, Cell Descriptor) in the first-in first-out queue FIFO;
  • next pointer group nextptr is updated as the virtual header of the current queue. pointer.
  • Step D8 updating the next pointer group nextptr to be the head pointer of the current queue
  • Step C2 The pre-departure first-in first-out queue is queued and dequeued
  • the pre-dequeued PD FIFO is scheduled according to the queue status, and a true dequeue request is initiated.
  • the queue dequeue operation based on the pre-dequeued PD FIFO, the first pointer of the message is obtained. If there is still the message body information, the pre-departed CD FIFO is continuously read, and all the pointers of the queue are obtained. At the same time, the splicing and recycling of the pointer is performed, and the real message is read from the external memory.
  • the performing the free pointer reclaiming operation on the queue storage space by using the pointer group includes: sequentially writing the free pointer released by the queue dequeuing operation into the pointer group; when the pointer group is saturated, The pointer group performs idle pointer recovery.
  • FIG. 9 is a schematic flowchart of a method for recovering a free pointer in a queue storage space according to an embodiment of the present invention. As shown in FIG. 9 , in the embodiment of the present invention, performing idle pointer recovery on a queue storage space includes the following steps:
  • Step E1 Write the dequeue pointer released by the queue dequeue operation to the pointer group in turn;
  • Step E2 determining whether the pointer group is saturated; when the pointer group is saturated, step E4 is performed; otherwise, step E3 is performed;
  • Step E3 waiting for the dequeue pointer; and returning to step E1;
  • FIG. 10 is a detachment of the dequeue pointer in the embodiment of the present invention.
  • the queue is not distinguished, and any queue dequeue pointers are spliced into a pointer group. Therefore, there is no correlation between the actual pointers in the pointer group.
  • the idle pointer can be reclaimed in time without waiting for splicing based on the queue.
  • Step E4 performing idle pointer recovery
  • Step E5 reading the external memory through the tail pointer tailptr of the idle queue state
  • Step E6 writing the next pointer group field of the external memory through the pointer group
  • Step E7 updating the state table tail pointer tailptr by the pointer group
  • steps E4-E7 the real pointer is recovered only when the dequeue pointer is full of a pointer group.
  • a first-in first-out queue FIFO that dequeues the pointer to be released is needed to store the pointer group to be released by the actual pointer pre-dequeued; since the virtual pointer itself does not have any free pointer, the pointer group is released. Can not be recycled, need to wait for the team's pointer to be released, the two can be associated with the real recycling.
  • a pointer group is read out from the queue of the queue to be released in the first-in first-out queue.
  • the tail pointer tailptr of the idle queue state table is first used to read the external memory.
  • FIG. 11 is a schematic structural diagram of a queue storage space management apparatus according to an embodiment of the present invention.
  • the queue storage space management apparatus of the embodiment of the present invention includes: a pointer group creation. Unit 111, operation unit 112, wherein
  • the pointer group creation unit 111 is configured to create a pointer group, the pointer group includes at least one message pointer field, and each message pointer field stores a message pointer;
  • the addresses between the message pointer fields in the pointer group are independent of each other, and there is no address association relationship.
  • the contents of the pointer group are all free pointers, and are initialized in order, after the pointer group is repeatedly dequeued, the actual pointers stored by the pointer group are all scrambled, and the actual pointer There is no longer an association between pointers in the domain.
  • the operating unit 112 is configured to perform read and write operations on the queue storage space by using the pointer group;
  • the operation unit 112 is further configured to: perform idle pointer application, queue enqueue, queue dequeue, idle pointer recovery, and idle pointer linked list storage and queue linked list storage operations on the queue storage space by using the packet pointer group. .
  • the idle pointer list is linked by the pointer group, and one pointer group stores N actual idle pointers, and there is no actual idle pointer between the pointers.
  • the pointer group is just the address that stores the actual free pointer.
  • the head and tail virtual pointers of the free pointer list are stored in the chip, and the free pointer chain header node, the tail node and the intermediate node are all stored in the external memory. There are N actual idle pointers for each pointer group.
  • the queue-based pointer list is also linked by using a pointer group, and each queue has its own independent virtual linked list, and one pointer group stores N.
  • the actual queue pointer, the pointer group is only used as the address to store the actual queue pointer; the head and tail virtual pointer of the queue state table is stored in the chip, and the queue chain header node, the tail node and the intermediate node are all stored in the external memory.
  • Each queue list has independent non-empty status information, which is stored in the chip to indicate whether the queue status is non-empty, and only the non-empty status update is performed.
  • the operating unit 112 is further configured to: determine whether there is a free pointer in the current pointer group; when there is no free pointer in the current pointer group, apply for a new free pointer group as the current pointer group, and read The free pointer in the current pointer group is taken; when there is a free pointer in the current pointer group, the free pointer in the current pointer group is read.
  • the operation unit 112 when there is no free pointer in the current pointer group, that is, when the current virtual pointer is exhausted, the operation unit 112 applies for a new idle pointer group as the current pointer group, and re-initiates the read idle virtual pointer first in first out queue FIFO. Specifically, the operation unit 112 reads a pointer group pin from the external memory at a time, updates the head pointer headptr by using the next pointer group nextptr, and applies N actual idle pointers to the first-in first-out queue for the queue actual. Enter the team to use.
  • the operation unit 112 When there is a free pointer in the current pointer group, that is, the current pointer group is not exhausted, the operation unit 112 performs the free list update operation using the remaining free pointers in the current virtual pointer; and reads the head pointer of the current pointer group.
  • the external memory obtains the content of the current pointer group and the next pointer group nextptr, updates the idle queue state header pointer headptr by using the nextptr of the pointer group, and stores the N actual idle pointers in the current pointer group to be stored in the pointer group FIFO. Used as a queue for actual enqueue.
  • the first-in first-out queue FIFO is empty, and the virtual idle pointer is updated until the idle pointer first-in first-out FIFO is filled.
  • the operating unit 112 is further configured to: fill a pointer that needs to be enqueued into a free pointer in the pointer group; when the pointer group is saturated, or the enqueue pointer of the same queue waits for a timeout, The pointer group is queued into a queue operation.
  • only one queue pointer of the queue can be stored in a pointer group, and the actual queued pointers are sorted according to the queue enqueue order, and the order cannot be disordered, otherwise the packets will be out of order.
  • step B3-B5 after receiving the enqueue pointer message of the message, the operation unit 112 determines whether the current virtual pointer has a free pointer field available, and if so, performs the concatenation pointer group splicing, and then determines Whether the pointer field of the current pointer group is saturated. If there is no saturation, it will continue to wait for the next pointer of the same queue; if the pointer of the next same queue is not received within the preset time, it is considered to wait until the timeout condition is reached, even if the timeout condition is reached, even if The pointer group is not spliced and saturated, and it is also forced to join the queue, and the number of pointers in the pointer group is recorded.
  • the tail pointer tailptr of the queue state is used as the address to write the external memory, and the nextptr of the incoming queue is updated to be the tailptr pointer of the current queue.
  • the operation unit 112 is further configured to: write a pointer that needs to be dequeued into the pre-out queue first-in first-out queue, and perform the queue-out operation in the pre-departure first-in-first-out queue.
  • the queue Queue pre-departure condition can be reached.
  • the pre-dequeued PD FIFO is scheduled according to the queue status, and a true dequeue request is initiated.
  • the queue dequeue operation based on the pre-dequeued PD FIFO, the first pointer of the message is obtained. If there is still the message body information, the pre-departed CD FIFO is continuously read, and all the pointers of the queue are obtained. At the same time, the splicing and recycling of the pointer is performed, and the real message is read from the external memory.
  • the operation unit 112 in the embodiment of the present invention is further configured to: write the dequeue pointer released by the queue dequeuing operation to the pointer group in turn; and when the pointer group is saturated, perform the idle pointer collection on the pointer group.
  • the operation unit 112 sequentially writes the actual dequeue pointers released by each Queue dequeue into each domain of the pointer group to be reclaimed, and then performs real recovery after being filled;
  • the queue pointer is written into the pointer group in turn, and the queue is not distinguished. Any queue dequeue pointer is spliced into a pointer group, so there is no correlation between the actual pointers in the pointer group, so that the idleness can be recovered in time. Pointers, without queue-based wait for stitching.
  • a first-in first-out queue FIFO that dequeues the pointer to be released is needed to store the pointer group to be released by the actual pointer pre-dequeued; since the virtual pointer itself does not have any free pointer, the pointer group is released. Can not be recycled, need to wait for the team's pointer to be released, the two can be associated with the real recycling.
  • a pointer group is read out from the queue of the queue to be released in the first-in first-out queue.
  • the tail pointer tailptr of the idle queue state table is first used to read the external memory.
  • the implementation functions of the processing units in the queue storage space management apparatus shown in FIG. 11 can be understood by referring to the related description of the foregoing queue storage space management method. Those skilled in the art should It is understood that the functions of the processing units in the queue storage space management apparatus shown in FIG. 11 can be implemented by a program running on a processor, or can be implemented by a specific logic circuit, for example, by a central processing unit (CPU), Microprocessor (MPU), digital signal processor (DSP), or field programmable gate array (FPGA) implementation.
  • CPU central processing unit
  • MPU Microprocessor
  • DSP digital signal processor
  • FPGA field programmable gate array
  • the apparatus for tracking the service signaling may also be stored in a computer readable storage medium if it is implemented in the form of a software function module and sold or used as a separate product.
  • the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions.
  • a computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a magnetic disk, or an optical disk.
  • program codes such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a magnetic disk, or an optical disk.
  • an embodiment of the present invention further provides a computer storage medium, wherein a computer program is stored, and the computer program is used to execute a queue storage space management method according to an embodiment of the present invention.
  • the disclosed method, apparatus, and system may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner such as: multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored or not executed.
  • the communication connections between the various components shown or discussed may be indirect coupling or communication connections through some interfaces, devices or units, and may be electrical, mechanical or otherwise.
  • the units described above as separate components may or may not be physically separated, and the components displayed as the unit may or may not be physical units, that is, may be located in one place or distributed to multiple network units; You can choose some of them according to your actual needs. Or all of the units to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated into one unit;
  • the unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the foregoing program may be stored in a computer readable storage medium, and when executed, the program includes The foregoing steps of the method embodiment; and the foregoing storage medium includes: a removable storage device, a read-only memory (ROM), a magnetic disk or an optical disk, and the like, which can store program codes.
  • ROM read-only memory
  • the above-described integrated unit of the embodiment of the present invention may be stored in a computer readable storage medium if it is implemented in the form of a software functional unit and sold or used as a stand-alone product.
  • the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions.
  • a computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes various media that can store program codes, such as a mobile storage device, a ROM, a magnetic disk, or an optical disk.
  • a pointer group is first created, the pointer group includes at least one message pointer field, and each message pointer field stores a message pointer; and the queue storage space is further performed by the pointer group. Read and write operations.
  • the access to the external memory at one time can obtain the N message pointer, which can be used for multiple times, thereby reducing the number of accesses to the external memory and solving the external
  • the high memory read and write latency problem improves the processing performance of the queue management unit, saves the number of reads and writes of the external memory, and reduces power consumption.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

提供一种队列存储空间管理方法,包括:创建指针组,所述指针组包括至少一个的报文指针域,每个报文指针域存储一个报文指针(201);通过所述指针组,对队列存储空间进行读写操作(202)。还提供一种队列存储空间管理装置、计算机存储介质。

Description

一种队列存储空间管理方法及装置、计算机存储介质 技术领域
本发明涉及通信技术领域中队列管理的相关技术,尤其涉及一种队列存储空间管理方法及装置、计算机存储介质。
背景技术
随着网络流量的飞速发展,用户对数据产品的服务质量(QoS,Quality of Service)要求越来越高,对QoS需要支持的队列数、带宽和报文存储时间也提出了更高的要求,这就对队列管理单元(QM,Queue Manager)的性能要求越来越高。
通常情况下,队列管理包括入队、出队两个基本操作。报文入队时,根据报文包含的队列号可以将报文存储到对应的队列存储空间中,在报文被调度出队时,从队列存储空间读取入队存储的报文。
对于大容量的流量管理,一般都是把报文存储在外部存储器中,随着存储报文的外部存储器越来越大,如何对外部存储器进行缓存划分和管理变得越来越重要。一般情况下,是将外部存储器按照固定大小进行划分,每个单元为一个Block块,一个Block块可以存储512B或者其他固定大小的报文分片。每个Block都对应一个地址指针,通过指针指向报文分片存储的地址。为了节省随机存取存储器(RAM,Random Access Memory)资源,这些指针一般是通过链表进行管理的。
现有的队列管理方法一般是基于链表的队列管理方法。由于地址数量非常多,通常需要一个RAM来存放。队列每调度出队一个报文,都需要刷新这个队列的头指针,先从RAM中读取队列的下一个报文的地址,然后再将下一个报文的地址更新为队列头指针。这里,由于RAM的读延迟比较大, 因此头指针的刷新需要很多个时钟周期,而在头指针刷新完成之前,队列不能发送下一个报文,这就严重影响队列的出队报文的速度。
由于当前的队列存储空间都比较大,所以链表信息一般都是存储在片外的4倍数据比率(QDR,Quad Data Rate)存储器里面或者2倍数据比率(DDR,Double Data Rate)存储器中,QDR的读写延迟有8个时钟周期左右,DDR的读写延迟更大,过高的读写延迟极大的限制了队列管理性能的提升。
发明内容
为解决上述技术问题,本发明实施例提供了一种队列存储空间管理方法及装置、计算机存储介质,至少解决了外部存储器高读写延迟问题。
本发明实施例提供的队列存储空间管理方法,包括:
创建指针组,所述指针组包括至少一个的报文指针域,每个报文指针域存储一个报文指针;
通过所述指针组,对队列存储空间进行读写操作。
上述方案中,所述指针组中的报文指针域之间地址相互独立。
上述方案中,所述通过所述报文指针组,对队列存储空间进行读写操作包括:
通过所述报文指针组,对队列存储空间进行空闲指针申请、队列入队、队列出队、空闲指针回收以及空闲指针链表存储和队列链表存储操作。
上述方案中,所述通过指针组,对队列存储空间进行空闲指针申请包括:
判断当前的指针组内是否还有空闲指针;
当前指针组内没有空闲指针时,申请一个新的空闲指针组作为当前指针组,并读取当前指针组中的空闲指针;
当前指针组内有空闲指针时,读取当前指针组中的空闲指针。
上述方案中,所述通过指针组,对队列存储空间进行队列入队操作包括:
将需要入队的指针填充到所述指针组中的空闲指针中;
当所述指针组饱和、或相同队列的入队指针等待超时,将所述指针组进行队列入队操作。
上述方案中,所述通过指针组,对队列存储空间进行队列出队操作包括:
将需要出队的指针写入预出队先入先出队列,将所述预出队先入先出队列进行队列出队操作。
上述方案中,所述通过指针组,对队列存储空间进行空闲指针回收包括:
将队列出队操作释放的出队指针依次写入指针组;
当所述指针组饱和时,将所述指针组进行空闲指针回收。
本发明实施例提供的队列存储空间管理装置,包括:指针组创建单元、操作单元,其中,
所述指针组创建单元,配置为创建指针组,所述指针组包括至少一个的报文指针域,每个报文指针域存储一个报文指针;
所述操作单元,配置为通过所述指针组,对队列存储空间进行读写操作。
上述方案中,所述操作单元还配置为:
通过所述报文指针组,对队列存储空间进行空闲指针申请、队列入队、队列出队、空闲指针回收以及空闲指针链表存储和队列链表存储操作。
上述方案中,所述操作单元还配置为:
判断当前的指针组内是否还有空闲指针;
当前指针组内没有空闲指针时,申请一个新的空闲指针组作为当前指 针组,并读取当前指针组中的空闲指针;
当前指针组内有空闲指针时,读取当前指针组中的空闲指针。
上述方案中,所述操作单元还配置为:
将需要入队的指针填充到所述指针组中的空闲指针中;
当所述指针组饱和、或相同队列的入队指针等待超时,将所述指针组进行队列入队操作。
上述方案中,所述操作单元还配置为:
将需要出队的指针写入预出队先入先出队列,将所述预出队先入先出队列进行队列出队操作。
上述方案中,所述操作单元还配置为:
将队列出队操作释放的出队指针依次写入指针组;
当所述指针组饱和时,将所述指针组进行空闲指针回收。
本发明实施例提供的计算机存储介质存储有计算机程序,该计算机程序用于执行上述队列存储空间管理方法。
本发明实施例所提供的队列存储空间管理方法和装置、计算机存储介质,先创建指针组,所述指针组包括至少一个的报文指针域,每个报文指针域存储一个报文指针;再通过所述指针组,对队列存储空间进行读写操作。如此,在对队列存储空间进行入队、出队和空闲指针管理时,一次访问外部存储器得到能够得到N报文指针,可供多次使用,从而能够减少对外部存储器的访问次数,解决了外部存储器高读写延迟问题,提高了队列管理单元的处理性能,节省了外部存储器的读写次数,降低了功耗。
附图说明
图1为本发明实施例指针组结构示意图;
图2为本发明实施例队列存储空间管理方法流程示意图;
图3为本发明实施例空闲指针链表链接结构示意图;
图4为本发明实施例队列链表链接结构示意图;
图5为本发明实施例对队列存储空间进行空闲指针申请方法流程示意图;
图6为本发明实施例对队列存储空间进行队列入队操作方法流程示意图;
图7为本发明实施例对队列存储空间进行队列出队操作方法流程示意图;
图8为本发明实施例队列预出队方法流程示意图;
图9为本发明实施例对队列存储空间进行空闲指针回收方法流程示意图;
图10为本发明实施例出队指针拼接方法示意图;
图11为本发明实施例队列存储空间管理装置结构示意图。
具体实施方式
在本发明实施例中,先创建指针组,其中,所述指针组包括至少一个的报文指针域,每个报文指针域存储一个报文指针;再通过所述指针组,对队列存储空间进行读写操作。
本发明实施例中,所述指针组结构示意图如图1所示,在进行队列存储空间管理时,不使用报文真实的指针进行管理,使用指针组进行管理,指针组不作为实际的报文存储指针,只是作为存储报文指针的地址。报文存储的指针按照入队顺序依次存储在指针组的报文指针域里面。
具体的,所述指针组中包含的报文指针域的数量在创建指针组时确定,在通过指针组对队列存储空间进行读写操作时,所述指针组中的报文指针域数目不变。
本发明实施例中,一个指针组可以包括N个报文指针域,存储N个实际的报文描述符,报文描述符包括报文的实际指针、存储器bank信息等, N个实际的报文指针域地址之间相互独立,没有任何地址关联关系。对队列存储空间进行入队和出队写操作时,以指针组为单位,一次读出或者写入一个指针组;由于指针组包括多个实际的包描述符,对应N个实际的报文指针,因此在对队列存储空间进行入队、出队和空闲指针管理时,一次访问外部存储器得到能够得到N报文指针,可供多次使用,从而能够减少对外部存储器的访问次数。
下面结合附图及具体实施例,对本发明实施例所述队列存储空间管理方法进行进一步详细说明,图2为本发明实施例队列存储空间管理方法流程示意图,如图2所示本发明实施例中所述队列存储空间管理方法包括以下步骤:
步骤201:创建指针组;
其中,所述指针组包括至少一个的报文指针域,每个报文指针域存储一个报文指针;所述指针组中的报文指针域之间地址相互独立,不存在地址关联关系。
具体的,在首次进行指针组初始化的时候,指针组里面的内容全部是空闲指针,按照顺序进行初始化,指针组在经过多次出队回收之后,指针组存储的实际指针全部打乱,实际指针域中的指针之间不再存在关联关系。
步骤202:通过所述指针组,对队列存储空间进行读写操作;
其中,通过所述报文指针组,对队列存储空间进行空闲指针申请、队列入队、队列出队、空闲指针回收以及空闲指针链表存储和队列链表存储操作。
本发明实施例中,所述对队列存储空间进行空闲指针链表存储时,空闲指针链表通过指针组进行链接,一个指针组存储N个实际的空闲指针,这些实际的空闲指针之间没有任何关系,指针组只是作为存储实际空闲指针的地址。空闲指针链表的头尾虚拟指针存储在芯片内,空闲指针链表头 节点、尾节点和中间节点都存储在外部存储器中。每个指针组都存有N个实际的空闲指针,空闲指针链表链接结构示意图如图3所示。
本发明实施例中,所述对队列存储空间进行队列链表存储操作时,基于队列的指针链表也使用指针组进行链接,图4为本发明实施例队列链表链接结构示意图;每个队列都有各自独立的虚拟链表,一个指针组存储N个实际的队列指针,指针组只是作为存储实际队列指针的地址;队列状态表的头尾虚拟指针存储在芯片内,队列链表头节点、尾节点和中间节点都存储在外部存储器中。每个队列链表都有独立的非空状态信息,存储在芯片内,用来指示队列状态是否非空,只有非空才进行队列状态更新。
本发明实施例中,所述通过指针组,对队列存储空间进行空闲指针申请包括:判断当前的指针组内是否还有空闲指针;当前指针组内没有空闲指针时,申请一个新的空闲指针组作为当前指针组,并读取当前指针组中的空闲指针;当前指针组内有空闲指针时,读取当前指针组中的空闲指针。
图5为本发明实施例对队列存储空间进行空闲指针申请方法流程示意图,如图5所示,本发明实施例中,所述对队列存储空间进行空闲指针申请包括以下步骤:
步骤A1:接收到空闲指针申请请求;
步骤A2:判断当前的指针组内是否还有空闲指针;当前指针组内没有空闲指针时,执行步骤A3;否则,执行步骤A4;
步骤A3:申请一个新的空闲指针组作为当前指针组,并执行步骤A4;
当前指针组内没有空闲指针时,即当前的虚拟指针耗尽时,则申请一个新的空闲指针组作为当前指针组,重新发起读空闲虚拟指针先入先出队列FIFO;具体的,一次从外部存储器中读一个指针组针,使用下一个指针组nextptr更新头指针headptr,申请到N个实际空闲指针存入先入先出队列中,以备队列实际入队使用。
步骤A4:读取当前指针组中的空闲指针。
具体的,本步骤中,当前的指针组内还有空闲指针时,即当前指针组没有耗尽,则使用当前虚拟指针中剩余的空闲指针,进行空闲链表更新操作;使用当前的指针组的头指针读外部存储器,获得当前指针组的内容和下一个指针组nextptr,使用指针组的nextptr更新空闲队列状态表头指针headptr,读取的当前指针组里面的N个实际空闲指针存入指针组FIFO中,作为队列实际入队使用。上电初始化时候,先入先出队列FIFO为空,一直进行虚拟空闲指针的更新,直到将空闲指针先入先出FIFO填到将满。
本发明实施例中,所述通过指针组,对队列存储空间进行队列入队操作包括:将需要入队的指针填充到所述指针组中的空闲指针中;当所述指针组饱和、或相同队列的入队指针等待超时,将所述指针组进行队列入队操作。
图6为本发明实施例对队列存储空间进行队列入队操作方法流程示意图,如图6所示,本发明实施例中,所述对队列存储空间进行队列入队操作包括以下步骤:
步骤B1:接收到入队指针;
步骤B2:将需要入队的指针填充到所述指针组中的空闲指针中;
本步骤中,一个指针组中只能存储一个队列的入队指针,存储的实际的入队指针之间根据队列入队的顺序进行排序,顺序不能错乱,否则会导致报文乱序。
步骤B3:判断当前指针组是否饱和;当当前指针组没有饱和时,执行步骤B4;否则,执行步骤B6;
步骤B4:继续等待相同队列的入队指针;
步骤B5:判断相同队列的入队指针是否等待超时;当相同队列的入队指针等待超时,执行步骤B6;当相同队列的入队指针没有等待超时,即接 收到相同队列的入队指针时,返回步骤B2;
在步骤B3-B5中,当接收到报文的入队指针报文进入后,判断当前虚指针是否还有空闲指针域可用,如果有则进行入队指针组拼接,然后判断当前指针组的指针域是否饱和,如果没有饱和,则继续等待下一个相同队列的指针;预设时间内,如果没有收到下一个相同队列的指针,则认为等到超时,如果达到超时条件,即使指针组没有拼接饱和,也要进行强制入队,同时记录指针组中的指针个数。
步骤B6:将所述指针组发起队列入队操作;
步骤B7:更新当前节点链表的实际指针和下一个指针组nextptr;
步骤B8:通过所述指针组写外部存储器;
步骤B9:更新当前入队指针组为尾指针tailptr;
步骤B10:更新队列状态表;
其中,步骤B6-B10所述将指针组进行队列入队操作的过程中,使用队列状态的尾指针tailptr作为地址写外部存储器,同时更新入队的nextptr为当前队列的tailptr指针。
本发明实施例中,当指针组入队的时候,使用入队的当前指针组作为地址写外部存储器,更新当前节点链表的实际指针和下一个指针组nextptr,每个队列在入队进行指针组拼接的时候都需要预取2个指针组,当前指针入队的时候,需要提供下一个指针组,这样做的好处是可以减少一次存储在外部存储器中的链表的读,链表更新同时更新当前入队虚拟指针为当前队列的尾指针tailptr。同时更新虚拟队列状态表的非空状态为非空。
本发明实施例中,所述通过指针组,对队列存储空间进行队列出队操作包括:将需要出队的指针组成指针组,将所述指针组进行队列出队操作。
图7为本发明实施例对队列存储空间进行队列出队操作方法流程示意图,如图7所示,本发明实施例中,所述对队列存储空间进行队列出队操 作包括以下步骤:
步骤C1:将需要出队的指针写入预出队先入先出队列;
本发明实施例中,在预出队过程中,首次按需要进行预出队处理,将需要出队的指针写入预出队先入先出队列;图8为本发明实施例队列预出队方法流程示意图,如图8所示,包括一下步骤:
步骤D1:确定开始预出队过程;
步骤D2:判断队列状态表状态变是否为非空;当队列状态表状态不是非空时,即队列状态为空,则执行步骤D3;否则,执行步骤D4;
本步骤中,当队列状态表状态变为非空时候,且报文描述符(PD,Pack Descriptor)先入先出队列FIFO没有写满的时候,即可达到队列Queue预出队条件。
步骤D3:等待入队过程,并在报文指针入队后,返回步骤D1;
本步骤中,当队列状态为空时,无法进行出队操作。
步骤D4:根据队列头指针headptr读取外部存储器;
步骤D5:接收外部存储器返回的数据;
步骤D6:更新队列状态表;
步骤D4-D6中,根据每个队列Queue头指针headptr,对外部存储器进行读取,得到当前的N个实际的出队指针;
步骤D7:将报文指针写入PD/单元描述符(CD,Cell Descriptor)先入先出队列FIFO中;
本步骤中,如果属于报文首指针,则写入预出队PD FIFO中,如果属于报文身指针,写入预出队CD FIFO中;同时更新下一指针组nextptr为当前队列的虚拟头指针。
步骤D8:更新下一个指针组nextptr为当前队列的头指针;
如此,完成队列预出队过程;
步骤C2:将所述预出队先入先出队列进行队列出队操作;
当预出队PD FIFO非空时候,则根据队列状态调度出预出队PD FIFO后,发起真正的出队请求。在队列出队操作过程中,基于预出队PD FIFO,获取到报文首指针,如果还有报文身信息,则继续读取预出队CD FIFO,得到队列的所有指针。同时进行指针的拼接回收,从外部存储器中读出真正的报文。
本发明实施例中,,所述通过指针组,对队列存储空间进行空闲指针回收操作包括:将队列出队操作释放的空闲指针依次写入指针组;当所述指针组饱和时,将所述指针组进行空闲指针回收。
图9为本发明实施例对队列存储空间进行空闲指针回收方法流程示意图,如图9所示,本发明实施例中,所述对队列存储空间进行空闲指针回收包括以下步骤:
步骤E1:将队列出队操作释放的出队指针依次写入指针组;
步骤E2:判断所述指针组是否饱和;当所述指针组饱和时,执行步骤E4,否则,执行步骤E3;
步骤E3:等待出队指针;并返回步骤E1;
步骤E1-E3中,将每个Queue出队释放的实际出队指针,依次写入待回收的指针组各个域,拼满之后才进行真正的回收;图10为本发明实施例出队指针拼接方法示意图,如图10所示,q0、q1、q2分别表示不同的队列,ptrA、ptrB、ptrC分别表示不同的指针,在队列出队操作释放的出队指针依次写入指针组的过程中,不对队列进行区分,任意队列出队指针都拼接到一个指针组里面,因此指针组里面的实际指针之间没有任何关联性,如此,可以及时回收空闲指针,不用基于队列的等待拼接。
步骤E4:进行空闲指针回收;
步骤E5:通过空闲队列状态的尾指针tailptr读取外部存储器;
步骤E6:通过所述指针组写外部存储器的下一个指针组域;
步骤E7:通过所述指针组更新状态表尾指针tailptr;
在步骤E4-E7中,出队的指针是满一个指针组时,才进行真正的指针回收。
本发明实施例中,需要一个出队待释放指针的先入先出队列FIFO来存储实际指针预出队产生的待释放的指针组;因为虚拟指针本身没有任何的空闲指针,因此,指针组释放还不能进行回收,需要等待出队的指针释放后,两者进行关联才可以真正的回收。出队指针拼满一个指针组后,从出队待释放指针组先入先出队列FIFO中读出一个指针组进行回收;回收过程中,首先使用空闲队列状态表的尾指针tailptr去读取外部存储器,获得当前尾指针节点的内容,然后把待回收的指针组回写到当前尾部指针组的下一个指针组nextptr域,完成空闲虚拟链表的更新,然后用待回收的指针组更新队列状态表的尾部指针tailptr域,至此,指针回收动作全部完成。
本发明实施例还提供了一种队列存储空间管理装置,图11为本发明实施例队列存储空间管理装置结构示意图,如图11所示,本发明实施例队列存储空间管理装置包括:指针组创建单元111、操作单元112,其中,
所述指针组创建单元111,配置为创建指针组,所述指针组包括至少一个的报文指针域,每个报文指针域存储一个报文指针;
本发明实施例中,所述指针组中的报文指针域之间地址相互独立,不存在地址关联关系。
具体的,在首次进行指针组初始化的时候,指针组里面的内容全部是空闲指针,按照顺序进行初始化,指针组在经过多次出队回收之后,指针组存储的实际指针全部打乱,实际指针域中的指针之间不再存在关联关系。
所述操作单元112,配置为通过所述指针组,对队列存储空间进行读写操作;
其中,所述操作单元112还配置为:通过所述报文指针组,对队列存储空间进行空闲指针申请、队列入队、队列出队、空闲指针回收以及空闲指针链表存储和队列链表存储操作。
本发明实施例中,所述操作单元112对队列存储空间进行空闲指针链表存储时,空闲指针链表通过指针组进行链接,一个指针组存储N个实际的空闲指针,这些实际的空闲指针之间没有任何关系,指针组只是作为存储实际空闲指针的地址。空闲指针链表的头尾虚拟指针存储在芯片内,空闲指针链表头节点、尾节点和中间节点都存储在外部存储器中。每个指针组都存有N个实际的空闲指针。
本发明实施例中,所述操作单元112对队列存储空间进行队列链表存储操作时,基于队列的指针链表也使用指针组进行链接,每个队列都有各自独立的虚拟链表,一个指针组存储N个实际的队列指针,指针组只是作为存储实际队列指针的地址;队列状态表的头尾虚拟指针存储在芯片内,队列链表头节点、尾节点和中间节点都存储在外部存储器中。每个队列链表都有独立的非空状态信息,存储在芯片内,用来指示队列状态是否非空,只有非空才进行队列状态更新。
本发明实施例中,所述操作单元112还配置为:判断当前的指针组内是否还有空闲指针;当前指针组内没有空闲指针时,申请一个新的空闲指针组作为当前指针组,并读取当前指针组中的空闲指针;当前指针组内有空闲指针时,读取当前指针组中的空闲指针。
具体的,当前指针组内没有空闲指针时,即当前的虚拟指针耗尽时,则所述操作单元112申请一个新的空闲指针组作为当前指针组,重新发起读空闲虚拟指针先入先出队列FIFO;具体的,所述操作单元112一次从外部存储器中读一个指针组针,使用下一个指针组nextptr更新头指针headptr,申请到N个实际空闲指针存入先入先出队列中,以备队列实际入队使用。
当前的指针组内还有空闲指针时,即当前指针组没有耗尽,则所述操作单元112使用当前虚拟指针中剩余的空闲指针,进行空闲链表更新操作;使用当前的指针组的头指针读外部存储器,获得当前指针组的内容和下一个指针组nextptr,使用指针组的nextptr更新空闲队列状态表头指针headptr,读取的当前指针组里面的N个实际空闲指针存入指针组FIFO中,作为队列实际入队使用。上电初始化时候,先入先出队列FIFO为空,一直进行虚拟空闲指针的更新,直到将空闲指针先入先出FIFO填到将满。
本发明实施例中,所述操作单元112还配置为:将需要入队的指针填充到所述指针组中的空闲指针中;当所述指针组饱和、或相同队列的入队指针等待超时,将所述指针组进行队列入队操作。
本发明实施例中,一个指针组中只能存储一个队列的入队指针,存储的实际的入队指针之间根据队列入队的顺序进行排序,顺序不能错乱,否则会导致报文乱序。
在步骤B3-B5中,当接收到报文的入队指针报文进入后,所述操作单元112判断当前虚指针是否还有空闲指针域可用,如果有则进行入队指针组拼接,然后判断当前指针组的指针域是否饱和,如果没有饱和,则继续等待下一个相同队列的指针;预设时间内,如果没有收到下一个相同队列的指针,则认为等到超时,如果达到超时条件,即使指针组没有拼接饱和,也要进行强制入队,同时记录指针组中的指针个数。
在将指针组进行队列入队操作的过程中,使用队列状态的尾指针tailptr作为地址写外部存储器,同时更新入队的nextptr为当前队列的tailptr指针。
本发明实施例中,所述操作单元112还配置为:将需要出队的指针写入预出队先入先出队列,将所述预出队先入先出队列进行队列出队操作。
具体的,当队列状态表状态变为非空时候,且PD先入先出队列FIFO没有写满的时候,即可达到队列Queue预出队条件。
当预出队PD FIFO非空时候,则根据队列状态调度出预出队PD FIFO后,发起真正的出队请求。在队列出队操作过程中,基于预出队PD FIFO,获取到报文首指针,如果还有报文身信息,则继续读取预出队CD FIFO,得到队列的所有指针。同时进行指针的拼接回收,从外部存储器中读出真正的报文。
本发明实施例中所述操作单元112还配置为:将队列出队操作释放的出队指针依次写入指针组;当所述指针组饱和时,将所述指针组进行空闲指针回收。
具体的,所述操作单元112将每个Queue出队释放的实际出队指针,依次写入待回收的指针组各个域,拼满之后才进行真正的回收;在队列出队操作释放的出队指针依次写入指针组的过程中,不对队列进行区分,任意队列出队指针都拼接到一个指针组里面,因此指针组里面的实际指针之间没有任何关联性,如此,可以及时回收空闲指针,不用基于队列的等待拼接。
本发明实施例中,需要一个出队待释放指针的先入先出队列FIFO来存储实际指针预出队产生的待释放的指针组;因为虚拟指针本身没有任何的空闲指针,因此,指针组释放还不能进行回收,需要等待出队的指针释放后,两者进行关联才可以真正的回收。出队指针拼满一个指针组后,从出队待释放指针组先入先出队列FIFO中读出一个指针组进行回收;回收过程中,首先使用空闲队列状态表的尾指针tailptr去读取外部存储器,获得当前尾指针节点的内容,然后把待回收的指针组回写到当前尾部指针组的下一个指针组nextptr域,完成空闲虚拟链表的更新,然后用待回收的指针组更新队列状态表的尾部指针tailptr域,至此,指针回收动作全部完成。
图11中所示的队列存储空间管理装置中的各处理单元的实现功能,可参照前述队列存储空间管理方法的相关描述而理解。本领域技术人员应当 理解,图11所示的队列存储空间管理装置中各处理单元的功能可通过运行于处理器上的程序而实现,也可通过具体的逻辑电路而实现,比如:可由中央处理器(CPU)、微处理器(MPU)、数字信号处理器(DSP)、或现场可编程门阵列(FPGA)实现。
本发明实施例上述业务信令跟踪的装置如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)执行本发明各个实施例所述方法的全部或部分。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read Only Memory)、磁碟或者光盘等各种可以存储程序代码的介质。这样,本发明实施例不限制于任何特定的硬件和软件结合。
相应地,本发明实施例还提供一种计算机存储介质,其中存储有计算机程序,该计算机程序用于执行本发明实施例的队列存储空间管理方法。
在本发明所提供的几个实施例中,应该理解到,所揭露的方法、装置及系统,可以通过其他的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其他形式的。
上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分 或全部单元来实现本实施例方案的目的。
另外,在本发明各实施例中的各功能单元可以全部集成在一个处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、只读存储器(ROM,Read-Only Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
或者,本发明实施例上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)执行本发明各个实施例所述方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、磁碟或者光盘等各种可以存储程序代码的介质。
本发明是实例中记载的队列存储空间管理方法、装置只以上述实施例为例,但不仅限于此,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。
以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。
工业实用性
本发明实施例的技术方案,先创建指针组,所述指针组包括至少一个的报文指针域,每个报文指针域存储一个报文指针;再通过所述指针组,对队列存储空间进行读写操作。如此,在对队列存储空间进行入队、出队和空闲指针管理时,一次访问外部存储器得到能够得到N报文指针,可供多次使用,从而能够减少对外部存储器的访问次数,解决了外部存储器高读写延迟问题,提高了队列管理单元的处理性能,节省了外部存储器的读写次数,降低了功耗。

Claims (14)

  1. 一种队列存储空间管理方法,所述方法包括:
    创建指针组,所述指针组包括至少一个的报文指针域,每个报文指针域存储一个报文指针;
    通过所述指针组,对队列存储空间进行读写操作。
  2. 根据权利要求1所述方法,其中,所述指针组中的报文指针域之间地址相互独立。
  3. 根据权利要求1所述方法,其中,所述通过所述报文指针组,对队列存储空间进行读写操作包括:
    通过所述报文指针组,对队列存储空间进行空闲指针申请、队列入队、队列出队、空闲指针回收以及空闲指针链表存储和队列链表存储操作。
  4. 根据权利要求3所述方法,其中,所述通过指针组,对队列存储空间进行空闲指针申请包括:
    判断当前的指针组内是否还有空闲指针;
    当前指针组内没有空闲指针时,申请一个新的空闲指针组作为当前指针组,并读取当前指针组中的空闲指针;
    当前指针组内有空闲指针时,读取当前指针组中的空闲指针。
  5. 根据权利要求3所述方法,其中,所述通过指针组,对队列存储空间进行队列入队操作包括:
    将需要入队的指针填充到所述指针组中的空闲指针中;
    当所述指针组饱和、或相同队列的入队指针等待超时,将所述指针组进行队列入队操作。
  6. 根据权利要求3所述方法,其中,所述通过指针组,对队列存储空间进行队列出队操作包括:
    将需要出队的指针写入预出队先入先出队列,将所述预出队先入先出 队列进行队列出队操作。
  7. 根据权利要求3所述方法,其中,所述通过指针组,对队列存储空间进行空闲指针回收包括:
    将队列出队操作释放的出队指针依次写入指针组;
    当所述指针组饱和时,将所述指针组进行空闲指针回收。
  8. 一种队列存储空间管理装置,所述装置包括:指针组创建单元、操作单元,其中,
    所述指针组创建单元,配置为创建指针组,所述指针组包括至少一个的报文指针域,每个报文指针域存储一个报文指针;
    所述操作单元,配置为通过所述指针组,对队列存储空间进行读写操作。
  9. 根据权利要求8所述装置,其中,所述操作单元还配置为:
    通过所述报文指针组,对队列存储空间进行空闲指针申请、队列入队、队列出队、空闲指针回收以及空闲指针链表存储和队列链表存储操作。
  10. 根据权利要求9所述装置,其中,所述操作单元还配置为:
    判断当前的指针组内是否还有空闲指针;
    当前指针组内没有空闲指针时,申请一个新的空闲指针组作为当前指针组,并读取当前指针组中的空闲指针;
    当前指针组内有空闲指针时,读取当前指针组中的空闲指针。
  11. 根据权利要求9所述装置,其中,所述操作单元还配置为:
    将需要入队的指针填充到所述指针组中的空闲指针中;
    当所述指针组饱和、或相同队列的入队指针等待超时,将所述指针组进行队列入队操作。
  12. 根据权利要求9所述装置,其中,所述操作单元还配置为:
    将需要出队的指针写入预出队先入先出队列,将所述预出队先入先出 队列进行队列出队操作。
  13. 根据权利要求9所述装置,其中,所述操作单元还配置为:
    将队列出队操作释放的出队指针依次写入指针组;
    当所述指针组饱和时,将所述指针组进行空闲指针回收。
  14. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,该计算机可执行指令配置为执行权利要求1-7任一项所述的队列存储空间管理方法。
PCT/CN2016/081542 2015-06-17 2016-05-10 一种队列存储空间管理方法及装置、计算机存储介质 WO2016202120A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510336880.4 2015-06-17
CN201510336880.4A CN106325758B (zh) 2015-06-17 2015-06-17 一种队列存储空间管理方法及装置

Publications (1)

Publication Number Publication Date
WO2016202120A1 true WO2016202120A1 (zh) 2016-12-22

Family

ID=57545062

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/081542 WO2016202120A1 (zh) 2015-06-17 2016-05-10 一种队列存储空间管理方法及装置、计算机存储介质

Country Status (2)

Country Link
CN (1) CN106325758B (zh)
WO (1) WO2016202120A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110532198A (zh) * 2019-09-09 2019-12-03 成都西山居互动娱乐科技有限公司 一种存储空间分配的方法及装置
CN111181874A (zh) * 2018-11-09 2020-05-19 深圳市中兴微电子技术有限公司 一种报文处理方法、装置及存储介质
CN113454957A (zh) * 2019-02-22 2021-09-28 华为技术有限公司 一种存储器的管理方法及装置
WO2022028048A1 (zh) * 2020-08-06 2022-02-10 北京微核芯科技有限公司 乱序处理器中乱序执行队列的调度方法和装置

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109688085B (zh) * 2017-10-19 2021-11-02 中兴通讯股份有限公司 传输控制协议代理方法、存储介质及服务器
CN109697022B (zh) * 2017-10-23 2022-03-04 深圳市中兴微电子技术有限公司 一种报文描述符pd的处理方法、装置及计算机可读存储介质
CN109840150B (zh) * 2017-11-29 2021-10-26 北京忆芯科技有限公司 存储器分配器
CN113079113B (zh) * 2021-03-30 2022-03-15 扬州万方电子技术有限责任公司 数据传输装置和数据传输系统
CN117908968A (zh) * 2022-10-11 2024-04-19 深圳市中兴微电子技术有限公司 基于压缩型发射队列的指令发送方法、装置、设备及介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030145012A1 (en) * 2002-01-31 2003-07-31 Kurth Hugh R. Shared resource virtual queues
CN101635682A (zh) * 2009-08-05 2010-01-27 中兴通讯股份有限公司 一种存储管理的方法和系统
CN102185770A (zh) * 2011-05-05 2011-09-14 汉柏科技有限公司 基于多核架构的批量式报文收发方法
CN102811176A (zh) * 2012-08-28 2012-12-05 迈普通信技术股份有限公司 一种数据流量控制方法和装置
CN103914341A (zh) * 2013-01-06 2014-07-09 中兴通讯股份有限公司 数据队列出队管控方法和装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101902487B (zh) * 2009-05-26 2013-03-20 中兴通讯股份有限公司 基于链表的队列调度方法与装置
CN101605100B (zh) * 2009-07-15 2012-04-25 华为技术有限公司 队列存储空间的管理方法和设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030145012A1 (en) * 2002-01-31 2003-07-31 Kurth Hugh R. Shared resource virtual queues
CN101635682A (zh) * 2009-08-05 2010-01-27 中兴通讯股份有限公司 一种存储管理的方法和系统
CN102185770A (zh) * 2011-05-05 2011-09-14 汉柏科技有限公司 基于多核架构的批量式报文收发方法
CN102811176A (zh) * 2012-08-28 2012-12-05 迈普通信技术股份有限公司 一种数据流量控制方法和装置
CN103914341A (zh) * 2013-01-06 2014-07-09 中兴通讯股份有限公司 数据队列出队管控方法和装置

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111181874A (zh) * 2018-11-09 2020-05-19 深圳市中兴微电子技术有限公司 一种报文处理方法、装置及存储介质
CN111181874B (zh) * 2018-11-09 2023-10-10 深圳市中兴微电子技术有限公司 一种报文处理方法、装置及存储介质
CN113454957A (zh) * 2019-02-22 2021-09-28 华为技术有限公司 一种存储器的管理方法及装置
US11695710B2 (en) 2019-02-22 2023-07-04 Huawei Technologies Co., Ltd. Buffer management method and apparatus
CN110532198A (zh) * 2019-09-09 2019-12-03 成都西山居互动娱乐科技有限公司 一种存储空间分配的方法及装置
CN110532198B (zh) * 2019-09-09 2023-08-08 成都西山居互动娱乐科技有限公司 一种存储空间分配的方法及装置
WO2022028048A1 (zh) * 2020-08-06 2022-02-10 北京微核芯科技有限公司 乱序处理器中乱序执行队列的调度方法和装置
US11989561B2 (en) 2020-08-06 2024-05-21 Beijing Vcore Technology Co., Ltd. Method and apparatus for scheduling out-of-order execution queue in out-of-order processor

Also Published As

Publication number Publication date
CN106325758B (zh) 2019-10-22
CN106325758A (zh) 2017-01-11

Similar Documents

Publication Publication Date Title
WO2016202120A1 (zh) 一种队列存储空间管理方法及装置、计算机存储介质
US9280297B1 (en) Transactional memory that supports a put with low priority ring command
US8325603B2 (en) Method and apparatus for dequeuing data
US9069602B2 (en) Transactional memory that supports put and get ring commands
TW200406672A (en) Free list and ring data structure management
EP3166269B1 (en) Queue management method and apparatus
WO2011015055A1 (zh) 一种存储管理的方法和系统
CN107783727B (zh) 一种内存设备的访问方法、装置和系统
CN105793835B (zh) 用于支持计算环境中的i/o虚拟化的系统和方法
US11425057B2 (en) Packet processing
WO2014106436A1 (zh) 数据队列出队管控方法和装置
CN112650558B (zh) 数据处理方法、装置、可读介质和电子设备
WO2016202113A1 (zh) 一种队列管理方法、装置及存储介质
WO2017133439A1 (zh) 一种数据管理方法及装置、计算机存储介质
WO2023201987A1 (zh) 请求处理方法、装置、设备及介质
JP2008512942A5 (zh)
CN116954675A (zh) 已用环表更新方法及模块、后端设备、介质、设备、芯片
TWI223747B (en) Increasing memory access efficiency for packet applications
US7975183B2 (en) Dynamic debugging of platform transactions via context aware transactional debug marking
US8898353B1 (en) System and method for supporting virtual host bus adaptor (VHBA) over infiniband (IB) using a single external memory interface
WO2022223003A1 (zh) 一种文件访问方法、网卡以及计算设备
CN109144742B (zh) 通过队列交换信息的方法和处理队列的系统
CN109597577A (zh) 一种处理nvme协议读写命令的方法、系统及相关装置
CN112732176B (zh) 基于fpga的ssd访问方法及装置、存储系统及存储介质
CN107025064A (zh) 一种低延迟高iops的数据访问方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16810861

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16810861

Country of ref document: EP

Kind code of ref document: A1