Summary of the invention
The embodiment of the present invention provides a kind of method and apparatus of queue scheduling, in the situation that treat that the performance of scheduling queue surpasses system list queue processing ability, still can realize the scheduling to this queue.
To achieve these goals, the embodiment of the present invention provides a kind of method of queue scheduling, comprising:
To enter that queue is tied to common port and/or non-common port is dispatched;
Logic port level scheduler is set, according to pre-configured scheduling mode, dispatch described common end mouth and/or non-common port, the enter a plurality of subqueues and/or common port queue corresponding to described common port that after queue fractionation, obtain that described non-common port is corresponding are authorized, wherein, described common port and non-common ports share bandwidth;
By authorized subqueue and/common port queue puts into register, and carries out first order burst scheduling;
In described subqueue, carry out after first order burst scheduling, described subqueue is write respectively to corresponding FIFO first-in first-out, and record by sequence FIFO the order that the packet header sign of each subqueue enters FIFO, according to the FIFO in described sequence FIFO, number corresponding FIFO reading out data until read bag tail, again read described sequence FIFO;
The data that data in described FIFO and/or described common port queue are carried out after first order burst scheduling are carried out second level burst scheduling.
Describedly will enter queue and be tied to common port and/or non-common port and dispatch and comprise:
According to joining the team described in preset strategy judgement, classify non-common port queue or common port queue as, described non-common port queue is split into a plurality of subqueues, be tied on non-common port and dispatch, described common port queue is tied on common port and is dispatched, wherein, described non-common port and common port are logic port, the corresponding a plurality of physical ports of each non-common port, the corresponding physical port of each common port.
The described logic port level scheduler that arranges comprises:
At physical port, corresponding scheduler subordinate arranges logic port level scheduler, and described logic port level scheduler is corresponding with logic port.
Describedly according to pre-configured scheduling mode, dispatch described common end mouth and non-common port comprises:
To described common port and non-common port, adopt polling dispatching mode or strict priority scheduling mode to dispatch.
Describedly carry out first order burst scheduling and comprise: according to the burst of fixed size and time slot, subqueue and/or common port queue are dispatched.
Describedly carry out first order burst scheduling and comprise:
Once, once, x is natural number to the every x/n of a described non-common port periodic scheduling to the every x of a described common port periodic scheduling, and n is the number of the register that described non-common port is corresponding.
Describedly carry out first order burst scheduling and comprise the one or more of the following content of output: the register label of physical port number, common port/non-common port designations, physical queue number, packet header and bag tail tag will, non-common port polling.
Data in described FIFO and/or described common port queue are carried out to data after first order burst scheduling to carry out second level burst scheduling and comprises:
Give each burst marking to indicate that this burst is from common port or non-common port.
The embodiment of the present invention also provides a kind of device of queue scheduling, comprising:
Enter queue processing unit, for entering, queue will be tied to common port and/or non-common port is dispatched;
Authorisation process unit, be used for arranging logic port level scheduler, according to pre-configured scheduling mode, dispatch described common end mouth and non-common port, described a plurality of subqueues and/or common port queue are authorized, wherein, described common port and non-common ports share bandwidth;
First order burst scheduling unit, for by authorized subqueue and/common port queue puts into register, and carries out first order burst scheduling;
Bag recomposition unit, for carrying out after first order burst scheduling in described subqueue, described subqueue is write respectively to corresponding FIFO first-in first-out, and record by sequence FIFO the order that the packet header sign of each subqueue enters FIFO, according to the FIFO in described sequence FIFO, number corresponding FIFO reading out data until read bag tail, again read described sequence FIFO;
Second level burst scheduling unit, the data of carrying out after first order burst scheduling for the data in described FIFO and/or described common port queue are carried out second level burst scheduling.
Described enter queue processing unit also for: according to preset strategy, judgement is joined the team and is classified non-common port queue or common port queue as, described non-common port queue is split into a plurality of subqueues, be tied on non-common port and dispatch, described common port queue is tied on common port and is dispatched, wherein, described non-common port and common port are logic port, the corresponding a plurality of physical ports of each non-common port, the corresponding physical port of each common port.
Described authorisation process unit also for: at physical port, corresponding scheduler subordinate arranges logic port level scheduler, and described logic port level scheduler is corresponding with logic port.
Described first order burst scheduling unit also for: to described common port and non-common port, adopt polling dispatching mode or strict priority scheduling mode to dispatch.
Described first order burst scheduling unit also for: according to the burst of fixed size and time slot, subqueue and/or common port queue are dispatched.
Described first order burst scheduling unit also for: described in every x periodic scheduling, once, once, x is natural number to non-common port to common port described in every x/n periodic scheduling, and n is the number of the register that described non-common port is corresponding.
Described first order burst scheduling unit also for: export the one or more of following content: the register label of physical port number, common port/non-common port designations, physical queue number, packet header and bag tail tag will, non-common port polling.
Described second level burst scheduling unit also for: give each burst marking to indicate that this burst is from common port or non-common port.
In the method and apparatus that the embodiment of the present invention provides, non-common port queue is split into a plurality of subqueues to be tied on non-common port and to dispatch, and by increasing logic port level scheduler, non-common port and common ports share bandwidth are dispatched, solved and treated that the performance of scheduling queue surpasses the processing problem of queue in the situation of system list queue processing ability.Meanwhile, by twin-stage burst, dispatch and wrap restructuring and guaranteed the integrality of packet, and make full use of time interval resource, improved the bag forward efficiency of system.
Embodiment
For making the object, technical solutions and advantages of the present invention clearer, hereinafter in connection with accompanying drawing, embodiments of the invention are elaborated.It should be noted that, in the situation that not conflicting, the embodiment in the application and the feature in embodiment be combination in any mutually.
Main thought of the present invention is: the particular queue that some queue performances is exceeded to system list queue processing ability is tied on non-common port, finally be mapped on common port, non-common end oral instruction power is unified to process, share common port resource, improve system effectiveness.Further, utilize two-stage burst scheduling to add bag reorganization scheme, guarantee that completing property of message makes full use of time interval resource simultaneously, according to the scheduling of configurable burst size, improve the dispatching of total port.Wherein, non-common port and common port are logic port, the corresponding a plurality of physical ports of each non-common port, the corresponding physical port of each common port.
The embodiment of the present invention provides a kind of method of queue scheduling, as shown in Figure 1, comprising:
Step 101, carries out queue type's judgement and bag processing to the queue that enters receiving.
According to preset strategy, judgement is joined the team and is classified non-common port queue or common port queue as, this preset strategy is for example: set in advance the corresponding relation of type of service and port type, according to the type of service that enters queue, judge that it is non-common port queue or common port queue.Non-common port queue is split into a plurality of subqueues, be tied on non-common port and dispatch, common port queue is tied on common port and is dispatched.Entering to wrap in processing procedure, can also use the counter of a 2bit, for recording the chained list situation that current non-common port queue uses the 0th, 1,2,3 physical queue number of this polymerization queue (with respect to), as shown in Figure 2, when having non-common port queue to join the team, the physical queue number that current block should write equals polymerization queue number+current chained list counter.Because the pattern of current queue can be joined, any chained list is all likely configured to non-common port queue or common port queue, so current each queue should be reserved this counter, for common port queue, this counter can only be 0.
Step 102, carries out authorisation process to non-common port queue and/or common port queue.
As shown in Figure 3, the authorization module of chip arranges logic port level scheduler below physical port level scheduler.Logic port level scheduler is bound processing to all non-common port unifications, and the QOS mode of non-common port and common port configurable (for example strict priority scheduling mode, polling dispatching mode), non-common port and common port are shared bandwidth, thereby reach the flow of non-common port the most at last, are mapped to the object on physical port.Logic port level scheduler splits to non-common port queue a plurality of subqueues and/or the common port queue that obtain and authorizes, and subsequent treatment is carried out in authorized queue.
Step 103, carries out first order burst scheduling to non-common port queue and/or common port queue.
Each subqueue of non-common port and common port queue are put in each register, each subqueue and common port equalization are dispatched according to fixing burst size, burst size is configurable, the time slot of scheduling is fixed, reduced conflict, according to burst, go deduction to authorize surplus simultaneously, further reduce conflict.As shown in Figure 4, once, once, wherein, x is natural number to the every x/n of a non-common port periodic scheduling to the every x of a common port periodic scheduling, and n is the number of the register that non-common port is corresponding.Common port and non-port carry out polling dispatching according to fixing burst, non-common port carries out polling dispatching at reg0 to regn-1, and it is following one or more that scheduling output comprises: the reg label (reg0...regn-1) of physical port number, common port/non-common port designations, physical queue number, packet header and bag tail tag will, non-common port polling.
Step 104, wraps restructuring to the first order burst scheduling result of non-common port queue and processes.
During first order burst scheduling can there is out of order situation in the message of non-common port, and can be mapped to final common port, can have the out of order of non-common port bag, in the embodiment of the present invention, first order burst scheduling result wrapped to restructuring and process.Bag restructuring completes by some row FIFO, wherein, sequence FIFO is for sorting to the sop of first order burst (packet header sign), first other FIFO, for depositing the burst information that first order burst scheduler schedules is come, need to read sequence FIFO while reading the data in FIFO, if sequence FIFO non-NULL, according to the FIFO in sequence FIFO, number corresponding FIFO reading out data until read bag tail, again read sequence FIFO, if non-NULL repeats top-operation.Example as shown in Figure 5, bag restructuring is processed and is undertaken by n FIFO, each FIFO0...FIFOn-1 is corresponding one by one to regn-1 with the reg0 in Fig. 4, has in addition a sequence FIFO, is used for recording the order that packet header sign enters FIFO0-FIFOn-1, if sequence FIFO non-NULL, read read data packet in the FIFO that FIFO wherein numbers reference numeral, until read bag tail, again read sequence FIFO, if non-NULL, repeats top-operation.
Step 105, carries out second level burst scheduling to non-common port queue and/or data corresponding to common port queue.
Wrap the long bag of complete packet scheduling of having recombinated and have long time space, there is the burst of flow, in the embodiment of the present invention, adopt in FIFO with the mode with walking, first section and common port in the FIFO of scheduling carry out second level burst scheduling at first, and the section marking of common port and non-common port is distinguished, improved the performance of system.Still take Fig. 5 as example, the time delay bringing in order to shorten bag restructuring, as long as have burst size data can carry out burst scheduling in FIFO0-FIFOn-1, non-common port burst size data and common port burst data are carried out burst scheduling again, as long as be from common port and non-common port to each burst mark, the order that has guaranteed bag, has improved again dispatching efficiency.As shown in Figure 6, for dequeue schematic diagram, after first order burst scheduling, non-common port data wraps recomposition unit, common port data enters common port burst buffer unit, then wrap recomposition unit and common port burst buffer unit data are transmitted to second level burst scheduling unit, carry out second level burst scheduling.
By the method that adopts the embodiment of the present invention to provide, non-common port queue is split into a plurality of subqueues to be tied on non-common port and to dispatch, and by increasing logic port level scheduler, non-common port and common ports share bandwidth are dispatched, solved and treated that the performance of scheduling queue surpasses the processing problem of queue in the situation of system list queue processing ability.Meanwhile, by twin-stage burst, dispatch and wrap restructuring and guaranteed the integrality of packet, and make full use of time interval resource, improved the bag forward efficiency of system.
Technical conceive based on identical with said method embodiment, the embodiment of the present invention also provides a kind of device of queue scheduling, as shown in Figure 7, comprising:
Enter queue processing unit 10, for entering, queue will be tied to common port and/or non-common port is dispatched;
Authorisation process unit 20, be used for arranging logic port level scheduler, according to pre-configured scheduling mode, dispatch described common end mouth and non-common port, the enter a plurality of subqueues and/or common port queue corresponding to described common port that after queue fractionation, obtain that described non-common port is corresponding are authorized, wherein, described common port and non-common ports share bandwidth;
First order burst scheduling unit 30, for by authorized subqueue and/common port queue puts into register, and carries out first order burst scheduling;
Bag recomposition unit 40, for carrying out after first order burst scheduling in described subqueue, described subqueue is write respectively to corresponding FIFO first-in first-out, and record by sequence FIFO the order that the packet header sign of each subqueue enters FIFO, according to the FIFO in described sequence FIFO, number corresponding FIFO reading out data until read bag tail, again read described sequence FIFO;
Second level burst scheduling unit 50, the data of carrying out after first order burst scheduling for the data in described FIFO and/or described common port queue are carried out second level burst scheduling.
Preferably, described enter queue processing unit 10 also for: according to preset strategy, judgement is joined the team and is classified non-common port queue or common port queue as, described non-common port queue is split into a plurality of subqueues, be tied on non-common port and dispatch, described common port queue is tied on common port and is dispatched, and wherein, described non-common port and common port are logic port, the corresponding a plurality of physical ports of each non-common port, the corresponding physical port of each common port.
Preferably, described authorisation process unit 20 also for: at physical port, corresponding scheduler subordinate arranges logic port level scheduler, and described logic port level scheduler is corresponding with logic port.
Described first order burst scheduling unit 30 also for: to described common port and non-common port, adopt polling dispatching mode or strict priority scheduling mode to dispatch.
Described first order burst scheduling unit 30 also for: according to the burst of fixed size and time slot, subqueue and/or common port queue are dispatched.
Described first order burst scheduling unit 30 also for: described in every x periodic scheduling, once, once, x is natural number to non-common port to common port described in every x/n periodic scheduling, and n is the number of the register that described non-common port is corresponding.
Described first order burst scheduling unit 30 also for: export the one or more of following content: the register label of physical port number, common port/non-common port designations, physical queue number, packet header and bag tail tag will, non-common port polling.
Described second level burst scheduling unit 50 also for: give each burst marking to indicate that this burst is from common port or non-common port.
By the device that adopts the embodiment of the present invention to provide, non-common port queue is split into a plurality of subqueues to be tied on non-common port and to dispatch, and by increasing logic port level scheduler, non-common port and common ports share bandwidth are dispatched, solved and treated that the performance of scheduling queue surpasses the processing problem of queue in the situation of system list queue processing ability.Meanwhile, by twin-stage burst, dispatch and wrap restructuring and guaranteed the integrality of packet, and make full use of time interval resource, improved the bag forward efficiency of system.
One of ordinary skill in the art will appreciate that all or part of step in said method can come instruction related hardware to complete by program, described program can be stored in computer-readable recording medium, as read-only memory, disk or CD etc.Alternatively, all or part of step of above-described embodiment also can realize with one or more integrated circuits.Correspondingly, each the module/unit in above-described embodiment can adopt the form of hardware to realize, and also can adopt the form of software function module to realize.The present invention is not restricted to the combination of the hardware and software of any particular form.