Test method, device, equipment and medium for scheduler in switch chip

By backfilling the traffic mark value of the to-forward data queue in the switching chip, determining the actual backfill weight and comparing it with the expected value, the problem of inability to effectively test the backfill weight in the prior art is solved, and a more fine-grained scheduler functional test is achieved.

CN115865767BActive Publication Date: 2025-05-16WXILICON TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211526619.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-30
Publication Date
2025-05-16
Estimated Expiration
2042-11-30

AI Technical Summary

Technical Problem

When testing the correctness of the DWRR scheduler function, the prior art cannot effectively test whether the backfill weight is correct, and the statistical methods are rough, so the rate accuracy range cannot be verified.

Method used

By backfilling the traffic mark value of the data queue to be forwarded in the switching chip, sampling the backfill value and backfilling the traffic mark value at the backfill time point, the actual backfill weight is determined, and compared with the expected value, and the error prompt information is output.

Benefits of technology

The backfill weights are tested, the test indicators are enriched, and the fine-grainedness of scheduler functional testing is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115865767B_ABST
    Figure CN115865767B_ABST
Patent Text Reader

Abstract

This disclosure discloses a testing method, apparatus, device, and medium for a scheduler in a switching chip. The specific implementation of the method includes: for a target data queue in at least one data queue to be forwarded corresponding to the switching chip, in response to backfilling of the traffic marker value corresponding to the target data queue to change the traffic marker value from negative to non-negative, sampling the backfilled value and the backfilled traffic marker value at the corresponding backfilling time point; determining the actual backfilling weight of the target data queue based on the backfilled value and the backfilled traffic marker value at the corresponding backfilling time point; comparing the actual backfilling weight with the expected backfilling weight value contained in the configuration file; and outputting a prompt message indicating an error in the actual backfilling weight in response to a discrepancy between the actual backfilling weight and the expected backfilling weight value. This implementation achieves the testing of backfilling weight.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular to a test method, device, equipment, and medium for a scheduler in a switching chip. Background Art

[0002] The switch chip is the core component of the switch to realize the data forwarding function. The switch chip is an application-specific integrated circuit (ASIC) used to exchange and process large amounts of data and forward messages. It is one of the core parts of the switch. The purpose of using the DWRR scheduler in the switch chip is to ensure the fairness of the traffic of each queue in the case of congestion, so that each queue can obtain a corresponding proportion of traffic (byte traffic) according to the weight ratio in the same time. The correctness of the DWRR scheduler function is usually tested by a fuzzy statistical verification method.

[0003] However, the inventors have found that when the above method is used to test the correctness of the DWRR scheduler function, the following technical problems often occur:

[0004] First, the above method can only test a single indicator and cannot test whether the backfill weight is correct;

[0005] Second, the above method relies on the selection of statistical start and end times, which can only ensure that the rate of the traffic passing through is within an approximate range, and cannot prove the correctness of the DWRR scheduling algorithm;

[0006] Third, since such statistics are rough, the above approach cannot verify the range of the limited rate accuracy.

[0007] The above information disclosed in this Background section is only for enhancement of understanding of the background of the inventive concept and therefore it may contain information that does not form the prior art that is already known in this country to a person of ordinary skill in the art. Summary of the invention

[0008] The content of this disclosure is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.

[0009] Some embodiments of the present disclosure propose a test method, apparatus, device, and computer-readable medium for a scheduler in a switching chip to solve one or more of the technical problems mentioned in the above background technology section.

[0010] In a first aspect, some embodiments of the present disclosure provide a testing method for a scheduler in a switching chip, the method comprising: for a target data queue to be forwarded in at least one data queue to be forwarded corresponding to the switching chip, backfilling occurs in response to a traffic mark value corresponding to the target data queue to be forwarded, so that the traffic mark value is changed from a negative number to a non-negative number, sampling the backfill value and the post-backfill traffic mark value corresponding to the backfill time point; determining the actual backfill weight of the target data queue to be forwarded based on the backfill value and the post-backfill traffic mark value corresponding to the backfill time point; comparing the actual backfill weight with the expected backfill weight value contained in a configuration file; in response to the actual backfill weight and the expected backfill weight value being inconsistent, outputting a prompt message indicating that the actual backfill weight is wrong.

[0011] In the second aspect, some embodiments of the present disclosure provide a test device for a scheduler in a switching chip, the device comprising: a sampling unit, configured to backfill a target data queue in at least one data queue to be forwarded corresponding to the switching chip in response to a flow mark value corresponding to the target data queue to be forwarded, so that the flow mark value is transformed from a negative number to a non-negative number, and to sample the backfill value and the flow mark value after backfilling corresponding to the backfill time point; a determination unit, configured to determine the actual backfill weight of the target data queue to be forwarded according to the backfill value and the flow mark value after backfilling corresponding to the backfill time point; a marking unit, configured to compare the actual backfill weight with the expected backfill weight value contained in the configuration file; an output unit, configured to output a prompt message representing an actual backfill weight error in response to the inconsistency between the actual backfill weight and the expected backfill weight value. In the third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device, on which one or more programs are stored, and when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation of the first aspect above.

[0012] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner of the above-mentioned first aspect is implemented.

[0013] The above-mentioned embodiments of the present disclosure have the following beneficial effects: by calculating the actual backfill weight and comparing it with the expected backfill weight value, prompt information representing the actual backfill weight error can be output, thereby realizing the test of the backfill weight, thereby enriching the test indicators and realizing a more fine-grained scheduler function test. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0015] Figure 1 is a flow chart of some embodiments of a method for testing a scheduler in a switch chip according to the present disclosure;

[0016] Figure 2 is a flow chart of other embodiments of a method for testing a scheduler in a switching chip according to the present disclosure;

[0017] Figure 3 is a schematic structural diagram of some embodiments of a test device for a scheduler in a switch chip according to some embodiments of the present disclosure;

[0018] Figure 4 Parameters corresponding to multiple backfill time points are shown as examples. DETAILED DESCRIPTION

[0019] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0020] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.

[0021] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0022] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0023] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0024] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0025] refer to Figure 1 , shows a process 100 of some embodiments of a method for testing a scheduler in a switching chip according to the present disclosure. The method for testing a scheduler in a switching chip comprises the following steps:

[0026] Step 101, for a target data queue to be forwarded in at least one data queue to be forwarded corresponding to the switching chip, backfilling occurs in response to a traffic mark value corresponding to the target data queue to be forwarded, so that the traffic mark value is transformed from a negative number to a non-negative number, and the backfill value and the backfilled traffic mark value corresponding to the backfill time point are sampled.

[0027] In some embodiments, the execution subject of the test method of the scheduler in the switching chip can be a switching chip or other electronic device. In practice, the above-mentioned execution subject can assign a flow mark (token) to the data queue to be forwarded in the multiple data queues to be forwarded corresponding to the switching chip. The flow mark is used to mark how much flow the current data queue to be forwarded can pass. When the flow mark value is positive, it can pass the flow, and when it is negative, it means that the flow is not allowed (not allowed to participate in this round of scheduling). When the target data queue to be forwarded participates in this round of scheduling, the flow mark value corresponding to the target data queue to be forwarded is deducted from the corresponding flow deduction value, and the flow deduction value can be obtained by multiplying the number of bytes of the flow of the target data queue to be forwarded in this round by the corresponding ratio value. Among them, the ratio value can be pre-specified. When the flow mark values ​​corresponding to all the data queues to be forwarded in at least one data queue to be forwarded are negative, it is necessary to reallocate the flow value of the corresponding weight to each data queue to be forwarded, and add the newly allocated flow value to the flow mark value of the data queue to be forwarded (currently negative) to obtain the added flow mark value. This process is called backfilling.

[0028] On this basis, the above-mentioned execution subject can monitor the traffic mark value of each of at least one data queue to be forwarded, and when the traffic mark value of a data queue to be forwarded changes from a negative number to a non-negative number after a backfill, the time point corresponding to this backfill, that is, the traffic mark value after backfilling at the backfill time point, and the sampled backfill value. Among them, the target data queue to be forwarded can be any data queue to be forwarded in at least one data queue to be forwarded. Each data queue to be forwarded corresponds to a forwarding priority. Usually, each port of the switching chip can correspond to 8 data queues to be forwarded.

[0029] like Figure 4As shown, T0 is used as a cycle for explanation. When token is positive, overflow is allowed. The flow deduction value during the overflow period is (-x0). When token changes from positive to negative, overflow is stopped until backfilling at the backfill time point. The backfill value is (n0*m0). After backfilling, token becomes positive and overflow can continue. The same applies to other cycles. Figure 4 Three cycles are shown as an example, and the deduction values ​​of the remaining two cycles are (-x1) and (-x2), and the backfill values ​​are n1*m1 and n2*m2.

[0030] Step 102, determining the actual backfill weight of the target to-be-forwarded data queue according to the backfill value (n*m) and the post-backfill traffic mark value corresponding to the backfill time point.

[0031] In some embodiments, the following steps may be performed: determining the actual backfill weight of the target queue of data to be forwarded:

[0032] Step 1: taking the sum of the flow deduction values ​​corresponding to a plurality of historical backfill time points and the flow mark value after backfilling at the current backfill time point as the first sum value;

[0033] Step 2: Determine the sum of the backfill weight multiples corresponding to a plurality of historical backfill time points as the second sum value;

[0034] Step 3: Determine the actual backfill weight of the target queue for forwarding data according to the ratio of the first sum value to the second sum value.

[0035] In addition, the actual backfill weight n of the target data queue to be forwarded can be determined by the queue weight value calculation model. real , n real is a real number:

[0036]

[0037] Among them, x i It represents the flow deduction value corresponding to the time period between the i-1th backfill time point and the ith backfill time point. The flow deduction value can be obtained by multiplying the number of bytes flowing through by the corresponding ratio value. k is the total number of backfills, m i is the backfill weight multiple, which indicates the m-weighted traffic value corresponding to the i-th backfill time point. The m used by each queue of data to be forwarded at the same backfill time is equal, and the m value can be pre-configured. Δt k Indicates the traffic mark value after backfilling at the kth backfill time point.

[0038] The above queue weight value calculation model can be inferred and demonstrated through the following steps:

[0039] Δt0=n0×m0+0-x0 (0)

[0040] Δt1=n1×m1+Δt0-x1 (1)

[0041] Δt2=n2×m2+Δt1-x2 (2)

[0042] …

[0043] Δt k =n k ×m k +Δt k-1 -x k (k)

[0044] Adding the left and right sides of equations (0) to (k) will yield the following formula:

[0045] x0+x1+x2+…+x k =(n0m0+n1m1+n2m2+…+n k m k )-Δt k +0

[0046] set up:

[0047] n min =min{n0,n1,n2,...n k};n max =max{n0,n n , n2,...n k}

[0048] but:

[0049]

[0050] set up:

[0051] n real ∈{n min , ..., n max}, that is, satisfying n min ≤n real ≤n max

[0052] There is always a real number n real So that:

[0053]

[0054] Therefore, the actual backfill weight n of the target queue for forwarding data can be determined by the above queue weight value calculation model. real .

[0055] Step 103 , compare the actual backfill weight with the expected backfill weight value contained in the configuration file.

[0056] In some embodiments, upon determining the actual backfill weight, the actual backfill weight may be compared to an expected backfill weight value.

[0057] Step 104: In response to the inconsistency between the actual backfill weight and the expected backfill weight, outputting prompt information indicating that the actual backfill weight is wrong.

[0058] In some embodiments, if the actual backfill weight is inconsistent with the expected backfill weight value, a prompt message representing the actual backfill weight error can be output to implement the backfill weight test, thereby enriching the test indicators and implementing a more fine-grained scheduler function test.

[0059] Further references Figure 2 , which shows a process 200 of another embodiment of a method for testing a scheduler in a switching chip. The process 200 of the method for testing a scheduler in a switching chip includes the following steps:

[0060] Step 201, for a target data queue to be forwarded in at least one data queue to be forwarded corresponding to the switching chip, backfilling occurs in response to a traffic mark value corresponding to the target data queue to be forwarded, so that the traffic mark value is transformed from a negative number to a non-negative number, and the backfill value and the backfilled traffic mark value corresponding to the backfill time point are sampled.

[0061] Step 202 , determining the actual backfill weight of the target to-be-forwarded data queue according to the backfill value and the post-backfill traffic mark value corresponding to the backfill time point.

[0062] Step 203, compare the actual backfill weight with the expected backfill weight value contained in the configuration file.

[0063] Step 204: In response to the inconsistency between the actual backfill weight and the expected backfill weight, outputting prompt information indicating that the actual backfill weight is wrong.

[0064] In some embodiments, the specific implementation of steps 201-204 and the technical effects thereof can be referred to in Figure 1 The corresponding embodiments will not be described in detail here.

[0065] Step 205: determine the actual rate corresponding to the target queue of data to be forwarded.

[0066] In some embodiments, the actual rate may be determined by:

[0067] Step 1: determine the traffic deduction value corresponding to the target data queue to be forwarded within the target time period and the duration of the target time period, wherein the start time point of the target time period is the time point corresponding to the traffic mark value corresponding to each data queue to be forwarded in the Nth data queue to be forwarded changes from a negative number to a non-negative number, and the end time point of the target time period is the time point corresponding to the traffic mark value corresponding to each data queue to be forwarded in the N+1th data queue to be forwarded changes from a negative number to a non-negative number.

[0068] Step 2: Determine the actual rate corresponding to the target queue of data to be forwarded according to the traffic deduction value and the duration of the target time period.

[0069] In some embodiments, ΔT represents the duration of the target time period. -0 Indicates the traffic mark value after backfilling the previous time node of the current backfill time node of the data queue X to be forwarded. For the data queue X to be forwarded, the corresponding actual rate

[0070]

[0071]

[0072] Step 206: If the at least one queue of data to be forwarded includes only one queue of data to be forwarded, determine whether an actual rate corresponding to the one queue of data to be forwarded is consistent with the channel bandwidth.

[0073] In some embodiments, for a single queue congestion scenario, the queue bandwidth is the channel bandwidth and needs to satisfy Equal to the channel bandwidth, because in the case of a single queue, all bandwidth is occupied by the queue.

[0074] Step 207: If the actual rate corresponding to a queue of data to be forwarded is inconsistent with the channel bandwidth, a prompt message indicating that the actual rate is wrong is output.

[0075] Step 208, if at least one queue of data to be forwarded includes multiple queues of data to be forwarded, for any two queues of data to be forwarded of the multiple queues of data to be forwarded, determine the actual rate corresponding to one of the two queues of data to be forwarded and use it as the first actual rate, and determine the actual rate corresponding to the other queue of data to be forwarded of the two queues of data to be forwarded and use it as the second actual rate.

[0076] In some embodiments, assuming that the weights of two queues X and Y of data to be forwarded are n and a respectively, according to the queue weight value calculation model, that is, formula (r), the following can be obtained:

[0077]

[0078] Among them, rate real_y Indicates the actual rate of the queue Y of data to be forwarded, n k and a k are the weights used by the two queues X and Y for forwarding data to be backfilled at the kth backfill time point. Δt_a -0 Indicates the traffic mark value after the backfill at the time node before the current backfill time node of the queue Y for data to be forwarded.

[0079] The actual rate ratio can be directly calculated by the deduction value of each overcurrent, the formula is:

[0080]

[0081] The expected rate ratio is calculated by the following formula:

[0082]

[0083] Among them, n cfg_x and a cfg_y are the expected backfill weight values ​​corresponding to the to-be-forwarded data queues X and Y respectively.

[0084] Step 209: Determine whether the ratio of the first actual rate to the second actual rate is consistent with the ratio of the expected rates corresponding to the two queues of data to be forwarded.

[0085] In some embodiments, it may be determined whether the following formula is satisfied:

[0086]

[0087] Step 10: If the ratio of the first actual rate to the second actual rate is inconsistent with the ratio of the expected rates corresponding to the two queues of data to be forwarded, output a prompt message indicating that the actual bandwidth allocation ratio is wrong.

[0088] from Figure 2 It can be seen that Figure 1 Compared with the description of some corresponding embodiments, Figure 2 In some corresponding embodiments, a test process for the actual bandwidth allocation ratio is added, thereby implementing the actual bandwidth allocation ratio test and ensuring that the actual bandwidth allocation ratio complies with the configured allocation ratio.

[0089] In some optional implementations of some embodiments, the above method also includes: scheduling the queue to be forwarded whose traffic mark value is non-negative in at least one queue of data to be forwarded through polling scheduling to obtain an actual scheduling result; in response to the actual scheduling result being inconsistent with the expected scheduling result, outputting prompt information representing the scheduling error.

[0090] The above execution subject can schedule the non-negative number of queues of data to be forwarded according to the RR algorithm. Among them, the RR algorithm (Round Robin) is a scheduling algorithm that ensures that each queue has the same scheduling opportunity; taking 8 priorities as an example, the corresponding scheduling order is as shown in the following sequence: 0-1-2-3-4-5-6-7-0-1-2-3-4-5-6-7-0-1-2-3-4-5-6-7-…, thereby ensuring that each queue has the same scheduling opportunity.

[0091] Further references Figure 3 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a test device for a scheduler in a switching chip. These device embodiments are similar to Figure 1 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0092] like Figure 3 As shown, the test device 300 of the scheduler in the switching chip of some embodiments includes: the sampling unit 301 is configured to backfill the target data queue to be forwarded in at least one data queue to be forwarded corresponding to the switching chip in response to the traffic mark value corresponding to the target data queue to be forwarded, so that the traffic mark value is transformed from a negative number to a non-negative number, and the sampling backfill value and the backfill time point The corresponding traffic mark value after backfilling. The determination unit 302 is configured to determine the actual backfill weight of the target data queue to be forwarded based on the backfill value and the backfill time point The traffic mark value after backfilling. The marking unit 303 is configured to compare the actual backfill weight with the expected backfill weight value contained in the configuration file. The output unit 304 is configured to output a prompt message indicating that the actual backfill weight is wrong in response to the inconsistency between the actual backfill weight and the expected backfill weight value.

[0093] It is understood that the units described in the device 300 are similar to those described in the reference Figure 1 Therefore, the operations, features and beneficial effects described in the above method are also applicable to the device 300 and the units contained therein, and will not be described in detail here.

[0094] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. When the computer program is executed, the above functions defined in the method of some embodiments of the present disclosure are executed.

[0095] It should be noted that the computer-readable medium recorded in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0096] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (Hyper Text Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0097] The computer-readable medium may be included in the electronic device; or it may exist independently without being assembled into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: for the target data queue to be forwarded in at least one data queue to be forwarded corresponding to the switching chip, in response to the flow mark value corresponding to the target data queue to be forwarded, backfill occurs so that the flow mark value is transformed from a negative number to a non-negative number, and the backfill value and the backfilled flow mark value corresponding to the backfill time point are sampled; according to the backfill value and the backfilled flow mark value corresponding to the backfill time point, the actual backfill weight of the target data queue to be forwarded is determined; the actual backfill weight is compared with the expected backfill weight value contained in the configuration file; in response to the inconsistency between the actual backfill weight and the expected backfill weight value, a prompt message indicating that the actual backfill weight is wrong is output.

[0098] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as a separate software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may 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 may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0099] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0100] The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The described units may also be provided in a processor, for example, may be described as: a processor including a sampling unit, a determination unit, a marking unit, and an output unit. The names of these units do not constitute limitations on the units themselves in certain circumstances, for example, the sampling unit may also be described as a "unit for sampling backfill values ​​and post-backfill flow marking values ​​corresponding to backfill time points".

[0101] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0102] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) and the technical solutions formed.

Claims

1. A method for testing a scheduler in a switching chip, comprising: For a target data queue to be forwarded in at least one data queue to be forwarded corresponding to the switching chip, in response to a backfill of a flow mark value corresponding to the target data queue to be forwarded, so that the flow mark value is transformed from a negative number to a non-negative number, sampling the backfill value and the backfilled flow mark value corresponding to the backfill time point; Determining an actual backfill weight of the target to-be-forwarded data queue according to the backfill value and the backfill time point corresponding to the post-backfill traffic mark value; comparing the actual backfill weight to a desired backfill weight value contained in a configuration file; In response to the actual backfill weight being inconsistent with the expected backfill weight value, a prompt message indicating that the actual backfill weight is wrong is output.

2. The method according to claim 1, wherein: The method further comprises: Determine an actual rate corresponding to the target queue of data to be forwarded; If the at least one queue of data to be forwarded includes only one queue of data to be forwarded, determining whether an actual rate corresponding to the one queue of data to be forwarded is consistent with the channel bandwidth; If the actual rate corresponding to the one queue of data to be forwarded is inconsistent with the channel bandwidth, a prompt message indicating that the actual rate is wrong is output.

3. The method according to claim 2, wherein: The determining an actual rate corresponding to the target queue of data to be forwarded includes: Determine the flow deduction value corresponding to the target data queue to be forwarded within the target time period and the duration of the target time period, wherein the starting time point of the target time period is the time point corresponding to the change of the flow mark value corresponding to each data queue to be forwarded in the data queue to be forwarded for the Nth time from a negative number to a non-negative number, and the ending time point of the target time period is the time point corresponding to the change of the flow mark value corresponding to each data queue to be forwarded in the data queue to be forwarded for the N+1th time from a negative number to a non-negative number; An actual rate corresponding to the target queue of data to be forwarded is determined according to the flow deduction value and the duration of the target time period.

4. The method according to claim 2 or 3, wherein: The method further comprises: If the at least one queue of data to be forwarded includes a plurality of queues of data to be forwarded, for any two of the plurality of queues of data to be forwarded, determining an actual rate corresponding to one of the two queues of data to be forwarded as a first actual rate, and determining an actual rate corresponding to the other of the two queues of data to be forwarded as a second actual rate; Determining whether a ratio of the first actual rate to the second actual rate is consistent with a ratio of expected rates corresponding to the two queues of data to be forwarded; If the ratio of the first actual rate to the second actual rate is inconsistent with the ratio of the expected rates corresponding to the two queues of data to be forwarded, a prompt message indicating that the actual bandwidth allocation ratio is wrong is output.

5. The method according to claim 4, wherein: The determining, according to the backfill value and the post-backfill traffic mark value corresponding to the backfill time point, an actual backfill weight of the target to-be-forwarded data queue includes: The sum of the flow deduction values ​​corresponding to the multiple historical backfill time points and the flow mark value after backfilling at the current backfill time point is used as a first sum value; Determine the sum of the backfill weight multiples corresponding to the plurality of historical backfill time points respectively as a second sum value; An actual backfill weight of the target to-be-forwarded data queue is determined according to a ratio of the first summed value to the second summed value.

6. The method according to claim 5, wherein: The method further comprises: Scheduling the queues to be forwarded whose traffic mark values ​​are non-negative in the at least one queue of data to be forwarded by polling scheduling to obtain an actual scheduling result; In response to the actual scheduling result being inconsistent with the expected scheduling result, prompt information indicating a scheduling error is output.

7. A test device for a scheduler in a switching chip, comprising: The sampling unit is configured to, for a target data queue to be forwarded in at least one data queue to be forwarded corresponding to the switching chip, backfill in response to a flow mark value corresponding to the target data queue to be forwarded, so that the flow mark value is transformed from a negative number to a non-negative number, and sample the backfill value and the backfilled flow mark value corresponding to the backfill time point; a determining unit configured to determine an actual backfill weight of the target to-be-forwarded data queue according to the backfill value and a post-backfill traffic mark value corresponding to a backfill time point; a marking unit configured to compare the actual backfill weight with an expected backfill weight value contained in a configuration file; The output unit is configured to output prompt information indicating that the actual backfill weight is wrong in response to the inconsistency between the actual backfill weight and the expected backfill weight.

8. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer readable medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Queue scheduling method and apparatus

    CN102326369A

  • Queue scheduling method, device and equipment and storage medium

    CN110445729A