A flow control model, congestion algorithm verification device and method
By designing a verification device for flow control models and congestion algorithms, simulating the flow control of multiple queue pairs, the problem that the existing technology cannot accurately verify the internal calculated values and register configuration of the DCQCN algorithm is solved, and dynamic output and optimization of queue pair rate are realized , improves the verification efficiency of the congestion algorithm.
Patent Information
- Application Number
- CN202411145594.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-08-20
AI Technical Summary
The existing RoCE congestion control method cannot accurately verify the calculated values and initial register configuration values within the DCQCN algorithm, and cannot observe the dynamic changes in the queue rate under RCM regulation.
A flow control model and congestion algorithm verification device is designed. By simulating the flow control of multiple queue pairs, sending message events and CNP events are generated, and the rates of each queue pair are output in real time, realizing verification of the congestion algorithm. The device includes a queue pair initialization module, an RCM context initialization module, an event generation module, a CNP event sending module, a message event sending module, a context write-back module and a rate write-back interface, and can dynamically output the real-time rate of each queue pair.
Through the flow control model, the real-time rate of each queue pair is dynamically output to the interface and presented in the waveform diagram, which is convenient for optimizing the calculated values and initial register configuration values within the congestion algorithm, and achieving effective verification of the DCQCN algorithm.
Smart Images

Figure CN118677791B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip verification technology, and in particular to a verification device and method for a flow control model and a congestion algorithm. Background Art
[0002] Congestion control is used to reduce packet loss in lossy networks or congestion propagation in lossless networks. It can also reduce the occupancy of switch buffers, thereby reducing latency and improving tolerance to burst traffic. Current RoCE congestion control relies on explicit congestion notification (ECN) to operate.
[0003] The RoCEv2 standard defines RoCEv2 Congestion Management (RCM), which provides the ability to avoid congestion hotspots and optimize link throughput. When RCM is enabled, early congestion on the link will be reported to the source of the network flow, which will then reduce their injection rate, thus preventing the negative effects of cache saturation and increased queuing delay on the link.
[0004] In order to avoid performance loss of Remote Direct Memory Access (RDMA) caused by network congestion and packet loss, the Data Center Quantized Congestion Notification (DCQCN) algorithm is usually used to adjust network congestion. For example, the sending network card adjusts the sending rate of the service message sent by the sending network card to the receiving network card according to the DCQCN algorithm, and can continuously increase the sending rate; in the case of network packet loss and the sending network card receiving the congestion notification packet (CNP), the sending rate is reduced. In short, if the queue pair (QP) is based on the internal timer and the send byte counter, the DCQCN algorithm will continue to increase the sending rate (i.e., the acceleration event); once the CNP packet is received, the specified queue pair will be reduced (i.e., the deceleration event).
[0005] In actual applications, if RCM is only verified by comparing the DCQCN algorithm with the input interface data format and the output interface data format, it is impossible to observe the dynamic changes of the rate of each queue under RCM regulation, and it is impossible to accurately verify the calculated values and register configuration initial values within the DCQCN algorithm. Summary of the invention
[0006] The present invention aims to provide a flow control model, a congestion algorithm verification device and method, based on the DCQCN algorithm, to simulate the flow control of multiple queue pairs to achieve the verification of the congestion algorithm.
[0007] To achieve the above object, the technical solution of the present invention is:
[0008] A flow control model, including a queue pair initialization module, an RCM context initialization module, an event generation module, a CNP event sending module, a message event sending module, a context write-back module and a rate write-back interface;
[0009] The queue pair initialization module initializes the state of the queue pair and transmits the queue pair sequence number to the RCM context initialization module for binding the queue pair sequence number with the context;
[0010] The RCM context initialization module initializes the context maintained in the RCM, and transmits the bound queue pair sequence number and context to the event generation module;
[0011] The event generating module generates a driving signal for sending a message event to the message event sending module, or generates a driving signal for sending a CNP event to the CNP event sending module;
[0012] The CNP event sending module sends a CNP event;
[0013] The message event sending module sends a message event;
[0014] The context write-back module receives the context parameters calculated by the design under test and outputs them to the event generation module, and returns the real-time rate of each queue pair to the rate write-back interface.
[0015] Furthermore, the queue increases the number of bytes of the sent message over time at a byte increase rate, and when the byte number is greater than the configured trigger event byte number, the event generation module generates a driving signal for sending the message event to the message event sending module; wherein the byte increase rate is less than or equal to the current rate in the context.
[0016] Further, when a CNP event is triggered, the event generating module generates a driving signal for sending the CNP event to the CNP event sending module.
[0017] In a specific embodiment, the rate write-back interface includes a real-type variable, and the real-time rate of each queue pair is returned to the real-type variable in the rate write-back interface.
[0018] The present invention also provides a verification device for a congestion algorithm, comprising the above-mentioned flow control model, and also comprising a driving component, a reference model, a design to be tested, and a comparison component;
[0019] The flow control model initializes the queue pair and the RCM context, and sends a message event or a CNP event to the driver component;
[0020] The driving component outputs the stimulus corresponding to the event to the reference model and the design under test;
[0021] The comparison component receives the context parameters calculated by the reference model and the context parameters calculated by the design to be tested, and compares them, and returns the context parameters calculated by the design to be tested to the flow control model.
[0022] In a specific embodiment, the fluid control model is arranged in the driving component.
[0023] The present invention also provides a congestion algorithm verification method, which is applied to the verification device of the congestion algorithm mentioned above, comprising:
[0024] Step S1, calling the flow control model, obtaining the register configuration for initializing the queue pair state and RCM context;
[0025] Step S2, creating queue pairs according to a preset number of queue pairs, creating a queue pair sequence number for each queue pair, and initializing the queue pairs, wherein each queue pair has a flow control model;
[0026] Step S3, initializing the RCM context;
[0027] Step S4, assign a process to each queue pair, enter the event control stage, the queue pair increases the number of bytes of the message sent over time at a byte increase rate, and when the number of bytes is greater than the number of bytes configured to trigger the event, enter the acceleration event of step S5; during this period, the CNP event will be randomly triggered according to the configuration, and when the CNP event is triggered, enter the deceleration event of step S6;
[0028] Step S5, in the acceleration event, encapsulate the inlet interface data of the design to be tested with the acceleration event type, inject the stimulus into the reference model and the design to be tested, and return the calculated context parameters to the flow control model; update the number of bytes to the current number of bytes minus the number of bytes of the configuration trigger event;
[0029] Step S6, in the deceleration event, encapsulate the inlet interface data of the design to be tested with the CNP event type, reduce the current rate, inject the stimulus into the reference model and the design to be tested, and return the calculated context parameters to the flow control model;
[0030] Step S7, writing back the real-time rate of each queue pair to the rate write-back interface of the flow control model.
[0031] In a specific embodiment, in the above step S2, the queue pair sequence number is created incrementally according to a preset starting value of the queue pair sequence number.
[0032] In a specific embodiment, in the above step S4, the rate at which the number of bytes increases is less than or equal to the current rate in the context.
[0033] Beneficial effect: The present invention provides a flow control model, a congestion algorithm verification device and method, which dynamically outputs the real-time rate of each queue pair to the interface through the flow control model, and finally presents it on the waveform. It can clearly see the effect of dynamic regulation of the rate of each queue pair in RCM under different configurations and different initial values, which is convenient for optimizing the calculated value and register configuration initial value inside the congestion algorithm.
[0034] In order to make the above features and advantages of the invention more obvious and easy to understand, embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 The figure is a schematic diagram of the structure of a verification device for a congestion algorithm of the present invention.
[0036] Figure 2 It is a structural schematic diagram of a flow control model of the present invention.
[0037] Figure 3 The present invention is a flow chart of a congestion algorithm verification method.
[0038] Figure 4 It is a simulation waveform diagram of multiple queues to real-time rate in a specific embodiment. DETAILED DESCRIPTION
[0039] In order to make the purpose and technical solution of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] Figure 1 FIG. 1 is a schematic diagram of a structure of a verification device for a congestion algorithm of the present invention. Figure 1As shown, a verification device for a congestion algorithm of the present invention includes a flow control model 1, a driving component 2, a reference model 3, a design to be tested 4 and a comparison component 5. Among them, the flow control model 1 initializes the queue pair and the RCM context, and sends a message event or a CNP event to the driving component 2; the driving component 2 outputs the stimulus of the corresponding event to the reference model 3 and the design to be tested 4; the comparison component 5 receives the context parameters calculated by the reference model 3 and the context parameters calculated by the design to be tested 4 and compares them, and returns the calculated context parameters to the flow control model 1 to update the current rate of the queue pair in the flow control model 1.
[0041] Optionally, the comparison component 5 returns the calculated context parameters of the design to be tested 4 to the flow control model 1 .
[0042] Furthermore, if it is an ideal state, the context parameters calculated by the reference model 3 are the same as the context parameters calculated by the design to be tested 4; if it is a non-ideal state, the context parameters calculated by the reference model 3 are different from the context parameters calculated by the design to be tested 4. At this time, the comparison component 5 will output an error signal to inform the verification personnel for subsequent processing.
[0043] Optionally, the fluid control model 1 may also be arranged in the driving component 2 .
[0044] Further, Figure 2 FIG. 1 is a schematic diagram of the structure of a flow control model of the present invention. Figure 2 As shown, a flow control model 1 of the present invention includes a queue pair initialization module 11, an RCM context initialization module 12, an event generation module 13, a CNP event sending module 14, a message event sending module 15, a context write-back module 16 and a rate write-back interface 17.
[0045] More specifically, the queue pair initialization module 11 is used to initialize the state of the queue pair and create a queue pair process according to the external configuration; the queue pair initialization module 11 transmits the queue pair sequence number to the RCM context initialization module 12, which is used to bind the queue pair sequence number to the context so that the queue pair and the context run in the same thread.
[0046] More specifically, the RCM context initialization module 12 initializes the context maintained in the RCM, and some parameters in the context are randomly configured as needed; the RCM context initialization module 12 transmits the bound queue pair sequence number and context to the event generation module 13, which is used to simulate byte accumulation in the current queue pair according to the context parameters.
[0047] Furthermore, the context includes the following parameters:
[0048] Congestion management activation flag rcm_sta_active: After initialization, congestion management is inactive until it enters the active state after receiving a CNP event. The purpose is to prevent full-rate queue pairs from entering the congestion management process and to enable congestion management only after a deceleration event occurs.
[0049] Rate control factor rcm_sta_alpha: The maximum value at initialization. The purpose is to reduce the speed faster for the first time and then accelerate slowly afterwards.
[0050] The calculation timestamp rcm_sta_alpha_ts of the rate control factor rcm_sta_alpha: records the time when the rate control factor rcm_sta_alpha was last updated. The initial value is 0. During congestion management, the timestamp is automatically updated.
[0051] Current rate rcm_sta_crate: the real-time rate of sending messages. The initial value is the maximum rate value of the current queue pair configured by the register.
[0052] Target rate rcm_sta_trate: The expected rate of sending messages calculated by the rate algorithm. The initial value is the maximum rate value of the current queue pair configured in the register.
[0053] Counter rcm_sta_tx_bc: counts the number of bytes sent, increases dynamically, and the initial value is 0.
[0054] Counter rcm_sta_bc_cnt: counts the number of times the counter rcm_sta_tx_bc is full. When the counter rcm_sta_tx_bc is full once, the value of the counter rcm_sta_bc_cnt is increased by 1. It is used to control the single acceleration degree in the acceleration stage, and the initial value is 0.
[0055] CNP message interval calculation timestamp rcm_sta_cnp_ts: records the interval time of receiving CNP messages inside the design under test. If no CNP messages are received for a long time, a message sending event will be triggered; the initial value is 0.
[0056] Counter rcm_sta_time_cnt: counts the time when no CNP message is received. When the time is greater than the configured value of the CNP message interval, the counter rcm_sta_time_cnt counts once. It is used to control the single acceleration degree in the acceleration stage. The initial value is 0.
[0057] More specifically, the event generation module 13 generates a driving signal for sending a message event to the message event sending module 15, or generates a driving signal for sending a CNP event to the CNP event sending module 14. More specifically, the queue increases the number of bytes of the message sent over time at a byte increase rate. When the number of bytes is greater than the number of bytes configured to trigger the event, the event generation module 13 generates a driving signal for sending a message event to the message event sending module 15. The byte increase rate is less than or equal to the current rate rcm_sta_crate in the context. In a specific embodiment, the byte increase rate is the current rate rcm_sta_crate in the context.
[0058] More specifically, the CNP event is randomly generated during the operation of the entire queue pair. When the CNP event is triggered, the event generation module 13 generates a driving signal for sending the CNP event to the CNP event sending module 14 to reduce the current rate rcm_sta_crate and enter a deceleration event.
[0059] More specifically, the CNP event sending module 14 sends the CNP event to the driving component 2 .
[0060] More specifically, the message event sending module 15 sends the message event to the driving component 2 .
[0061] More specifically, the comparison component 5 returns the calculated context parameters to the context write-back module 16 .
[0062] More specifically, the context write-back module 16 returns the real-time rate of each queue pair, that is, the current rate rcm_sta_crate, to the rate write-back interface 17; the context write-back module 16 outputs the calculated context parameters to the event generation module 13 to update the current rate rcm_sta_crate in the flow control model 1.
[0063] Optionally, the rate write-back interface 17 includes a real type variable, and the real-time rate of each queue pair is continuously updated to the real-type variable in the rate write-back interface 17, so that the continuous change of the real-time rate of each queue pair can be seen in the waveform.
[0064] Figure 1In the specific embodiment, only one flow control model is shown. When there are multiple queue pairs, a flow control model can be created for each queue pair. Each queue pair maintains its own rate and context parameters. Each queue pair runs as an independent thread, randomly sends accumulated bytes and CNP events, and randomly sets event trigger intervals. Acceleration events and deceleration events are triggered according to the configured threshold inside each queue pair, and the values of the real-time rate of the queue pair and the context related to the congestion algorithm are updated to the context maintained separately by each queue pair. Another thread reflects the current rates of each queue pair in the context through an interface, and the changes in the rate of each queue pair can be seen through the waveform, which is convenient for observing the continuous changes in the rates of each queue pair under different configurations, and more intuitively observing the effects of the congestion algorithm and the impact of the configuration on the rates of each queue pair.
[0065] like Figure 3 As shown, a verification method of a congestion algorithm of the present invention includes the following steps.
[0066] Step S1, calling the flow control model, obtaining the register configuration for initializing the queue pair state and RCM context.
[0067] More specifically, the flow control model is called when the environment enters the Main Phase.
[0068] Step S2: create queue pairs according to the preset number of queue pairs, create queue pair numbers for each queue pair, and initialize the queue pairs. Each queue pair has a flow control model.
[0069] More specifically, the number of parallel processes created is equal to the number of queue pairs created.
[0070] Optionally, a queue pair sequence number QPN is created incrementally according to a preset starting value of the queue pair sequence number. The queue pair sequence number QPN is not a strongly related variable, and RCM is only transparently transmitted, which will not affect the congestion algorithm.
[0071] Step S3, initializing the RCM context.
[0072] More specifically, each parameter in the context is initialized, including the congestion management activation flag rcm_sta_active, the rate control factor rcm_sta_alpha, the calculation timestamp of the rate control factor rcm_sta_alpha rcm_sta_alpha_ts, the current rate rcm_sta_crate, the target rate rcm_sta_trate, the counter rcm_sta_tx_bc, the counter rcm_sta_bc_cnt, the CNP message interval calculation timestamp rcm_sta_cnp_ts, and the counter rcm_sta_time_cnt.
[0073] Step S4, assign a process to each queue pair, enter the event control stage, and start simulating the running state of a normal queue pair.
[0074] exist Figure 3 Specifically, they are queue pair QP1, queue pair QP2, and finally queue pair QPN.
[0075] More specifically, in the event control phase, the queue pair will increase the number of bytes of the sent message over time at a byte increase rate, and will compare at intervals. When the number of bytes is greater than the configured trigger event byte number, the acceleration event of step S5 is entered. The byte increase rate is less than or equal to the current rate rcm_sta_crate in the context. In a specific embodiment, the byte increase rate is the current rate rcm_sta_crate in the context.
[0076] During this period, the CNP event will be triggered randomly according to the configuration. When the CNP event is triggered, the deceleration event of step S6 is entered.
[0077] Step S5, in the acceleration event, encapsulate the entry interface data of the design to be tested with the acceleration event type, inject the stimulus into the reference model and the design to be tested, and return the calculated context parameters to the flow control model; update the number of bytes to the current number of bytes minus the number of bytes of the configuration trigger event.
[0078] More specifically, the purpose of updating the byte count to the current byte count minus the configured trigger event byte count is to subtract the current byte count after an acceleration event. Otherwise, the current byte count is always greater than the configured trigger event byte count, which will always trigger acceleration events.
[0079] Step S6, in the deceleration event, encapsulate the inlet interface data of the design to be tested with the CNP event type, reduce the current rate rcm_sta_crate, inject the stimulus into the reference model and the design to be tested, and return the calculated context parameters to the flow control model.
[0080] Step S7, writing back the real-time rate of each queue pair to the rate write-back interface of the flow control model.
[0081] More specifically, whenever an event triggers a change in the rate of a queue pair, the real-time rate of the queue pair will be updated to the rate writeback interface 17, specifically to the real type variable in the rate writeback interface 17. Therefore, when the waveform is generated by simulation, the dynamic speed-up and speed-down of each queue pair during packet transmission can be seen on the waveform. Then, based on the speed-up and speed-down curves of the queue pairs, it can be judged whether the desired rate control effect can be achieved. If not, the desired rate control effect can be achieved by adjusting the configuration value of the parameters to verify the congestion algorithm.
[0082] Figure 4 A simulation waveform diagram of multiple queues to real-time rate in a specific embodiment is shown. Figure 4 The rates of six queue pairs, QP1, QP2, QP3, QP4, QP5, and QP6, can be monitored in real time.
[0083] Although the present invention has been disclosed as above by way of embodiments, it is not intended to limit the present invention. Any person having ordinary knowledge in the technical field may make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the scope of the attached patent application.
Claims
1. A flow control model, characterized in that: It includes a queue pair initialization module, an RCM context initialization module, an event generation module, a CNP event sending module, a message event sending module, a context write-back module and a rate write-back interface; The queue pair initialization module initializes the state of the queue pair and transmits the queue pair sequence number to the RCM context initialization module for binding the queue pair sequence number with the context; The RCM context initialization module initializes the context maintained in the RCM, and transmits the bound queue pair sequence number and context to the event generation module; The event generating module generates a driving signal for sending a message event to the message event sending module, or generates a driving signal for sending a CNP event to the CNP event sending module; The CNP event sending module sends a CNP event; The message event sending module sends a message event; The context write-back module receives the context parameters calculated by the design under test and outputs them to the event generation module, and returns the real-time rate of each queue pair to the rate write-back interface.
2. A flow control model as claimed in claim 1, characterized in that: The queue increases the number of bytes of the sent message over time at a byte increase rate. When the byte number is greater than the configured trigger event byte number, the event generation module generates a driving signal for sending the message event to the message event sending module; wherein the byte increase rate is less than or equal to the current rate in the context.
3. A flow control model as claimed in claim 1, characterized in that: When a CNP event is triggered, the event generating module generates a driving signal for sending the CNP event to the CNP event sending module.
4. A flow control model as claimed in claim 1, characterized in that: The rate write-back interface includes a real type variable, and the real-time rate of each queue pair is returned to the real type variable in the rate write-back interface.
5. A verification device for a congestion algorithm, characterized in that: A fluid control model comprising a fluid control model as claimed in any one of claims 1 to 4, further comprising a drive component, a reference model, a design to be tested and a comparison component; The flow control model initializes the queue pair and the RCM context, and sends a message event or a CNP event to the driver component; The driving component outputs the stimulus corresponding to the event to the reference model and the design under test; The comparison component receives the context parameters calculated by the reference model and the context parameters calculated by the design to be tested, and compares them, and returns the context parameters calculated by the design to be tested to the flow control model.
6. A verification device for a congestion algorithm as claimed in claim 5, characterized in that: The fluid control model is arranged in the driving component.
7. A congestion algorithm verification method, characterized in that: A verification device for a congestion algorithm as claimed in any one of claims 5 to 6, comprising: Step S1, calling the flow control model, obtaining the register configuration for initializing the queue pair state and RCM context; Step S2, creating queue pairs according to a preset number of queue pairs, creating a queue pair sequence number for each queue pair, and initializing the queue pairs, wherein each queue pair has a flow control model; Step S3, initializing the RCM context; Step S4, assign a process to each queue pair, enter the event control stage, the queue pair increases the number of bytes of the message sent over time at a byte increase rate, and when the number of bytes is greater than the number of bytes configured to trigger the event, enter the acceleration event of step S5; during this period, the CNP event will be randomly triggered according to the configuration, and when the CNP event is triggered, enter the deceleration event of step S6; Step S5, in the acceleration event, encapsulate the inlet interface data of the design to be tested with the acceleration event type, inject the stimulus into the reference model and the design to be tested, and return the calculated context parameters to the flow control model; update the number of bytes to the current number of bytes minus the number of bytes of the configuration trigger event; Step S6, in the deceleration event, encapsulate the inlet interface data of the design to be tested with the CNP event type, reduce the current rate, inject the stimulus into the reference model and the design to be tested, and return the calculated context parameters to the flow control model; Step S7, writing back the real-time rate of each queue pair to the rate write-back interface of the flow control model.
8. A congestion algorithm verification method as claimed in claim 7, characterized in that: In the step S2, queue pair sequence numbers are created incrementally according to a preset starting value of the queue pair sequence numbers.
9. A congestion algorithm verification method as claimed in claim 7, characterized in that: In step S4, the rate at which the number of bytes increases is less than or equal to the current rate in the context.
