A programmable scheduled flow control method and apparatus

CN118842754BActive Publication Date: 2026-10-20WUXI STARS MICRO SYSTEM TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411116738.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2026-10-20
Estimated Expiration
2044-08-14

AI Technical Summary

Technical Problem

[0004]从以上传统调度流程可以看出,当节点个数增多时,父子节点的映射关系将导致物理实现难以实现,如果采用从端口层往流队列层的反向调度流程,虽然可以解决物理实现的难题,却又无法感知上面层节点的速率现在状态,导致可能在中间由于节点速率限制无法继续到达流队列层的空调度,从而导致性能损失

Benefits of technology

[0034]调度器在新一轮调度流程中,在端口节点即可确定能调度到流队列节点不会阻塞在中间层,导致空调度。整个调度架构只需要一个调度器,大大减少了逻辑资源。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118842754B_ABST
    Figure CN118842754B_ABST
Patent Text Reader

Abstract

The application provides a programmable scheduling flow control method and device. A rate limiting event is triggered when the number of tokens of a node changes from greater than or equal to a threshold value to less than the threshold value, and a rate limiting release event is triggered when the number of tokens changes from less than the threshold value to greater than or equal to the threshold value; the number of branches of a flow queue layer to each node that are not rate limited and are rate limited is recorded by using a counter, so as to send a non-zero state of a non-rate limited branch from a port node to a target flow queue node to a scheduler, wherein the target flow queue node is located on the non-rate limited branch of the port node; in response to detecting a node enqueueing, dequeueing, rate limiting or rate limiting release event, the counter value of the flow queue node is updated according to the rate limiting state of the flow queue node, and the counter values of parent nodes of each layer are updated according to the rate limiting states of the parent nodes of each layer until the port node. The application reduces performance loss caused by empty scheduling in reverse scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of programmable scheduling, and specifically relates to a flow control method and apparatus for programmable scheduling. Background Technology

[0002] In traditional hierarchical scheduling structures for transmission directions, a forward scheduling process is used from the stream queue layer to the port layer, for example:

[0003] First, scan the bitmap of the flow queue layer nodes to find nodes that are not rate-limited. Based on the mapping relationship between flow queues and flow queue layer nodes, obtain and record the flow queue IDs attached to these nodes. Next, scan the bitmap of the user layer nodes to find the parent nodes that are not rate-limited. Based on the parent-child mapping relationship between flow queue layer nodes and user layer nodes and the scheduling algorithm, determine all child nodes scheduled from this layer. Based on the results of the previous step, obtain and record the flow queue IDs scheduled from this layer. Then, scan the bitmap of the traffic class (TC) layer nodes to find the grandparent nodes that are not rate-limited. Based on the parent-child mapping relationship between user layer nodes and TC layer nodes and the scheduling algorithm, determine the child nodes that can be scheduled from this layer. Based on the results of the previous step, obtain and record the flow queue IDs scheduled from this layer. Repeat the above operations until the port layer determines the child nodes that can be scheduled from that port, finally obtaining the flow queue IDs scheduled from that port.

[0004] As can be seen from the traditional scheduling process above, when the number of nodes increases, the mapping relationship between parent and child nodes will make physical implementation difficult. If a reverse scheduling process from the port layer to the flow queue layer is adopted, although the problem of physical implementation can be solved, it is impossible to perceive the current speed status of the upper layer nodes, which may result in the node speed being unable to continue to reach the flow queue layer for air conditioning due to node speed limitations, thus causing performance loss. Summary of the Invention

[0005] To address the problems in related technologies, this application provides a programmable scheduling flow control method and apparatus, which aims to avoid performance loss caused by air conditioning in reverse scheduling.

[0006] According to a first aspect of this application, a programmable scheduling flow control method is provided, comprising:

[0007] When a queue dequeue event occurs at any flow queue layer node in the hierarchical scheduling structure, the number of tokens on all nodes in the entire branch from that node to the port node is reduced. When the number of tokens of a node changes from greater than or equal to a preset threshold value to less than a preset threshold value, a rate limiting event for that node is triggered. When the number of tokens of a node changes from less than the preset threshold value to greater than or equal to the preset threshold value, a rate limiting release event for that node is triggered.

[0008] For each node, a counter is used to record the number of unrate-limited branches and the number of rate-limited branches from the flow queue layer to that node, so as to send the non-zero unrate-limited state from the port node to the target flow queue node, wherein the target flow queue node is located on the unrate-limited branch of the port node;

[0009] In response to the detection of a queue enqueue event, queue dequeue event, rate limit event, or rate limit release event on a node, the counter value of the node is updated according to the rate limit status of the node, and the counter values ​​of each parent node in the branch to which the node belongs are updated according to the rate limit status of each parent node, up to the port node.

[0010] In an optional implementation, when a queue dequeue event occurs at any flow queue layer node in the hierarchical scheduling structure, the number of tokens on all nodes in the entire branch from that node to the port node is reduced, further including:

[0011] Credit values ​​are periodically filled into the token bucket of each node according to a pre-configured rate. When a queue is scheduled out of a node, the number of tokens matching the length of the queue message is taken out of the node's token bucket.

[0012] In an optional implementation, sending the non-zero, unrate-limited state from the port node to the target flow queue node to the scheduler further includes:

[0013] A first counter and a second counter are assigned to each node. The first counter records the number of branches that arrive at the node from the flow queue layer without being rate-limited, and the second counter records the number of branches that arrive at the node from the flow queue layer but are blocked due to the rate limit of the node. Starting from the port node, child nodes with non-zero first counters are selected layer by layer to form the unrate-limited branches of the port node until the target flow queue node is determined.

[0014] In an optional implementation, the step of updating the counter value of a node according to its rate limiting status, and updating the counter values ​​of each parent node in the branch to which the node belongs, up to the port node, further includes:

[0015] When a queue is enqueued from a stream queue layer node:

[0016] If the enqueuing node is not rate-limited, increment the first counter value of the current enqueuing node. If none of the parent nodes are rate-limited, increment the first counter value of each parent node in turn. If any parent node is rate-limited, increment the second counter value of that parent node.

[0017] When a queue is dequeued from a stream queue layer node:

[0018] If the first counter of the dequeuing node is zero, then its second counter is decremented by 1; if the first counter of the dequeuing node is non-zero, then its first counter is decremented by 1 to update the first and second counters of the dequeuing node.

[0019] If the first counter of the dequeue node is non-zero, then for the parent node of the dequeue node, update the first and second counters of the parent node according to the update method of the dequeue node, and so on until the port node.

[0020] In an optional implementation, the step of updating the counter value of a node according to its rate limiting status, and updating the counter values ​​of each parent node in the branch to which the node belongs, up to the port node, further includes:

[0021] When a rate-limiting event occurs on a node:

[0022] For the rate-limited event source node, add the value of its first counter to the second counter, and then clear the first counter to zero;

[0023] For the parent node of the rate-limited event source node, if the parent node is not rate-limited, the first counter of the parent node is subtracted from the first counter of the rate-limited event source node; if the parent node is rate-limited, the second counter of the parent node is subtracted from the first counter of the rate-limited event source node to update the first or second counter of the parent node.

[0024] If the parent node is not rate-limited, continue searching for the parent node's lower-level parent node and update the first or second counter of the lower-level parent node according to the parent node's update method, and iterate in this way until the port node.

[0025] When a node experiences a rate-limit-removal event:

[0026] For the source node of the rate-limiting event, add the value of its second counter to the first counter, and then clear the second counter to zero;

[0027] For the parent node of the rate-limited event source node, if the parent node is not rate-limited, the first counter of the parent node is decremented by the second counter of the rate-limit-removal event source node; if the parent node is rate-limited, the second counter of the parent node is decremented by the second counter of the rate-limit-removal event source node, so as to update the first or second counter of the parent node.

[0028] If the parent node is not rate-limited, continue searching for its lower-level parent node and update the first or second counter of the lower-level parent node according to the update method of the parent node. This process is repeated until the port node is reached.

[0029] According to a second aspect of this application, a programmable scheduling flow control device is provided, comprising:

[0030] The event triggering unit is used to reduce the number of tokens of all nodes on the entire branch from the node to the port node when a queue dequeue event occurs at any flow queue layer node in the hierarchical scheduling structure; when the number of tokens of a node changes from greater than or equal to a preset threshold value to less than a preset threshold value, it triggers a rate limiting event for that node; and when the number of tokens of a node changes from less than the preset threshold value to greater than or equal to the preset threshold value, it triggers a rate limiting release event for that node.

[0031] A recording unit is used to record, for each node, the number of unrate-limited branches and the number of rate-limited branches from the flow queue layer to that node using a counter, so as to send the non-zero unrate-limited state from the port node to the target flow queue node to the scheduler, wherein the target flow queue node is located on the unrate-limited branch of the port node.

[0032] The state update unit is used to respond to the detection of a queue enqueue event, queue dequeue event, rate limit event, or rate limit release event of a node, update the counter value of the node according to the rate limit status of the node, and update the counter value of each parent node according to the rate limit status of each parent node in the branch to the port node.

[0033] Compared with related technologies, the technical solution of this application has at least the following advantages:

[0034] In the next round of scheduling, the scheduler can determine at the port node whether a stream queue node can be scheduled and will not be blocked in the intermediate layer, thus avoiding wasted time. The entire scheduling architecture only requires one scheduler, greatly reducing logical resources.

[0035] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures and processes shown in the description and the accompanying drawings. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0037] Figure 1 This is a schematic diagram of a hierarchical scheduling structure based on the relevant technology of this application.

[0038] Figure 2 This is a system framework diagram based on an exemplary embodiment of this application.

[0039] Figure 3 This is a flowchart of a programmable scheduling flow control method according to an exemplary embodiment of this application.

[0040] Figure 4 This is a schematic diagram of a rate limiting process according to an exemplary embodiment of this application.

[0041] Figure 5 This is a schematic diagram of the queuing event updating scheduling state according to an exemplary embodiment of this application.

[0042] Figure 6 This is a schematic diagram illustrating the RL_FALLING event updating the scheduling state according to an exemplary embodiment of this application.

[0043] Figure 7 This is a schematic diagram of updating the scheduling state via the RL_RISING event according to an exemplary embodiment of this application.

[0044] Figure 8 This is a schematic diagram of the scheduling state update for a dequeue event according to an exemplary embodiment of this application. Detailed Implementation

[0045] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0046] like Figure 1 In the related technologies shown, each parent node in each layer can have multiple child nodes attached. Physically, there are various possible connection relationships between parent and child nodes. When the number of parent nodes is P and the number of child nodes is C, each parent node can have N child nodes, and the cross-connection of all parent and child nodes is P*N*C. It is evident that when the number of parent and child nodes reaches a certain level, backend synthesis tools (such as Synopsys' Design Compiler) will be unable to implement the cross-connection logic due to its excessive complexity. Furthermore, each node acting as a parent node requires a scheduler. To save scheduler resources, the tree height of the scheduling structure must be reduced, thus affecting the granularity of flow control. Since the parent nodes of all nodes in the same layer can only be in the same layer and cannot cross layers, the flexibility of the scheduling architecture is also reduced. In addition, simply changing the traditional forward scheduling to reverse scheduling can solve the above problems, but during reverse scheduling, the inability to determine the state of layers above the current layer may lead to frequent de-scheduling, resulting in performance loss.

[0047] Based on the above analysis, this application proposes a programmable scheduling flow control method and apparatus to implement flow control in reverse scheduling technology. According to queue enqueue, rate limit changes, and queue dequeue events, the method updates the number of unrate-limited branches and the number of rate-limited branches at each node in a funnel-like manner, based on the logical topology from the flow queue layer to the port layer. In this way, the reverse scheduler, located at any port node, can obtain the number of flow queue layer to port layer topology branches reaching that node, without causing scheduling conflicts.

[0048] The overall system block diagram is as follows Figure 2 As shown, this scheme updates the schedulable branch status information from the leaf layer node to each node based on the queue enqueue information, the traffic limit information of each node, and the queue dequeue information of the DMA send engine. The reverse scheduler determines the child node, the grandchild node, and so on, until the queue is attached to the leaf node, based on the scheduling status information of the port node.

[0049] See Figure 3 The flowchart provided in this application shows the programmable scheduling flow control method, which includes:

[0050] Step 301: When a queue dequeue event occurs at any flow queue layer node in the hierarchical scheduling structure, reduce the number of tokens for all nodes on the entire branch from that node to the port node. When the number of tokens for a node changes from greater than or equal to a preset threshold to less than a preset threshold, trigger a rate limiting event for that node. When the number of tokens for a node changes from less than the preset threshold to greater than or equal to the preset threshold, trigger a rate limiting release event for that node.

[0051] The hierarchical scheduling structure includes flow queue nodes, user nodes, TC nodes, and port nodes. Each node controls its rate limit using a token bucket. Based on the configured rate, it periodically fills the token bucket with credits. When a queue is scheduled out of a node, the number of tokens matching the queue message length is retrieved from the token bucket. When the number of tokens in the token bucket is less than a threshold, it indicates that the node has reached its rate limit. A rate limit event (RL_FALLING) is triggered when the number of tokens falls from greater than or equal to the threshold to less than the threshold. A rate limit release event (RL_RISING) is triggered when the number of tokens falls from less than the threshold to greater than or equal to the threshold. This is used for "lighting up" control of the scheduling tree structure. See [link to relevant documentation]. Figure 4 .

[0052] Step 302: For each node, use a counter to record the number of unrate-limited branches and the number of rate-limited branches from the flow queue layer to that node, so as to send the non-zero unrate-limited state from the port node to the target flow queue node, wherein the target flow queue node is located on the unrate-limited branch of the port node.

[0053] For example, two counters are assigned to each node, called the first counter `permit_cnt` and the second counter `shape_cnt`. `permit_cnt` records the number of branches arriving at the node from the flow queue layer without rate limiting. `shape_cnt` records the number of branches arriving at the node from the flow queue layer but blocked due to the node's rate limit. When `permit_cnt` is non-zero, it indicates that a queued branch has passed through the node without rate limiting, and this indicates that the node can participate in scheduling when being scheduled upwards.

[0054] Step 303: In response to detecting a queue enqueue event, queue dequeue event, rate limit event, or rate limit release event of a node, update the counter value of the node according to the rate limit status of the node, and update the counter values ​​of each parent node according to the rate limit status of each parent node in the branch to the port node.

[0055] According to a further embodiment, when a queue is enqueued from the stream queue layer, if none of the parent nodes of each layer are rate-limited, the first counter value of each parent node is incremented sequentially; if any parent node is rate-limited, the second counter value of that parent node is incremented.

[0056] Specifically, see Figure 5When a node is enqueued from the stream queue layer, if the enqueued node is not rate-limited, its `permit_cnt` is incremented by 1. The process then continues downwards to find the parent node of the enqueued node. If the parent node is also not rate-limited, its `permit_cnt` is also incremented by 1. This process iterates until the port node is reached. Throughout this process, if any node is rate-limited, its `shape_cnt` is incremented by 1, and the process stops there, without further updating the `permit_cnt` or `shape_cnt` of its parent, grandparent, etc., nodes.

[0057] See Figure 6 When the source node experiences an RL_FALLING event, all permit_cnt and shape_cnt values ​​on the entire branch from the source node to the port node are refreshed. First, for the source node, its permit_cnt value is added to its shape_cnt, and the permit_cnt is cleared. Second, the source node's parent node is found. If the parent node is not rate-limited, the source node's permit_cnt is subtracted from the parent node's permit_cnt. If the parent node is rate-limited, the source node's permit_cnt is subtracted from the parent node's shape_cnt. If the parent node is not rate-limited, the grandparent node of the source node is found along the branch, and the same processing method is applied to the parent node. This process iterates until the port node is reached. If the parent node is rate-limited, the search for its parent nodes at each level is stopped.

[0058] See Figure 7 When the source node experiences an RL_RISING event, all permit_cnt and shape_cnt values ​​on the entire branch from the source node to the port node are refreshed. First, for the source node, its shape_cnt value is added to permit_cnt, and shape_cnt is cleared to zero. Second, the source node's parent node is found. If the parent node is not rate-limited, the source node's shape_cnt is subtracted from the parent node's permit_cnt. If the parent node is rate-limited, the source node's shape_cnt is subtracted from the parent node's shape_cnt. If the parent node is not rate-limited, the branch continues to find the source node's grandparent node and is processed in the same way as the parent node, iterating until the port node. If the parent node is rate-limited, the branch stops searching for its parent nodes at each level.

[0059] When the scheduler is at a node, it retrieves its child nodes based on the parent-child relationship and checks if the `permit_cnt` value of each child node is non-zero. If it is non-zero, it indicates that scheduling can proceed upwards from that child node to reach the flow queue layer. When multiple child nodes have non-zero `permit_cnt` values, the scheduler then uses a scheduling algorithm (WRR, DWRR, etc.) to decide which child node to schedule upwards from, continuing this process layer by layer until it reaches the flow queue layer, where it determines which flow can be dequeued.

[0060] See Figure 8 When a node is scheduled to dequeue in the flow queue layer, the `permit_cnt` and `shape_cnt` of all nodes on the entire branch from the dequeued node to the port node are refreshed. First, for the dequeued node, if its `permit_cnt` is non-zero, its `permit_cnt` is decremented by 1; otherwise, its `shape_cnt` is decremented by 1. Second, if the `permit_cnt` of the dequeued node is non-zero, the parent node of the dequeued node is found, and its `permit_cnt` and `shape_cnt` are updated in the same way as the dequeued node. This process is repeated until the port node. If the `shape_cnt` of the dequeued node is non-zero, there is no need to update subsequent nodes on the branch.

[0061] It is evident that the programmable scheduling flow control method proposed in this application has at least the following advantages compared to related technologies:

[0062] In the next round of scheduling, the scheduler can determine at the port node whether a stream queue node can be scheduled and will not be blocked in the intermediate layer, thus avoiding wasted time. The entire scheduling architecture only requires one scheduler, greatly reducing logical resources.

[0063] Accordingly, by way of example, this application provides a programmable scheduling flow control apparatus in a second aspect, comprising:

[0064] The event triggering unit is used to reduce the number of tokens of all nodes on the entire branch from the node to the port node when a queue dequeue event occurs at any flow queue layer node in the hierarchical scheduling structure; when the number of tokens of a node changes from greater than or equal to a preset threshold value to less than a preset threshold value, it triggers a rate limiting event for that node; and when the number of tokens of a node changes from less than the preset threshold value to greater than or equal to the preset threshold value, it triggers a rate limiting release event for that node.

[0065] A recording unit is used to record, for each node, the number of unrate-limited branches and the number of rate-limited branches from the flow queue layer to that node using a counter, so as to send the non-zero unrate-limited state from the port node to the target flow queue node to the scheduler, wherein the target flow queue node is located on the unrate-limited branch of the port node.

[0066] The state update unit is used to respond to the detection of a queue enqueue event, queue dequeue event, rate limit event, or rate limit release event of a node, update the counter value of the node according to the rate limit status of the node, and update the counter value of each parent node according to the rate limit status of each parent node in the branch to the port node.

[0067] The above-described device can be implemented using the programmable scheduling flow control method provided in the first aspect of the embodiment. For specific implementation details, please refer to the description in the first aspect of the embodiment, which will not be repeated here.

[0068] It is understood that the structures, names, and parameters described in the above embodiments are merely examples. Those skilled in the art can also make readily conceived combinations and adjustments to the structural features of the above embodiments according to their needs, and the concept of this application should not be limited to the specific details of the above examples.

[0069] Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A programmable scheduling flow control method, characterized in that, include: When a queue dequeue event occurs at any flow queue layer node in the hierarchical scheduling structure, the number of tokens on all nodes in the entire branch from that node to the port node is reduced. When the number of tokens of a node changes from greater than or equal to a preset threshold value to less than a preset threshold value, a rate limiting event for that node is triggered. When the number of tokens of a node changes from less than the preset threshold value to greater than or equal to the preset threshold value, a rate limiting release event for that node is triggered. The hierarchical scheduling structure includes flow queue nodes, user nodes, flow classification nodes, and port nodes, with each node controlling its rate limit in the form of a token bucket. For each node, a counter is used to record the number of unrate-limited branches and the number of rate-limited branches from the flow queue layer to that node, so as to send the non-zero unrate-limited state from the port node to the target flow queue node, wherein the target flow queue node is located on the unrate-limited branch of the port node; In response to the detection of a queue enqueue event, queue dequeue event, rate limit event, or rate limit release event on a node, the counter value of the node is updated according to the rate limit status of the node, and the counter values ​​of each parent node in the branch to which the node belongs are updated according to the rate limit status of each parent node, up to the port node. Sending the non-zero, rate-unlimited state from the port node to the target flow queue node to the scheduler further includes: A first counter and a second counter are assigned to each node. The first counter records the number of branches that arrive at the node from the flow queue layer without being rate-limited, and the second counter records the number of branches that arrive at the node from the flow queue layer but are blocked due to the rate limit of the node. Starting from the port node, child nodes with non-zero first counters are selected layer by layer to form the unrate-limited branches of the port node until the target flow queue node is determined.

2. The programmable scheduling flow control method according to claim 1, characterized in that, When a dequeue event occurs at any flow queue layer node in the hierarchical scheduling structure, the token count of all nodes on the entire branch from that node to the port node is reduced, further including: Credit values ​​are periodically filled into the token bucket of each node according to a pre-configured rate. When a queue is scheduled out of a node, the number of tokens matching the length of the queue message is taken out of the node's token bucket.

3. The programmable scheduling flow control method according to claim 1, characterized in that, The step of updating the counter value of a node based on its rate limiting status, and updating the counter values ​​of each parent node in the branch to which the node belongs based on its rate limiting status, up to the port node, further includes: When a queue is enqueued from a stream queue layer node: If the enqueuing node is not rate-limited, increment the first counter value of the current enqueuing node. If none of the parent nodes are rate-limited, increment the first counter value of each parent node in turn. If any parent node is rate-limited, increment the second counter value of that parent node. When a queue is dequeued from a stream queue layer node: If the first counter of the dequeuing node is zero, then its second counter is decremented by 1; if the first counter of the dequeuing node is non-zero, then its first counter is decremented by 1 to update the first and second counters of the dequeuing node. If the first counter of the dequeue node is non-zero, then for the parent node of the dequeue node, update the first and second counters of the parent node according to the update method of the dequeue node, and so on until the port node.

4. The programmable scheduling flow control method according to claim 1, characterized in that, The step of updating the counter value of a node based on its rate limiting status, and updating the counter values ​​of each parent node in the branch to which the node belongs based on its rate limiting status, up to the port node, further includes: When a rate-limiting event occurs on a node: For the rate-limited event source node, add the value of its first counter to the second counter, and then clear the first counter to zero; For the parent node of the rate-limited event source node, if the parent node is not rate-limited, the first counter of the parent node is subtracted from the first counter of the rate-limited event source node; if the parent node is rate-limited, the second counter of the parent node is subtracted from the first counter of the rate-limited event source node to update the first or second counter of the parent node. If the parent node is not rate-limited, continue searching for the parent node's lower-level parent node and update the first or second counter of the lower-level parent node according to the parent node's update method, and iterate in this way until the port node. When a node experiences a rate-limit-removal event: For the source node of the rate-limiting event, add the value of its second counter to the first counter, and then clear the second counter to zero; For the parent node of the rate-limited event source node, if the parent node is not rate-limited, the first counter of the parent node is decremented by the second counter of the rate-limit-removal event source node; if the parent node is rate-limited, the second counter of the parent node is decremented by the second counter of the rate-limit-removal event source node, so as to update the first or second counter of the parent node. If the parent node is not rate-limited, continue searching for its lower-level parent node and update the first or second counter of the lower-level parent node according to the update method of the parent node. This process is repeated until the port node is reached.

5. A programmable scheduling flow control device, characterized in that, include: The event triggering unit is used to reduce the number of tokens of all nodes on the entire branch from the node to the port node when a queue dequeue event occurs at any flow queue layer node in the hierarchical scheduling structure; when the number of tokens of a node changes from greater than or equal to a preset threshold value to less than a preset threshold value, it triggers a rate limiting event for that node; and when the number of tokens of a node changes from less than the preset threshold value to greater than or equal to the preset threshold value, it triggers a rate limiting release event for that node. The hierarchical scheduling structure includes flow queue nodes, user nodes, flow classification nodes, and port nodes, with each node controlling its rate limit in the form of a token bucket. A recording unit is used to record, for each node, the number of unrate-limited branches and the number of rate-limited branches from the flow queue layer to that node using a counter, so as to send the non-zero unrate-limited state from the port node to the target flow queue node to the scheduler, wherein the target flow queue node is located on the unrate-limited branch of the port node. The state update unit is used to respond to the detection of a queue enqueue event, queue dequeue event, rate limit event, or rate limit release event of a node, update the counter value of the node according to the rate limit status of the node, and update the counter value of each parent node according to the rate limit status of each parent node in the branch to which the node is located, up to the port node. The recording unit is further used for: A first counter and a second counter are assigned to each node. The first counter records the number of branches that arrive at the node from the flow queue layer without being rate-limited, and the second counter records the number of branches that arrive at the node from the flow queue layer but are blocked due to the rate limit of the node. Starting from the port node, child nodes with non-zero first counters are selected layer by layer to form the unrate-limited branches of the port node until the target flow queue node is determined.

6. The programmable scheduling flow control device according to claim 5, characterized in that, The event triggering unit is further used for: Credit values ​​are periodically filled into the token bucket of each node according to a pre-configured rate. When a queue is scheduled out of a node, the number of tokens matching the length of the queue message is taken out of the node's token bucket.

7. The programmable scheduling flow control device according to claim 5, characterized in that, The state update unit is further used for: When a queue is enqueued from a stream queue layer node: If the enqueuing node is not rate-limited, increment the first counter value of the current enqueuing node. If none of the parent nodes are rate-limited, increment the first counter value of each parent node in turn. If any parent node is rate-limited, increment the second counter value of that parent node. When a queue is dequeued from a stream queue layer node: If the first counter of the dequeuing node is zero, then its second counter is decremented by 1; if the first counter of the dequeuing node is non-zero, then its first counter is decremented by 1 to update the first and second counters of the dequeuing node. If the first counter of the dequeue node is non-zero, then for the parent node of the dequeue node, update the first and second counters of the parent node according to the update method of the dequeue node, and so on until the port node.

8. The programmable scheduling flow control device according to claim 5, characterized in that, The state update unit is further used for: When a rate-limiting event occurs on a node: For the rate-limited event source node, add the value of its first counter to the second counter, and then clear the first counter to zero; For the parent node of the rate-limited event source node, if the parent node is not rate-limited, the first counter of the parent node is subtracted from the first counter of the rate-limited event source node; if the parent node is rate-limited, the second counter of the parent node is subtracted from the first counter of the rate-limited event source node to update the first or second counter of the parent node. If the parent node is not rate-limited, continue searching for the parent node's lower-level parent node and update the first or second counter of the lower-level parent node according to the parent node's update method, and iterate in this way until the port node. When a node experiences a rate-limit-removal event: For the source node of the rate-limiting event, add the value of its second counter to the first counter, and then clear the second counter to zero; For the parent node of the rate-limited event source node, if the parent node is not rate-limited, the first counter of the parent node is decremented by the second counter of the rate-limit-removal event source node; if the parent node is rate-limited, the second counter of the parent node is decremented by the second counter of the rate-limit-removal event source node, so as to update the first or second counter of the parent node. If the parent node is not rate-limited, continue searching for its lower-level parent node and update the first or second counter of the lower-level parent node according to the update method of the parent node. This process is repeated until the port node is reached.

Citation Information

Patent Citations

  • Queue scheduling method, device and system

    CN113949675A

  • Root scheduling algorithm in a network processor

    US20120020370A1