Delay tolerance value determination method and device, computer equipment and storage medium
By identifying effective downstream ports and aggregating their delay tolerance values, the problem of low aggregation efficiency in PCIe bus systems is solved, and timely updates of delay tolerance values and system performance improvements are achieved.
Patent Information
- Application Number
- CN202411203595.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-12-06
AI Technical Summary
When the switches aggregate delay tolerance value in PCIe bus system, unused and unupdated downstream port information leads to inefficient acquisition of aggregated LTR information and cannot be updated in time.
By determining the current mode of the port component, identifying effective downstream ports and only aggregating delay tolerance values is performed on them, improving aggregation efficiency, ensuring that only the delay tolerance values to be updated participate in the comparison, and realizing timely updates of the delay tolerance values.
Improves the efficiency of obtaining delay tolerance values, ensures system performance and the effectiveness of low-power strategies, reduces invalid comparisons, and improves the efficiency of reporting delay tolerance values to upstream ports.
Smart Images

Figure CN119094399A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer communication technology, and in particular to a method and device for determining a delay tolerance value, a computer device and a storage medium. Background Art
[0002] A high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, referred to as PCIe) has revolutionized the way hardware devices are connected inside computers, improving data transmission efficiency and system performance. Latency Tolerance Reporting (LTR), as a key feature of the PCIE protocol, optimizes power management and allows PCIe devices to adjust system response time based on latency tolerance reports to balance performance and energy consumption.
[0003] In the related technology, the endpoint (EP) device in the PCIe bus system is responsible for packaging and uploading LTR information, and the switch (Switch) is used to aggregate the LTR information received by each downstream port (DSP), determine the minimum delay tolerance value, and send the aggregated LTR information to the upstream port (USP) after considering the delay inside the Switch.
[0004] However, when the switch aggregates the LTR information received by each downstream port and determines the minimum delay tolerance value, it aggregates the LTR information of the unused downstream ports and the LTR information of the downstream ports that have not performed LTR update, resulting in low efficiency in obtaining the aggregated LTR information and failure to complete the timely update of the LTR information. Summary of the invention
[0005] In view of this, the present invention provides a method, apparatus, computer device and storage medium for determining a delay tolerance value to solve the problem in the related art that the efficiency of obtaining aggregated LTR information is low and the timely update of LTR information cannot be completed.
[0006] In a first aspect, the present invention provides a method for determining a delay tolerance value, the method comprising:
[0007] For any port component in the switch, based on the current port mode of the port component, determine the port usage vectors of multiple downstream ports of the port component;
[0008] Determining a valid downstream port based on a port usage vector of the downstream port;
[0009] Determining a target downstream port based on a trigger state of delay tolerance update enable of the valid downstream port;
[0010] Obtaining a delay tolerance value to be reported of the target downstream port;
[0011] Determining a minimum delay tolerance value based on the delay tolerance value to be reported of the target downstream port;
[0012] Based on the minimum delay tolerance value and the port transmission delay tolerance value, a target delay tolerance value reported to the upstream port is determined.
[0013] The delay tolerance value determination method provided in this embodiment determines the port usage vectors of multiple downstream ports of the port component according to the current port mode of the port component, determines the effective downstream port based on the port usage vector of the downstream port, determines the target downstream port based on the trigger state of the delay tolerance update enable of the effective downstream port, determines the minimum delay tolerance value based on the delay tolerance value to be reported of the target downstream port, and determines the target delay tolerance value reported to the upstream port based on the minimum delay tolerance value and the port transmission delay tolerance value. In the case of aggregating the delay tolerance values, only the delay tolerance values corresponding to the target downstream ports in the effective downstream ports are aggregated, thereby improving the efficiency of obtaining the target delay tolerance value and realizing the timely update of the delay tolerance value.
[0014] In an optional implementation, determining the port usage vectors of the plurality of downstream ports of the port component based on the current port mode of the port component includes:
[0015] Determine, based on a first preset mapping table of the port component, the use status of multiple downstream ports of the port component in the current port mode of the port component, wherein the first preset mapping table includes a correspondence between the port mode of the port component and the use status of multiple downstream ports of the port component;
[0016] Based on the usage status of the multiple downstream ports of the port component, the port usage vectors of the multiple downstream ports of the port component are determined.
[0017] The method for determining the delay tolerance value provided by the present embodiment determines the usage status of multiple downstream ports of the port component in the current port mode of the port component through a first preset mapping table, determines the port usage vector of the downstream port according to the usage status of the downstream port, and then can determine the downstream port that can be used as a valid downstream port based on the usage status of the downstream port. In the case of aggregating the delay tolerance values, there is no need to aggregate the delay tolerance values of invalid downstream ports, thereby improving the efficiency of obtaining the delay tolerance values and realizing timely updating of the delay tolerance values.
[0018] In an optional implementation manner, determining the target downstream port based on the trigger state of the delay tolerance update enable of the valid downstream port includes:
[0019] In a case where the triggering state of the delay tolerance update enable of the valid downstream port is triggering delay tolerance update enable, the valid downstream port is determined to be a target downstream port.
[0020] The delay tolerance value determination method provided in this embodiment determines the effective downstream port whose triggering state of delay tolerance update enabling is triggering delay tolerance update enabling as the target downstream port, and then in the case of aggregating the delay tolerance values, it is only necessary to aggregate the delay tolerance values of the target downstream port, thereby improving the efficiency of obtaining the delay tolerance value and realizing timely updating of the delay tolerance value.
[0021] In an optional implementation, determining the minimum delay tolerance value based on the delay tolerance value to be reported of the target downstream port includes:
[0022] Determining a target mode for obtaining the minimum delay tolerance value based on the number of the target downstream ports;
[0023] The minimum delay tolerance value is determined based on the target mode and the delay tolerance value to be reported of the target downstream port.
[0024] The delay tolerance value determination method provided in this embodiment determines the target mode for obtaining the minimum delay tolerance value according to the number of target downstream ports, determines the minimum delay tolerance value based on the target mode and the delay tolerance value to be reported of the target downstream port, and obtains the minimum delay tolerance value by setting different target modes, thereby further improving the efficiency of obtaining the delay tolerance value.
[0025] In an optional implementation manner, determining the target mode for obtaining the minimum delay tolerance value based on the number of the target downstream ports includes:
[0026] When the number of the target downstream port is one, determining that the target mode for obtaining the minimum delay tolerance value is a pass-only mode;
[0027] When the number of the target downstream ports is greater than one, it is determined that the target mode for obtaining the minimum delay tolerance value is a normal mode.
[0028] The delay tolerance value determination method provided in this embodiment can adjust the manner of obtaining the minimum delay tolerance value according to the number of downstream ports by distinguishing different target modes, thereby further improving the efficiency of obtaining the delay tolerance value.
[0029] In an optional implementation, determining the minimum delay tolerance value based on the target mode and the delay tolerance value to be reported of the target downstream port includes:
[0030] In the case where the target mode is the pass-only mode, determining whether the to-be-reported delay tolerance value of the target downstream port is less than a current minimum delay tolerance value;
[0031] In a case where the delay tolerance value to be reported of the target downstream port is not less than the current minimum delay tolerance value, taking the current minimum delay tolerance value as the minimum delay tolerance value;
[0032] In the case that the delay tolerance value to be reported of the target downstream port is less than the current minimum delay tolerance value, updating the current minimum delay tolerance value, and using the delay tolerance value to be reported of the target downstream port as the minimum delay tolerance value;
[0033] When the target mode is a normal mode, filtering out the current downstream port to be compared from the target downstream ports according to the aggregation code of the target downstream port;
[0034] Determine whether the delay tolerance value to be reported of the current downstream port to be compared is less than the current minimum delay tolerance value;
[0035] When the delay tolerance value to be reported of the current downstream port to be compared is not less than the current minimum delay tolerance value, keeping the current minimum delay tolerance value unchanged;
[0036] When the delay tolerance value to be reported of the current downstream port to be compared is less than the current minimum delay tolerance value, updating the current minimum delay tolerance value to be the delay tolerance value to be reported of the current downstream port to be compared;
[0037] Return to execute the step of filtering out the current downstream port to be compared from the target downstream ports according to the aggregation coding of the target downstream port, until all the delay tolerance values to be reported of the target downstream ports are compared, and take the current minimum delay tolerance value as the minimum delay tolerance value.
[0038] The delay tolerance value determination method provided in this embodiment obtains the minimum delay tolerance value according to the target mode. When the target mode is the pass-only mode, the minimum delay tolerance value can be confirmed according to the delay tolerance value of the only target downstream port. When the target mode is the normal mode, the minimum delay tolerance value is determined by continuously comparing and updating the current minimum delay tolerance value. This ensures that when only one target downstream port updates the delay tolerance value, the target delay tolerance value can be reported to the upstream port faster and more efficiently, thereby improving the efficiency of reporting the target delay tolerance value to the upstream port and improving the system's performance and low power consumption strategy.
[0039] In an optional implementation, determining the target delay tolerance value reported to the upstream port based on the minimum delay tolerance value and the port transmission delay tolerance value includes:
[0040] In the case where the minimum delay tolerance value is less than the minimum delay tolerance value obtained by the previous triggering of the delay tolerance update enable, and the minimum delay tolerance value is not less than the port transmission delay tolerance value, based on the minimum delay tolerance value and the port transmission delay tolerance value, determine the difference between the minimum delay tolerance value and the port transmission delay tolerance value, and use the difference as the target delay tolerance value reported to the upstream port;
[0041] When the minimum delay tolerance value is smaller than the minimum delay tolerance value obtained by the previous triggering of the delay tolerance update enable, and the minimum delay tolerance value is smaller than the port transmission delay tolerance value, the preset value is used as the target delay tolerance value reported to the upstream port.
[0042] The delay tolerance value determination method provided in this embodiment ensures the accuracy of the target delay tolerance value reported to the upstream port by considering the port transmission delay tolerance value.
[0043] In a second aspect, the present invention provides a device for determining a delay tolerance value, the device comprising:
[0044] A first determination module is used to determine, for any port component in the switch, a port usage vector of multiple downstream ports of the port component based on a current port mode of the port component;
[0045] A second determination module, configured to determine a valid downstream port based on a port usage vector of the downstream port;
[0046] A third determination module, configured to determine a target downstream port based on a trigger state of enabling delay tolerance update of the valid downstream port;
[0047] A first acquisition module, used to acquire a delay tolerance value to be reported of the target downstream port;
[0048] A fourth determination module, configured to determine a minimum delay tolerance value based on the delay tolerance value to be reported of the target downstream port;
[0049] The fifth determination module is used to determine a target delay tolerance value reported to the upstream port based on the minimum delay tolerance value and the port transmission delay tolerance value.
[0050] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the delay tolerance value determination method of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0051] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the delay tolerance value determination method of the above-mentioned first aspect or any corresponding embodiment thereof.
[0052] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the delay tolerance value determination method of the above-mentioned first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0054] Figure 1 This is a schematic diagram of the routing of LTR messages inside a Switch in the related art;
[0055] Figure 2 is a schematic diagram of a structure for reporting a delay tolerance value to USP in the related art;
[0056] Figure 3 is a schematic diagram of a structure for reporting a delay tolerance value to USP in the related art;
[0057] Figure 4 is a schematic flow chart of a method for determining a delay tolerance value according to an embodiment of the present invention;
[0058] Figure 5 is a flow chart of another method for determining a delay tolerance value according to an embodiment of the present invention;
[0059] Figure 6 is a schematic diagram of a first preset mapping table according to an embodiment of the present invention;
[0060] Figure 7 is a schematic diagram of a process for obtaining a minimum delay tolerance value in a pass-only mode according to an embodiment of the present invention;
[0061] Figure 8 is a schematic diagram of a process for obtaining a minimum delay tolerance value in a normal mode according to an embodiment of the present invention;
[0062] Fig. 9 is a structural block diagram of a system for determining a delay tolerance value according to an embodiment of the present invention;
[0063] Fig.10 is a schematic diagram of determining a target downstream port according to an embodiment of the present invention;
[0064] Fig.11 is a schematic diagram of allocating aggregate coding to a delay tolerance value of a target downstream port according to an embodiment of the present invention;
[0065] Fig.12 is a schematic diagram of another method for determining a target downstream port according to an embodiment of the present invention;
[0066] Fig.13 is a diagram comparing a process of reporting a delay tolerance value to an upstream port according to an embodiment of the present invention and a process of reporting a delay tolerance value to an upstream port in a related art;
[0067] Fig.14 is a structural block diagram of a device for determining a delay tolerance value according to an embodiment of the present invention;
[0068] Fig.15 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0070] PCIe is used to connect various hardware devices inside the computer, such as graphics cards, network cards, storage devices, etc. It replaces the old bus standards such as PCI, PCI-X and AGP, and innovates the connection method of hardware devices inside the computer. The PCIe bus uses an end-to-end connection method. Only one device can be connected at each end of a PCIe link. These two devices are both data senders and data receivers.
[0071] LTR is an optional feature specified in the PCIe protocol that can be used to improve the power management efficiency of the system. Through the LTR mechanism, PCIe devices can inform the system of the maximum response delay they can tolerate, as long as the system responds to the request from the PCIe device within this time. When the PCIe device needs it, the system responds quickly to the request from the PCIe device; when the PCIe device does not need it, the system can delay for a while before responding to the request from the PCIe device, as long as it does not exceed the time specified in the LTR information of the PCIe device, that is, it does not exceed the delay tolerance value of the PCIe device. It should be noted that LTR is the delay tolerance value.
[0072] For example, if the system receives a request from a PCIe device while in a low power state, the system may delay responding to the request from the PCIe device for a while to avoid frequent wake-up from the low power state.
[0073] In the related art, the EP device in the PCIe bus system is responsible for packaging and uploading LTR information. The EP device is at the very end of the PCIe bus system topology and generally acts as the initiator or terminator of the bus operation. Whenever the EP device's response time requirement for a request changes, an LTR message should be sent. Switch, as a device used to expand the connection capabilities of the PCIe bus, is similar to a switch in a network, allowing multiple PCIe devices to be connected to the same PCIe bus, thereby achieving management of communication and data transmission between multiple PCIe devices.
[0074] Figure 1 This is a schematic diagram of the routing of LTR messages inside a Switch in the related art. Figure 1As shown, according to the PCIe protocol, the Switch does not generate LTR information, but is used to aggregate the LTR information packaged and uploaded by each EP device received by each downstream port, determine the minimum delay tolerance value, and send the aggregated LTR information, i.e., the aggregated delay tolerance value, to the upstream port after considering the delay inside the Switch. Among them, the upstream port is usually connected to the root complex (RC) or the downstream port of another Switch, and is responsible for transmitting data to a place closer to the CPU, i.e., the upstream direction of data transmission. The downstream port is used to connect PCIe devices, or to connect to another Switch to expand more device connections, and data flows from the Switch to these devices, i.e., the downstream direction of data transmission.
[0075] Generally, a Switch includes a USP and multiple DSPs, and each DSP may send LTR information upward. When any DSP sends LTR information upward, the Switch needs to aggregate the LTR information.
[0076] Figure 2 Schematic diagram of the structure of reporting delay tolerance value to USP in the related art. Figure 2 As shown, the process of reporting the delay tolerance value to USP in the related art includes:
[0077] 1. When the system is initialized, the delay tolerance update enable trigger state of each downstream port is to trigger the delay tolerance update enable. At this time, the Switch stores the delay tolerance values in the LTR information sent by all DSPs in the storage block according to the DSP number ( Figure 2 In the example above, there are 31 DSPs in Switch.)
[0078] 2. Under the control of the first state machine, the first counter starts counting plus 1, and the first selector selects the delay tolerance value sent by the DSP with the corresponding number through the current count value of the first counter, and sends the delay tolerance value sent by the selected DSP to the comparison module. The comparison module is used to compare the delay tolerance value sent by the selected DSP with the current minimum delay tolerance value.
[0079] 3. If the delay tolerance value sent by the selected DSP is less than the current minimum delay tolerance value, then the delay tolerance value sent by the selected DSP will be used as the current minimum delay tolerance value; if the delay tolerance value of the selected DSP is greater than the current minimum delay tolerance value, then the current minimum delay tolerance value will remain unchanged.
[0080] It should be noted that the initial current minimum delay tolerance value is 0, but the current minimum delay tolerance value of 0 is invalid. That is to say, when the delay tolerance value sent by DSP No. 1 is compared with the initial current minimum delay tolerance value, the delay tolerance value sent by DSP No. 1 is directly used as the current minimum delay tolerance value.
[0081] 4. Figure 3 Schematic diagram of the structure of reporting delay tolerance value to USP in the related art. Figure 3 As shown, the above steps 2 and 3 are repeatedly performed until the delay tolerance values of all DSPs are compared, and the final determined current minimum delay tolerance value is sent to the first judgment module, and the first judgment module is used to determine whether the current minimum delay tolerance value is greater than the system delay tolerance value. The system delay tolerance value is the delay inside the Switch, that is, the delay in transmitting data from the downstream port to the upstream port.
[0082] 5. The first judgment module sends the judgment result to the second selector. When the judgment result is that the current minimum delay tolerance value is greater than the system delay tolerance value, the second selector outputs the difference between the current minimum delay tolerance value and the system delay tolerance value; when the judgment result is that the current minimum delay tolerance value is not greater than the system delay tolerance value, the second selector outputs a fixed value of 0. The output of the second selector is the delay tolerance value reported to the USP.
[0083] It should be noted that the first addition and subtraction calculator is used to calculate the difference between the current minimum delay tolerance value and the delay tolerance value of the system.
[0084] 6. After the system initialization is completed, if the trigger state of the delay tolerance update enable of one or more DSPs is triggering the delay tolerance update enable, then based on the updated delay tolerance value, the delay tolerance values of all downstream ports are compared to obtain the current minimum delay tolerance value. It should be noted that the delay tolerance value of the downstream port whose trigger state of the delay tolerance update enable is not triggering the delay tolerance update enable is the delay tolerance value previously uploaded by the downstream port.
[0085] It is understandable that if the current minimum delay tolerance value is the same as the minimum delay tolerance value obtained when one or more DSPs triggered the delay tolerance update enablement last time, the subsequent step of determining whether the current minimum delay tolerance value is greater than the system delay tolerance value will no longer be performed, that is, there is no need to send a new delay tolerance value to the USP. If the current minimum delay tolerance value is less than the minimum delay tolerance value obtained when one or more DSPs triggered the delay tolerance update enablement last time, the step of determining whether the current minimum delay tolerance value is greater than the system delay tolerance value will continue to be performed to obtain a new delay tolerance value uploaded to the USP.
[0086] However, in actual Switch, not all DSPs are used. When the switch aggregates the delay tolerance values sent by each downstream port and determines the minimum delay tolerance value, the delay tolerance values of the unused DSPs in the related technology will also be compared, resulting in a significant increase in the time to report the delay tolerance value to the USP, which seriously affects the reporting efficiency of the delay tolerance value. And when only one DSP initiates the delay tolerance update enable, the related technology will still compare the delay tolerance values of all DSPs to determine the minimum delay tolerance value and determine whether to send a new delay tolerance value to the USP. Therefore, the scheme for reporting the delay tolerance value to the USP in the related technology is less efficient in obtaining the delay tolerance value, resulting in the inability to update the response requirements of the EP device to the RC in a timely manner throughout the process, thereby affecting the system's performance and low power consumption strategy.
[0087] An embodiment of the present invention provides a method for determining a delay tolerance value, which determines the valid downstream ports in the port component, that is, the downstream ports that can be used, through the port mode of the port component. Unused downstream ports will not participate in the comparison of delay tolerance values, and only downstream ports enabled for starting delay tolerance update among the valid downstream ports will participate in the comparison of delay tolerance values to determine the minimum delay tolerance value, and then determine the target delay tolerance value reported to the upstream port to improve the efficiency of obtaining the target delay tolerance value and achieve the effect of timely updating of the delay tolerance value.
[0088] According to an embodiment of the present invention, an embodiment of a method for determining a delay tolerance value is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0089] In this embodiment, a method for determining a delay tolerance value is provided, which can be used in the above-mentioned switch. Figure 4is a flowchart of a method for determining a delay tolerance value according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0090] Step S401: for any port component in the switch, based on the current port mode of the port component, determine the port usage vectors of multiple downstream ports of the port component.
[0091] The switch allocates all downstream ports to different port components as needed. For any of the port components, the port usage vectors of the multiple downstream ports in the port component are determined according to the current port mode of the port component.
[0092] It should be noted that the port usage vector is used to represent the usage status of the downstream port.
[0093] Step S402: determining a valid downstream port based on the port usage vector of the downstream port.
[0094] After the port usage vectors of the downstream ports in all port components are obtained, the valid downstream ports are determined according to the port usage vectors of the downstream ports.
[0095] It should be noted that a valid downstream port is a downstream port that can be used, and an invalid downstream port is an unused downstream port, that is, a downstream port that will not be used in the current port mode.
[0096] Step S403: determining a target downstream port based on the delay tolerance update enabled triggering state of the effective downstream port.
[0097] After the effective downstream port is determined, the trigger state of the enable is updated according to the delay tolerance of the effective downstream port to determine the target downstream port.
[0098] It should be noted that the target downstream port is a downstream port whose delay tolerance value is updated among the valid downstream ports.
[0099] Step S404: Obtain the delay tolerance value to be reported of the target downstream port.
[0100] After the target downstream port is determined, the delay tolerance value to be reported of the target downstream port is obtained. The delay tolerance value to be reported is the updated delay tolerance value.
[0101] Step S405: determining a minimum delay tolerance value based on the delay tolerance value to be reported of the target downstream port.
[0102] After the delay tolerance values to be reported of the target downstream port are obtained, the minimum delay tolerance value therein, ie, the minimum delay tolerance value, is determined.
[0103] Step S406: determining a target delay tolerance value reported to the upstream port based on the minimum delay tolerance value and the port transmission delay tolerance value.
[0104] After the minimum delay tolerance value is determined, the target delay tolerance value reported to the upstream port is determined according to the minimum delay tolerance value and the port transmission delay tolerance value.
[0105] It should be noted that the port transmission delay tolerance value is the aforementioned internal delay of the Switch.
[0106] The delay tolerance value determination method provided in this embodiment determines the port usage vectors of multiple downstream ports of the port component according to the current port mode of the port component, determines the effective downstream port based on the port usage vector of the downstream port, determines the target downstream port based on the trigger state of the delay tolerance update enable of the effective downstream port, determines the minimum delay tolerance value based on the delay tolerance value to be reported of the target downstream port, and determines the target delay tolerance value reported to the upstream port based on the minimum delay tolerance value and the port transmission delay tolerance value. In the case of aggregating the delay tolerance values, only the delay tolerance values corresponding to the target downstream ports in the effective downstream ports are aggregated, thereby improving the efficiency of obtaining the target delay tolerance value and realizing the timely update of the delay tolerance value.
[0107] In this embodiment, a method for determining a delay tolerance value is provided, which can be used in the above-mentioned switch, etc. Figure 5 is a flowchart of a method for determining a delay tolerance value according to an embodiment of the present invention. Figure 5 As shown, the process includes the following steps:
[0108] Step S501: for any port component in the switch, based on the current port mode of the port component, determine the port usage vectors of multiple downstream ports of the port component.
[0109] Specifically, the above step S501 includes:
[0110] Step S5011, based on the first preset mapping table of the port component, determine the usage status of multiple downstream ports of the port component in the current port mode of the port component, the first preset mapping table includes the correspondence between the port mode of the port component and the usage status of multiple downstream ports of the port component.
[0111] Figure 6 is a schematic diagram of a first preset mapping table according to an embodiment of the present invention. Taking a port component in a Switch as an example, its corresponding first preset mapping table, i.e., the port component mapping table, is as follows: Figure 6As shown, according to the current port mode of the port component, the use status of multiple downstream ports of the port component in the current port mode is determined, that is, it is determined how many downstream ports in the port component will be used in the current port mode.
[0112] like Figure 6 As shown, the port component includes 8 downstream ports. When the port mode is selected (1), that is, the port mode (1) is valid, only the downstream port (1) will be used, that is, the use state of the downstream port (1) is 1, and the characterization can be used; the use state of the other downstream ports is 0, and the characterization will not be used, that is, it cannot be used. When the port mode is selected (2), that is, the port mode (2) is valid, the downstream port (1) and the downstream port (5) will be used, that is, the use state of the downstream port (1) and the downstream port (5) is 1, and the characterization can be used; the use state of the other downstream ports is 0, and the characterization will not be used. When the port mode is selected (3), that is, the port mode (3) is valid, the downstream port (1), the downstream port (3), the downstream port (5) and the downstream port (7) will be used, that is, the use state of the downstream port (1), the downstream port (3), the downstream port (5) and the downstream port (7) is 1, and the characterization can be used; the use state of the other downstream ports is 0, and the characterization will not be used. When the port mode selection (4) is selected, that is, the port mode (4) is valid, the use status of the eight downstream ports is 1, and it is determined that the eight downstream ports can be used.
[0113] It should be noted that the manner in which other port components obtain the usage status of their downstream ports is similar to the manner in which the usage status of the downstream port of the port component is obtained in the above exemplary embodiment, and will not be described in detail here.
[0114] Step S5012: Determine the port usage vectors of the multiple downstream ports of the port component based on the usage status of the multiple downstream ports of the port component.
[0115] Wherein, for any port component, after the usage status of multiple downstream ports of the port component is acquired, the port usage vectors of the multiple downstream ports of the port component are determined based on the usage status of the multiple downstream ports of the port component.
[0116] It should be noted that, if the usage state of the downstream port is 1, the corresponding port usage vector is 1; if the usage state of the downstream port is 0, the corresponding port usage vector is 0.
[0117] Step S502: determining a valid downstream port based on the port usage vector of the downstream port.
[0118] After the port usage vector of the downstream port is determined, for any downstream port, if the port usage vector of the downstream port is a first preset value, the downstream port is determined to be a valid downstream port.
[0119] It should be noted that the first preset value is 1. That is, a downstream port whose usage status is that it can be used is a valid downstream port.
[0120] Step S503: determining a target downstream port based on the delay tolerance update enabled triggering state of the effective downstream port.
[0121] Specifically, the above step S503 includes:
[0122] Step S5031: when the triggering state of the delay tolerance update enable of the valid downstream port is triggering delay tolerance update enable, determining the valid downstream port as the target downstream port.
[0123] Among them, after determining the valid downstream ports, among the valid downstream ports, if the trigger state of the delay tolerance update enable of any valid downstream port is triggering delay tolerance update enable, then the valid downstream port is determined to update the delay tolerance value and is determined to be the target downstream port.
[0124] Step S504, obtain the delay tolerance value to be reported of the target downstream port. Figure 4 Step S404 of the illustrated embodiment will not be described in detail here.
[0125] Step S505: determining a minimum delay tolerance value based on the delay tolerance value to be reported of the target downstream port.
[0126] Specifically, the above step S505 includes:
[0127] Step S5051: Determine a target mode for obtaining a minimum delay tolerance value based on the number of target downstream ports.
[0128] Among them, this embodiment ensures that the efficiency of obtaining the target delay tolerance value can be further improved by determining different target modes for obtaining the minimum delay tolerance value according to the number of target downstream ports.
[0129] Step S5052: Determine a minimum delay tolerance value based on the target mode and the delay tolerance value to be reported of the target downstream port.
[0130] After the target mode is determined, the minimum delay tolerance value is determined according to the determined target mode and the delay tolerance value to be reported of the target downstream port.
[0131] It should be noted that the delay tolerance value to be reported is the updated delay tolerance value.
[0132] Step S506: Determine the target delay tolerance value reported to the upstream port based on the minimum delay tolerance value and the port transmission delay tolerance value. Figure 4 Step S406 of the illustrated embodiment will not be described in detail here.
[0133] The method for determining the delay tolerance value provided by the present embodiment determines the usage status of multiple downstream ports of the port component in the current port mode of the port component through a first preset mapping table, determines the port usage vector of the downstream port according to the usage status of the downstream port, and then can determine the downstream port that can be used as a valid downstream port based on the usage status of the downstream port. In the case of aggregating the delay tolerance values, there is no need to aggregate the delay tolerance values of invalid downstream ports, thereby improving the efficiency of obtaining the delay tolerance values and realizing timely updating of the delay tolerance values.
[0134] By determining the effective downstream port whose triggering state of delay tolerance update enabling is triggering delay tolerance update enabling as the target downstream port, when aggregating the delay tolerance values, it is only necessary to aggregate the delay tolerance values of the target downstream port, thereby improving the efficiency of obtaining the delay tolerance value and realizing timely updating of the delay tolerance value.
[0135] By determining the target mode for obtaining the minimum delay tolerance value according to the number of target downstream ports, determining the minimum delay tolerance value based on the target mode and the delay tolerance value to be reported of the target downstream port, and obtaining the minimum delay tolerance value by setting different target modes, the efficiency of obtaining the delay tolerance value is further improved.
[0136] In some optional implementations, the above step S5051 includes:
[0137] Step a1: when the number of the target downstream port is one, determine that the target mode for obtaining the minimum delay tolerance value is the pass-only mode.
[0138] After the target downstream ports are determined, a target mode for obtaining a minimum delay tolerance value is determined according to the number of the target downstream ports.
[0139] Different target modes are set according to two application scenarios, ie, an application scenario in which multiple DSPs update delay tolerance values and an application scenario in which a single DSP updates the delay tolerance value.
[0140] Among them, the number of target downstream ports that simultaneously trigger the delay tolerance update enable is one, and the application scenario is that a single DSP updates the delay tolerance value, so the target mode for obtaining the minimum delay tolerance value is determined to be the pass-only mode, that is, the Bypass mode.
[0141] Step a2: when the number of target downstream ports is greater than one, determine that the target mode for obtaining the minimum delay tolerance value is the normal mode.
[0142] If the number of target downstream ports that simultaneously trigger the delay tolerance update enable is greater than one, and the application scenario is that multiple DSPs update the delay tolerance value, then the target mode for obtaining the minimum delay tolerance value is determined to be the normal mode, that is, the Normal mode.
[0143] The delay tolerance value determination method provided in this embodiment can adjust the manner of obtaining the minimum delay tolerance value according to the number of downstream ports by distinguishing different target modes, thereby further improving the efficiency of obtaining the delay tolerance value.
[0144] In some optional implementations, the above step S5052 includes:
[0145] Step b1: when the target mode is the pass-only mode, determine whether the delay tolerance value to be reported of the target downstream port is less than the current minimum delay tolerance value.
[0146] Figure 7 1 is a flow chart of obtaining the minimum delay tolerance value in the pass-through mode according to an embodiment of the present invention. Figure 7 As shown, after the system starts, all DSPs will be assigned to different port components, and each port component will determine the number of ports to be used according to the port mode. Correspondingly, the port components determine the number of ports of each component according to the port mode selection, that is, the port components determine the number of valid downstream ports according to the current port mode.
[0147] Different port components are aggregated to obtain the total number of ports and the port mapping vector, that is, the number of valid downstream ports in different port components is added together to obtain the total number of valid downstream ports. The port mapping vector is a port usage vector that indicates whether a downstream port can be used.
[0148] When the trigger state of delay tolerance update enabling is a downstream port enabling triggering delay tolerance update among the valid downstream ports, that is, when there is a downstream port enabling triggering LTR update event among the valid downstream ports, it means that there is a DSP that needs to report the updated delay tolerance value to the USP.
[0149] It is determined whether only one DSP updates the LTR value, that is, it is determined whether there is only one downstream port that triggers the LTR update event enable, that is, it is determined whether the number of target downstream ports is one.
[0150] If only one DSP updates the LTR value, it means that the number of the target downstream port is one, and it is determined that the target mode for obtaining the minimum delay tolerance value is the pass-only mode.
[0151] If more than one DSP updates the LTR value, it means that the number of target downstream ports is greater than one, and it is determined that the target mode for obtaining the minimum delay tolerance value is the normal mode, and the Normal mode is executed according to the port mode selection and the LTR update event mapping. In other words, the minimum delay tolerance value is determined based on the Normal mode and the delay tolerance value to be reported of the target downstream port.
[0152] In the pass-only mode, it is determined whether the LTR value of the DSP is not less than the current minimum LTR value, that is, it is determined whether the delay tolerance value to be reported of the target downstream port is not less than the current minimum delay tolerance value.
[0153] It should be noted that when the system is initialized, the current minimum delay tolerance value defaults to 0, which is invalid. When compared with the invalid current minimum delay tolerance value, the target downstream port's to-be-reported delay tolerance value is directly used as the current minimum delay tolerance value. After the default current minimum delay tolerance value is updated, the current minimum delay tolerance value is valid and can be used for comparison with the target downstream port's to-be-reported delay tolerance value.
[0154] In this embodiment, the judgment condition is whether the delay tolerance to be reported of the target downstream port is less than the current minimum delay tolerance value, which is essentially the same as Figure 7 The judgment logic in is similar to Figure 7 The judgment logic in is described exemplarily.
[0155] Step b2: When the delay tolerance value to be reported of the target downstream port is not less than the current minimum delay tolerance value, the current minimum delay tolerance value is used as the minimum delay tolerance value.
[0156] Among them, in the pass-through mode, the target downstream port is 1, and when the delay tolerance value to be reported of the target downstream port is not less than the current minimum delay tolerance value, the current minimum delay tolerance value is kept unchanged, that is, the current minimum LTR value is kept unchanged. It can be understood that the current minimum delay tolerance value is the minimum delay tolerance value obtained by the previous triggering of the delay tolerance update enable. And the current minimum delay tolerance value is used as the minimum delay tolerance value.
[0157] Step b3: when the delay tolerance value to be reported of the target downstream port is less than the current minimum delay tolerance value, the current minimum delay tolerance value is updated, and the delay tolerance value to be reported of the target downstream port is used as the minimum delay tolerance value.
[0158] Among them, in the pass-through mode, if the delay tolerance value to be reported of the target downstream port is less than the current minimum delay tolerance value, the current minimum delay tolerance value is updated, that is, the LTR value of the DSP is used as the minimum LTR value, that is, the delay tolerance value to be reported of the target downstream port is used as the current minimum delay tolerance value, and the delay tolerance value to be reported of the target downstream port is used as the minimum delay tolerance value.
[0159] Step b4: when the target mode is the normal mode, the current downstream port to be compared is selected from the target downstream ports according to the aggregation code of the target downstream ports.
[0160] Figure 8 1 is a flow chart of obtaining the minimum delay tolerance value in a normal mode according to an embodiment of the present invention. Figure 8 As shown, after the system starts, all DSPs will be assigned to different port components, and each port component will determine the number of ports to be used according to the port mode. Correspondingly, the port components determine the number of ports of each component according to the port mode selection, that is, the port components determine the number of valid downstream ports according to the current port mode.
[0161] Different port components are aggregated to obtain the total number of ports and the port mapping vector, that is, the number of valid downstream ports in different port components is added together to obtain the total number of valid downstream ports. The port mapping vector is a port usage vector that indicates whether a downstream port can be used.
[0162] When the trigger state of delay tolerance update enabling is a downstream port enabling triggering delay tolerance update among the valid downstream ports, that is, when there is a downstream port enabling triggering LTR update event among the valid downstream ports, it means that there is a DSP that needs to report the updated delay tolerance value to the USP.
[0163] In the normal mode, if there are multiple target downstream ports, the LTR value in the corresponding DSP is selected, that is, the current downstream port to be compared is screened out from the target downstream ports according to the aggregation coding of the target downstream ports.
[0164] It should be noted that each downstream port corresponds to a downstream port number, and the aggregation code is the aggregation code assigned to the target downstream port in ascending order of the downstream port numbers corresponding to the target downstream ports. According to the order of the aggregation codes from small to large, the current downstream port to be compared is screened out from the target downstream ports.
[0165] Step b5, determining whether the delay tolerance value to be reported of the current downstream port to be compared is smaller than the current minimum delay tolerance value.
[0166] After the current downstream port to be compared is determined, it is determined whether the LTR value of the DSP is not less than the current minimum delay tolerance value, that is, it is determined whether the delay tolerance value of the current downstream port to be compared is not less than the current minimum delay tolerance value.
[0167] In this embodiment, the judgment condition is whether the delay tolerance value to be reported of the current downstream port to be compared is less than the current minimum delay tolerance value, which is essentially the same as Figure 8 The judgment logic in is similar to Figure 8 The judgment logic in is described exemplarily.
[0168] Step b6: when the delay tolerance value to be reported of the downstream port to be compared is not less than the current minimum delay tolerance value, the current minimum delay tolerance value is kept unchanged.
[0169] Among them, in normal mode, when the delay tolerance value to be reported of the current downstream port to be compared is not less than the current minimum delay tolerance value, the current minimum delay tolerance value is kept unchanged, that is, the current minimum LTR value is kept unchanged. It can be understood that the current minimum delay tolerance value is the minimum delay tolerance value obtained by the previous triggering of the delay tolerance update enable. And the current minimum delay tolerance value is used as the minimum delay tolerance value.
[0170] Step b7: when the delay tolerance value to be reported of the current downstream port to be compared is less than the current minimum delay tolerance value, update the current minimum delay tolerance value to be the delay tolerance value to be reported of the current downstream port to be compared.
[0171] Among them, in normal mode, if the delay tolerance value to be reported of the current downstream port to be compared is less than the current minimum delay tolerance value, the current minimum delay tolerance value is updated, that is, the LTR value of the DSP is used as the minimum LTR value, that is, the delay tolerance value to be reported of the current downstream port to be compared is used as the current minimum delay tolerance value.
[0172] Step b8, returning to the step of selecting the current downstream port to be compared from the target downstream ports according to the aggregation coding of the target downstream ports, until all the delay tolerance values to be reported of the target downstream ports are compared, and taking the current minimum delay tolerance value as the minimum delay tolerance value.
[0173] like Figure 8 As shown, it is determined whether all the LTRs of the current DSP have been compared, that is, whether all the delay tolerance values to be reported of the target downstream port have been compared.
[0174] When all the delay tolerance values to be reported of the target downstream port have not been compared, return to execute the step of filtering out the current downstream port to be compared from the target downstream ports according to the aggregation coding of the target downstream port, until all the delay tolerance values to be reported of the target downstream port have been compared, and take the current minimum delay tolerance value as the minimum delay tolerance value.
[0175] The delay tolerance value determination method provided in this embodiment obtains the minimum delay tolerance value according to the target mode. When the target mode is the pass-only mode, the minimum delay tolerance value can be confirmed according to the delay tolerance value of the only target downstream port. When the target mode is the normal mode, the minimum delay tolerance value is determined by continuously comparing and updating the current minimum delay tolerance value. This ensures that when only one target downstream port updates the delay tolerance value, the target delay tolerance value can be reported to the upstream port faster and more efficiently, thereby improving the efficiency of reporting the target delay tolerance value to the upstream port and improving the system's performance and low power consumption strategy.
[0176] In some optional implementations, the above step S506 includes:
[0177] Step c1, when the minimum delay tolerance value is less than the minimum delay tolerance value obtained by the previous triggering of the delay tolerance update enable, and the minimum delay tolerance value is not less than the port transmission delay tolerance value, based on the minimum delay tolerance value and the port transmission delay tolerance value, determine the difference between the minimum delay tolerance value and the port transmission delay tolerance value, and use the difference as the target delay tolerance value reported to the upstream port.
[0178] Among them, Figure 7 and Figure 8 As shown, whether it is the pass-only mode or the normal mode, after determining the minimum delay tolerance value, it is also necessary to determine whether the minimum delay tolerance value is less than the minimum delay tolerance value obtained by the previous triggering of the delay tolerance update enable (not shown in the figure).
[0179] The new delay tolerance value will be reported only when the minimum delay tolerance value is less than the minimum delay tolerance value obtained by the previous triggering of the delay tolerance update enable. The new delay tolerance value is determined as follows:
[0180] It is determined whether the minimum delay tolerance value is not less than the port transmission delay tolerance value, that is, it is determined whether the minimum LTR value is not less than the system LTR value.
[0181] When the minimum delay tolerance value is not less than the port transmission delay tolerance value, the DSP minimum LTR value minus the system LTR value is used as the final LTR value reported to the USP, that is, the difference between the minimum delay tolerance value and the port outgoing delay tolerance is used as the target delay tolerance value reported to the upstream port.
[0182] Step c2: when the minimum delay tolerance value is less than the minimum delay tolerance value obtained by the previous triggering of delay tolerance update enable, and the minimum delay tolerance value is less than the port transmission delay tolerance value, the preset value is used as the target delay tolerance value reported to the upstream port.
[0183] When the minimum delay tolerance value is less than the minimum delay tolerance value obtained by the previous triggering of the delay tolerance update enable, and when the minimum delay tolerance value is less than the port transmission delay tolerance value, the LTR value reported to the USP is fixed to 0. That is, the preset value is 0, and 0 is used as the target delay tolerance value reported to the upstream port.
[0184] It should be noted that when the minimum delay tolerance value is not less than the minimum delay tolerance value obtained by the previous triggering of the delay tolerance update enable, there is no need to execute the step of determining the target delay tolerance value reported to the upstream port based on the minimum delay tolerance value and the port transmission delay tolerance value, that is, there is no need to report a new delay tolerance value to the upstream port.
[0185] The delay tolerance value determination method provided in this embodiment ensures the accuracy of the target delay tolerance value reported to the upstream port by considering the port transmission delay tolerance value.
[0186] And only when the minimum delay tolerance value is less than the minimum delay tolerance value obtained by the previous triggering of the delay tolerance update enable will the new delay tolerance value be reported to the upstream port, reducing unnecessary updates of delay tolerance values, thereby reducing network overhead and improving system efficiency.
[0187] This embodiment also provides a delay tolerance determination system, wherein: Fig. 9 is a structural block diagram of a system for determining a delay tolerance value according to an embodiment of the present invention. Fig. 9As shown, the system includes: a port component, a port pool, a second counter, an aggregation module, a multi-selector, a second state machine, a first-level comparison module, a second-level comparison module, a second judgment module, a third selector and a second addition and subtraction counter.
[0188] Among them, different DSPs are assigned to different port components. Fig. 9 Five port components are used as an example. The port component selects and determines the number of DSPs used in the port component according to the current port mode, that is, according to the current mode of the port component, the number of valid downstream ports in the port component is determined.
[0189] For example, Fig. 9 As shown, the number of valid downstream ports in port component (1) is port number (1); the number of valid downstream ports in port component (2) is port number (2); the number of valid downstream ports in port component (3) is port number (3); the number of valid downstream ports in port component (4) is port number (4); and the number of valid downstream ports in port component (5) is port number (5).
[0190] Among them, each port component sends the port quantity to the port pool.
[0191] The port pool is used to summarize the number of ports sent by each port component to obtain the total number of valid downstream ports, that is, the total number of ports. It is also used to obtain the port usage vectors of multiple downstream ports contained in the port components sent by each port component. The port usage vector is the port position vector.
[0192] The port pool sends the total amount of valid downstream ports to the counter and sends the port usage vector corresponding to the downstream ports to the aggregation module.
[0193] The aggregation module is used to determine the effective downstream port according to the port usage vector corresponding to the downstream port, and determine the target downstream port according to the trigger state of the delay tolerance update enable of the effective downstream port, that is, the LTR update event enable of the effective downstream port.
[0194] The second state machine is used to control the counter to count and update and send the delay tolerance value.
[0195] The second counter is used to perform counting operations in a specific state of the state machine, and its counter value will be used by the multi-selector to select the delay tolerance value in the aggregation position corresponding to the corresponding counter value, that is, to obtain the delay tolerance value of the target downstream port of the corresponding aggregation code according to the counter value.
[0196] The multiple selector is used to select the delay tolerance value of the corresponding target downstream port according to the counter value of the second counter.
[0197] The first level comparison module is used to select the LTR value of the corresponding DSP in the Normal mode and compare it with the current minimum LTR value to determine the minimum delay tolerance value.
[0198] The second judgment module is used to judge the size of the minimum LTR value of all DSPs and the LTR value of the system, that is, to judge the size of the minimum delay tolerance value and the delay tolerance value of the system.
[0199] The second level comparison module is used to compare the LTR value of the corresponding DSP with the current minimum LTR value in the Bypass mode to determine the minimum delay tolerance value.
[0200] The third selector is used to output the delay tolerance value reported to the USP according to the output result of the second judgment module.
[0201] Specifically, when the output result of the second judgment module is that the minimum delay tolerance value is greater than the delay tolerance value of the system, the third selector outputs the difference between the minimum delay tolerance value and the delay tolerance value of the system; when the output result of the second judgment module is that the minimum delay tolerance value is not greater than the delay tolerance value of the system, the third selector outputs a fixed value of 0.
[0202] It should be noted that the second addition and subtraction calculator is used to calculate the difference between the current minimum delay tolerance value and the delay tolerance value of the system.
[0203] The delay tolerance value determination system provided in this embodiment determines the valid downstream ports and the number of valid downstream ports in the port component through the port mode and the port pool, and determines all the valid downstream ports according to the valid downstream ports in all the port components. Unused downstream ports will not participate in the comparison of delay tolerance values, thereby reducing the comparison time and the number of comparisons, thereby improving the efficiency of reporting delay tolerance values. At the same time, for the application scenarios where multiple DSPs update delay tolerance values and the application scenarios where a single DSP updates delay tolerance values, normal mode and pass-only mode are set to ensure that when only one valid downstream port updates the delay tolerance value, the delay tolerance value can be reported to the USP faster and more efficiently, thereby improving the efficiency of reporting delay tolerance values and improving the performance and low power consumption strategy of the system.
[0204] In order to make the process of obtaining the minimum delay tolerance value in the two application scenarios clearer, it is explained in combination with the following exemplary description.
[0205] 1. Application scenarios where multiple DSPs update delay tolerance values
[0206] According to the first preset mapping table of each port component, the number of DSPs used in each port component, i.e., the number of valid downstream ports, is determined in the current port mode of each port component, and each port component has a number of ports under its own mapping relationship. The number of ports under each port component, such as the number of ports (1), the number of ports (2), the number of ports (3), the number of ports (4), and the number of ports (5), will be aggregated into the port pool, and the port pool will obtain the total number of DSP ports used, i.e., the total number of valid downstream ports, and also obtain the port usage vector of each downstream port.
[0207] The total number of valid downstream ports and the port usage vector are output to the second counter and the aggregation module respectively. The maximum value of the second counter depends on the total number of downstream ports when the LTR update event is enabled, that is, the total number of target downstream ports, and the second counter performs a counting operation under the control of the second state machine.
[0208] The trigger state of the port usage vector and LTR update event enable, ie, delay tolerance update enable, determines the aggregation position of the LTR value of the corresponding DSP, that is, the port usage vector and LTR update event enable determine the aggregation position of the target downstream port to be aggregated. Fig.10 FIG. 1 is a schematic diagram of determining a target downstream port according to an embodiment of the present invention. Fig.10 As shown, there are 31 downstream ports in the Switch as an example. Each downstream port has a corresponding DSP serial number, that is, the downstream port number. Each downstream port also has a corresponding port position vector, that is, the port usage vector and the LTR update event enable. Among them, the value of the port position vector is 1, indicating that the downstream port is a valid downstream port; the value of the port position vector is 0, indicating that the downstream port is an invalid downstream port. The LTR update event enable is 1, which determines that the delay tolerance update enable is triggered; the LTR update event enable is 0, which determines that the delay tolerance update enable is not triggered. The downstream port that triggers the delay tolerance update enable among the valid downstream ports is determined as the target downstream port, and the delay tolerance value of the target downstream port is obtained, that is, the LTR value is extracted. As shown Fig.10 As shown, the downstream ports with DSP serial numbers 1, 3, 4, and 31 are the target downstream ports. The delay tolerance values of the target downstream ports can be extracted, and the delay tolerance values of the target downstream ports can be allocated aggregation codes, that is, aggregation positions, in order from small to large DSP serial numbers of the target downstream ports. Fig.11 FIG. 1 is a schematic diagram of allocating aggregate coding to the delay tolerance value of a target downstream port according to an embodiment of the present invention. Fig.11As shown, the aggregation code of the target downstream port with DSP number 1, i.e., the aggregation position, is 1; the aggregation code of the target downstream port with DSP number 3, i.e., the aggregation position, is 2; the aggregation code of the target downstream port with DSP number 4, i.e., the aggregation position, is 3; and the aggregation code of the target downstream port with DSP number 31, i.e., the aggregation position, is 4.
[0209] The multi-selector selects and extracts the LTR value in the target downstream port corresponding to the corresponding aggregation position according to the counter value of the second counter.
[0210] The extracted LTR value will be compared with the current minimum LTR value in the first-level comparison module. If the DSP's LTR value is greater than or equal to the current minimum LTR value, the current minimum LTR value will remain unchanged; if the DSP's LTR value is less than the current minimum LTR value, the current minimum LTR value will be updated and the DSP's LTR value will be used as the minimum LTR value until all LTR values are compared and the current minimum LTR value, that is, the minimum delay tolerance value, is obtained.
[0211] The minimum delay tolerance value is input into the second judgment module. In the second judgment module, the minimum LTR value will be compared with the system LTR value, and the third selector will output the final LTR value according to the judgment of the second judgment module. If the minimum LTR value is greater than or equal to the system LTR value, then the minimum LTR value needs to be subtracted from the system LTR value, and the final difference is used as the LTR value reported to the USP; if the minimum LTR value is less than the system LTR value, then the LTR value reported to the USP is fixed to 0.
[0212] It is understandable that the step of inputting the minimum LTR value into the judgment module and subsequent steps will be executed only when the minimum LTR value is smaller than the minimum delay tolerance value obtained by the previous triggering of the delay tolerance update enable.
[0213] 2. Application scenarios of updating the delay tolerance value of a single DSP
[0214] After the system is initialized and the number of ports and the port position vector are determined, when a DSP wants to update the LTR value, the LTR update event enable will be triggered, and the aggregation module will determine that there is only one DSP that needs to update the LTR value based on the LTR update event enable. At this time, the updated LTR value in the aggregation module will be extracted based on the LTR update event enable and the port position vector. Fig.12 FIG. 1 is a schematic diagram of determining a target downstream port according to an embodiment of the present invention. Fig.12As shown, there are 31 downstream ports in the Switch as an example. Each downstream port has a corresponding DSP serial number, that is, the downstream port number. Each downstream port also has a corresponding port position vector, that is, the port usage vector and the LTR update event enable. Among them, the value of the port position vector is 1, indicating that the downstream port is a valid downstream port; the value of the port position vector is 0, indicating that the downstream port is an invalid downstream port. The LTR update event enable is 1, which determines that the delay tolerance update enable is triggered; the LTR update event enable is 0, which determines that the delay tolerance update enable is not triggered. The downstream port that triggers the delay tolerance update enable among the valid downstream ports is determined as the target downstream port, and the delay tolerance value of the target downstream port is obtained, that is, the LTR value is extracted. As shown Fig.12 As shown, the downstream port with DSP serial number 3 is the target downstream port, and the delay tolerance value of the target downstream port can be extracted.
[0215] Then the delay tolerance value of the target downstream port is directly compared with the current minimum LTR value in the second-level comparison module.
[0216] If the LTR value of DSP is greater than or equal to the current minimum LTR value, then the current minimum LTR value is kept unchanged and the process ends directly without reporting the LTR value to USP; if the LTR value of DSP is less than the current minimum LTR value, then the current minimum LTR value is updated and the LTR value of DSP is used as the minimum LTR value.
[0217] In the second judgment module, the minimum LTR value will be compared with the system LTR value. At the same time, the third selector will output the final LTR value according to the judgment of the second judgment module. If the minimum LTR value is greater than or equal to the system LTR value, then the minimum LTR value minus the system LTR value needs to be subtracted, and the final difference is used as the LTR value reported to the USP; if the minimum LTR value is less than the system LTR value, then the LTR value reported to the USP is fixed to 0.
[0218] Fig.13 2 is a diagram comparing the process of reporting a delay tolerance value to an upstream port according to an embodiment of the present invention and the process of reporting a delay tolerance value to an upstream port in a related art. Fig.13As shown, compared with the method of reporting the delay tolerance value to the upstream port in the related art, the Normal mode has fewer comparisons of the delay tolerance value when not all DSP ports are used and multiple valid downstream ports trigger the delay tolerance update to be enabled, and can report the target delay tolerance value to the USP more efficiently. In Bypass mode, since there is only one target DSP updating the delay tolerance value, there is only one comparison. Compared with the method in the related art where only one DSP updates the delay tolerance value, all delay tolerance values need to be compared once, the Bypass mode can report the updated delay tolerance value to the USP faster. Both modes greatly improve the efficiency of reporting delay tolerance values.
[0219] In this embodiment, a delay tolerance value determination device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0220] This embodiment provides a delay tolerance value determination device, such as Fig.14 As shown, including:
[0221] The first determination module 1401 is configured to determine, for any port component in the switch, a port usage vector of multiple downstream ports of the port component based on a current port mode of the port component.
[0222] The second determining module 1402 is configured to determine a valid downstream port based on a port usage vector of the downstream port.
[0223] The third determination module 1403 is configured to determine a target downstream port based on a trigger state of enabling delay tolerance update of a valid downstream port.
[0224] The first acquisition module 1404 is configured to acquire the delay tolerance value to be reported of the target downstream port.
[0225] The fourth determining module 1405 is configured to determine a minimum delay tolerance value based on the delay tolerance value to be reported of the target downstream port.
[0226] The fifth determining module 1406 is configured to determine a target delay tolerance value reported to the upstream port based on the minimum delay tolerance value and the port transmission delay tolerance value.
[0227] In some optional implementations, the first determining module 1401 includes:
[0228] A first determination unit is used to determine the usage status of multiple downstream ports of the port component under the current port mode of the port component based on a first preset mapping table of the port component, wherein the first preset mapping table includes a correspondence between the port mode of the port component and the usage status of multiple downstream ports of the port component.
[0229] The second determining unit is used to determine the port usage vectors of the multiple downstream ports of the port component based on the usage status of the multiple downstream ports of the port component.
[0230] In some optional implementations, the third determining module 1403 includes:
[0231] The third determining unit is configured to determine the valid downstream port as the target downstream port when the triggering state of the delay tolerance update enable of the valid downstream port is triggering delay tolerance update enable.
[0232] In some optional implementations, the fourth determining module 1405 includes:
[0233] The fourth determining unit is used to determine a target mode for obtaining a minimum delay tolerance value based on the number of target downstream ports.
[0234] The fifth determining unit is configured to determine a minimum delay tolerance value based on the target mode and the delay tolerance value to be reported of the target downstream port.
[0235] In some optional implementations, the fourth determining unit includes:
[0236] The sixth determining unit is configured to determine that the target mode for obtaining the minimum delay tolerance value is the pass-only mode when the number of the target downstream port is one.
[0237] The seventh determining unit is configured to determine that the target mode for obtaining the minimum delay tolerance value is the normal mode when the number of the target downstream ports is greater than one.
[0238] In some optional implementations, the fifth determining unit includes:
[0239] The first judgment unit is used to judge whether the to-be-reported delay tolerance value of the target downstream port is less than the current minimum delay tolerance value when the target mode is the pass-only mode.
[0240] The first holding unit is configured to use the current minimum delay tolerance value as the minimum delay tolerance value when the delay tolerance value to be reported of the target downstream port is not less than the current minimum delay tolerance value.
[0241] The first updating unit is used to update the current minimum delay tolerance value and use the delay tolerance value to be reported of the target downstream port as the minimum delay tolerance value when the delay tolerance value to be reported of the target downstream port is less than the current minimum delay tolerance value.
[0242] The screening unit is used to screen out the current downstream port to be compared from the target downstream ports according to the aggregation code of the target downstream ports when the target mode is the normal mode.
[0243] The second judgment unit is used to judge whether the delay tolerance value to be reported of the downstream port to be compared is less than the current minimum delay tolerance value.
[0244] The second holding unit is used to keep the current minimum delay tolerance value unchanged when the delay tolerance value to be reported of the downstream port to be compared is not less than the current minimum delay tolerance value.
[0245] The second updating unit is configured to update the current minimum delay tolerance value as the delay tolerance value to be reported of the current downstream port to be compared when the delay tolerance value to be reported of the current downstream port to be compared is less than the current minimum delay tolerance value.
[0246] The return execution unit is used to return to execute the step of filtering out the current downstream port to be compared from the target downstream ports according to the aggregation encoding of the target downstream port, until all the delay tolerance values to be reported of the target downstream ports are compared, and the current minimum delay tolerance value is used as the minimum delay tolerance value.
[0247] In some optional implementations, the fifth determining module 1406 includes:
[0248] An eighth determination unit is used to determine the difference between the minimum delay tolerance value and the port transmission delay tolerance value based on the minimum delay tolerance value and the port transmission delay tolerance value, when the minimum delay tolerance value is less than the minimum delay tolerance value obtained by the previous triggering of the delay tolerance update enable, and the minimum delay tolerance value is not less than the port transmission delay tolerance value, and use the difference as the target delay tolerance value reported to the upstream port.
[0249] The ninth determination unit is used to use the preset value as the target delay tolerance value reported to the upstream port when the minimum delay tolerance value is less than the minimum delay tolerance value obtained by the previous triggering of the delay tolerance update enable and the minimum delay tolerance value is less than the port transmission delay tolerance value.
[0250] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0251] The delay tolerance value determination device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0252] The embodiment of the present invention also provides a computer device having the above Fig.14 The delay tolerance value determination device is shown.
[0253] See also Fig.15 , Fig.15 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig.15 As shown, the computer device includes: one or more processors 1501, memory 1502, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other, and can be installed on a common mainboard or installed in other ways as required. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.15 A processor 1501 is taken as an example.
[0254] The processor 1501 may be a central processing unit, a network processor or a combination thereof. The processor 1501 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.
[0255] The memory 1502 stores instructions executable by at least one processor 1501 so as to enable at least one processor 1501 to implement the method shown in the above embodiment.
[0256] The memory 1502 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 1502 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 1502 may optionally include a memory remotely arranged relative to the processor 1501, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0257] The memory 1502 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 1502 may also include a combination of the above types of memory.
[0258] The computer device also includes a communication interface 1503, which is used for the computer device to communicate with other devices or a communication network.
[0259] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0260] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0261] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for determining a delay tolerance value, characterized in that: The method comprises: For any port component in the switch, based on the current port mode of the port component, determine the port usage vectors of multiple downstream ports of the port component; Determining a valid downstream port based on a port usage vector of the downstream port; Determining a target downstream port based on a trigger state of delay tolerance update enable of the valid downstream port; Obtaining a delay tolerance value to be reported of the target downstream port; Determining a minimum delay tolerance value based on the delay tolerance value to be reported of the target downstream port; Based on the minimum delay tolerance value and the port transmission delay tolerance value, a target delay tolerance value reported to the upstream port is determined.
2. The method according to claim 1, characterized in that The determining, based on the current port mode of the port component, the port usage vectors of the multiple downstream ports of the port component comprises: Determine, based on a first preset mapping table of the port component, the use status of multiple downstream ports of the port component in the current port mode of the port component, wherein the first preset mapping table includes a correspondence between the port mode of the port component and the use status of multiple downstream ports of the port component; Based on the usage status of the multiple downstream ports of the port component, the port usage vectors of the multiple downstream ports of the port component are determined.
3. The method according to claim 1, characterized in that The step of determining the target downstream port based on the trigger state of the delay tolerance update enable of the effective downstream port includes: In a case where the triggering state of the delay tolerance update enable of the valid downstream port is triggering delay tolerance update enable, the valid downstream port is determined to be a target downstream port.
4. The method according to claim 1, characterized in that: The determining of the minimum delay tolerance value based on the delay tolerance value to be reported of the target downstream port includes: Determining a target mode for obtaining the minimum delay tolerance value based on the number of the target downstream ports; The minimum delay tolerance value is determined based on the target mode and the delay tolerance value to be reported of the target downstream port.
5. The method according to claim 4, characterized in that The determining, based on the number of the target downstream ports, a target mode for obtaining the minimum delay tolerance value comprises: When the number of the target downstream port is one, determining that the target mode for obtaining the minimum delay tolerance value is a pass-only mode; When the number of the target downstream ports is greater than one, it is determined that the target mode for obtaining the minimum delay tolerance value is a normal mode.
6. The method according to claim 4, characterized in that The determining of the minimum delay tolerance value based on the target mode and the delay tolerance value to be reported of the target downstream port includes: In the case where the target mode is the pass-only mode, determining whether the to-be-reported delay tolerance value of the target downstream port is less than a current minimum delay tolerance value; In a case where the delay tolerance value to be reported of the target downstream port is not less than the current minimum delay tolerance value, taking the current minimum delay tolerance value as the minimum delay tolerance value; In the case that the delay tolerance value to be reported of the target downstream port is less than the current minimum delay tolerance value, updating the current minimum delay tolerance value, and using the delay tolerance value to be reported of the target downstream port as the minimum delay tolerance value; When the target mode is a normal mode, filtering out the current downstream port to be compared from the target downstream ports according to the aggregation code of the target downstream port; Determine whether the delay tolerance value to be reported of the current downstream port to be compared is less than the current minimum delay tolerance value; When the delay tolerance value to be reported of the current downstream port to be compared is not less than the current minimum delay tolerance value, keeping the current minimum delay tolerance value unchanged; When the delay tolerance value to be reported of the current downstream port to be compared is less than the current minimum delay tolerance value, updating the current minimum delay tolerance value to be the delay tolerance value to be reported of the current downstream port to be compared; Return to execute the step of filtering out the current downstream port to be compared from the target downstream ports according to the aggregation coding of the target downstream port, until all the delay tolerance values to be reported of the target downstream ports are compared, and take the current minimum delay tolerance value as the minimum delay tolerance value.
7. The method according to claim 1, characterized in that The step of determining a target delay tolerance value reported to the upstream port based on the minimum delay tolerance value and the port transmission delay tolerance value includes: In the case where the minimum delay tolerance value is less than the minimum delay tolerance value obtained by the previous triggering of the delay tolerance update enable, and the minimum delay tolerance value is not less than the port transmission delay tolerance value, based on the minimum delay tolerance value and the port transmission delay tolerance value, determine the difference between the minimum delay tolerance value and the port transmission delay tolerance value, and use the difference as the target delay tolerance value reported to the upstream port; When the minimum delay tolerance value is smaller than the minimum delay tolerance value obtained by the previous triggering of the delay tolerance update enable, and the minimum delay tolerance value is smaller than the port transmission delay tolerance value, the preset value is used as the target delay tolerance value reported to the upstream port.
8. A device for determining a delay tolerance value, characterized in that: The device comprises: A first determination module is used to determine, for any port component in the switch, a port usage vector of multiple downstream ports of the port component based on a current port mode of the port component; A second determination module, configured to determine a valid downstream port based on a port usage vector of the downstream port; A third determination module, configured to determine a target downstream port based on a trigger state of enabling delay tolerance update of the valid downstream port; A first acquisition module, used to acquire a delay tolerance value to be reported of the target downstream port; A fourth determination module, configured to determine a minimum delay tolerance value based on the delay tolerance value to be reported of the target downstream port; The fifth determination module is used to determine a target delay tolerance value reported to the upstream port based on the minimum delay tolerance value and the port transmission delay tolerance value.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the delay tolerance value determination method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the delay tolerance value determination method according to any one of claims 1 to 7.
