A flow control scheduling method and device with compensation mechanism

By setting the maximum number of copies of the message INFO and the cache backpressure threshold of the message INFO in the network card chip, and performing compensation operation of the flow control credit value on the receiving end, the problem of difficult to reasonably calculate the cache size caused by the change in the data volume after data replication is solved, and efficient cache utilization is achieved.

CN118764436BActive Publication Date: 2025-03-25WUXI STARS MICRO SYSTEM TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411067989.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-05
Publication Date
2025-03-25
Estimated Expiration
2044-08-05

AI Technical Summary

Technical Problem

In network card chips, the data volume changes after data copying, and the transmission cannot be directly controlled using the flow control credit value, which makes it difficult to calculate the cache size reasonably, which may lead to excessive cache overhead.

Method used

By setting the maximum number of copies of the message INFO at the sending end and the cache backpressure threshold at the receiving end, and determining the flow control credit value at the sending end, when the sum of the flow control credit value consumption and the maximum number of copies is not greater than the cache backpressure threshold, the thread ID is allocated to the message INFO, and the flow control credit value compensation operation is performed on the receiving end.

Benefits of technology

The size of the receiver cache is calculated reasonably, which avoids excessive cache overhead and improves the utilization rate of cache.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118764436B_ABST
    Figure CN118764436B_ABST
Patent Text Reader

Abstract

The present application provides a flow control scheduling method and device with a compensation mechanism, the method comprising: setting the maximum number of copies of the message INFO of the sending end and the buffer back pressure threshold of the receiving end, and determining the flow control credit value of the sending end, wherein each INFO consumes one flow control credit value; when the sum of the current flow control credit value consumption and the maximum number of copies is not greater than the buffer back pressure threshold, assigning a thread ID to the message INFO, copying the message INFO, and forwarding it to the receiving end; in the process of receiving the message INFO at the receiving end, compensating the flow control credit value consumption of the sending end based on the storage consumption corresponding to the thread ID. The technical solution of the present application improves the efficiency of flow control scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network card chips, and in particular to a flow control scheduling method and device with a compensation mechanism. Background Art

[0002] In the network card chip structure, the description information (Info) of the message will be copied into multiple copies after being processed by the forwarding module (Route). The number of copies for each service is inconsistent, and the forwarding processing delay is relatively large, so a cache needs to be set to accommodate these copied information. If a first-in-first-out (FIFO) data cache structure is used, the required cache will be very large when considering both performance and overflow, while the flow control (Flow ctrl) control structure will require less cache than FIFO.

[0003] When the flow ctrl mechanism is used to control data transmission, the amount of flow control credits required before data transmission is fixed. However, in the network card project, the amount of data will change after the data is copied, and credits cannot be used directly to control transmission. Summary of the invention

[0004] The purpose of this application is to provide a flow control scheduling method and device with a compensation mechanism, aiming to improve the efficiency of flow control scheduling.

[0005] According to a first aspect of the present application, a flow control scheduling method with a compensation mechanism is provided, comprising:

[0006] Before forwarding a message from the sender to the receiver, set the maximum number of copies of the message INFO at the sender and the buffer backpressure threshold at the receiver, and determine the flow control credit value at the sender, where each INFO consumes one flow control credit value;

[0007] When the sum of the current flow control credit value consumption and the maximum number of copies is not greater than the cache back pressure threshold, a thread ID is allocated to the message INFO, the message INFO is copied, and forwarded to the receiving end;

[0008] In the process of receiving the message INFO at the receiving end, a compensation operation is performed on the flow control credit value consumption of the sending end based on the storage consumption corresponding to the thread ID.

[0009] In an optional implementation manner, the setting of the maximum number of copies of the message INFO of the sending end further includes:

[0010] Set the maximum number of copies of the message INFO according to the service type of the message.

[0011] In an optional implementation manner, after allocating a thread ID to the message INFO, the method further includes:

[0012] The thread ID is used as an index, the maximum number of copies is used as the storage consumption of the thread ID, and the start and end marks of the message INFO are marked according to the maximum number of copies.

[0013] In an optional implementation manner, the compensating operation for the flow control credit value consumption of the sending end further includes:

[0014] When the flip indicator bit is not set, for an INFO that does not carry an end flag, if the storage consumption of the thread ID is zero, the flip indicator bit is set and the accumulated consumption is increased by 1; if the current cache storage is non-zero, the storage consumption of the thread ID is reduced by 1; for an INFO that carries an end flag, the thread ID is recycled and the corresponding storage consumption is recycled at the same time;

[0015] When the flip indication bit is set, for an INFO that does not carry an end mark, the accumulated consumption is increased by 1, and for an INFO that carries an end mark, the thread ID is recycled and the accumulated consumption is increased by 1 at the same time.

[0016] In an optional implementation manner, the reclaiming the thread ID further includes:

[0017] Set the timeout statistics threshold and the thread ID enable table. When the thread ID is used, set the enable indication bit of the corresponding thread ID.

[0018] When the thread ID is recycled, the enable bit of the corresponding thread ID is cleared, the timeout count is started, a snapshot of the thread ID enable table is taken, and the current thread ID usage status is obtained. When the thread ID is recycled, the snapshot result is updated;

[0019] When the timeout calculation ends, if there are still thread IDs in the snapshot result that have not been released, the thread IDs are taken out one by one from the snapshot result, and the consumption is read with the thread ID as the index, and the credit value is compensated after processing.

[0020] According to a second aspect of the present application, a flow control scheduling device with a compensation mechanism is provided, comprising:

[0021] A setting unit, used for setting a maximum number of copies of a message INFO of the sending end and a buffer back pressure threshold of the receiving end before forwarding the message from the sending end to the receiving end, and determining a flow control credit value of the sending end, wherein each INFO consumes one flow control credit value;

[0022] A replication unit, configured to allocate a thread ID to the message INFO, replicate the message INFO, and forward it to the receiving end when the sum of the current flow control credit value consumption and the maximum number of replications is not greater than the cache back pressure threshold;

[0023] The compensation unit is used to compensate the flow control credit value consumption of the sending end based on the storage consumption corresponding to the thread ID during the process of the receiving end receiving the message INFO.

[0024] Compared with the related art, the technical solution of this application has the following advantages:

[0025] By predicting the consumption of credits, the size of the receiving end's cache can be reasonably calculated, avoiding the excessive cache overhead caused by using step-by-step back pressure. At the same time, by performing flow control compensation in a timely manner, the cache utilization rate is further improved.

[0026] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained through the structures and processes indicated in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. It is obvious that the drawings described below are certain embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0028] Figure 1 It is a flowchart of a flow control scheduling method with a compensation mechanism according to an exemplary embodiment of the present application.

[0029] Figure 2 It is a schematic diagram of the principle of a flow control structure with a compensation mechanism according to an exemplary embodiment of the present application.

[0030] Figure 3 It is a processing flow chart of the sending end according to an exemplary embodiment of the present application.

[0031] Figure 4 is a flowchart of a receiving end process according to an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0033] Based on the above analysis, the present application proposes a flow control scheduling method and device with a compensation mechanism.

[0034] See also Figure 1 The flow control scheduling method with compensation mechanism provided in this application includes:

[0035] Step 101: Before forwarding a message from the sender to the receiver, set the maximum number of copies of the message INFO of the sender and the buffer back pressure threshold of the receiver, and determine the flow control credit value of the sender, where each INFO consumes one flow control credit value.

[0036] Figure 2 The schematic diagram of a flow control scheduling structure with a compensation mechanism is shown as an example. The structure mainly consists of three parts: sending SEND, forwarding ROUTE and receiving RECEIVE. xoff indicates the back pressure of the receiving end on Route. rls ind indicates that the message INFO is read out from the receiving end cache, which can release the cache space. Schedule represents a scheduling scenario in which the message INFO is extracted from the cache. The processing flow of the sending end is as follows Figure 3 As shown. The sender pre-sets the maximum number of copies N of the message INFO, and each INFO consumes 1 credit unit. Before each INFO is sent, the sending application amount, that is, the maximum number of copies N, is pre-calculated as the number of credits to be consumed. INFO is information that characterizes the message.

[0037] Then, a buffer back pressure threshold M of the receiving end is set, and the threshold is not greater than the actual buffer space size of the receiving end.

[0038] In a further embodiment, since the sending application amount of each INFO varies greatly in different scenarios, in order to reasonably use space and meet performance requirements, the sending amount required for different INFOs is set in advance according to the service type corresponding to the INFO. For example, for unicast services, there is still only one copy of the message INFO after forwarding processing, or a small number of copies appear when mirrored; for multicast messages, since the number of outbound ports will be relatively large, the number of copies will be very large, so a relatively large sending amount needs to be set in advance.

[0039] Step 102: When the sum of the current flow control credit value consumption and the maximum number of copies is not greater than the cache back pressure threshold, a thread ID is allocated to the message INFO, the message INFO is copied, and forwarded to the receiving end.

[0040] Exemplarily, the relationship between the sum of the cumulative consumption T and the sent application N of the current credit statistics and the cache back pressure threshold M is determined. If the sum of the cumulative consumption T and the sent application N is not greater than the cache back pressure threshold M, the INFO is allowed to be sent, and a thread ID is applied at the same time. The sent application N is stored with the thread ID as the index and regarded as the consumption of the thread ID. Otherwise, the INFO is prohibited from being sent.

[0041] After the business processing module Route parses a message INFO, if the INFO needs to be copied, the start and end flags of the INFO copy are marked respectively; for the INFO that does not need to be copied, the start and end flags are added at the same time.

[0042] Step 103: When the receiving end receives the message INFO, a compensation operation is performed on the flow control credit value consumption of the sending end based on the storage consumption corresponding to the thread ID.

[0043] As an example, the receiving end receives the message INFO, identifies the thread ID, queries the credit consumption stored with the thread ID as the index, and prepares to perform compensation operations. The processing flow is as follows: Figure 4 The specific compensation situations are as follows:

[0044] After receiving INFO, the current storage consumption N and the rollover indication bit in the thread ID entry are queried to determine whether the rollover indication bit is set.

[0045] The receiving end reads the cache status according to the thread ID. When the preset conditions are met, the flip bit can be set. When the flip indication bit is set, it indicates a reverse compensation scenario, the expected credit consumption is insufficient, and the consumption needs to be increased. At this time, for INFOs that do not carry an end mark, the sender's current credit cumulative consumption T is increased by 1. For INFOs that carry an end mark, the thread ID is recycled while T is increased by 1.

[0046] When the flip indicator bit is not set, it indicates a positive compensation scenario and the consumption needs to be reduced. At this time, for the INFO with the end flag, the thread ID needs to be recycled and the current storage needs to be recycled; for the INFO without the end flag, if the storage consumption of the thread ID is zero, the flip indicator bit is set and the credit cumulative consumption T is increased by 1. If the current cached storage is non-zero, only the storage consumption is reduced by 1.

[0047] In addition, after the data cached by the receiver is scheduled to the next level, it is necessary to release credits and notify the sender of the updated credit amount.

[0048] Therefore, the method of the present application detects the credit consumption in real time at the receiving end and compensates in time, which can more accurately control the consumption of the receiving end buffer.

[0049] Furthermore, for the scenario where the thread ID cannot be recycled (after INFO is copied in Route, the receiving end does not detect the start bit or end bit identifier), the message INFO is discarded as a whole in Route.

[0050] Furthermore, for timeout exception processing, since each INF0 sent to Route carries a thread ID, the aging monitoring of the thread ID can be used to prevent credit leakage. First, set the timeout statistical threshold, which is preferably much larger than the delay of the Route forwarding processing. Then set the thread ID enable table. When the thread ID is used, the enable indication bit of the corresponding thread ID entry is set. When the thread ID is recycled, the enable bit of the corresponding thread ID entry is cleared. At this time, the aging timeout count is started, and a snapshot of the thread ID enable table is taken to obtain the current thread ID usage situation. Only when the thread ID is recycled, the snapshot value is updated. At the end of the timeout calculation, if there are still thread IDs that have not been released in the snapshot data, it means that the thread ID recycling is abnormal. It is necessary to take out the thread IDs one by one from the snapshot result, and use them as indexes to read the consumption. After processing, the credit is compensated.

[0051] The flow control scheduling system with compensation mechanism is highly dependent on the evaluation of Route processing. If the number of INFO copies caused by the dynamic configuration table entry of the software is too large, it will cause the receiving end buffer to be full and cause discarding. In a further embodiment, in order to avoid such discarding, it is necessary to increase back pressure on the port and short-term back pressure Route processing.

[0052] Optionally, in a specific implementation, if Route reasonably controls the maximum number of copies during processing and reasonably sets the threshold M, the above back pressure operation may not be performed.

[0053] It can be seen that the flow control scheduling method with compensation mechanism proposed in this application has the following advantages compared with related technologies: by predicting the consumption of credits, the size of the receiving end cache can be reasonably calculated, avoiding the excessive cache overhead caused by the use of step-by-step back pressure, and at the same time, by timely performing flow control compensation, the cache utilization rate is further improved.

[0054] Accordingly, the present application provides a flow control scheduling device with a compensation mechanism in a second aspect, including:

[0055] A setting unit, used for setting a maximum number of copies of a message INFO of the sending end and a buffer back pressure threshold of the receiving end before forwarding the message from the sending end to the receiving end, and determining a flow control credit value of the sending end, wherein each INFO consumes one flow control credit value;

[0056] A replication unit, configured to allocate a thread ID to the message INFO, replicate the message INFO, and forward it to the receiving end when the sum of the current flow control credit value consumption and the maximum number of replications is not greater than the cache back pressure threshold;

[0057] The compensation unit is used to compensate the flow control credit value consumption of the sending end based on the storage consumption corresponding to the thread ID during the process of the receiving end receiving the message INFO.

[0058] The above-mentioned device can be implemented through the flow control scheduling method with compensation mechanism provided by the embodiment of the first aspect above. The specific implementation method can be found in the description of the embodiment of the first aspect, and will not be repeated here.

[0059] It is understood that the architectures, names and parameters described in the above embodiments are only examples. Those skilled in the art can also easily combine and adjust the structural features of the above embodiments according to the use requirements, and should not limit the concept of the present application to the specific details of the above examples.

[0060] Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that he or she may still modify the technical solutions described in the aforementioned embodiments, or make equivalent substitutions for some of the technical features therein; 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 the present application.

Claims

1. A flow control scheduling method with a compensation mechanism, characterized in that: include: Before forwarding a message from the sender to the receiver, set the maximum number of copies of the message INFO at the sender and the buffer backpressure threshold at the receiver, and determine the flow control credit value at the sender, where each INFO consumes one flow control credit value; When the sum of the current flow control credit value consumption and the maximum number of copies is not greater than the cache back pressure threshold, a thread ID is allocated to the message INFO, the message INFO is copied, and forwarded to the receiving end; In the process of receiving the message INFO at the receiving end, compensating the flow control credit value consumption of the sending end based on the storage consumption corresponding to the thread ID; After allocating the thread ID to the message INFO, the method further includes: Taking the thread ID as an index, taking the maximum number of copies as the storage consumption of the thread ID, and marking the start and end flags of the message INFO according to the maximum number of copies; The step of compensating the flow control credit value consumption of the sending end further includes: When the flip indicator bit is not set, for an INFO that does not carry an end flag, if the storage consumption of the thread ID is zero, the flip indicator bit is set and the accumulated consumption is increased by 1; if the current cache storage is non-zero, the storage consumption of the thread ID is reduced by 1; for an INFO that carries an end flag, the thread ID is recycled and the corresponding storage consumption is recycled at the same time; When the flip indication bit is set, for an INFO that does not carry an end mark, the accumulated consumption is increased by 1, and for an INFO that carries an end mark, the thread ID is recycled and the accumulated consumption is increased by 1 at the same time.

2. The flow control scheduling method with compensation mechanism according to claim 1, characterized in that: The step of setting the maximum number of copies of the message INFO of the sending end further includes: Set the maximum number of copies of the message INFO according to the service type of the message.

3. The flow control scheduling method with compensation mechanism according to claim 1, characterized in that: The step of recycling the thread ID further comprises: Set the timeout statistics threshold and the thread ID enable table. When the thread ID is used, set the enable indication bit of the corresponding thread ID. When the thread ID is recycled, the enable bit of the corresponding thread ID is cleared, the timeout count is started, a snapshot of the thread ID enable table is taken, and the current thread ID usage status is obtained. When the thread ID is recycled, the snapshot result is updated; When the timeout calculation ends, if there are still thread IDs in the snapshot result that have not been released, the thread IDs are taken out one by one from the snapshot result, and the consumption is read with the thread ID as the index, and the credit value is compensated after processing.

4. A flow control scheduling device with a compensation mechanism, characterized in that: include: A setting unit, used for setting a maximum number of copies of a message INFO of the sending end and a buffer back pressure threshold of the receiving end before forwarding the message from the sending end to the receiving end, and determining a flow control credit value of the sending end, wherein each INFO consumes one flow control credit value; A replication unit, configured to allocate a thread ID to the message INFO, replicate the message INFO, and forward it to the receiving end when the sum of the current flow control credit value consumption and the maximum number of replications is not greater than the cache back pressure threshold; A compensation unit, configured to perform a compensation operation on the flow control credit value consumption of the sending end based on the storage consumption corresponding to the thread ID during the process of receiving the message INFO at the receiving end; The replication unit is further used for: After the thread ID is allocated to the message INFO, the thread ID is used as an index, the maximum number of copies is used as the storage consumption of the thread ID, and the start and end marks of the message INFO are marked according to the maximum number of copies; The compensation unit is further used for: When the flip indicator bit is not set, for an INFO that does not carry an end flag, if the storage consumption of the thread ID is zero, the flip indicator bit is set and the accumulated consumption is increased by 1; if the current cache storage is non-zero, the storage consumption of the thread ID is reduced by 1; for an INFO that carries an end flag, the thread ID is recycled and the corresponding storage consumption is recycled at the same time; When the flip indication bit is set, for an INFO that does not carry an end mark, the accumulated consumption is increased by 1, and for an INFO that carries an end mark, the thread ID is recycled and the accumulated consumption is increased by 1 at the same time.

5. The flow control scheduling device with compensation mechanism according to claim 4, characterized in that: The setting unit is further used for: Set the maximum number of copies of the message INFO according to the service type of the message.

6. The flow control scheduling device with compensation mechanism according to claim 4, characterized in that: The compensation unit is further used for: Set the timeout statistics threshold and the thread ID enable table. When the thread ID is used, set the enable indication bit of the corresponding thread ID. When the thread ID is recycled, the enable bit of the corresponding thread ID is cleared, the timeout count is started, a snapshot of the thread ID enable table is taken, and the current thread ID usage status is obtained. When the thread ID is recycled, the snapshot result is updated; When the timeout calculation ends, if there are still thread IDs in the snapshot result that have not been released, the thread IDs are taken out one by one from the snapshot result, and the consumption is read with the thread ID as the index, and the credit value is compensated after processing.

Citation Information

Patent Citations

  • Flow control method for universal multi-core network processor

    CN103428099A

  • Method and system for providing credit-based flow control

    CN104320350A