A method and apparatus for verifying a flow control frame, a switch and a storage medium

By combining the generated backpressure information and the flow control frame mode parameters, the problem of the inability to effectively check the flow control frame generation rules in the prior art is solved, and the accurate verification of the flow control frame generation rules is achieved to ensure that they comply with the protocol.

CN116896522BActive Publication Date: 2026-06-09WXILICON TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WXILICON TECH CO LTD
Filing Date
2023-07-26
Publication Date
2026-06-09

Smart Images

  • Figure CN116896522B_ABST
    Figure CN116896522B_ABST
Patent Text Reader

Abstract

The application discloses a flow control frame inspection method and device, a switch and a storage medium. The method comprises the following steps: obtaining reverse pressure information at each moment according to port priority configuration parameters and real-time obtained flow control information of an entry port of a to-be-tested device, wherein the reverse pressure information at each moment comprises reverse pressure control information of each entry port of the to-be-tested device at the moment to an exit port of a superior device; obtaining expected flow control frame information according to flow control frame mode parameters and the reverse pressure information at each moment, wherein the flow control frame mode parameters comprise parameters for controlling generation of the flow control frame; and comparing the expected flow control frame information with actual flow control frame information of the to-be-tested device, so as to inspect a generation rule of the flow control frame of the to-be-tested device. According to the technical scheme, the expected flow control frame of the to-be-tested device is obtained according to the flow control information, the port priority configuration parameters and the flow control frame mode, and whether the generation rule of the flow control frame of the to-be-tested device conforms to a specification is inspected according to the expected flow control frame.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital communications, and more particularly to a method, apparatus, switch, and storage medium for verifying flow control frames. Background Technology

[0002] Existing technologies typically check whether the content of the flow control frames in the generated data packets conforms to the specifications, but cannot effectively check whether the rules of the flow control frames conform to the specifications. Summary of the Invention

[0003] In view of this, a method, apparatus, switch, and storage medium for verifying flow control frames are provided. The method includes: obtaining backpressure information at each moment based on port priority configuration parameters and real-time flow control information of the ingress port of the device under test (DUT), wherein the backpressure information at each moment includes backpressure control information of each ingress port of the DUT to the egress port of the upstream device at that moment; obtaining desired flow control frame information based on flow control frame mode parameters and the backpressure information at each moment, wherein the flow control frame information includes at least the type, quantity, and generation time of the flow control frame, and the flow control frame mode parameters include parameters controlling the generation of the flow control frame; and comparing the desired flow control frame information with the actual flow control frame information of the DUT to verify the flow control frame generation rules of the DUT. The technical solution of this invention obtains the desired flow control frame of the DUT based on flow control information, port priority configuration parameters, and flow control frame mode, and verifies whether the generation rules of the flow control frame of the DUT conform to the specifications.

[0004] In a first aspect, embodiments of the present invention provide a method for verifying flow control frames, comprising: obtaining backpressure information at each moment based on port priority configuration parameters and flow control information of the ingress port of the device under test obtained in real time, wherein the backpressure information at each moment includes backpressure control information of each ingress port of the device under test to the egress port of the superior device at that moment; obtaining desired flow control frame information based on flow control frame mode parameters and the backpressure information at each moment, wherein the flow control frame information includes at least the type, quantity and generation time of the flow control frame, wherein the flow control frame mode parameters include parameters controlling the generation of the flow control frame; and comparing the desired flow control frame information with the actual flow control frame information of the device under test to verify the flow control frame generation rules of the device under test.

[0005] Based on the above, the flow control frame of the device under test is obtained according to the flow control information, port priority configuration parameters and flow control frame mode. Based on this, the generation rules of the flow control frame of the device under test are checked online to see if they conform to the specifications. Compared with the traditional content inspection method, the technical solution of the present invention can also check whether the generation of the flow control frame of the device under test conforms to the protocol according to the flow control frame generation rules.

[0006] In one possible implementation of the first aspect, the flow control frame includes a PFC frame and / or a Pause frame.

[0007] Therefore, the embodiments of the present invention can be used to verify whether the generation of PFC frames and / or Pause frames of the device under test conforms to the protocol.

[0008] In one possible implementation of the first aspect, the comparison of the expected flow control frame information and the actual flow control frame information of the device under test includes: whether the number of actual flow control frames in each flow control process falls within the range of the maximum and minimum number of expected flow control frames, and each flow control process corresponds to a flow control setting until the end of the flow control; whether the time difference between the generation time of the actual flow control frame and the generation time of the corresponding expected flow control frame in each flow control process falls within a set threshold.

[0009] Based on the above, the actual generation time and number of flow control frames are examined on a flow control process basis, thereby more comprehensively verifying whether the generation rules of the flow control frames of the device under test comply with the specifications.

[0010] In one possible implementation of the first aspect, each flow control process includes the period from the initial setting of its corresponding flow control to its revocation.

[0011] As described above, each flow control process, from the first setting of its corresponding flow control to the cancellation of its corresponding flow control, makes the actual generation time and number of flow control frames more accurate when verified on a flow control process-by-process basis, and reduces the impact of flow control information time on the working time of the module that generates flow control frames.

[0012] In one possible implementation of the first aspect, before comparing the expected flow control frame information with the actual flow control frame information of the device under test, it is also verified whether the content of the actual flow control frame conforms to the specification.

[0013] Therefore, by verifying whether the content of the actual flow control frames conforms to the specifications, the number and timing of the actual flow control frames are compared with those of the correct flow control frames, thereby improving the accuracy of the verification.

[0014] In one possible implementation of the first aspect, the backpressure information includes whether the backpressure of each inlet port to the outlet port of the upper-level device is enabled or whether the backpressure of each queue to the corresponding queue in the outlet port of the upper-level device is enabled.

[0015] As described above, by using backpressure information, including whether backpressure is enabled for each port or each queue, control frames for both Pause frames and PFC frames can be verified.

[0016] In one possible implementation of the first aspect, the flow control information includes at least the flow control status of a port or queue; the port priority configuration parameters include at least port flow control enable and queue flow control enable; the flow control frame mode parameters include at least pause duration, flow control frame count, resume frame enable, and selection of PFC frame and Pause frame.

[0017] Therefore, by using the above flow control information, port priority configuration parameters, and flow control frame mode parameters, the desired flow control frame generation environment is made the same as the actual flow control frame generation environment, thereby improving the accuracy of the verification.

[0018] In one possible implementation of the first aspect, the flow control information further includes at least a comparison between the flow of a port or queue and the dual waterline; the port priority configuration parameters include at least port dual waterline enable and queue dual waterline enable.

[0019] As described above, by using the flow control information, port priority configuration parameters, and flow control frame mode parameters, the actual flow control frame generation environment under dual-waterline enabled is the same, thus improving the accuracy of the verification.

[0020] Secondly, embodiments of the present invention provide a flow control frame verification device, comprising: a backpressure information generation module, configured to obtain backpressure information at each moment based on port priority configuration parameters and flow control information of the inlet port of the device under test obtained in real time, wherein the backpressure information at each moment includes backpressure control information of each inlet port of the device under test to the outlet port of the upper-level device at that moment; a desired control frame generation module, configured to obtain desired flow control frame information based on flow control frame mode parameters and the backpressure information at each moment, wherein the flow control frame information includes at least the type, quantity, and generation time of the flow control frame, and the flow control frame mode parameters include parameters controlling the generation of the flow control frame; and an actual control frame verification module, configured to compare the desired flow control frame information with the actual flow control frame information of the device under test to verify the flow control frame generation rules of the device under test.

[0021] Based on the above, the flow control frame of the device under test is obtained according to the flow control information, port priority configuration parameters and flow control frame mode. Based on this, the generation rules of the flow control frame of the device under test are checked online to see if they conform to the specifications. Compared with the traditional content inspection method, the technical solution of the present invention can also check whether the generation of the flow control frame of the device under test conforms to the protocol according to the flow control frame generation rules.

[0022] In one possible implementation of the second aspect, the flow control frame includes a PFC frame and / or a Pause frame.

[0023] Therefore, the embodiments of the present invention can be used to verify whether the generation of PFC frames and / or Pause frames of the device under test conforms to the protocol.

[0024] In one possible implementation of the second aspect, the actual control frame verification module is specifically used to: whether the number of actual flow control frames in each flow control process falls within the range of the maximum and minimum number of expected flow control frames, and whether each flow control process corresponds to a flow control setting until the end of the flow control; and whether the time difference between the generation time of the actual flow control frame and the generation time of the corresponding expected flow control frame in each flow control process falls within a set threshold.

[0025] Based on the above, the actual generation time and number of flow control frames are examined on a flow control process basis, thereby more comprehensively verifying whether the generation rules of the flow control frames of the device under test comply with the specifications.

[0026] In one possible implementation of the second aspect, each flow control process includes the first setting of its corresponding flow control until its corresponding flow control is revoked.

[0027] As described above, each flow control process, from the first setting of its corresponding flow control to the cancellation of its corresponding flow control, makes the actual generation time and number of flow control frames more accurate when verified on a flow control process-by-process basis, and reduces the impact of flow control information time on the working time of the module that generates flow control frames.

[0028] In one possible implementation of the second aspect, the actual control frame verification module is further specifically used to verify whether the content of the actual flow control frame conforms to the specification before comparing the expected flow control frame information with the actual flow control frame information of the device under test.

[0029] Therefore, by verifying whether the content of the actual flow control frames conforms to the specifications, the number and timing of the actual flow control frames are compared with those of the correct flow control frames, thereby improving the accuracy of the verification.

[0030] In one possible implementation of the second aspect, the backpressure information includes whether the backpressure of each inlet port to the outlet port of the upper-level device is enabled or whether the backpressure of each queue to the corresponding queue in the outlet port of the upper-level device is enabled.

[0031] As described above, by using backpressure information, including whether backpressure is enabled for each port or each queue, control frames for both Pause frames and PFC frames can be verified.

[0032] In one possible implementation of the second aspect, the flow control information includes at least the flow control status of a port or queue; the port priority configuration parameters include at least port flow control enable and queue flow control enable; and the flow control frame mode parameters include at least pause duration, number of flow control frames, resume frame enable, and selection of PFC and Pause frames.

[0033] Therefore, by using the above flow control information, port priority configuration parameters, and flow control frame mode parameters, the desired flow control frame generation environment is made the same as the actual flow control frame generation environment, thereby improving the accuracy of the verification.

[0034] In one possible implementation of the second aspect, the flow control information further includes at least a comparison between the flow of a port or queue and the dual waterline; the port priority configuration parameters include at least port dual waterline enable and queue dual waterline enable.

[0035] As described above, by using the flow control information, port priority configuration parameters, and flow control frame mode parameters, the actual flow control frame generation environment under dual-waterline enabled is the same, thus improving the accuracy of the verification.

[0036] Thirdly, embodiments of the present invention provide a switch, including: the apparatus of any of the embodiments described in the second aspect.

[0037] Fourthly, embodiments of the present invention provide a computing device, comprising: a bus; a communication interface connected to the bus; at least one processor connected to the bus; and at least one memory connected to the bus and storing program instructions, which, when executed by the at least one processor, cause the at least one processor to perform any of the embodiments described in the first aspect of the present invention.

[0038] Fifthly, embodiments of the present invention provide a computer-readable storage medium having program instructions stored thereon, which, when executed by a computer, cause the computer to perform any of the embodiments described in the first aspect of the present invention. Attached Figure Description

[0039] Figure 1 This is a flowchart illustrating a method for verifying flow control frames according to the present invention.

[0040] Figure 2 This is a flowchart illustrating a second embodiment of the flow control frame verification method of the present invention.

[0041] Figure 3 This is a schematic diagram of a first embodiment of a flow control frame verification device according to the present invention;

[0042] Figure 4 This is a schematic diagram of a second embodiment of the flow control frame verification device of the present invention;

[0043] Figure 5 This is a schematic diagram of the structure of an embodiment of the computing device of the present invention. Detailed Implementation

[0044] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0045] In the following description, the terms “first, second, third, etc.” or module A, module B, module C, etc. are used only to distinguish similar objects or different embodiments and do not represent a specific ordering of objects. It is understood that a specific order or sequence may be interchanged where permitted so that the embodiments of the invention described herein can be implemented in an order other than that illustrated or described herein.

[0046] In the following description, the labels of the steps, such as S110, S120, etc., do not necessarily mean that the steps will be executed in this way. The order of the steps can be interchanged or executed simultaneously if permitted.

[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit the invention.

[0048] A method, apparatus, switch, and storage medium for verifying flow control frames are disclosed. The method includes: obtaining backpressure information at each moment based on port priority configuration parameters and real-time flow control information of the ingress port of the device under test (DUT), wherein the backpressure information at each moment includes backpressure control information of each ingress port of the DUT to the egress port of the upstream device at that moment; obtaining desired flow control frame information based on flow control frame mode parameters and the backpressure information at each moment, wherein the flow control frame information includes at least the type, quantity, and generation time of the flow control frame, and the flow control frame mode parameters include parameters controlling the generation of the flow control frame; and comparing the desired flow control frame information with the actual flow control frame information of the DUT to verify the flow control frame generation rules of the DUT. The technical solution of this invention obtains the desired flow control frame of the DUT based on flow control information, port priority configuration parameters, and flow control frame mode, and verifies whether the generation rules of the flow control frame of the DUT conform to the specifications.

[0049] The flow control frame involved in this invention is first described, which includes a PFC frame and / or a Pause frame.

[0050] PFC frames are used to perform flow control on a priority packet queue of an ingress port (port). They include PFC frames for enabling flow control and PFC frames for revoking flow control. The PFC frame for enabling flow control has a pause duration, informing the upstream device (which may include an upstream switch, connected to the device under test via a network) to suspend the transmission of data packets of the corresponding priority in the corresponding egress port for that pause duration. The PFC frame for revoking flow control has a pause duration of 0, informing the upstream device to resume the transmission of data packets of the corresponding priority in the corresponding egress port.

[0051] Pause frames are used to perform flow control on an ingress port, without distinguishing priorities. They include Pause frames for initiating flow control and Pause frames for revoking flow control. Pause frames for initiating flow control have a pause duration, which is used to inform the upstream device to suspend the transmission of all data packets in the corresponding egress port within the pause duration. Pause frames for revoking flow control have a pause duration of 0, which is used to inform the upstream device to resume the transmission of all data packets in the corresponding egress port.

[0052] The following is combined Figures 1 to 2 An embodiment of a method for verifying flow control frames is introduced.

[0053] In an embodiment of a flow control frame verification method, backpressure information at each moment is obtained based on port priority configuration parameters and real-time flow control information of the ingress port of the device under test (DUT). The backpressure information at each moment includes the backpressure control information of each ingress port of the DUT to the egress port of the upstream device at that moment. Desired flow control frame information is obtained based on flow control frame mode parameters and the backpressure information at each moment. The flow control frame information includes at least the type, quantity, and generation time of the flow control frames. The flow control frame mode parameters include parameters controlling the generation of flow control frames. The desired flow control frame information is compared with the actual flow control frame information of the DUT to verify the flow control frame generation rules of the DUT.

[0054] Figure 1 The flowchart of a flow control frame verification method embodiment one is shown, including steps S110 to S130.

[0055] S110: Obtain back pressure information at each moment based on port priority configuration parameters and real-time flow control information of the inlet port of the device under test.

[0056] The flow control information of the ingress port of the device under test is obtained in real time from the environment of the device under test, for example, from the flow control module of the device under test.

[0057] In some embodiments, the flow control information includes at least the flow control status of a port or queue (port + priority, hereinafter the same), for example, whether flow control of the port or queue is enabled; the port priority configuration parameters include at least port flow control enabled and queue flow control enabled. In each embodiment of the present invention, the queue is a queue of priority packets within a port.

[0058] In other embodiments, the flow control information further includes at least the comparison between port or queue traffic and dual waterlines, i.e., the relationship between port or queue traffic and its high and low waterlines. For example, whether port traffic is higher than the port's high waterline or lower than the port's low waterline, and whether queue traffic is higher than the queue's high waterline or lower than the queue's low waterline. The port priority configuration parameters include at least port dual waterline enabling and queue dual waterline enabling.

[0059] The backpressure information at each moment includes the backpressure control information of each inlet port of the device under test to the outlet port of the upstream device at that moment. This backpressure control information is used to generate flow control frames and send them to the upstream device. Flow control frames include PFC frames or Pause frames.

[0060] In some embodiments, backpressure information includes whether backpressure is enabled for each ingress port to the egress port of the upstream device or whether backpressure is enabled for each queue to the corresponding queue in the egress port of the upstream device.

[0061] For example, when dual waterlines are not enabled at a port, if flow control for a certain port is enabled in the flow control information, the back pressure control information for the corresponding port in the back pressure information is also enabled. If flow control for that port is deactivated in the flow control information, the back pressure control information for the corresponding port in the back pressure information is also deactivated.

[0062] For example, when dual waterlines are enabled for queues, if flow control for a queue is enabled in the flow control information and the flow of that queue exceeds the high waterline, the back pressure control information for the corresponding queue in the back pressure information is enabled. If flow control for a queue in the flow control information is changed from enabled to disabled and the flow of that queue is lower than the low waterline, the back pressure control information for the corresponding queue in the back pressure information is also disabled.

[0063] S120: Obtain the desired flow control frame information based on the flow control frame mode parameters and the back pressure information at each time step.

[0064] The flow control frame information includes at least the type, number, and generation time of the flow control frames, and the flow control frame mode parameters include parameters that control the generation of the flow control frames.

[0065] In some embodiments, the flow control frame mode parameters include at least the pause duration, the number of flow control frames, the enable of the recovery frame, and the selection of PFC and Pause frames. The recovery frame is a flow control frame used to cancel flow control.

[0066] Exemplarily, taking the scenario enabled by PFC frames, sending flow control frames twice, and resuming flow control frames as an example, the desired flow control frame information is obtained with the duration from the setting to the cancellation of flow control for one queue.

[0067] First, when the backpressure information of a queue at time t is set, it is expected to generate two PFC frames for suspension with a suspension duration of n; at time t + m (m < n), the backpressure information of this queue continues to be set. Since the previous suspension duration has not expired, no PFC frames are expected to be generated; at time t + n, the backpressure information of this queue continues to be set. Since the previous suspension duration has expired, it is expected to continue generating two PFC frames for suspension; at time t + n + m, the backpressure information of this queue is cancelled. Since the previous suspension duration has not expired, it is expected to generate two PFC frames for resumption; in total, 6 PFC frames are generated.

[0068] S130: Compare the desired flow control frame information with the actual flow control frame information of the device under test to verify the flow control frame generation rule of the device under test.

[0069] Among them, the actual flow control frame information of the device under test is received at a certain moment. In some embodiments, one flow control process is compared, and one flow control process includes the time from the first setting of its corresponding flow control to the cancellation of its corresponding flow control.

[0070] In some embodiments, the following information is compared: whether the number of actual flow control frames in each flow control process falls within the range of the maximum number and the minimum number of the desired flow control frames. Each flow control process corresponds to one type of flow control from the setting to the end of this flow control; whether the time difference between the generation time of the actual flow control frames in each flow control process and the generation time of the corresponding desired flow control frames falls within the set threshold. Each set threshold is used to address the impact of the time difference between generating flow control information and actual flow control frames, and can be obtained based on the actual process test of the device under test.

[0071] In some embodiments, before comparing the desired flow control frame information with the actual flow control frame information of the device under test, it is also verified whether the type of the actual flow control frame conforms to the specification.

[0072] In summary, in the first embodiment of a method for verifying flow control frames, the desired flow control frames of the device under test are obtained according to flow control information, port priority configuration parameters, and flow control frame modes, and based on this, it is verified whether the flow control frame generation rule of the device under test conforms to the specification, and online real-time verification is achieved.

[0073] Embodiment 2 of the method for verifying flow control frames is a detailed implementation of Embodiment 1 of the method for verifying flow control frames. It inherits all the methods of Embodiment 1 of the method for verifying flow control frames and has all the advantages of Embodiment 1 of the method for verifying flow control frames.

[0074] Figure 2 The flowchart of a second embodiment of a flow control frame verification method is shown, including steps S2110 to S2330. Steps S2110 and S2120 are detailed flowcharts of an example of step S110 in a first embodiment of a flow control frame verification method, steps S2210 and S2220 are detailed flowcharts of an example of step S120 in a first embodiment of a flow control frame verification method, and steps S2310 and S2330 are detailed flowcharts of an example of step S130 in a first embodiment of a flow control frame verification method.

[0075] S2110: Collects flow control information, flow control configuration parameters, and flow control frame mode parameters of the device under inspection in real time.

[0076] The flow control information of the device under inspection is collected in real time from the operating environment of the device under inspection. It can be provided by other devices of the device under inspection. Each flow control information includes at least the flow control information of the port, priority and queue, and is stored in the corresponding variables. The following is an example of a flow control message.

[0077] {iqm_status_vld_i: Flow control information number}

[0078] iqm_status_port_num_i: The ingress port number corresponding to the flow control information.

[0079] iqm_status_port_high_i: A single-bit signal indicating whether flow control for the port corresponding to the flow control information is enabled; 1 indicates that flow control for the corresponding port is enabled.

[0080] `iqm_status_port_reached_swm_i`: A single-bit signal indicating whether the port traffic corresponding to the flow control information has reached the high watermark. 1 indicates that the corresponding port traffic has reached the high watermark.

[0081] `iqm_status_port_above_lwm_i`: A single-bit signal indicating whether the port traffic corresponding to the flow control information exceeds the low watermark. 1 indicates that the corresponding port traffic exceeds the low watermark.

[0082] iqm_status_buf_port_high_i: A single-bit signal indicating whether any priority flow control is enabled on the port corresponding to the flow control information. 1 indicates that priority flow control is enabled for the corresponding priority.

[0083] iqm_status_prio_i: Indicates the priority of the flow control information.

[0084] `iqm_status_prio_high_i`: Indicates whether the priority flow control corresponding to the flow control information is enabled. 1 indicates that the flow control for the corresponding port is enabled.

[0085] `iqm_status_prio_reached_swm_i`: Indicates whether the priority flow corresponding to the flow control information has reached the high watermark. 1 indicates that the corresponding priority has reached the high watermark.

[0086] `iqm_status_prio_above_lwm_i`: Indicates whether the priority flow corresponding to the flow control information exceeds the low watermark; 1 indicates that the corresponding priority has reached the high watermark.

[0087] `iqm_status_buf_prio_high_i`: Indicates whether any port-level flow control is enabled in the priority list corresponding to the flow control information. 1 indicates that the corresponding port has priority flow control enabled.

[0088] `iqm_status_queue_high_i`: Indicates whether flow control for the queue (port + priority) corresponding to the flow control information is enabled. 1 indicates that the corresponding queue is enabled.

[0089] `iqm_status_queue_reached_swm_i` indicates whether the queue flow corresponding to the flow control information has reached the high watermark; 1 indicates that the corresponding queue has reached the high watermark.

[0090] iqm_status_queue_above_lwm_i: indicates whether the queue flow corresponding to the flow control information exceeds the low watermark, 1 indicates that the corresponding queue exceeds the low watermark.

[0091] Among them, at least the following flow control configuration parameters should be collected and stored in variables.

[0092] {buf_prio_ena[port]: Statistical parameter 1 for priority flow control enabled on each port. Each port corresponds to 8 bits, and each bit indicates whether the corresponding priority flow control is counted. When the priority corresponding to one bit of any port is enabled, the flow control for that priority is counted.}

[0093] port_ena[port]: Statistical parameters for priority flow control enabled on each port. Each port corresponds to 8 bits, and each bit represents whether the corresponding priority is enabled. When the priority corresponding to any bit of a port is enabled, the flow control of that port is counted.

[0094] prio_ena[port]: Statistical parameters for priority flow control enabled on each port. Each port has 8 bits, and each bit represents whether the corresponding priority is enabled. When the priority corresponding to a certain bit of a port is enabled, the flow control for that port and the queue corresponding to that priority is statistically analyzed.

[0095] `port_buf_port_ena` is typically 32 bits, with each bit corresponding to a port. Once the port corresponding to a bit is enabled, the flow control for that port is monitored.

[0096] `prio_buf_prio_ena` is an 8-bit variable, with each bit corresponding to a priority level. When the priority level corresponding to a bit is enabled, the flow control for that priority level is tracked.

[0097] `queue_swm_ena[port]` assigns 8 bits to each port, with each bit corresponding to a priority level for that port, indicating whether the double waterline of a queue is open.

[0098] port_swm_ena, which is typically 32 bits, with each bit corresponding to whether the double waterline of a port is open or closed.

[0099] In some embodiments, prio_ena[port] is replaced by port_ena[port], and {buf_prio_ena[port] is replaced by buf_port_ena[port].

[0100] Among them, at least the following flow control frame mode parameters should be collected.

[0101] tx_pfc_val_cfg[port]: The pause duration of PFC and Pause frames.

[0102] send_paude_frm_twice_cfg[port]: Sends flow control frames once or twice.

[0103] tx_pfc_xon_xoff[port]: Whether to send a recovery frame for the PFC frame and the Pause frame.

[0104] pfc_port_tx_sel[port]: Whether to send a PFC frame or a Pause frame.

[0105] tx_Pfc_frame_en[port]: Flow control frame enable bit.

[0106] tx_pause_ctrl[port]: The granularity of Pause frame transmission, whether to send it when all priorities are enabled or when a single priority is enabled.

[0107] S2120: Obtain back pressure information at each moment based on port priority configuration parameters and real-time flow control information of the inlet port of the device under test.

[0108] For example, the backpressure information of PFC is queue backpressure information, represented by a two-dimensional array pfc_fc_array_s[port][prio]. Each element of this two-dimensional array corresponds to a queue. When backpressure is applied to a queue, the corresponding element in the two-dimensional array has a value of 1. pfc_fc_array_s[port][prio] is obtained according to the PFC frame mapping principle.

[0109] For example, the backpressure information of a port is represented by a 3D array pfc_fc_array_s[port]. Each element of this array corresponds to a port. When backpressure is applied to a port, the corresponding element in the array has a value of 1. pfc_fc_array_s[port] is obtained according to the Pause frame mapping principle.

[0110] S2210: Obtain the generation time of each flow control frame in each flow control process based on the flow control frame mode parameters and the back pressure information at each moment.

[0111] The generation time of each desired flow control frame is obtained by using a flow control activation to deactivation process.

[0112] For example, taking a PFC frame of a queue as an example, the time when the element corresponding to the queue in the queue backpressure array pfc_fc_array_s[port][prio] changes from 0 to 1 is taken as the time when the flow control of the queue is set up, and the time when the element corresponding to the queue in the queue backpressure array pfc_fc_array_s[port][prio] changes from 1 to 0 is taken as the time when the flow control of the queue is canceled. From the time when the flow control of the queue is set up to the time when the flow control of the queue is canceled, in step S2120, pfc_fc_array_s[port][prio] has been obtained according to the PFC frame mapping principle. In this step, the expected PFC frame generation time is obtained by using the queue backpressure array pfc_fc_array_s[port][prio] and the flow control frame mode parameters, and stored in the queue pfc_expect_time[port][prio][$], where [$] represents the number.

[0113] S2220: Based on the flow control frame mode parameters and the back pressure information at each moment, the expected number of flow control frames in each flow control process is also obtained.

[0114] For example, taking the PFC frame statistics in a flow control process of a queue as an example, and setting each PFC frame to be sent twice, and sending a PFC frame for recovery, at the time of flow control initiation of the queue, the backpressure duration of the current flow control for the queue is obtained using the flow control initiation time and flow control cancellation time obtained in step S2210; the backpressure duration is divided by the pause duration set for the corresponding port, and the quotient is rounded up to obtain the baseline statistical value; the baseline statistical value is added to and subtracted from the protection threshold respectively to obtain the maximum and minimum expected number of PFC frames for the current flow control of the queue, and stored in sum_max_pfc[port][prio] and sum_min_pfc[port][prio]. Because there is a difference between the actual flow control frame generation time of the receiving switch and the flow control information acquisition time, the maximum and minimum expected number of PFC frames are set for easy comparison.

[0115] S2310: Continuously collect the flow control frames output by the device under test, verify their contents, and save the flow control frames with correct contents.

[0116] S2320: Based on the correct flow control frames, calculate the timing and number of flow control frames for each flow control process.

[0117] For example, taking the PFC frame statistics in a flow control process of a queue as an example, the number of PFC frames with ports and priorities analyzed from the PFC frames with correct content and the time of their generation are counted and stored in the statistics array axi_pfc_num[port][prio] and the queue array pfc_out_time[port][prio][$], respectively.

[0118] S2330: Compare the expected flow control frames for each flow control process with the actual number and timing of flow control frames of the device under test to verify the flow control frame generation rules of the device under test.

[0119] For example, continuing with a PFC frame in a flow control process of a queue, the number of PFC frames in the device under test is checked by comparing whether the axi_pfc_num[port][prio] obtained in step S2320 falls between sum_max_pfc[port][prio] and sum_min_pfc[port][prio] obtained in step S2220. The number of PFC frames in the device under test is checked by comparing whether the difference between the stream pfc_out_time[port][prio][n] (n is the queue index) obtained in step S2320 and pfc_expect_time[port][prio][n] obtained in step S2220 falls within a reasonable range. The number of PFC frames generated at the time of generation in the device under test is checked by checking whether the PFC frame generation rule is correct. The rule for generating PFC frames is determined to be correct. Through the above comparison, it is determined whether the rule for generating PFC frames in the device under test conforms to the specification.

[0120] The following is combined Figures 3 to 4 An embodiment of a flow control frame verification device is introduced.

[0121] An embodiment of a flow control frame inspection device performs a flow control frame inspection method described in embodiment one, and has all the advantages of the flow control frame inspection method in embodiment one.

[0122] Figure 3 The structure of a flow control frame verification device according to an embodiment is shown, including: a back pressure information generation module 310, a desired control frame generation module 320, and an actual control frame verification module 330.

[0123] The backpressure information generation module 310 is used to obtain backpressure information at each moment based on the port priority configuration parameters and the flow control information of the inlet port of the device under test obtained in real time. For its working principle and advantages, please refer to step S110 of Embodiment 1 of a flow control frame verification method.

[0124] The expected control frame generation module 320 is used to obtain the expected flow control frame information based on the flow control frame mode parameters and the backpressure information at each time. For its working principle and advantages, please refer to step S120 of Embodiment 1 of a flow control frame verification method.

[0125] The actual control frame verification module 330 is used to compare the expected flow control frame information with the actual flow control frame information of the device under test (DUT) to verify the flow control frame generation rules of the DUT. For its working principle and advantages, please refer to step S130 of Embodiment 1 of a flow control frame verification method.

[0126] An embodiment of a flow control frame inspection device performs the flow control frame inspection method described in embodiment two, and has all the advantages of the flow control frame inspection method embodiment two.

[0127] Figure 4 The structure of a flow control frame verification device according to embodiment 2 is shown, including: a real-time information acquisition module 4110, a back pressure information generation module 4120, a desired control frame generation module 4210, a desired control frame statistics module 4220, an actual control frame acquisition module 4310, an actual control frame statistics module 4320, and an actual control frame verification module 4330.

[0128] The real-time information acquisition module 4110 is used to collect flow control information, flow control configuration parameters, and flow control frame mode parameters of the device under inspection in real time. For its working principle and advantages, please refer to step S2110 of Embodiment 2 of a flow control frame inspection method.

[0129] The backpressure information generation module 4120 is used to obtain backpressure information at each moment based on the port priority configuration parameters and the flow control information of the inlet port of the device under test obtained in real time. For its working principle and advantages, please refer to step S2120 of Embodiment 2 of a flow control frame verification method.

[0130] The expected control frame generation module 4210 is used to obtain the generation time of each flow control frame in each flow control process based on the flow control frame mode parameters and the back pressure information at each moment. For its working principle and advantages, please refer to step S2210 of Embodiment 2 of a flow control frame verification method.

[0131] The expected control frame statistics module 4220 is used to obtain the expected number of flow control frames in each flow control process based on the flow control frame mode parameters and the back pressure information at each moment. For its working principle and advantages, please refer to step S2220 of Embodiment 2 of a flow control frame verification method.

[0132] The actual control frame acquisition module 4310 is used to continuously collect the flow control frames output by the device under test, verify their content, and save the flow control frames with correct content. For its working principle and advantages, please refer to step S2310 of Embodiment 2 of a flow control frame verification method.

[0133] The actual control frame statistics module 4320 is used to count the timing and number of flow control frames for each flow control process based on the correct content of the flow control control frames. For its working principle and advantages, please refer to step S2320 of Example 2 of a flow control frame verification method.

[0134] The actual control frame verification module 4330 is used to compare the expected flow control frames of each flow control process with the actual number and timing of flow control frames of the device under test, in order to verify the flow control frame generation rules of the device under test. For its working principle and advantages, please refer to step S2330 of Embodiment 2 of a flow control frame verification method.

[0135] This invention also provides a switch, including a flow control frame verification device according to Embodiment 1 or the device described in Embodiment 1 of the flow control frame verification device.

[0136] This invention also provides a computing device, which is described below. Figure 5 Detailed introduction.

[0137] The computing device 500 includes a processor 510, a memory 520, a communication interface 530, and a bus 540.

[0138] It should be understood that the communication interface 530 in the computing device 500 shown in the figure can be used to communicate with other devices.

[0139] The processor 510 can be connected to the memory 520. The memory 520 can be used to store the program code and data. Therefore, the memory 520 can be a storage unit inside the processor 510, an external storage unit independent of the processor 510, or a component that includes both the storage unit inside the processor 510 and the external storage unit independent of the processor 510.

[0140] Optionally, the computing device 500 may also include a bus 540. The memory 520 and communication interface 530 can be connected to the processor 510 via the bus 540. The bus 540 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus 540 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one line is used in this figure, but this does not mean that there is only one bus or one type of bus.

[0141] It should be understood that in this embodiment of the invention, the processor 510 may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. Alternatively, the processor 510 may employ one or more integrated circuits to execute relevant programs to implement the technical solutions provided in this embodiment of the invention.

[0142] The memory 520 may include read-only memory and random access memory, and provides instructions and data to the processor 510. A portion of the processor 510 may also include non-volatile random access memory. For example, the processor 510 may also store device type information.

[0143] When the computing device 500 is running, the processor 510 executes computer execution instructions stored in the memory 520 to perform the operation steps of each method embodiment.

[0144] It should be understood that the computing device 500 according to the embodiments of the present invention can correspond to the corresponding subject in executing the methods according to the various embodiments of the present invention, and the above and other operations and / or functions of each module in the computing device 500 are respectively for implementing the corresponding processes of the methods in the embodiments of the present method. For the sake of brevity, they will not be described in detail here.

[0145] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0146] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0147] In the embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0148] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this method embodiment according to actual needs.

[0149] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0150] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the decoding method described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0151] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is used to perform the operation steps of the various method embodiments.

[0152] The computer-readable storage medium of this invention can be any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0153] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0154] The program code contained on a computer-readable medium may be transmitted using any suitable medium, including, but not limited to, wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0155] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0156] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, all of which fall within the scope of protection of the present invention.

Claims

1. A method for verifying flow control frames, characterized in that, include: The back pressure information at each moment is obtained based on the port priority configuration parameters and the flow control information of the inlet port of the device under test obtained in real time. The back pressure information at each moment includes the back pressure control information of each inlet port of the device under test to the outlet port of the upper-level device at that moment. The desired flow control frame information is obtained based on the flow control frame mode parameters and the back pressure information at each time. The flow control frame information includes at least the number and the time of generation. The flow control frame mode parameters include parameters that control the generation of flow control frames. The expected flow control frame information is compared with the actual flow control frame information of the device under test (DUT) to verify the flow control frame generation rules of the DUT, including: Does the actual number of flow control frames in each flow control process fall within the expected maximum and minimum number of flow control frames? Does the time difference between the actual generation time of the flow control frame and the corresponding expected generation time of the flow control frame in each flow control process fall within the set threshold? 2. The method according to claim 1, characterized in that, Each flow control process includes the period from when its corresponding flow control is applied to when its corresponding flow control is revoked.

3. The method according to claim 1, characterized in that, Before comparing the expected flow control frame information with the actual flow control frame information of the device under test, it is also necessary to verify whether the content of the actual flow control frame conforms to the specification.

4. The method according to claim 1, characterized in that, The backpressure information includes whether the backpressure of each inlet port to the outlet port of the upstream device is enabled, or whether the backpressure of each queue to the corresponding queue in the outlet port of the upstream device is enabled.

5. The method according to claim 1, characterized in that, The flow control information includes at least the flow control status of the port or queue; The port priority configuration parameters include at least port flow control enable and queue flow control enable; The flow control frame mode parameters include at least the pause duration, the number of flow control frames, the enable of the resume frame, and the selection of PFC and Pause frames.

6. The method according to claim 5, characterized in that, The flow control information also includes at least a comparison between the flow of a port or queue and the dual waterline; The port priority configuration parameters include at least port dual waterline enable and queue dual waterline enable.

7. A device for verifying flow control frames, characterized in that, include: The back pressure information generation module is used to obtain the back pressure information at each moment based on the port priority configuration parameters and the flow control information of the inlet port of the device under test obtained in real time. The back pressure information at each moment includes the back pressure control information of each inlet port of the device under test to the outlet port of the upper-level device at that moment. The expected control frame generation module is used to obtain expected flow control frame information based on the flow control frame mode parameters and the backpressure information at each time. The flow control frame information includes at least the type, number, and generation time of the flow control frame. The flow control frame mode parameters include parameters that control the generation of the flow control frame. The actual control frame verification module is used to compare the expected flow control frame information with the actual flow control frame information of the device under test (DUT) to verify the flow control frame generation rules of the DUT, including: Does the actual number of flow control frames in each flow control process fall within the expected maximum and minimum number of flow control frames? Does the time difference between the actual generation time of the flow control frame and the corresponding expected generation time of the flow control frame in each flow control process fall within the set threshold? 8. A switch, characterized in that, Includes the apparatus of claim 7.

9. A computer-readable storage medium, characterized in that, It contains a computer program that, when executed by a computer, is used to perform the method described in any one of claims 1 to 6.