WO2014106436A1 - 数据队列出队管控方法和装置 - Google Patents

数据队列出队管控方法和装置 Download PDF

Info

Publication number
WO2014106436A1
WO2014106436A1 PCT/CN2013/090148 CN2013090148W WO2014106436A1 WO 2014106436 A1 WO2014106436 A1 WO 2014106436A1 CN 2013090148 W CN2013090148 W CN 2013090148W WO 2014106436 A1 WO2014106436 A1 WO 2014106436A1
Authority
WO
WIPO (PCT)
Prior art keywords
queue
node
linked list
dequeuing
write
Prior art date
Application number
PCT/CN2013/090148
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 WO2014106436A1 publication Critical patent/WO2014106436A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices

Definitions

  • the present invention relates to the field of data processing technologies, and in particular, to a data queue dequeuing control method and apparatus. Background technique
  • the traffic control chip implements large-scale queue control
  • the data packet is stored in the DDR (Double Data Rate) memory.
  • the index address corresponding to the data packet is stored in the form of a queue.
  • On-chip QDR Quad Data Rate
  • the index address is obtained, and the data packet corresponding to the index address is read out, and the data packet is dequeued.
  • the control of the queue is mainly for the control of packet storage, including two steps of enqueue and dequeue.
  • the queue divides the data packets belonging to the same queue into one or more nodes, which are stored in the cache space.
  • Each node constitutes a sink node, and multiple sink nodes form a queue list; the queues and queues are logically independent of each other, and each queue maintains a queue list.
  • the cache reads and writes the index address and the data message according to the read/write command given by the scheduling instruction, and realizes the control of the data flow.
  • the existing queue management technology for shared storage space mainly adopts the implementation of single-linked list and multi-linked list to realize the storage of the linked list in the queue management.
  • the way to implement queue control by using a single-link list is mainly to store the address pointer of each node in the queue in the linked list. After reading a node, the address of the next node can be obtained. Considering the read delay of the QDR memory, Meet the rate requirements for demarcation processing. Summary of the invention
  • an embodiment of the present invention provides a data queue dequeuing control method and apparatus.
  • the embodiment of the invention provides a data queue dequeuing control method, which comprises the steps of:
  • Receiving a queue scheduling instruction acquiring a queue first address in the queue descriptor and a dequeue sub-pointer of the dequeue node in the dequeue list of the queue, and combining the queue first address and the dequeue sub-pointer into a dequeue node Absolute address
  • the start flag of the data packet included in the child node information of the dequeue node in the reassembly queue is monitored, and the scheduling sequence number of the data packet is sequentially written into the sorting queue according to the order in which the start flag arrives;
  • the child node information of the dequeue node stored in the reorganization queue is sequentially taken out, and points to the corresponding data packet storage location.
  • Send data packet dequeue instructions is sequentially taken out, and points to the corresponding data packet storage location.
  • the information about the child nodes of the dequeue node in the current linked list is obtained in the order of the absolute addresses of the dequeue nodes in the current linked list, and is written into the reassembly queue and reassembled into data packets; according to the dequeued nodes in the current linked list
  • the parity sequence, the pre-fetching of the child node information of the next dequeued node, the writing of the parity list, and the prefetching of the message tail identifier of the next dequeued node from the parity list include:
  • the dequeued nodes in the current linked list are divided into odd nodes and even nodes;
  • the monitoring starts the flag of the data packet included in the child node information of the dequeue node in the reassembly queue, and sequentially writes the scheduling number of the data packet into the sorting queue according to the order in which the start flag arrives.
  • the steps in the specific steps include:
  • the scheduling column number of the node corresponding to the first arrival start flag is written into the sorting queue; the scheduling number of the data packet belonging to the same reassembly queue corresponding to the first arrival start flag is sequentially written into the sorting queue. ;
  • the sub-node information of the current write node includes the end of the message, the next arriving node is the node corresponding to the start flag, and the scheduling number of the next arriving node is written into the sorting queue;
  • the sub-node information of the next dequeued node is pre-fetched, written into the parity list, and the message tail of the next dequeued node is prefetched from the parity list.
  • the method further includes:
  • the address of the next linked list head node included in the child node information of the currently written node is extracted, and the child node information of the first node of the next linked list is pre-read;
  • the child nodes of the dequeue nodes in the next linked list are cross-obtained and written into the reassembly queue.
  • the method further includes:
  • the embodiment of the invention further provides a data queue dequeuing control device, comprising:
  • An address generation module configured to receive a queue scheduling instruction, obtain a queue first address in the queue descriptor, and a dequeue sub-pointer of the dequeue node in the dequeue list of the queue, and the queue first address and the dequeue The pointers are combined into the absolute address of the dequeue node;
  • the reassembly queue module is configured to obtain the sub-node information of the dequeue node in the current linked list according to the absolute address sequence of the dequeue node in the current linked list, write the reassembly queue, and reassemble into Data message
  • the pre-read queue module is configured to cross-prefetch the child node information of the next dequeue node according to the parity order of the dequeue nodes in the current linked list, write the parity list, and prefetch the report of the next dequeue node from the parity list. End mark
  • the sorting queue module is configured to monitor a start flag of the data packet included in the child node information of the dequeue node in the reassembly queue, and sequentially write the scheduling number of the data packet according to the order in which the start flag arrives In the queue;
  • the dequeue instruction module is configured to: according to the scheduling sequence number of the dequeue data packet in the sorting queue, sequentially take out the child node information of the dequeue node stored in the reorganization queue, point to the corresponding data packet storage location, and send the datagram. Text out of the team instructions.
  • the reassembly queue module is specifically configured to:
  • the dequeued nodes in the current linked list are divided into odd nodes and even nodes;
  • the sorting queue module is specifically configured as:
  • the next arriving node is used as the node corresponding to the start flag, and the scheduling number of the next arriving node is written into the sorting queue;
  • the reassembly queue module is further configured to:
  • the address of the next linked list head node included in the child node information of the currently written node is extracted, and the child node information of the first node of the next linked list is pre-read;
  • the child nodes of the dequeue nodes in the next linked list are cross-obtained and written into the reassembly queue.
  • the reassembly queue module is further configured to:
  • the queue scheduling instruction is released, and the operation of writing to the reassembly queue is stopped.
  • the embodiment of the present invention uses a "node aggregation" method to implement single-chain list queue control, and solves the problem of pin and wiring caused by excessive SRAM resources occupied by nodes, and realizes through a single linked list.
  • the queue control of large-scale queues saves the external off-chip QDR memory storage space and pins under the premise of ensuring the line speed, which reduces the complexity of the layout of the flow control using FPGA.
  • FIG. 1 is a flowchart of a first embodiment of a data queue dequeuing control method according to the present invention
  • FIG. 2 is a flowchart of a second embodiment of a data queue dequeuing control method according to the present invention
  • FIG. 4 is a flowchart of a fourth embodiment of a data queue dequeuing control method according to the present invention
  • FIG. 5 is a structural diagram of a data queue dequeuing control device according to an embodiment of the present invention; schematic diagram.
  • FIG. 1 is a flow chart of a first embodiment of a data queue dequeuing control method according to the present invention.
  • the data queue dequeuing control method mentioned in this embodiment includes:
  • Step S10 Receive a queue scheduling instruction, obtain a queue first address in the queue descriptor, and a dequeue sub-pointer of the dequeue node in the dequeue list of the queue, and synthesize the absolute address of the dequeue node;
  • the off-chip QDR memory of this embodiment includes a queue descriptor off-chip QDR memory, a linked-slice off-chip QDR memory, and a sub-node information off-chip QDR memory, respectively storing descriptors of each queue, a leader pointer and a tail pointer, and a sink node (That is, information about all nodes in each linked list, and child node information of each node.
  • the information of the sink node includes the packet tail identifier of the first node of the next sink node in the queue linked list and the address of the next sink node in the queue linked list; the child node information includes the length of the node and whether the node is the end of the packet.
  • the dequeuing operation receives the dequeue queue number from the queue schedule, reads the queue descriptor and the dequeue sub-pointer, and the queue descriptor includes the queue first address.
  • the actual address of each node consists of the base address plus the offset address.
  • the base address of the nodes in the same linked list is the same, and the offset is the offset of the remaining nodes relative to the first node in the same linked list. Since the addresses of the nodes in each aggregation node in a linked list are continuous, So if you read from the first node of a sink node of a linked list, you can immediately know the address of the next node, without waiting for the return result of the first read operation.
  • the address allocation and release of the sink node are based on the linked list. basic unit. Therefore, in obtaining the actual address of each node, that is, the absolute address, the address stored in the queue head node of the queue and the dequeue sub-pointer of each node in the queue may be combined into the absolute address of the dequeue node. All nodes belonging to the same data packet must be written to the same reassembly queue.
  • Step S20 Obtain the child node information of the dequeue node in the current linked list according to the order of the absolute addresses of the dequeue nodes in the current linked list, write the reassembly queue, and reassemble into data packets; according to the parity order of the dequeue nodes in the current linked list Cross-prefetching the child node information of the next dequeue node, writing the parity list, and prefetching the message tail identifier of the next dequeued node from the parity list;
  • the current linked list is divided into an odd-linked list and an even-linked list, and the sub-node information in the odd-chain list and the even-chain list is cross-read, and the sub-list is obtained.
  • the node address of the pre-reading even list when obtaining the child information of the even list, pre-reads the node address of the odd-linked list, and cross-operates the double-linked list to effectively improve the efficiency of the child node information dequeue of each node.
  • the start and stop information of the data packet saved in the parity list is fed back to the scheduling side in time, ensuring that the scheduling side switches the scheduling queue in time to meet the line speed requirement of the scheduling side.
  • Step S30 monitoring the start flag of the data packet included in the child node information of the dequeue node in the reassembly queue, and sequentially writing the scheduling number of the data packet into the sorting queue according to the order in which the start flag arrives;
  • the packet reorganization operation of the dequeue command is set.
  • the first node includes a start flag
  • the tail node includes a message tail identifier.
  • the start flags arrive that is, according to the order in which the first nodes arrive in the same data packet
  • the nodes of the same data packet are sequentially written into the sorting queue to implement the packet reorganization operation, so that the sections belonging to the same data packet are
  • the points are continuously given out of the queue command, and the order in which the dequeue commands are issued is the same as the order of the scheduling, and the message interleaving and disorder of the dequeue command are avoided.
  • step S40 the child node information of the dequeue node stored in the reassembly queue is sequentially taken out according to the scheduling sequence number of the dequeue data packet in the sorting queue, and the data packet storage location is sent to the corresponding data packet storage location, and the data packet dequeue instruction is sent.
  • the dequeue command is sent to the register to obtain the corresponding data packet, and the data packet is dequeued.
  • the end of the packet corresponding to a data packet in the sorting queue is 1, it indicates that one packet is dequeued and another data packet is ejected.
  • the node that is dequeued is the tail node, that is, the node includes the message tail identifier
  • the node corresponding to the next data packet in the sort queue is read, and the head pointer of the queue descriptor is updated. If the node that was last dequeued is not the tail node, the head pointer remains unchanged.
  • this embodiment uses the "node aggregation" method to implement single-chain list queue control, and solves the problem of pin and wiring caused by excessive SRAM resources occupied by nodes, and realizes large through a single linked list.
  • the queue control of the scale queue saves the off-chip QDR memory storage space and pins under the premise of ensuring the line speed, and reduces the complexity of the layout of the flow control using the FPGA.
  • FIG. 2 is a flow chart of a second embodiment of a data queue dequeuing control method according to the present invention. This embodiment is based on the embodiment shown in FIG. 1, and the steps of writing the reassembly queue are described in detail.
  • Step S20 specifically includes:
  • Step S21 dividing the dequeued nodes in the current linked list into odd nodes and even nodes according to the parity order of the absolute addresses of the dequeue nodes in the current linked list;
  • each node in the current linked list is divided into an odd node and an even node, that is, an odd-chain list and an even-chain list are formed, and the queue scheduling instruction, the acquisition queue descriptor, and the dequeue pointer are received in the receiving queue.
  • the end of the packet of the odd link list and the end of the end of the even list are obtained.
  • the subsequent operation is performed from the first odd node or the first even node.
  • Step S23 Obtain the child node information of the i-th odd node according to the absolute address of the i-th odd node, write the reassembly queue, and pre-read the sub-node information of the i+1th odd node, and write the singular list;
  • the child node information of the current odd node is obtained and written into the reassembly queue; the child node information of the next odd node is pre-read and written into the odd chain table.
  • the queue number of the dequeue given by the scheduling side is obtained, the odd list is searched, the start and stop identifier of the queue is given, and the scheduling side determines whether to switch the queue; the queue descriptor and the dequeue pointer of the current dequeue queue are obtained, The queue descriptor and the dequeue sub-pointer are used as addresses, and the sub-node information of the odd-numbered nodes is read and written into the re-queue; the sub-node information of the odd-numbered nodes in the queue is pre-read, and the result is written into the odd-chain list.
  • Step S24 Obtain, according to the absolute address of the i-th even node, the child node information of the i-th even-numbered node, write the re-queue, and pre-read the sub-node information of the i+1th even-node, and write the even-chain list;
  • the child node information of the current even node is obtained and written into the reassembly queue; the child node information of the next even node is pre-read, and the even list is written.
  • the queue number of the dequeue given by the current scheduling side is obtained, the even list is queried, the start and end identifier of the queue is given, and the scheduling side determines whether to switch the queue; the queue descriptor and the dequeue pointer of the current dequeue queue are obtained.
  • Step S25 determining whether the child node information of all nodes in the current linked list is written into the reorganization team ⁇ 'J; if yes, ending the method flow, that is, starting from step S20; if not, B' J i Add 1 to return to step S23.
  • the subnode information of the next odd node is obtained, written into the reassembly queue, and the subnode information of the next odd node is pre-read;
  • the child node information of an even number node is written into the reassembly queue, and the child node information of the next even node is pre-read.
  • the scheduling side determines whether to switch the queue; obtain the queue descriptor and the dequeue sub-pointer, and read The child node information of the next odd node is written into the reassembly queue; the child node information of the next odd node is read-aheaded, and the result is written into the odd-chain list; the dequeue queue number given by the scheduling side is obtained (same as the upper queue number) Querying the even list, giving the start and stop identifier of the queue, the scheduling side determining whether to switch the queue; obtaining the queue descriptor and the dequeue sub-pointer of the current dequeue queue, using the queue descriptor and the dequeue sub-point as the address Read the child node information of the next even node and write it into the reassembly queue; read the subnode information
  • the update of the parity list is completed when the queue is dequeued, and the next odd node or even node is read according to the parity attribute of the currently dequeued node. Pre-reading in the same aggregation node according to the parity and cross-over manner.
  • the nodes belonging to the same data packet are numbered, and are divided into odd-numbered nodes and even-numbered nodes.
  • odd-numbered nodes the next odd number is selected.
  • the node performs pre-reading; during the dequeuing of the even node, the next even node is pre-read; the node obtained by the pre-reading is stored in the on-chip RAM of the FPGA, and the odd-linked list and the even-linked list are stored independently, corresponding to the queue.
  • a flag indicating whether the dequeuing of the data packet is completed is immediately given to switch the scheduling port queue.
  • the address of the first odd node of the new sink node is written into the child node information of the last odd node of the previous linked list, the new linked list
  • the address of the first even node is written to the child information of the last even node of the previous linked list.
  • FIG. 3 is a flow chart of a third embodiment of a data queue dequeuing control method according to the present invention. This embodiment is based on the embodiment shown in FIG. 1, and the steps of writing the sorting queue are described in detail.
  • Step S30 specifically includes:
  • Step S31 monitoring a start flag and a start sequence of the start of the data packet included in the child node information of the dequeue node in the reassembly queue;
  • the packet reorganization operation of the dequeue command is designed.
  • the first node includes a start flag
  • the tail node includes a message tail identifier.
  • the nodes of the same data packet are sequentially written into the sorting queue to implement the packet reorganization operation, so that the nodes belonging to the same data packet continuously give the dequeue command, ensuring that the order of issuing the dequeue command is the same as the scheduling sequence, avoiding The message of the dequeue command is interlaced and out of order.
  • Step S33 the scheduling column number of the node corresponding to the jth arriving start flag is written into the sorting queue
  • the scheduling column number of the node corresponding to the first arriving start flag is written into the sorting queue.
  • Step S34 in which the scheduling number of the data packet belonging to the same reassembly queue corresponding to the j-th arrival start flag is sequentially written into the sorting queue;
  • the scheduling number of the data packet belonging to the same reassembly queue corresponding to the first arrival start flag is sequentially written into the sorting queue;
  • Step S35 determining whether the message end identifier is included in the child node information currently written to the node; If yes, go to step S36; if no, go back to step S34;
  • Step S36 determining whether the scheduling sequence numbers of all data packets in the reassembly queue are all written into the sorting queue; if yes, ending the method flow, that is, ending from step S30; if not, the shell 'J j is incremented by 1, returning to the step S33.
  • the child node information of the node corresponding to the next arrival start flag is written into the sorting queue, and the node corresponding to the next arrival start flag belongs to the node of the same data message in turn.
  • the child node information is written to the sort queue.
  • Message Reassembly Sets a set of reassembly queues and a sort queue for all queues.
  • the number of reassembly queues is set according to the requirements of the line rate and the clock used. For example, taking 10 clock cycles as a dequeue time node, and dequeuing four different queues in each dequeue time node as an example, four reassembly queues need to be set, and each queue corresponds to one time slot. Team operation.
  • a sort queue is set to store the start flag of each reassembly queue.
  • the read of the reassembly queue is the same as the demarcation rate of the line rate requirement.
  • the dequeue of one node is completed every 2 cycles.
  • the reassembly queue reads one queue node every 2 cycles, and then decides whether to continue reading this queue or switching queue according to the message tail identification field.
  • the dequeue commands stored in each queue are read from the queue, and after the content of the first node is obtained, it is determined whether to read the next node of the queue or read another queue node, because the data is in the third of the queue. Only one cycle can be dequeued.
  • the requirement to read out the dequeue command of one node every 2 cycles is to make a pre-read operation for each queue, and the content of the sorting queue is also pre-read.
  • the four sets of reassembly queues and a set of sorting queues are independently read-ahead and stored in the pre-read registers of each queue.
  • the read-ahead register of each reassembly queue stores the contents of the first node in the queue.
  • Each pre-read operation of the reassembly queue is independent. When each content in the pre-read register is read, a new pre-trigger is triggered. Read operation; the sort queue is also pre-read, pre-reading the number of the next queue to be dequeued, setting a set of dequeue information registers, reading the value of the pre-read register of the sort queue, in the process of dequeuing, Choose The dequeue node command gives an indication.
  • the packet reassembly scheme of the continuous dequeue queue is implemented, and the node scheduling according to the packet segmentation is implemented, and the entire packet is dequeued.
  • FIG. 4 is a flow chart of a fourth embodiment of a data queue dequeuing control method according to the present invention.
  • the step of pre-reading the next linked list is added, and after step S20, the method further includes:
  • step S51 when the sub-node information of the current write node includes the end of the message, it is determined whether the queue is empty after being dequeued; if yes, step S52 is performed; if no, step S54 is performed; It is used to indicate whether the tail node of each linked list is the last node of the message (0 means not the end of the message, 1 means the end of the message), so as to facilitate the pre-dequeue operation.
  • each linked list is pre-allocated with a continuous space, and one linked list only receives the nodes of the same data message.
  • Step S52 extracting an address of a first linked list head node included in the child node information currently written to the node, and pre-reading the child node information of the first linked list first node;
  • Step S53 Obtain, according to the parity order of the absolute addresses of the nodes in the next linked list, the child node information of each node in the next linked list, and write the information into the reassembly queue;
  • Step S54 Release the queue scheduling instruction, and stop writing to the reassembly queue.
  • each linked list begins with the first node dequeuing, until the last node reads, and the linked list is released. After the queue is dequeued, the queue is released after the last linked list node to which the queue belongs is dequeued. According to the queue first address and the tail address in the queue descriptor, and the dequeue sub-pointer and the enqueue sub-pointer of the queue, it is judged whether the queue is empty after being dequeued.
  • the maintenance of the idle linked list is completed by judging the empty and non-empty attributes of the queue.
  • FIG. 5 is a schematic structural diagram of a data queue dequeuing control device according to an embodiment of the present invention.
  • the data queue dequeuing control device of the embodiment may be located in the flow control chip, and includes:
  • the address generation module 10 is configured to receive a queue scheduling instruction, obtain a queue first address in the queue descriptor, and a dequeue sub-pointer of each node in each linked list of the queue, and synthesize the absolute addresses of the nodes;
  • the reassembly queue module 20 is configured to obtain the sub-node information of the dequeue node in the current linked list in the order of the absolute addresses of the dequeue nodes in the current linked list, write the reassembly queues, and reassemble into the data packets;
  • the pre-read queue module 30 is configured to cross-prefetch the child node information of the next dequeued node according to the parity order of the dequeue node, and write the parity list; and obtain the current end of the dequeue node from the parity list.
  • the sorting queue module 40 is configured to monitor the start flag of the data packet included in the child node information of the dequeue node in the reassembly queue, and sequentially write the scheduling number of the data packet into the sorting queue according to the order in which the start flag arrives;
  • the dequeue instruction module 50 is configured to take out the sub-node information of the dequeue node stored in the re-queue queue according to the scheduling sequence number of the dequeue data packet in the sorting queue, and point to the corresponding data packet storage location, and send the data packet. Departure instructions.
  • the address generation module 10, the reassembly queue module 20, the pre-read queue module 30, the sort queue module 40, and the dequeue instruction module 50 may be implemented by a CPU (Central Processing Unit) and a DSP (Digital Processing Unit). Signal Processor, Digital Signal Processor) or FPGA (Field - Programmable Gate Array) implementation.
  • CPU Central Processing Unit
  • DSP Digital Processing Unit
  • FPGA Field - Programmable Gate Array
  • the off-chip QDR memory of this embodiment includes a queue descriptor off-chip QDR memory, a linked-slice off-chip QDR memory, and a sub-node information off-chip QDR memory, respectively storing descriptors of each queue, a leader pointer and a tail pointer, and a sink node ( That is, the information of all the nodes in each queue list, and the information of the child nodes of each node, wherein the information of the aggregation node includes the identifier of the header of the first node of the next aggregation node in the queue list and the address of the next aggregation node in the queue list.
  • the child node information includes the length of the node and whether the node is the end of the message.
  • Dequeue operation receives from queue scheduling The dequeue queue number, the read queue descriptor and the dequeue sub-pointer, and the queue descriptor includes the queue first address.
  • the actual address of each node is composed of the base address plus the offset address.
  • the base address of the node in the same aggregation node of the queue list is the same, and the offset is the first node relative to the first node in the same linked list. The offset. Since the addresses of the nodes in a linked list are continuous, if the reading is started from the first node of a sink node, the address of the next node can be immediately known without waiting for the return result of the first read operation.
  • the allocation and release of the aggregation node is based on the linked list.
  • the address stored in the queue head packet of the queue and the dequeue sub-pointer of each node in the queue may be combined into the absolute address of the dequeue node. All nodes belonging to the same data packet must be written to the same reassembly queue. Reading the sub-node information off-chip QDR memory, according to the parity attribute of the dequeue sub-pointer, the current linked list is divided into an odd-linked list and an even-linked list, and the sub-node information in the odd-chain list and the even-chain list is cross-read, and the sub-list is obtained.
  • the node address of the pre-reading even list when obtaining the child information of the even list, pre-reads the node address of the odd-linked list, and cross-operates the double-linked list to effectively improve the efficiency of the child node information dequeue of each node.
  • the start and stop information of the data packet saved in the parity list is fed back to the scheduling side in time, ensuring that the scheduling side switches the scheduling queue in time to meet the line speed requirement of the scheduling side.
  • the nodes belonging to the same data packet are not contiguous.
  • the message reorganization operation of the dequeue command is proposed.
  • the first node includes a start flag
  • the tail node includes a message tail identifier.
  • the nodes of the same data packet are sequentially written into the sorting queue to implement the packet reorganization operation, so that the nodes belonging to the same data packet continuously give the dequeue command, ensuring that the order of issuing the dequeue command is the same as the scheduling sequence, avoiding The message of the dequeue command is interlaced and out of order.
  • the dequeue command is sent to the register to obtain the corresponding data packet, and the data packet is dequeued.
  • the packet tail of the node corresponding to a data packet When sorting queue When the packet tail of the node corresponding to a data packet is 1, it indicates that one packet is dequeued and another data packet is ejected.
  • the node that is dequeued is the tail node, that is, the node includes the message tail identifier
  • the node corresponding to the next data packet in the sort queue is read, and the value of the team information register is updated. If the node that was last dequeued is not a tail node, the dequeue information register remains unchanged.
  • the link release command After the node in a linked list is dequeued, the link release command is received, the release flag is detected, the linked list is released, and the data packet is dequeued.
  • this embodiment uses the "node aggregation" method to implement single-chain list queue control, and solves the problem of pin and wiring caused by excessive SRAM resources occupied by nodes, and realizes large through a single linked list.
  • the queue control of the scale queue saves the external off-chip QDR memory storage space and pins under the premise of ensuring the line speed, which reduces the complexity of the layout of the flow control using the FPGA.
  • the reassembly queue module 20 is specifically configured as:
  • the dequeued nodes in the current linked list are divided into odd nodes and even nodes;
  • each node in the current linked list is divided into an odd node and an even node, that is, an odd-chain list and an even-chain list are formed, and the queue scheduling instruction, the acquisition queue descriptor, and the dequeue pointer are received in the receiving queue.
  • the end of the packet of the odd link list and the end of the end of the even list are obtained.
  • the dequeue queue number given by the scheduling side querying the odd-chain list, giving the start and stop identifier of the queue, and determining whether to switch the queue; and obtaining the queue descriptor and the dequeue sub-pointer of the current dequeue queue, to the queue
  • the descriptor and the dequeue sub-pointer are used as addresses, the sub-node information of the odd-numbered nodes is read, and the re-queue is written; the sub-node information of the odd-numbered nodes in the queue is pre-read, and the result is written into the odd-chain list.
  • the dequeue queue number given by the current scheduling side querying the even list, giving the queue start and end identifier, and the scheduling side determining whether to switch the queue; obtaining the queue descriptor and the dequeue sub-pointer of the current dequeue queue, The queue descriptor and the dequeue sub-pointer are used as the address, the sub-node information of the even-numbered node is read, and the re-queue is written; the sub-node information of the next even-numbered node is pre-read, and the result is written into the even-chain list; if the current linked list still exists If the child node information of the node is not written into the reassembly queue, the child node information of the next odd node is obtained, written into the reassembly queue, and the child node information of the next odd node is pre-read; and then the child node of the next even node is obtained.
  • the dequeue queue number given by the scheduling side is obtained (same as the upper queue number), the odd-chain list is queried, the start and end identifier of the queue is given, and the scheduling side determines whether to switch the queue; the queue descriptor and the dequeue sub-pointer are obtained.
  • the update of the parity list is completed when the queue is dequeued, and the next odd node or even node is read according to the parity attribute of the currently dequeued node.
  • the nodes in the same aggregation node are pre-read in the manner of parity crossing. In the process of dequeuing, the nodes belonging to the same data packet are numbered, and are divided into odd nodes and even nodes.
  • the next one is Odd nodes for pre-reading; even nodes for dequeuing, for the next even
  • the number of nodes is pre-read; the nodes obtained by pre-reading are stored in the on-chip RAM of the FPGA, and the odd-linked list and the even-linked list are stored separately, corresponding to the queue.
  • a flag indicating whether the dequeuing of the data packet is completed is immediately given to switch the scheduling port queue.
  • the new queue entry when the new queue entry is applied for, the new one will be added.
  • the address of the first odd node of the linked list is written into the child node information of the last odd node of the previous linked list, and the address of the first even node of the new linked list is written into the child node information of the last even node of the previous linked list.
  • the sort queue module 40 is specifically configured as:
  • the scheduling column number of the node corresponding to the first arrival start flag is written into the sorting queue; the scheduling number of the data packet belonging to the same reassembly queue corresponding to the first arrival start flag is sequentially written into the sorting queue;
  • the next arriving node is used as the node corresponding to the start flag, and the scheduling number of the next arriving node is written into the sorting queue;
  • the scheduling sequence number of the data packet belonging to the same reassembly queue corresponding to the start flag of the next arrival is sequentially written into the sorting queue;
  • the dequeue command is designed.
  • Message reorganization operation In the linked list formed by the nodes belonging to the same data packet, the first node includes a start flag, and the tail node includes a message tail identifier, according to the start flag.
  • the order of arrival that is, according to the order of arrival of the first node in the same data packet, the nodes of the same data packet are sequentially written into the sorting queue to implement the message reorganization operation, so that the nodes belonging to the same data packet are continuously Given the dequeue command, the order in which the dequeue commands are issued is the same as the order of the scheduling, avoiding the interleaving and disorder of the message of the dequeue command.
  • Message Reassembly Sets a set of reassembly queues and a sort queue for all queues. The number of reassembly queues is set according to the requirements of the line rate and the clock used.
  • a sort queue is set to store the order in which the start flags of the reassembly queues arrive, and the dequeue commands of the queue messages are read out by the reassembly queue in the order of queue scheduling.
  • the readout of the reassembly queue is the same as the dequeue rate required by the line rate. Take the dequeue of one node every 2 cycles as an example.
  • the reassembly queue reads one queue node every 2 cycles, and then identifies the tail according to the packet.
  • the field determines whether to continue reading this queue or to switch queues.
  • the dequeue command stored in each queue is read from the queue, and after obtaining the content of the first node, it is determined whether to read the next node of the queue or read another queue node, because the data is in the third of the queue.
  • the cycle can be dequeued.
  • the requirement to read out the dequeue command of 1 node every 2 cycles is to make a pre-read operation for each queue, and the content of the sorting queue is also pre-read.
  • the four sets of reassembly queues and a set of sorting queues are independently read-ahead and stored in the pre-read registers of each queue.
  • the read-ahead register of each reassembly queue stores the contents of the first node in the queue.
  • Each pre-read operation of the reassembly queue is independent. When each content in the pre-read register is read, a new pre-trigger is triggered. Read operation; the sort queue is also pre-read, pre-reading the number of the next queue to be dequeued, setting a set of dequeue information registers, reading the value of the pre-read register of the sort queue, in the process of dequeuing, Select the dequeue node command to make an indication.
  • the packet reassembly scheme of the continuous dequeue queue is implemented, and the node scheduling according to the packet segmentation is implemented, and the entire packet is dequeued.
  • the reassembly queue module 20 is further configured to: When the information of the child node currently written to the node includes the end of the message, it is determined whether the queue is empty after being dequeued;
  • the address of the head node of the next linked list included in the child node information currently written to the node is extracted, and the child node information of the head node of the next linked list is pre-read;
  • the child nodes of each node in the next linked list are cross-obtained and written into the reassembly queue.
  • the reassembly queue module 20 is further configured to:
  • the queue scheduling instruction is released, and the step of writing to the reassembly queue is stopped.
  • the message tail identifier is used to indicate whether the tail node of each linked list is the last node of the message (0 means not the end of the message, and 1 means the end of the message), so as to facilitate the pre-dequeue operation.
  • each linked list is pre-allocated with continuous space, and one linked list only receives the nodes of the same data message.
  • each linked list begins with the first node dequeuing, and until the last node is read, the linked list is released. After the queue is dequeued, the queue is released after the last linked list node to which the queue belongs.
  • the queue descriptor According to the queue first address and the tail address in the queue descriptor, and the dequeue sub-pointer and the enqueue sub-pointer of the queue, it is judged whether the queue is empty after being dequeued. If the queue is empty, the command to release the linked list is issued, no longer Read the end of the message. If the queue is non-empty, the sub-node information of the next linked list is pre-read in the queue, the corresponding end information of the node packet is selected, and the parity packet end list is written. In this embodiment, the maintenance of the idle linked list is completed by judging the empty and non-empty attributes of the queue.
  • embodiments of the present invention can be provided as a method, apparatus, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware aspects. Moreover, the invention can take the form of a computer program product embodied on one or more computer usable storage media (including but not limited to disk storage and optical storage, etc.) in which computer usable program code is embodied.
  • the present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus, devices, and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
  • These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

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

Abstract

本发明公开了一种数据队列出队管控方法和装置,该方法包括:接收队列调度指令,获取队列首地址和出队子指针,组合成绝对地址;按照所述绝对地址的顺序,获取出队节点的子节点信息,写入重组队列;按照出队节点的奇偶顺序,交叉预取下次出队节点的子节点信息,写入奇偶链表,并预取下次出队节点的报文尾标识;监测开始标志,按照开始标志到达的先后顺序,依次将数据报文的调度序号写入排序队列中;按照调度序号顺序,依次将重组队列中出队节点的子节点信息取出,指向对应的数据报文存储位置,发送数据报文出队指令。

Description

数据队列出队管控方法和装置 技术领域
本发明涉及到数据处理技术领域, 特别涉及到数据队列出队管控方法 和装置。 背景技术
随着网络业务和容量的不断增长, 对于流量管控芯片的处理能力要求 越来越高。 流量管控芯片实现大规模队列管控时, 通常采用链表的方式, 将数据报文存储于片外 DDR ( Double Data Rate, 双倍速率 )存储器中, 数 据报文对应的索引地址以队列的形式, 存储在片外 QDR ( Quad Data Rate,
4倍数据倍率)存储器中, 在执行出队操作时, 获取索引地址, 将索引地址 对应的数据报文读出, 完成数据报文出队。
队列的管控主要是对报文存储的管控, 包括入队和出队两步, 队列按 照一定的原则, 将属于同一队列的数据报文划分为一个或者多个节点, 存 储在緩存空间里, 多个节点组成一个汇聚节点, 多个汇聚节点组成一条队 列链表; 队列与队列之间逻辑相互独立, 每一队列维护一条队列链表。 在 入队和出队过程中, 緩存根据调度指令给出的读写命令, 对索引地址和数 据报文进行存储和读出, 实现数据流的管控。
队列管控有两种方式, 一是为每一队列分配固定的存储空间, 二是所 有的队列共享同一存储空间。 在大规模队列的情况下, 采用固定分配存储 空间的方式会造成每组队列分配的存储空间很小, 对突发流量的吸收能力 比较弱, 同时存储空间的浪费比较严重。 因此, 在大规模的队列管控中基 本都采用共享存储空间的方式。 现有的共享存储空间的队列管控技术主要 采用单链表和多链表的实现方式, 以实现队列管控中链表的存储。 如果采 用传统的单链表结构, 片外 QDR存储器的读写延时导致单队列出队不能满 足出入队速率要求,同时会大量占用 SRAM( Static Random Access Memory, 静止随机存储器) 资源, 使用 FPGA ( Field - Programmable Gate Array, 现 场可编程门阵列) 实现时, 无论对于器件管脚分配还是布局布线都是巨大 的挑战; 如果采用多链表结构, 依然存在大量 SRAM资源被占用的缺点, 并且使用 FPGA 实现时, 器件管脚分配和布局布线比单链表方案的难度更 大。 同时, 采用单链表实现队列管控的方式主要是将队列中每个节点的地 址指针存储在链表中, 需要读出一个节点之后才能得到下一个节点的地址, 考虑到 QDR存储器的读延时, 不能满足出队处理的速率要求。 发明内容
为解决现有存在的技术问题, 本发明实施例了提供一种数据队列出队 管控方法和装置。
本发明实施例提出一种数据队列出队管控方法, 包括步骤:
接收队列调度指令, 获取队列描述符中的队列首地址和所述队列的出 队链表中出队节点的出队子指针, 将所述队列首地址和所述出队子指针组 合成出队节点的绝对地址;
按照当前链表中出队节点的所述绝对地址的顺序, 获取当前链表中出 队节点的子节点信息, 写入重组队列, 重新组合为数据报文; 按照当前链 表中出队节点的奇偶顺序, 交叉预取下次出队节点的子节点信息, 写入奇 偶链表, 并从奇偶链表中预取下次出队节点的报文尾标识;
监测所述重组队列中出队节点的子节点信息中包括的数据报文的开始 标志, 按照所述开始标志到达的先后顺序, 依次将数据报文的调度序号写 入排序队列中;
按照所述排序队列中出队数据报文的调度序号顺序, 依次将重组队列 中存储的出队节点的子节点信息取出, 指向对应的数据报文存储位置, 发 送数据报文出队指令。
优选地, 所述按照当前链表中出队节点的绝对地址的顺序, 获取当前 链表中出队节点的子节点信息, 写入重组队列, 重新组合为数据报文; 按 照当前链表中出队节点的奇偶顺序, 交叉预取下次出队节点的子节点信息, 写入奇偶链表, 并从奇偶链表中预取下次出队节点的报文尾标识的步骤具 体包括:
按照当前链表中出队节点的绝对地址的奇偶顺序, 将当前链表中出队 节点划分为奇数节点和偶数节点;
根据当前奇数节点的绝对地址, 获取当前奇数节点的子节点信息, 写 入重组队列; 预读下一奇数节点的子节点信息, 写入奇链表;
根据当前偶数节点的绝对地址, 获取当前偶数节点的子节点信息, 写 入重组队列; 预读下一偶数节点的子节点信息, 写入偶链表;
根据下一奇数节点的绝对地址, 获取下一奇数节点的子节点信息, 写 入重组队列; 预读再下一奇数节点的子节点信息, 写入奇链表;
根据下一偶数节点的绝对地址, 获取下一偶数节点的子节点信息, 写 入重组队列; 预读再下一偶数节点的子节点信息, 写入偶链表;
以此类推, 直至当前链表中所有节点的子节点信息均写入重组队列。 优选地, 所述监测所述重组队列中出队节点的子节点信息中包括的数 据报文的开始标志, 按照所述开始标志到达的先后顺序, 依次将数据报文 的调度序号写入排序队列中的步骤具体包括:
监测所述重组队列中出队节点的子节点信息中包括的数据报文的开始 标志和所述开始标志到达的先后顺序;
将首个到达的开始标志对应的节点的调度列号写入排序队列中; 依次将与所述首个到达的开始标志对应的节点属于同一重组队列的数 据报文的调度序号写入排序队列中; 在当前写入节点的子节点信息中包括报文尾标识时, 下一个到达的节 点作为开始标志对应的节点, 将下一个到达的节点的调度序号写入排序队 列中;
依次将与所述下一个到达的开始标志对应的节点属于同一重组队列的 数据报文的调度序号写入排序队列中;
以此类推, 直至所有重组队列的所有数据报文的调度序号均写入排序 队列中。
优选地, 所述按照当前链表中出队节点的奇偶顺序, 交叉预取下次出 队节点的子节点信息, 写入奇偶链表, 并从奇偶链表中预取下次出队节点 的报文尾标识的步骤之后, 该方法还包括:
在当前写入节点的子节点信息中包括报文尾标识时, 判断所述队列在 出队后是否为空;
当所述队列在出队后为非空时, 提取当前写入节点的子节点信息中包 括的下一链表首节点的地址, 预读下一链表首节点的子节点信息;
按照下一链表中出队节点的绝对地址的奇偶顺序, 交叉获取下一链表 中出队节点的子节点信息, 写入重组队列。
优选地, 所述在当前写入节点的子节点信息中包括报文尾标识时, 判 断所述队列在出队后是否为空的步骤之后, 该方法还包括:
当所述队列在出队后为空时, 释放队列调度指令, 停止写入重组队列。 本发明实施例还提出一种数据队列出队管控装置, 包括:
地址生成模块, 配置为接收队列调度指令, 获取队列描述符中的队列 首地址和所述队列的出队链表中出队节点的出队子指针, 将所述队列首地 址和所述出队子指针组合成出队节点的绝对地址;
重组队列模块, 配置为按照当前链表中出队节点的所述绝对地址的顺 序, 获取当前链表中出队节点的子节点信息, 写入重组队列, 重新组合为 数据报文;
预读队列模块, 配置为按照当前链表中出队节点的奇偶顺序, 交叉预 取下次出队节点的子节点信息, 写入奇偶链表, 并从奇偶链表中预取下次 出队节点的报文尾标识;
排序队列模块, 配置为监测所述重组队列中出队节点的子节点信息中 包括的数据报文的开始标志, 按照所述开始标志到达的先后顺序, 依次将 数据报文的调度序号写入排序队列中;
出队指令模块, 配置为按照所述排序队列中出队数据报文的调度序号, 依次将重组队列中存储的出队节点的子节点信息取出, 指向对应的数据报 文存储位置, 发送数据报文出队指令。
优选地, 所述重组队列模块具体配置为:
按照当前链表中出队节点的绝对地址的奇偶顺序, 将当前链表中出队 节点划分为奇数节点和偶数节点;
根据当前奇数节点的绝对地址, 获取当前奇数节点的子节点信息, 写 入重组队列; 预读下一奇数节点的子节点信息, 写入奇链表;
根据当前偶数节点的绝对地址, 获取当前偶数节点的子节点信息, 写 入重组队列; 预读下一偶数节点的子节点信息, 写入偶链表;
根据下一奇数节点的绝对地址, 获取下一奇数节点的子节点信息, 写 入重组队列; 预读再下一奇数节点的子节点信息, 写入奇链表;
根据下一偶数节点的绝对地址, 获取下一偶数节点的子节点信息, 写 入重组队列; 预读再下一偶数节点的子节点信息, 写入偶链表;
以此类推, 直至当前链表中所有节点的子节点信息均写入重组队列。 优选地, 所述排序队列模块具体配置为:
监测所述重组队列中出队节点的子节点信息中包括的数据报文的开始 标志和所述开始标志到达的先后顺序; 将首个到达的开始标志对应的节点的调度列号写入排序队列中; 依次将与所述首个到达的开始标志对应的节点属于同一重组队列的数 据报文的调度序号写入排序队列中;
在当前写入节点的子节点信息中包括报文尾标识时, 下一个到达的节 点作为开始标志对应的节点, 将下一个到达的节点的调度序号写入排序队 列中;
依次将与所述下一个到达的开始标志对应的节点属于同一重组队列的 数据报文的调度序号写入排序队列中;
以此类推, 直至所有重组队列的所有数据报文的调度序号均写入排序 队列中。
优选地, 所述重组队列模块还配置为:
在当前写入节点的子节点信息中包括报文尾标识时, 判断所述队列在 出队后是否为空;
当所述队列在出队后为非空时, 提取当前写入节点的子节点信息中包 括的下一链表首节点的地址, 预读下一链表首节点的子节点信息;
按照下一链表中出队节点的绝对地址的奇偶顺序, 交叉获取下一链表 中出队节点的子节点信息, 写入重组队列。
优选地, 所述重组队列模块还配置为:
当所述队列在出队后为空时, 释放队列调度指令, 停止写入重组队列 的操作。
本发明实施例为了解决大规模队列管控中资源和速率的瓶颈, 使用"节 点汇聚 "的方式实现单链表队列管控,解决节点占用 SRAM资源过多而引起 的管脚和布线问题, 通过单链表实现大规模队列的队列管控, 在保证线速 的前提下, 节省了外部片外 QDR存储器存储空间以及管脚, 减轻了使用 FPGA实现的流量管控的布板的复杂度。 附图说明
图 1为本发明数据队列出队管控方法的第一实施例的流程图; 图 2为本发明数据队列出队管控方法的第二实施例的流程图; 图 3为本发明数据队列出队管控方法的第三实施例的流程图; 图 4为本发明数据队列出队管控方法的第四实施例的流程图; 图 5为本发明实施例数据队列出队管控装置的结构示意图。
本发明目的的实现、 功能特点及优点将结合实施例, 参照附图做进一 步说明。 具体实施方式
应当理解, 此处所描述的具体实施例仅仅用以解释本发明, 并不用于 限定本发明。
如图 1所示, 图 1为本发明数据队列出队管控方法的第一实施例的流 程图。 本实施例提到的数据队列出队管控方法, 包括:
步骤 S10,接收队列调度指令, 获取队列描述符中的队列首地址和队列 的出队链表中出队节点的出队子指针, 组合成出队节点的绝对地址;
本实施例的片外 QDR存储器包括队列描述符片外 QDR存储器、 链表 片外 QDR存储器和子节点信息片外 QDR存储器, 分别存储每个队列的描 述符、 队首指针和队尾指针、 汇聚节点 (即各链表中所有节点) 的信息、 每个节点的子节点信息。 其中, 所述汇聚节点的信息包括队列链表中下一 汇聚节点的首节点的报文尾标识和队列链表中下一汇聚节点的地址; 子节 点信息包括节点长度和节点是否为报文尾标识。 出队操作接收来自队列调 度的出队队列号, 读取队列描述符和出队子指针, 队列描述符中包括有队 列首地址。 每个节点的实际地址由基地址加上偏移地址组成, 对于同一个 链表内节点的基址是相同的, 偏址为其余节点相对于同一个链表中的第一 个节点的偏移量。 由于一个链表内各个汇聚节点内的节点的地址是连续的, 所以如果从一个链表的一个汇聚节点的第一个节点读取, 就可以立即知道 下一个节点的地址, 而不需要等待第一次读操作的返回结果, 汇聚节点的 地址分配和释放以链表为基本单位。 因此, 在获取每个节点的实际地址, 即绝对地址, 可将队列的队首汇聚节点存储的地址和队列中各节点的出队 子指针组合成出队节点的绝对地址。 属于同一数据报文的所有节点必须写 入同一个重组队列中。
步骤 S20,按照当前链表中出队节点的绝对地址的顺序,获取当前链表 中出队节点的子节点信息, 写入重组队列, 重新组合为数据报文; 按照当 前链表中出队节点的奇偶顺序, 交叉预取下次出队节点的子节点信息, 写 入奇偶链表, 并从奇偶链表中预取下次出队节点的报文尾标识;
读取子节点信息片外 QDR存储器, 根据出队子指针的奇偶属性, 将当 前链表分为奇链表和偶链表, 交叉读取奇链表和偶链表中各子节点信息, 在获取奇链表的子节点信息时, 预读偶链表的节点地址, 在获取偶链表的 子节点信息时, 预读奇链表的节点地址, 通过双链表交叉操作, 有效提高 各节点的子节点信息出队效率。 奇偶链表中保存的数据报文起止信息及时 反馈给调度侧, 保证调度侧及时切换调度队列, 满足调度侧的线速要求。
步骤 S30,监测重组队列中出队节点的子节点信息中包括的数据报文的 开始标志, 按照开始标志到达的先后顺序, 依次将数据报文的调度序号写 入排序队列中;
由于队列调度交叉出队, 属于同一个数据报文的节点并不是连续的, 为了避免同一个数据报文的节点不能连续地给出出队命令的问题, 设置了 出队命令的报文重组操作。 属于同一个数据报文的节点形成的链表中, 首 节点包括开始标志, 尾节点包括报文尾标识, 按照开始标志到达的先后顺 序, 即按照同一个数据报文中首节点到达的先后顺序, 将同一数据报文的 节点依次写入排序队列, 实现报文重组操作, 使属于同一个数据报文的节 点连续地给出出队命令, 保证发出出队命令的顺序与调度的顺序相同, 避 免出现出队命令的报文交错和乱序。
步骤 S40,按照排序队列中出队数据报文的调度序号顺序,依次将重组 队列中存储的出队节点的子节点信息取出, 指向对应的数据报文存储位置, 发送数据报文出队指令。
根据排序队列的顺序, 将出队命令发送给寄存器, 获取对应的数据报 文, 完成数据报文的出队。 当排序队列中一个数据报文对应的节点的报文 尾标识为 1 时, 标志着一个报文出队结束, 启动另一个数据报文的出队。 当出队的节点为尾节点, 即节点包括报文尾标识时, 读取排序队列中下一 数据报文对应的节点, 并更新队列描述符的队首指针。 如果最近一次出队 的节点不是尾节点, 则队首指针保持不变。 在链表中的一个汇聚节点出队 完毕后, 接收链表释放命令, 检测到释放标志, 释放链表中汇聚节点的地 址空间, 完成数据报文的出队操作。
本实施例为了解决大规模队列管控中资源和速率的瓶颈, 使用"节点汇 聚"的方式实现单链表队列管控,解决节点占用 SRAM资源过多而引起的管 脚和布线问题, 通过单链表实现大规模队列的队列管控, 在保证线速的前 提下, 节省了片外 QDR存储器存储空间以及管脚, 降低了使用 FPGA实现 的流量管控的布板的复杂度。
如图 2所示, 图 2为本发明数据队列出队管控方法的第二实施例的流 程图。 本实施例以图 1 所示实施例为基础, 对写入重组队列的步骤进行详 细描述, 步骤 S20具体包括:
步骤 S21,按照当前链表中出队节点的绝对地址的奇偶顺序,将当前链 表中出队节点划分为奇数节点和偶数节点;
本实施例将当前链表中各节点划分为奇数节点和偶数节点, 即构成了 奇链表和偶链表, 在接收队列调度指令、 获取队列描述符和出队指针的同 时, 还可获取奇链表报文尾标识和偶链表报文尾标识。
步骤 S22, i=l ;
即: 从第一个奇数节点或第一个偶数节点开始执行后续操作。
步骤 S23, 根据第 i个奇数节点的绝对地址, 获取第 i个奇数节点的子 节点信息, 写入重组队列, 并预读第 i+1个奇数节点的子节点信息, 写入奇 链表;
根据当前奇数节点的绝对地址, 获取当前奇数节点的子节点信息, 写 入重组队列; 预读下一奇数节点的子节点信息, 写入奇链表。 具体为, 获取调度侧给出的出队队列号, 查询奇链表, 给出队列的报文起止标 识, 调度侧确定是否切换队列; 获取当前出队队列的队列描述符和出队子 指针, 以所述队列描述符和出队子指针作为地址, 读出奇数节点的子节点 信息, 写入重组队列; 预读本队列下一奇数节点的子节点信息, 得到结果 后写入奇链表。
步骤 S24, 根据第 i个偶数节点的绝对地址, 获取第 i个偶数节点的子 节点信息, 写入重组队列, 并预读第 i+1个偶数节点的子节点信息, 写入偶 链表;
根据当前偶数节点的绝对地址, 获取当前偶数节点的子节点信息, 写 入重组队列; 预读下一偶数节点的子节点信息, 写入偶链表。 具体为, 获取当前调度侧给出的出队队列号, 查询偶链表, 给出队列的报文起 止标识, 调度侧确定是否切换队列; 获取当前出队队列的队列描述符和出 队子指针, 以所述队列描述符和出队子指针作为地址, 读出偶数节点的子 节点信息, 写入重组队列; 预读下一偶数节点的子节点信息, 得到结果后 写入偶链表;
步骤 S25, 判断当前链表中是否所有节点的子节点信息均写入重组队 歹' J ; 如果是, 则结束该方法流程, 即从步骤 S20 开始结束; 如果否, 贝' J i 加 1, 返回步骤 S23。
如果当前链表中仍然有节点的子节点信息未写入重组队列, 则获取下 一奇数节点的子节点信息, 写入重组队列, 并预读再下一奇数节点的子节 点信息; 之后再获取下一偶数节点的子节点信息, 写入重组队列, 并预读 再下一偶数节点的子节点信息。 具体为,
获取调度侧给出的出队队列号(与上队列号相同), 查询奇链表, 给出 队列的报文起止标识, 调度侧确定是否切换队列; 获取队列描述符和出队 子指针, 读出下一奇数节点的子节点信息, 写入重组队列; 预读再下一奇 数节点的子节点信息, 得到结果后写入奇链表; 获取调度侧给出的出队队 列号(与上队列号相同), 查询偶链表, 给出队列的报文起止标识, 调度侧 确定是否切换队列; 获取当前出队队列的队列描述符和出队子指针, 以所 述队列描述符和出队子指针作为地址, 读出下一偶数节点的子节点信息, 写入重组队列; 预读再下一偶数节点的子节点信息, 得到结果后写入偶链 表。
奇偶链表的更新在队列出队时完成, 根据当前出队的节点的奇偶属性, 读取下一个奇数节点或者偶数节点。 在同一个汇聚节点内的按照奇偶交叉 的方式预读, 出队过程中将队列属于同一数据报文的节点进行编号, 分为 奇数节点和偶数节点, 奇数节点出队过程中, 对下一个奇数节点进行预读; 偶数节点出队过程中, 对下一个偶数节点进行预读; 预读得到的节点存储 在 FPGA的片内 RAM中, 奇链表和偶链表独立存储, 与队列相对应。 在得 到出队队列号之后, 立刻给出数据报文的出队是否完成的标志, 以切换调 度端口队列。 当汇聚节点内的最后两个节点出队时, 需要首先得到队列链 表中下一个汇聚节点的地址,考虑到片外 QDR存储器的读延时和线速要求, 在入队申请新的队列链表汇聚节点地址后, 将新的汇聚节点的首个奇数节 点的地址写入上一链表的最后一个奇数节点的子节点信息中, 新的链表的 首个偶数节点的地址写入上一链表的最后一个偶数节点的子节点信息中。 通过队列双链表预读操作, 有效提高了节点出队的效率。
如图 3所示, 图 3为本发明数据队列出队管控方法的第三实施例的流 程图。 本实施例以图 1 所示实施例为基础, 对写入排序队列的步骤进行详 细描述, 步骤 S30具体包括:
步骤 S31,监测重组队列中出队节点的子节点信息中包括的数据报文的 开始标志和开始标志到达的先后顺序;
由于队列调度交叉出队, 属于同一个数据报文的节点并不是连续的, 为了避免同一个数据报文的节点不能连续地给出出队命令的问题, 设计了 出队命令的报文重组操作。 属于同一个数据报文的节点形成的链表中, 首 节点包括开始标志, 尾节点包括报文尾标识, 按照开始标志到达的先后顺 序, 即按照同一个数据报文中首节点到达的先后顺序, 将同一数据报文的 节点依次写入排序队列, 实现报文重组操作, 使属于同一个数据报文的节 点连续地给出出队命令, 保证发出出队命令的顺序与调度的顺序相同, 避 免出现出队命令的报文交错和乱序。
步骤 S32, j=l ;
即: 从第一个到达的开始标志对应的节点开始执行后续操作。
步骤 S33, 将第 j个到达的开始标志对应的节点的调度列号写入排序队 列中;
将首个到达的开始标志对应的节点的调度列号写入排序队列中。
步骤 S34,依次将与第 j个到达的开始标志对应的节点属于同一重组队 列的数据报文的调度序号写入排序队列中;
依次将与首个到达的开始标志对应的节点属于同一重组队列的数据报 文的调度序号写入排序队列中;
步骤 S35, 判断当前写入节点的子节点信息中是否包括报文尾标识; 如 果是, 则执行步骤 S36; 如果否, 则返回步骤 S34;
步骤 S36,判断重组队列中是否所有数据报文的调度序号均写入排序队 列中; 如果是, 则结束该方法流程, 即从步骤 S30开始结束; 如果否, 贝' J j 加 1, 返回步骤 S33。
如果当前数据报文已写完, 则将下一个到达的开始标志对应的节点的 子节点信息写入排序队列中, 并依次将与下一个到达的开始标志对应的节 点属于同一数据报文的节点的子节点信息写入排序队列中。
报文重组为所有队列设置一组重组队列和一个排序队列, 根据线速的 要求和采用的时钟, 来设置重组队列的数量。 例如, 以 10个时钟周期为一 个出队时间节点, 每一个出队时间节点内完成四个不同队列的出队操作为 例, 需要设置四个重组队列, 每个队列对应一个时隙内的出队操作。 为了 实现报文出队保序, 设置一个排序队列存储各个重组队列的开始标志到达 重组队列的读取与线速要求的出队速率相同, 以每 2个周期完成一个节点 的出队为例, 重组队列实现每 2个周期读取一个队列节点, 然后根据其中 的报文尾标识字段决定是否继续读取本队列还是切换队列。 每个队列中存 储的出队命令都从队列中读出, 并且在得到第一个节点的内容后, 确定是 否读本队列的下一节点, 还是读另外的队列节点, 由于数据在队列的第三 个周期才能出队, 每 2个周期读出 1个节点的出队命令的要求为每个队列 做出预读操作, 排序队列的内容也预读。 四组重组队列和一组排序队列进 行独立预读, 存储在每个队列的预读寄存器中。 每一个重组队列的预读寄 存器, 存储队列中第一个节点的内容, 每个重组队列预读的操作是各自独 立的, 每一次预读寄存器内的内容被读取时, 都触发新的预读操作; 排序 队列也进行预读, 将下一个将要出队的队列的编号预读出来, 设置一组出 队信息寄存器, 读取排序队列的预读寄存器的值, 在出队过程中, 为选择 出队节点命令做出指示。 本实施例通过对连续出队队列的报文重组方案, 实现按照报文分割的节点调度, 整报文出队。
如图 4所示, 图 4为本发明数据队列出队管控方法的第四实施例的流 程图。 本实施例在图 1所示实施例的基础上, 增加了预读下一链表的步骤, 步骤 S20之后还包括:
步骤 S51,在当前写入节点的子节点信息中包括报文尾标识时,判断队 列在出队后是否为空; 如果是, 则执行步骤 S52; 如果否, 则执行步骤 S54; 报文尾标识用于指示每个链表的尾节点是否为报文的最后一个节点( 0 表示不是报文尾, 1代表是报文尾), 以便于预出队操作。 在初始化时对每 一个链表预先分配连续的空间, 1个链表只接收同一个数据报文的节点。
步骤 S52,提取当前写入节点的子节点信息中包括的下一链表首节点的 地址, 预读下一链表首节点的子节点信息;
步骤 S53,按照下一链表中各节点的绝对地址的奇偶顺序, 交叉获取下 一链表中各节点的子节点信息, 写入重组队列;
步骤 S54, 释放队列调度指令, 停止写入重组队列。
出队过程中, 每个链表由第一个节点出队开始, 直到最后一个节点读 出, 链表被释放。 在队列出队读空之后, 队列所属的最后一个链表节点出 队之后, 释放队列。 根据队列描述符中的队列首地址和尾地址、 以及队列 的出队子指针和入队子指针, 判断队列出队之后是否为空, 如果队列为空, 发出释放本链表的命令, 不再预读报文尾标识; 如果队列为非空, 则在队 列中预读下一链表的子节点信息, 选择对应的节点报文尾标识信息, 写入 奇偶报文尾标识链表。 本实施例通过队列空和非空属性的判断, 完成空闲 链表的维护。
如图 5所示, 图 5为本发明实施例数据队列出队管控装置的结构示意 图。 本实施例的数据队列出队管控装置, 可位于流量管控芯片中, 包括: 地址生成模块 10, 配置为接收队列调度指令, 获取队列描述符中的队 列首地址和队列的各链表中各节点的出队子指针, 组合成各节点的绝对地 址;
重组队列模块 20,配置为按照当前链表中出队节点的绝对地址的顺序, 获取当前链表中出队节点的子节点信息, 写入重组队列, 重新组合为数据 报文;
预读队列模块 30, 配置为按照出队节点的奇偶顺序, 交叉预取下次出 队节点的子节点信息, 写入奇偶链表; 并从奇偶链表中获取本次出队节点 的才艮文尾标识;
排序队列模块 40, 配置为监测重组队列中出队节点的子节点信息中包 括的数据报文的开始标志, 按照开始标志到达的先后顺序, 依次将数据报 文的调度序号写入排序队列中;
出队指令模块 50, 配置为按照排序队列中出队数据报文的调度序号, 依次将重组队列中存储的出队节点的子节点信息取出, 指向对应的数据报 文存储位置, 发送数据报文出队指令。
其中, 所述地址生成模块 10、 重组队列模块 20、 预读队列模块 30、 排 序队列模块 40 和出队指令模块 50 可由流量管控芯片中的 CPU ( Central Processing Unit, 中央处理器)、 DSP ( Digital Signal Processor, 数字信号处 理器)或 FPGA ( Field - Programmable Gate Array, 可编程逻辑阵列)实现。
本实施例的片外 QDR存储器包括队列描述符片外 QDR存储器、 链表 片外 QDR存储器和子节点信息片外 QDR存储器, 分别存储每个队列的描 述符、 队首指针和队尾指针、 汇聚节点 (即各队列链表中所有节点) 的信 息、 每个节点的子节点信息, 其中汇聚节点的信息包括队列链表中下一个 汇聚节点的首节点报文尾标识和队列链表中下一汇聚节点的地址, 子节点 信息包括节点长度和节点是否为报文尾标识。 出队操作接收来自队列调度 的出队队列号, 读取队列描述符和出队子指针, 队列描述符中包括有队列 首地址。 每个节点的实际地址由基地址加上偏移地址组成, 对于队列链表 的同一个汇聚节点内的节点的基址是相同的, 偏址为其余节点相对于同一 个链表中的第一个节点的偏移量。 由于一个链表内各个节点的地址是连续 的, 所以如果从一个汇聚节点的第一个节点开始读取, 就可以立即知道下 一个节点的地址, 而不需要等待第一次读操作的返回结果, 汇聚节点的分 配和释放以链表为基本单位。 因此, 在获取每个节点的实际地址, 即绝对 地址时, 可将队列的队首报文存储的地址和队列中各节点的出队子指针组 合成出队节点的绝对地址。 属于同一数据报文的所有节点必须写入同一个 重组队列中。 读取子节点信息片外 QDR存储器, 根据出队子指针的奇偶属 性, 将当前链表分为奇链表和偶链表, 交叉读取奇链表和偶链表中各子节 点信息, 在获取奇链表的子节点信息时, 预读偶链表的节点地址, 在获取 偶链表的子节点信息时, 预读奇链表的节点地址, 通过双链表交叉操作, 有效提高各节点的子节点信息出队效率。 奇偶链表中保存的数据报文起止 信息及时反馈给调度侧, 保证调度侧及时切换调度队列, 满足调度侧的线 速要求。
由于队列调度交叉出队, 属于同一个数据报文的节点并不是连续的, 为了避免同一个数据报文的节点不能连续地给出出队命令的问题, 提出了 出队命令的报文重组操作。 属于同一个数据报文的节点形成的链表中, 首 节点包括开始标志, 尾节点包括报文尾标识, 按照开始标志到达的先后顺 序, 即按照同一个数据报文中首节点到达的先后顺序, 将同一数据报文的 节点依次写入排序队列, 实现报文重组操作, 使属于同一个数据报文的节 点连续地给出出队命令, 保证发出出队命令的顺序与调度的顺序相同, 避 免出现出队命令的报文交错和乱序。 根据排序队列的顺序, 将出队命令发 送给寄存器, 获取对应的数据报文, 完成数据报文的出队。 当排序队列中 一个数据报文对应的节点的报文尾标识为 1时, 标志着一个报文出队结束, 启动另一个数据报文的出队。 当出队的节点为尾节点, 即节点包括报文尾 标识时, 读取排序队列中下一数据报文对应的节点, 并更新出队信息寄存 器的值。 如果最近一次出队的节点不是尾节点, 则出队信息寄存器保持不 变。 在一个链表中的节点出队完毕后, 接收链表释放命令, 检测到释放标 志, 释放链表, 完成数据报文的出队操作。
本实施例为了解决大规模队列管控中资源和速率的瓶颈, 使用"节点汇 聚"的方式实现单链表队列管控,解决节点占用 SRAM资源过多而引起的管 脚和布线问题, 通过单链表实现大规模队列的队列管控, 在保证线速的前 提下, 节省了外部片外 QDR存储器存储空间以及管脚, 减轻了使用 FPGA 实现的流量管控的布板的复杂度。
本发明实施例中, 重组队列模块 20具体配置为:
按照当前链表中出队节点的绝对地址的奇偶顺序, 将当前链表中出队 节点划分为奇数节点和偶数节点;
根据当前奇数节点的绝对地址, 获取当前奇数节点的子节点信息, 写 入重组队列; 预读下一奇数节点的子节点信息, 写入奇链表;
根据当前偶数节点的绝对地址, 获取当前偶数节点的子节点信息, 写 入重组队列; 预读下一偶数节点的子节点信息, 写入偶链表;
根据下一奇数节点的绝对地址, 获取下一奇数节点的子节点信息, 写 入重组队列; 预读再下一奇数节点的子节点信息, 写入奇链表;
根据下一偶数节点的绝对地址, 获取下一偶数节点的子节点信息, 写 入重组队列; 预读再下一偶数节点的子节点信息, 写入偶链表;
以此类推, 直至当前链表中所有节点的子节点信息均写入重组队列。 本实施例将当前链表中各节点划分为奇数节点和偶数节点, 即构成了 奇链表和偶链表, 在接收队列调度指令、 获取队列描述符和出队指针的同 时, 还可获取奇链表报文尾标识和偶链表报文尾标识。 获取调度侧给出的 出队队列号, 查询奇链表, 给出队列的报文起止标识, 调度侧确定是否切 换队列; 获取当前出队队列的队列描述符和出队子指针, 以所述队列描述 符和出队子指针作为地址, 读出奇数节点的子节点信息, 写入重组队列; 预读本队列下一奇数节点的子节点信息, 得到结果后写入奇链表。 获取当 前调度侧给出的出队队列号, 查询偶链表, 给出队列的报文起止标识, 调 度侧确定是否切换队列; 获取当前出队队列的队列描述符和出队子指针, 以所述队列描述符和出队子指针作为地址, 读出偶数节点的子节点信息, 写入重组队列; 预读下一偶数节点的子节点信息, 得到结果后写入偶链表; 如果当前链表中仍然有节点的子节点信息未写入重组队列, 则获取下一奇 数节点的子节点信息, 写入重组队列, 并预读再下一奇数节点的子节点信 息; 之后再获取下一偶数节点的子节点信息, 写入重组队列, 并预读再下 一偶数节点的子节点信息。 具体为, 获取调度侧给出的出队队列号 (与上 队列号相同), 查询奇链表, 给出队列的报文起止标识, 调度侧确定是否切 换队列; 获取队列描述符和出队子指针, 读出下一奇数节点的子节点信息, 写入重组队列; 预读再下一奇数节点的子节点信息, 得到结果后写入奇链 表; 获取调度侧给出的出队队列号(与上队列号相同), 查询偶链表, 给出 队列的报文起止标识, 调度侧确定是否切换队列; 获取当前出队队列的队 列描述符和出队子指针, 以所述队列描述符和出队子指针作为地址, 读出 下一偶数节点的子节点信息, 写入重组队列; 预读再下一偶数节点的子节 点信息, 得到结果后写入偶链表。 奇偶链表的更新在队列出队时完成, 根 据当前出队的节点的奇偶属性, 读取下一个奇数节点或者偶数节点。 在同 一个汇聚节点内的节点按照奇偶交叉的方式预读, 出队过程中将队列属于 同一数据报文的节点进行编号, 分为奇数节点和偶数节点, 奇数节点出队 过程中, 对下一个奇数节点进行预读; 偶数节点出队过程中, 对下一个偶 数节点进行预读;预读得到的节点存储在 FPGA的片内 RAM中, 奇链表和 偶链表独立存储, 与队列相对应。 在得到出队队列号之后, 立刻给出数据 报文的出队是否完成的标志, 以切换调度端口队列。 当同一链表内的最后 两个节点出队时, 需要首先得到链表节点中下一个节点, 考虑到片外 QDR 存储器的读延时和线速要求, 在入队申请新的链表时, 将新的链表的首个 奇数节点的地址写入上一链表的最后一个奇数节点的子节点信息中, 新的 链表的首个偶数节点的地址写入上一链表的最后一个偶数节点的子节点信 息中。 通过队列双链表预读操作, 有效提高了节点出队的效率。
本发明实施例中, 排序队列模块 40具体配置为:
监测重组队列中出队节点的子节点信息中包括的数据报文的开始标志 和开始标志到达的先后顺序;
将首个到达的开始标志对应的节点的调度列号写入排序队列中; 依次将与首个到达的开始标志对应的节点属于同一重组队列的数据报 文的调度序号写入排序队列中;
在当前写入节点的子节点信息中包括报文尾标识时, 下一个到达的节 点作为开始标志对应的节点, 将下一个到达的节点的调度序号写入排序队 列中;
依次将与下一个到达的开始标志对应的节点属于同一重组队列的数据 报文的调度序号写入排序队列中;
以此类推, 直至所有重组队列的所有数据报文的调度序号均写入排序 队列中。
本实施例中, 由于队列调度交叉出队, 属于同一个数据报文的节点并 不是连续的, 为了避免同一个数据报文的节点不能连续地给出出队命令的 问题, 设计了出队命令的报文重组操作。 属于同一个数据报文的节点形成 的链表中, 首节点包括开始标志, 尾节点包括报文尾标识, 按照开始标志 到达的先后顺序, 即按照同一个数据报文中首节点到达的先后顺序, 将同 一数据报文的节点依次写入排序队列, 实现报文重组操作, 使属于同一个 数据报文的节点连续地给出出队命令, 保证发出出队命令的顺序与调度的 顺序相同, 避免出现出队命令的报文交错和乱序。 报文重组为所有队列设 置一组重组队列和一个排序队列, 根据线速的要求和采用的时钟, 来设置 重组队列的数量。 例如, 以 10个时钟周期为一个出队时间节点, 每一个出 队时间节点内完成四个不同队列的出队操作为例, 需要设置四个重组队列, 每个队列对应一个时隙内的出队操作。 为了实现报文出队保序, 设置一个 排序队列存储出队个重组队列的开始标志到达的顺序, 实现队列报文的出 队命令按照队列调度的顺序由重组队列中读出。 重组队列的读取与线速要 求的出队速率相同, 以每 2个周期完成一个节点的出队为例, 重组队列实 现每 2个周期读取一个队列节点, 然后根据其中的报文尾标识字段决定是 否继续读取本队列还是切换队列。 每个队列中存储的出队命令都从队列中 读出, 并且在得到第一个节点的内容后, 确定是否读本队列的下一节点还 是读另外的队列节点, 由于数据在队列的第三个周期才能出队, 每 2个周 期读出 1 个节点的出队命令的要求为每个队列做出预读操作, 排序队列的 内容也预读。 四组重组队列和一组排序队列进行独立预读, 存储在每个队 列的预读寄存器中。 每一个重组队列的预读寄存器, 存储队列中第一个节 点的内容, 每个重组队列预读的操作是各自独立的, 每一次预读寄存器内 的内容被读取时, 都触发新的预读操作; 排序队列也进行预读, 将下一个 将要出队的队列的编号预读出来, 设置一组出队信息寄存器, 读取排序队 列的预读寄存器的值, 在出队过程中, 为选择出队节点命令做出指示。 本 实施例通过对连续出队队列的报文重组方案, 实现按照报文分割的节点调 度, 整报文出队。
本发明实施例中, 重组队列模块 20还配置为: 在当前写入节点的子节点信息中包括报文尾标识时, 判断队列在出队 后是否为空;
当队列在出队后为非空时, 提取当前写入节点的子节点信息中包括的 下一链表首节点的地址, 预读下一链表首节点的子节点信息;
按照下一链表中各节点的绝对地址的奇偶顺序, 交叉获取下一链表中 各节点的子节点信息, 写入重组队列。
本发明实施例中, 重组队列模块 20还配置为:
当队列在出队后为空时, 释放队列调度指令, 停止写入重组队列的步 骤。
本实施例报文尾标识用于指示每个链表的尾节点是否为报文的最后一 个节点 (0表示不是报文尾, 1 代表是报文尾), 以便于预出队操作。 在初 始化时对每一个链表预先分配连续的空间, 1个链表只接收同一个数据报文 的节点。 出队过程中, 每个链表由第一个节点出队开始, 直到最后一个节 点读出, 链表被释放。 在队列出队读空之后, 队列所属的最后一个链表节 点出队之后, 释放队列。 根据队列描述符中的队列首地址和尾地址、 以及 队列的出队子指针和入队子指针, 判断队列出队之后是否为空, 如果队列 为空, 发出释放本链表的命令, 不再预读报文尾标识。 如果队列为非空, 则在队列中预读下一链表的子节点信息, 选择对应的节点报文尾标识信息, 写入奇偶报文尾标识链表。 本实施例通过队列空和非空属性的判断, 完成 空闲链表的维护。
本领域内的技术人员应明白, 本发明的实施例可提供为方法、 装置、 或计算机程序产品。 因此, 本发明可采用硬件实施例、 软件实施例、 或结 合软件和硬件方面的实施例的形式。 而且, 本发明可采用在一个或多个其 中包含有计算机可用程序代码的计算机可用存储介质 (包括但不限于磁盘 存储器和光学存储器等)上实施的计算机程序产品的形式。 本发明是参照根据本发明实施例的方法、 设备(装置)、 和计算机程序 产品的流程图和 /或方框图来描述的。 应理解可由计算机程序指令实现流程 图和 /或方框图中的每一流程和 /或方框、以及流程图和 /或方框图中的流程和 /或方框的结合。 可提供这些计算机程序指令到通用计算机、 专用计算机、 嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器, 使得 通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现 在流程图一个流程或多个流程和 /或方框图一个方框或多个方框中指定的功 能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理 设备以特定方式工作的计算机可读存储器中, 使得存储在该计算机可读存 储器中的指令产生包括指令装置的制造品, 该指令装置实现在流程图一个 流程或多个流程和 /或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备 上, 使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机 实现的处理, 从而在计算机或其他可编程设备上执行的指令提供用于实现 在流程图一个流程或多个流程和 /或方框图一个方框或多个方框中指定的功 能的步骤。
以上所述仅为本发明的优选实施例, 并非因此限制本发明的专利范围, 凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换, 或直 接或间接运用在其他相关的技术领域, 均同理包括在本发明的专利保护范 围内。

Claims

权利要求书
1、 一种数据队列出队管控方法, 该方法包括:
接收队列调度指令, 获取队列描述符中的队列首地址和所述队列的出 队链表中出队节点的出队子指针, 将所述队列首地址和所述出队子指针组 合成出队节点的绝对地址;
按照当前链表中出队节点的所述绝对地址的顺序, 获取当前链表中出 队节点的子节点信息, 写入重组队列, 重新组合为数据报文; 按照当前链 表中出队节点的奇偶顺序, 交叉预取下次出队节点的子节点信息, 写入奇 偶链表, 并从奇偶链表中预取下次出队节点的报文尾标识;
监测所述重组队列中出队节点的子节点信息中包括的数据报文的开始 标志, 按照所述开始标志到达的先后顺序, 依次将数据报文的调度序号写 入排序队列中;
按照所述排序队列中出队数据报文的调度序号顺序, 依次将重组队列 中存储的出队节点的子节点信息取出, 指向对应的数据报文存储位置, 发 送数据报文出队指令。
2、 根据权利要求 1所述的数据队列出队管控方法, 其中, 所述重新组 合数据报文, 以及预取下次出队节点的报文尾标识的步骤, 包括:
按照当前链表中出队节点的绝对地址的奇偶顺序, 将当前链表中出队 节点划分为奇数节点和偶数节点;
根据当前奇数节点的绝对地址, 获取当前奇数节点的子节点信息, 写 入重组队列; 预读下一奇数节点的子节点信息, 写入奇链表;
根据当前偶数节点的绝对地址, 获取当前偶数节点的子节点信息, 写 入重组队列; 预读下一偶数节点的子节点信息, 写入偶链表;
根据下一奇数节点的绝对地址, 获取下一奇数节点的子节点信息, 写 入重组队列; 预读再下一奇数节点的子节点信息, 写入奇链表; 根据下一偶数节点的绝对地址, 获取下一偶数节点的子节点信息, 写 入重组队列; 预读再下一偶数节点的子节点信息, 写入偶链表;
以此类推, 直至当前链表中所有节点的子节点信息均写入重组队列。
3、 根据权利要求 1所述的数据队列出队管控方法, 其中, 所述将数据 报文的调度序号写入排序队列中的步骤, 包括:
监测所述重组队列中出队节点的子节点信息中包括的数据报文的开始 标志和所述开始标志到达的先后顺序;
将首个到达的开始标志对应的节点的调度列号写入排序队列中; 依次将与所述首个到达的开始标志对应的节点属于同一重组队列的数 据报文的调度序号写入排序队列中;
在当前写入节点的子节点信息中包括报文尾标识时, 下一个到达的节 点作为开始标志对应的节点, 将所述下一个到达的节点的调度序号写入排 序队列中;
依次将与所述下一个到达的开始标志对应的节点属于同一重组队列的 数据报文的调度序号写入排序队列中;
以此类推, 直至所有重组队列的所有数据报文的调度序号均写入排序 队列中。
4、根据权利要求 1至 3中任一项所述的数据队列出队管控方法,其中, 所述从奇偶链表中预取下次出队节点的报文尾标识的步骤之后, 该方法还 包括:
在当前写入节点的子节点信息中包括报文尾标识时, 判断所述队列在 出队后是否为空;
当所述队列在出队后为非空时, 提取当前写入节点的子节点信息中包 括的下一链表首节点的地址, 预读下一链表首节点的子节点信息;
按照下一链表中出队节点的绝对地址的奇偶顺序, 交叉获取下一链表 中出队节点的子节点信息, 写入重组队列。
5、 根据权利要求 4所述的数据队列出队管控方法, 其中, 所述在当前 写入节点的子节点信息中包括报文尾标识时, 判断所述队列在出队后是否 为空的步骤之后, 该方法还包括:
当所述队列在出队后为空时, 释放队列调度指令, 停止写入重组队列 的操作。
6、 一种数据队列出队管控装置, 该装置包括:
地址生成模块, 配置为接收队列调度指令, 获取队列描述符中的队列 首地址和所述队列的出队链表中出队节点的出队子指针, 将所述队列首地 址和所述出队子指针组合成出队节点的绝对地址;
重组队列模块, 配置为按照当前链表中出队节点的所述绝对地址的顺 序, 获取当前链表中出队节点的子节点信息, 写入重组队列, 重新组合为 数据报文;
预读队列模块, 配置为按照当前链表中出队节点的奇偶顺序, 交叉预 取下次出队节点的子节点信息, 写入奇偶链表, 并从奇偶链表中预取下次 出队节点的报文尾标识;
排序队列模块, 配置为监测所述重组队列中出队节点的子节点信息中 包括的数据报文的开始标志, 按照所述开始标志到达的先后顺序, 依次将 数据报文的调度序号写入排序队列中;
出队指令模块, 配置为按照所述排序队列中出队数据报文的调度序号, 依次将重组队列中存储的出队节点的子节点信息取出, 指向对应的数据报 文存储位置, 发送数据报文出队指令。
7、 根据权利要求 6所述的数据队列出队管控装置, 其中, 所述重组队 列模块配置为:
按照当前链表中出队节点的绝对地址的奇偶顺序, 将当前链表中出队 节点划分为奇数节点和偶数节点;
根据当前奇数节点的绝对地址, 获取当前奇数节点的子节点信息, 写 入重组队列; 预读下一奇数节点的子节点信息, 写入奇链表;
根据当前偶数节点的绝对地址, 获取当前偶数节点的子节点信息, 写 入重组队列; 预读下一偶数节点的子节点信息, 写入偶链表;
根据下一奇数节点的绝对地址, 获取下一奇数节点的子节点信息, 写 入重组队列; 预读再下一奇数节点的子节点信息, 写入奇链表;
根据下一偶数节点的绝对地址, 获取下一偶数节点的子节点信息, 写 入重组队列; 预读再下一偶数节点的子节点信息, 写入偶链表;
以此类推, 直至当前链表中所有节点的子节点信息均写入重组队列。
8、 根据权利要求 6所述的数据队列出队管控装置, 其中, 所述排序队 列模块配置为:
监测所述重组队列中出队节点的子节点信息中包括的数据报文的开始 标志和所述开始标志到达的先后顺序;
将首个到达的开始标志对应的节点的调度列号写入排序队列中; 依次将与所述首个到达的开始标志对应的节点属于同一重组队列的数 据报文的调度序号写入排序队列中;
在当前写入节点的子节点信息中包括报文尾标识时, 下一个到达的节 点作为开始标志对应的节点, 将所述下一个到达的节点的调度序号写入排 序队列中;
依次将与所述下一个到达的开始标志对应的节点属于同一重组队列的 数据报文的调度序号写入排序队列中;
以此类推, 直至所有重组队列的所有数据报文的调度序号均写入排序 队列中。
9、根据权利要求 6至 8中任一项所述的数据队列出队管控装置,其中, 所述重组队列模块还配置为:
在当前写入节点的子节点信息中包括报文尾标识时, 判断所述队列在 出队后是否为空;
当所述队列在出队后为非空时, 提取当前写入节点的子节点信息中包 括的下一链表首节点的地址, 预读下一链表首节点的子节点信息;
按照下一链表中出队节点的绝对地址的奇偶顺序, 交叉获取下一链表 中出队节点的子节点信息, 写入重组队列。
10、 根据权利要求 9所述的数据队列出队管控装置, 其中, 所述重组 队列模块还配置为:
当所述队列在出队后为空时, 释放队列调度指令, 停止写入重组队列 的操作。
PCT/CN2013/090148 2013-01-06 2013-12-20 数据队列出队管控方法和装置 WO2014106436A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310003565.0 2013-01-06
CN201310003565.0A CN103914341B (zh) 2013-01-06 2013-01-06 数据队列出队管控方法和装置

Publications (1)

Publication Number Publication Date
WO2014106436A1 true WO2014106436A1 (zh) 2014-07-10

Family

ID=51040046

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/090148 WO2014106436A1 (zh) 2013-01-06 2013-12-20 数据队列出队管控方法和装置

Country Status (2)

Country Link
CN (1) CN103914341B (zh)
WO (1) WO2014106436A1 (zh)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106254270A (zh) * 2015-06-15 2016-12-21 深圳市中兴微电子技术有限公司 一种队列管理方法及装置
CN106325758B (zh) * 2015-06-17 2019-10-22 深圳市中兴微电子技术有限公司 一种队列存储空间管理方法及装置
CN108234348B (zh) * 2016-12-13 2020-09-25 深圳市中兴微电子技术有限公司 一种队列操作中的处理方法及装置
US11023275B2 (en) * 2017-02-09 2021-06-01 Intel Corporation Technologies for queue management by a host fabric interface
CN109144742B (zh) * 2017-06-15 2020-02-07 北京忆芯科技有限公司 通过队列交换信息的方法和处理队列的系统
CN108763116B (zh) * 2018-05-21 2021-08-06 南京大学 一种基于贪婪式算法的多通道ddr控制器
CN110837414B (zh) * 2018-08-15 2024-04-12 京东科技控股股份有限公司 任务处理方法和装置
CN111930307B (zh) * 2020-07-30 2022-06-17 北京浪潮数据技术有限公司 一种数据读取方法、装置、设备及计算机可读存储介质
CN111796306B (zh) * 2020-07-31 2023-05-02 北京中捷时代航空科技有限公司 一种导航卫星信号接收方法及接收机
CN112118262B (zh) * 2020-09-21 2022-07-29 武汉中元华电科技股份有限公司 一种基于动态内存分配实现数据排序与合并的系统及方法
CN113595932B (zh) * 2021-08-06 2024-05-14 上海金仕达软件科技股份有限公司 数据乱序报文的处理方法及专用集成电路
CN114185693A (zh) * 2021-11-22 2022-03-15 西安空间无线电技术研究所 一种可自修复的多结点聚合共享队列管理方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101594302A (zh) * 2009-07-01 2009-12-02 华为技术有限公司 数据出队的方法及装置
CN101854309A (zh) * 2010-06-18 2010-10-06 中兴通讯股份有限公司 报文输出的管理方法和装置
CN102437929A (zh) * 2011-12-16 2012-05-02 华为技术有限公司 队列管理中的数据出队方法及装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7558197B1 (en) * 2002-01-17 2009-07-07 Juniper Networks, Inc. Dequeuing and congestion control systems and methods

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101594302A (zh) * 2009-07-01 2009-12-02 华为技术有限公司 数据出队的方法及装置
CN101854309A (zh) * 2010-06-18 2010-10-06 中兴通讯股份有限公司 报文输出的管理方法和装置
CN102437929A (zh) * 2011-12-16 2012-05-02 华为技术有限公司 队列管理中的数据出队方法及装置

Also Published As

Publication number Publication date
CN103914341B (zh) 2018-09-25
CN103914341A (zh) 2014-07-09

Similar Documents

Publication Publication Date Title
WO2014106436A1 (zh) 数据队列出队管控方法和装置
US11216408B2 (en) Time sensitive networking device
US8472457B2 (en) Method and apparatus for queuing variable size data packets in a communication system
JP6535253B2 (ja) 複数のリンクされるメモリリストを利用する方法および装置
CN103946803B (zh) 具有高效工作排队的处理器
WO2016179968A1 (zh) 一种队列管理方法、装置及存储介质
WO2017157110A1 (zh) 高速访问双倍速率同步动态随机存储器的控制方法及装置
WO2016011894A1 (zh) 报文处理方法和装置
WO2018107681A1 (zh) 一种队列操作中的处理方法、装置及计算机存储介质
WO2016202120A1 (zh) 一种队列存储空间管理方法及装置、计算机存储介质
WO2012027959A1 (zh) 一种多处理器系统及其同步引擎装置
US20110219195A1 (en) Pre-fetching of data packets
US10248350B2 (en) Queue management method and apparatus
US11425057B2 (en) Packet processing
CN111382327A (zh) 一种字符串匹配装置及方法
WO2011015055A1 (zh) 一种存储管理的方法和系统
US9678891B2 (en) Efficient search key controller with standard bus interface, external memory interface, and interlaken lookaside interface
CN104065588B (zh) 一种数据包调度和缓存的装置及方法
CN105099957B (zh) 一种基于软件查表的数据包转发方法
WO2012055319A1 (zh) 调度tcam查询和刷新消息的方法和装置
TW201203099A (en) Packet buffer memory
US20160011994A1 (en) Multi-processor with efficient search key processing
WO2016202113A1 (zh) 一种队列管理方法、装置及存储介质
CN109800558A (zh) 密码服务板卡以及密码服务装置
US9594706B2 (en) Island-based network flow processor with efficient search key processing

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: 13870319

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: 13870319

Country of ref document: EP

Kind code of ref document: A1