Bandwidth adjusting method, device, equipment, medium and product
By obtaining the real-time data volume of the target port in the PCIe system and adjusting its channel count, the problem of large delay in the link width adjustment process is solved, and flexible bandwidth adjustment and resource optimization are achieved.
Patent Information
- Application Number
- CN202510251526.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-03-04
AI Technical Summary
In PCIe systems, changes in the link transmission environment lead to link transmission errors or link quality degradation, and link width needs to be adjusted dynamically, but this process will occupy a large amount of system delay and affect bandwidth.
By obtaining the real-time data amount of the target port in the target link, determining the number of target channels corresponding to the target port, and generating channel adjustment instructions based on the difference between the target channel number and the number of enabled channels, and issuing it to the target port to adjust the number of enabled channels.
It reduces the delay in the link bandwidth switching process, improves the flexibility of the method and resource utilization, and avoids the problem of wasted or insufficient bandwidth.
Smart Images

Figure CN119996209A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network transmission technology, and in particular to a bandwidth adjustment method, device, equipment, medium and product. Background Art
[0002] In the PCIe (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) system, the link transmission environment will change, which may lead to link transmission errors or link quality degradation. At this time, the width of the PCIe link needs to be adjusted dynamically. However, in the process of link width cutting, due to the link training process, a large amount of system delay will be occupied, and during this period of time, the link cannot perform any effective data transmission, which in turn affects the bandwidth.
[0003] In the related art, the switching of link width is achieved through software. Specifically, LTSSM (Link Training and Status State Machine) will jump from the normal working L0 state to the Recovery state, and then jump to the Configuration state. In this process, the controller will send TS1 (Training Sequence 1) and TS2 (Training Sequence 2) code streams to complete the switching of link width. However, this method will produce a large delay.
[0004] In view of this, a bandwidth adjustment method with low latency is needed. Summary of the invention
[0005] In view of this, the present application provides a bandwidth adjustment method, which can reduce the delay in the link bandwidth switching process.
[0006] In a first aspect, the present application provides a bandwidth adjustment method, which is applied to a high-speed serial computer expansion bus standard system, and the method includes: obtaining the real-time data volume of a target port in a target link; determining the target channel number corresponding to the target port based on the real-time data volume of the target port; if the target channel number of the target port is different from the enabled channel number, generating a channel adjustment instruction based on the target channel number and the enabled channel number; and sending the channel adjustment instruction to the target port to adjust the enabled channel number of the target port.
[0007] In an embodiment of the present application, the real-time data volume of the target port in the target link in the high-speed serial computer expansion bus standard system is obtained, and then the target channel number corresponding to the target port is determined according to the real-time data volume. When the target channel number of the target port is different from the number of enabled channels, a channel adjustment instruction is generated and sent to the target port to adjust the number of channels of the target port. The above scheme obtains the real-time data volume of the target port, confirms the target channel number of the target port, and adjusts the number of enabled channels of the target port according to the relationship between the target channel number and the number of enabled channels. Compared with the unified configuration of the number of enabled channels of the ports in the target link by software, the number of enabled channels of the target port can be adjusted according to the real-time data volume of the target port, thereby reducing power consumption and delay and improving the flexibility of the method.
[0008] In an optional implementation, the target number of channels corresponding to the target port is determined based on the real-time data volume of the target port, including: obtaining the bandwidth and data transmission rate of the target port to determine the first capacity of each channel in the target port; and determining the target number of channels of the target port based on the first capacity and the real-time data volume.
[0009] In the embodiment of the present application, the bandwidth and data transmission efficiency of the target port are obtained to determine the first capacity of the target port, thereby determining the number of target ports of the target port, thereby improving resource utilization and the flexibility of bandwidth adjustment.
[0010] In an optional implementation, generating a channel adjustment instruction according to the target channel number and the enabled channel number includes: determining a first channel of the target port based on a difference between the target channel number and the enabled channel number of the target port; and generating a channel adjustment instruction for the first channel.
[0011] In the embodiment of the present application, the first channel of the target port is determined according to the difference between the target channel number and the enabled channel number, and a channel adjustment instruction for the first channel is generated, which can improve the flexibility of the method and the utilization rate of bandwidth resources, and avoid the problem of bandwidth waste or bandwidth shortage.
[0012] In an optional embodiment, determining the first channel of the target port based on the difference between the target channel number and the enabled channel number of the target port includes: when the difference is greater than zero, obtaining the number of disabled channels of the target port; when the difference is less than the number of disabled channels, selecting a first number of disabled channels as the first channel; the first number is the same as the difference.
[0013] In the embodiment of the present application, when the difference is greater than zero, a first number of disabled channels are determined as the first channel based on the difference, which can dynamically balance the system pressure and adapt to sudden flow fluctuations.
[0014] In an optional implementation, determining the first channel of the target port based on the difference between the target channel number and the enabled channel number of the target port includes: when the difference is less than zero, obtaining the enabled channel number of the target port; selecting a second number of enabled channels as the first channel; and the second number is the same as the absolute value of the difference.
[0015] In the embodiment of the present application, when the difference is less than zero, the second number of enabled channels is determined as the first channel according to the difference, so as to avoid wasting resources.
[0016] In an optional embodiment, after sending a channel adjustment instruction to the target port to adjust the number of enabled channels of the target port, it also includes: updating the real-time data volume of the target port, and determining the difference between the target channel number and the enabled channel number of the target port based on the updated real-time data volume; when the difference is greater than zero, enabling a third number of disabled channels in the target port; the third number is the same as the difference; when the difference is less than zero, closing a fourth number of enabled channels in the target port; the fourth number is the absolute value of the difference.
[0017] In the embodiment of the present application, the real-time data volume of the target port is updated, and the number of enabled channels of the target port is adjusted again based on the update result, which can improve the flexibility of the method, optimize resource allocation, and prevent the increase of delay caused by data lag.
[0018] In a second aspect, the present application provides a bandwidth adjustment device, which includes: an acquisition module, used to acquire the real-time data volume of a target port in a target link; a determination module, used to determine the target channel number corresponding to the target port according to the real-time data volume of the target port; an adjustment module, used to generate a channel adjustment instruction according to the target channel number and the enabled channel number if the target channel number of the target port is different from the enabled channel number; and an update module, used to send the channel adjustment instruction to the target port to adjust the enabled channel number of the target port.
[0019] In a third aspect, the present application provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the bandwidth adjustment method of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0020] In a fourth aspect, the present application provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the bandwidth adjustment method of the first aspect or any corresponding embodiment thereof.
[0021] In a fifth aspect, the present application provides a computer program product, including computer instructions, where the computer instructions are used to enable a computer to execute the bandwidth adjustment method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0023] Figure 1 It is a link width switching state machine jump diagram of a high-speed serial computer expansion bus standard system;
[0024] Figure 2 is a flow chart of a bandwidth adjustment method according to an embodiment of the present application;
[0025] Figure 3 is a flow chart of another bandwidth adjustment method according to an embodiment of the present application;
[0026] Figure 4 is a structural schematic diagram of a high-speed serial computer expansion bus standard system according to an embodiment of the present application;
[0027] Figure 5 It is a structural schematic diagram of a high-speed serial computer expansion bus standard system before single-port width reduction according to an embodiment of the present application;
[0028] Figure 6 It is a structural schematic diagram of a high-speed serial computer expansion bus standard system after single-port width reduction according to an embodiment of the present application;
[0029] Figure 7 It is a structural schematic diagram of a high-speed serial computer expansion bus standard system before multi-port width reduction according to an embodiment of the present application;
[0030] Figure 8 It is a structural schematic diagram of a high-speed serial computer expansion bus standard system before and after multi-port width reduction according to an embodiment of the present application;
[0031] Fig. 9 is a structural block diagram of a bandwidth adjustment device according to an embodiment of the present application;
[0032] Fig.10 It is a schematic diagram of the hardware structure of the computer device of the embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of this application.
[0034] PCIe interfaces are widely used in high-speed interconnected devices. With the implementation of artificial intelligence and large model applications, the industry's demand for high-bandwidth, low-latency PCIe systems is becoming increasingly strong.
[0035] For high-speed IO (Input / Output) chips, since the PCIe protocol requires a large amount of data transmission in real time, in order to support higher transmission efficiency, the PCIe standard protocol supports multi-port transmission. A port consists of one or more physical layers, and each port is independent of each other, which can achieve higher transmission efficiency.
[0036] In the PCIe system, due to changes in the link transmission environment, link transmission errors or link quality degradation may occur. Therefore, the width of the PCIe link needs to be adjusted dynamically. In the process of link width adjustment, a large amount of system delay time will be occupied due to the link training process involved. During this period, the link cannot perform any effective data transmission, which has a great impact on the transmission bandwidth.
[0037] Figure 1 It is a link width switching state machine jump diagram of a high-speed serial computer expansion bus standard system. Figure 1The upper part is the way to enter the Configuration state to switch speed. You can see that LTSSM jumps from the normal working L0 (full function working) state to the RCVRY (Recovery) state, and then jumps to the Configuration state. During this process, the controller will send TS1 and TS2 code streams to complete the link width switching. Among them, the Configuration states are CFG_LNKWD_START (Configuration Link Width Start, Configuration Link Width Start), CFG_LNKWD_ACCPT (Configuration Link Width Accept, Configuration Link Width Accept), CFG_LNKWD_WAIT (Configuration Link Width Wait, Configuration Link Width Wait), CFG_COMPLETE (Configuration Complete, Configuration Complete). When the link is cut from x8 (eight channels) to x4 (four channels) in this way, a large delay will be generated due to the retraining of the link.
[0038] In actual applications, the total time required for link width switching from x8 to x4 in this way is 8 microseconds because it involves retraining the link. In addition, when the link switches from x8 to x4 through the Configuration mode, the width switching process enters the Recovery and Config Linkwidth states. At this time, all links need to enter the Configuration state for retraining, which makes the link unable to transmit data in this state, thus affecting the transmission bandwidth.
[0039] Figure 1 The following is the link width cut from x8 to x4 through L0p (low power state). In specific applications, since the L0p method does not enter Recovery for retraining, the total time consumption will be reduced to 700 nanoseconds.
[0040] In addition, in a PCIe system, each port usually works independently and has different data transmission states. If the width is not adjusted independently according to the state of each port, resource utilization will be affected.
[0041] The embodiment of the present application provides a bandwidth adjustment method, which obtains the real-time data volume of the target port in the target link in the high-speed serial computer expansion bus standard system, and then determines the target channel number corresponding to the target port based on the real-time data volume. When the target channel number of the target port is different from the enabled channel number, a channel adjustment instruction is generated and sent to the target port to adjust the channel number of the target port. The above scheme obtains the real-time data volume of the target port, confirms the target channel number of the target port, and adjusts the enabled channel number of the target port based on the relationship between the target channel number and the enabled channel number. Compared with the unified configuration of the enabled channel number of the port in the target link through software, the enabled channel number of the target port can be adjusted without affecting the data service transmission, thereby reducing power consumption and delay.
[0042] According to an embodiment of the present application, an embodiment of a bandwidth adjustment method 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.
[0043] In this embodiment, a bandwidth adjustment method is provided, which is applied to a high-speed serial computer expansion bus standard system. Figure 2 is a flow chart of a bandwidth adjustment method according to an embodiment of the present application. Figure 1 As shown, the process includes the following steps:
[0044] Step S201, obtaining the real-time data volume of the target port in the target link.
[0045] In the high-speed serial computer expansion bus standard system, since different devices have different requirements for data transmission bandwidth, by adjusting the bandwidth, appropriate resources can be allocated to different connected devices to avoid unnecessary waste of resources. Therefore, the bandwidth can be adjusted accordingly according to the amount of data transmitted by the target port in the target link, thereby optimizing the system power consumption.
[0046] For example, when the system does not need to transfer a lot of data, the bandwidth can be reduced to reduce the power consumption required by the system. When the system load is low or the connected device is inactive, the bandwidth can also be reduced to reduce the overall power consumption.
[0047] The target port in the target link can be determined according to the port settings in the high-speed serial computer expansion bus standard system. Among them, an independent port in the system can be selected as the target port for subsequent bandwidth adjustment, which can reduce costs while ensuring system performance.
[0048] After determining the target port, you can use the traffic monitoring module to obtain the real-time data volume of the target port. You can also use relevant network analysis software to read the real-time data volume of the target port.
[0049] Step S202, determining the number of target channels corresponding to the target port according to the real-time data volume of the target port.
[0050] The theoretical bandwidth of the target port standard channel can be determined based on the basic parameters of the high-speed serial computer expansion bus standard system, and then the theoretical number of channels required by the real-time data volume of the target port can be determined as the target channel number.
[0051] Step S203: if the target channel number and the enabled channel number of the target port are different, a channel adjustment instruction is generated according to the target channel number and the enabled channel number.
[0052] If the target channel number of the target port is different from the enabled channel number, it means that the bandwidth of the target port does not match the amount of data transmitted, and the channel of the target port needs to be adjusted to adapt to the amount of data currently transmitted by the target port.
[0053] When the number of target channels is greater than the number of enabled channels, it means that the target port has a large amount of real-time data and there may be data congestion. It is necessary to appropriately increase the number of enabled channels of the target port to avoid system failures that may be caused by data congestion.
[0054] When the number of target channels is less than the number of enabled channels, it means that the amount of real-time data of the target port is small, and there will be a certain waste of resources. The number of enabled channels of the target port can be appropriately reduced to improve resource utilization.
[0055] Step S204: Send a channel adjustment instruction to the target port to adjust the number of enabled channels of the target port.
[0056] After the channel adjustment instruction is generated, the channel adjustment instruction is sent to the target port to adjust the number of enabled channels of the target port, which can avoid resource waste while meeting the bandwidth demand of the target port, thereby improving system reliability and resource utilization.
[0057] After receiving the channel adjustment instruction, the target port may first analyze it to determine the first channel that needs to be adjusted and the adjustment type, so that the target port adjusts the first channel.
[0058] When the channel adjustment instruction is to reduce the number of enabled channels of the target port, the enabled channels that need to be closed in the target port can be determined according to the number of enabled channels that need to be reduced, and then closed.
[0059] In some optional implementations, based on the data volume of each enabled channel in the target port, an enabled channel with a smaller amount of transmitted data may be selected for closing to reduce the impact on data transmission of the target port.
[0060] When the channel adjustment instruction is to increase the number of enabled channels of the target port, the channels that need to be opened in the target port can be determined according to the number of enabled channels that need to be increased, and enabled to reduce the data transmission pressure of the originally enabled channels.
[0061] In some optional implementations, the channel to be enabled may be selected according to the priority of the channel in the target port to share the data transmission pressure of the originally enabled channel, so as to improve the operation efficiency of the system.
[0062] The bandwidth adjustment method provided in this embodiment obtains the real-time data volume of the target port in the target link in the high-speed serial computer expansion bus standard system, and then determines the target channel number corresponding to the target port based on the real-time data volume. When the target channel number of the target port is different from the enabled channel number, a channel adjustment instruction is generated and sent to the target port to adjust the channel number of the target port. The above scheme obtains the real-time data volume of the target port, confirms the target channel number of the target port, and adjusts the enabled channel number of the target port based on the relationship between the target channel number and the enabled channel number. Compared with the unified configuration of the enabled channel number of the port in the target link through software, the channel adjustment can be performed on the enabled channel number of the target port according to the real-time data volume of the target port, thereby reducing power consumption and delay and improving the flexibility of the method.
[0063] In this embodiment, another bandwidth adjustment method is provided, which is applied to a high-speed serial computer expansion bus standard system. Figure 3 is a flow chart of a bandwidth adjustment method according to an embodiment of the present application. Figure 3 As shown, the process includes the following steps:
[0064] Step S301, obtaining the real-time data volume of the target port in the target link.
[0065] For details, please see Figure 2 Step S201 of the illustrated embodiment will not be described in detail here.
[0066] Step S302, determining the number of target channels corresponding to the target port according to the real-time data volume of the target port.
[0067] For details, please see Figure 2 Step S202 of the illustrated embodiment will not be described in detail here.
[0068] In some optional implementations, the above step S302 includes:
[0069] Step S3021, obtaining the bandwidth and data transmission rate of the target port to determine the first capacity of each channel in the target port.
[0070] The bandwidth and data transmission efficiency of the target port can be determined according to the protocol of the high-speed serial computer expansion bus standard system, and then the product of the bandwidth and the data transmission efficiency is calculated to obtain the first capacity of the channel in the target port.
[0071] Step S3022: Determine the target channel number of the target port based on the first capacity and the real-time data volume.
[0072] The target channel number of the target port may be determined by calculating the quotient of the real-time data volume and the first capacity of the channel and then rounding up the quotient.
[0073] In practical applications, the number of target channels can be corrected according to the efficiency loss of the channels in the target port during data transmission to improve the stability of data transmission in the system.
[0074] In some possible implementations, when the target channel number is greater than the maximum channel number in the target port, the maximum channel number is used as the target channel number, so as to avoid errors in adjusting the channels of the target port.
[0075] Step S303: if the target channel number and the enabled channel number of the target port are different, a channel adjustment instruction is generated according to the target channel number and the enabled channel number.
[0076] Specifically, the above step S303 includes:
[0077] Step S3031 : determining a first channel of the target port based on a difference between the number of target channels and the number of enabled channels of the target port.
[0078] Wherein, when the number of target channels of the target port is greater than the number of enabled channels, the number of first channels may be the difference between the number of target channels and the number of enabled channels. When the difference is greater than the number of disabled channels in the target port, the number of disabled channels in the target port may be used as the first channel. This avoids errors in channel adjustment and improves the robustness of the method.
[0079] In the case that the target channel number of the target port is less than the enabled channel number, the number of first channels may be a difference between the enabled channel number and the target channel number.
[0080] In some optional implementations, the above step S3031 includes:
[0081] Step a1: when the difference is greater than zero, the number of disabled channels of the target port is obtained.
[0082] The channel status information of the target port may be obtained by calling a related command, thereby determining the number of disabled channels of the target port.
[0083] In the case where the difference is greater than the number of disabled channels, the number of the first channels is the number of disabled channels of the target port.
[0084] Step a2: when the difference is less than the number of disabled channels, select a first number of disabled channels as first channels; the first number is the same as the difference.
[0085] When the difference is less than the number of disabled channels, the disabled channels having the same number as the difference can be selected as the first channels for subsequent channel enabling to meet the transmission requirement of the data volume in the port.
[0086] In some optional implementations, the above step S3031 includes:
[0087] Step b1, when the difference is less than zero, the number of enabled channels of the target port is obtained.
[0088] When the difference is less than zero, the number of enabled channels of the target port can be obtained by calling the relevant command.
[0089] Step b2, selecting a second number of enabled channels as the first channels; the second number is the same as the absolute value of the difference.
[0090] Step S3032: Generate a channel adjustment instruction for the first channel.
[0091] When the number of target channels is greater than the number of enabled channels, a channel closing instruction for the first channel is generated to adjust the channels of the target port.
[0092] When the number of target channels is less than the number of enabled channels, a channel enable instruction for the first channel is generated to adjust the channels of the target port.
[0093] Step S304: Send a channel adjustment instruction to the target port to adjust the number of enabled channels of the target port.
[0094] For details, please see Figure 2 Step S204 of the illustrated embodiment will not be described in detail here.
[0095] In some optional implementations, the above step S304 further includes:
[0096] Step S305 , updating the real-time data volume of the target port, and determining the difference between the target channel number and the enabled channel number of the target port based on the updated real-time data volume.
[0097] See also Figure 2In step S201 of the illustrated embodiment, the real-time data volume of the target port is obtained and updated. Then, based on the updated real-time data volume, the target channel number corresponding to the target port is updated. The difference between the target channel number and the number of enabled channels of the target port is recalculated. When the difference is zero, it indicates that the real-time data volume of the target port is compatible with the bandwidth, and there is no need to adjust the number of enabled channels of the target port.
[0098] Step S306, when the difference is greater than zero, enabling a third number of disabled channels in the target port; the third number is the same as the difference;
[0099] When the difference is greater than zero, it indicates that the data transmission of the target port may be congested, and a third number of disabled channels in the target port needs to be enabled to prevent data loss caused by data transmission congestion. The third number is the same as the difference.
[0100] In a specific implementation, the number of disabled channels in the target port may be less than the difference between the number of target channels and the number of enabled channels, and the third number is the number of disabled channels of the target port.
[0101] Step S307: when the difference is less than zero, close a fourth number of enabled channels in the target port; the fourth number is the absolute value of the difference.
[0102] When the difference is less than zero, it indicates that data transmission of the target port may waste resources, and a fourth number of enabled channels in the target port needs to be closed to reduce power consumption. The fourth number is the same as the absolute value of the difference.
[0103] The bandwidth adjustment method provided in this embodiment determines the first channel of the target port according to the difference between the target channel number and the enabled channel number, and generates a channel adjustment instruction for the first channel, which can improve the flexibility of the method and the utilization rate of bandwidth resources, and avoid bandwidth waste or bandwidth shortage.
[0104] Figure 4 The schematic diagram is a schematic diagram of a high-speed serial computer expansion bus standard system to which the bandwidth adjustment method provided in the embodiment of the present application is applicable. The high-speed serial computer expansion bus standard system in the figure corresponds to the PCIe 6.0 protocol.
[0105] Reference Figure 4There are eight independent ports in the PCIe system, each of which has 8 channels (x8). The independent ports are PCIe Port_0, PCIe Port_1, PCIe Port_2, PCIe Port_3, PCIe Port_4, PCIe Port_5, PCIe Port_6 and PCIe Port_7. A traffic monitoring module is added to the PCIe system to monitor the Throughput (total amount of data) transmitted by each independent port per unit time.
[0106] In a specific implementation, link transmission can be divided into several gears according to the throughput of each independent port per unit time and the data volume of all ports in the entire link, and the link can be adjusted according to the size of the link transmission data volume in the PCIe system.
[0107] In an actual application, the port channel is x8, and the link transmission is divided into 4 gears, indicating the amount of data transmitted by the current link. As shown in Table 1:
[0108] Table 1
[0109] x8 gear Single port data throughput Expected width 1 0-10GB x1 2 10-20GB x2 3 20-40GB x4 4 40GB or more x8
[0110] In the case of a port channel of x8, when the data throughput of the port per unit time is 0 to 10GB (Gigabyte), the port transmission gear is gear 1, indicating that the data transmission volume of the port channel is small at this time, the port channel is relatively idle, and the width reduction operation can be started to save power. The expected width of this gear is x1 (single channel), indicating that the x1 width can perform the data throughput of the port in the current port state, thereby starting the port channel from x8 to x1.
[0111] During the width reduction, the channel 0 which has been in working state can continue to transmit data normally. When the data throughput of a single link port increases to a corresponding different expected width, the port is again widened to adjust the link width adaptively.
[0112] For a single-port link, the hardware can adaptively adjust the bandwidth through L0p according to the gear of the current data volume transmitted by the port link. This can effectively save system resources and power consumption without affecting normal business transmission.
[0113] In a practical application, the structural diagram of a single-port PCIe system is as follows: Figure 5As shown, the port has 8 channels and is continuously transmitting data. A traffic monitoring module is set up in the system to monitor the data throughput of the port. PCIeLane_0, PCIe Lane_1, PCIe Lane_2, PCIe Lane_3, PCIe Lane_4, PCIe Lane_5, PCIe Lane_6, and PCIe Lane_7 represent the eight channels of the port respectively. When the traffic monitoring module detects that the data throughput of the port has dropped from 59GB to 30GB per unit time, and only four channels are needed to complete the data transmission. The port then starts the L0p mode to operate the channel, reducing the number of port channels from x8 to x4. Figure 6 As shown in the figure, during the process of reducing channels, PCIeLane_0 to PCIe Lane_3 work normally and do not affect data transmission. The traffic monitoring module will continuously monitor the data throughput in the port. When the data throughput exceeds 40GB, the L0p mode will be started again to increase the width, so as to realize adaptive dynamic adjustment of the link width.
[0114] For multi-port links, the data of all ports can be monitored, and the link width of the port can be adjusted through L0p according to the data volume of each port and the gear position of each port.
[0115] In a practical application, the structural diagram of a multi-port PCIe system is as follows: Figure 7 As shown, a traffic monitoring module is provided in the system, and the system includes three ports, namely Port0 of x4, Port1 of x2 (2 channels) and Port2 of x2. Among them, the corresponding channels of Port0 are PCIe Lane_0, PCIe Lane_1, PCIe Lane_2 and PCIe Lane_3; the corresponding channels of Port1 are PCIe Lane_4 and PCIe Lane_5; the corresponding channels of Port2 are PCIe Lane_6 and PCIe Lane_7. When the traffic monitoring module detects that the data throughput per unit time of the three ports decreases, Port0 is reduced to x2, and Port1 and Port2 are both reduced to x1. As shown Figure 8 As shown in the figure, during the speed reduction process, PCIe Lane_0, PCIe Lane_1, PCIeLane_4, and PCIe Lane_6 all work normally and do not affect data transmission. 5) The traffic monitoring module continues to count, and when the data throughput exceeds the gear threshold, the L0p mode width increase operation is started to achieve adaptive dynamic adjustment of the link width;
[0116] In some optional implementations, the PCIe system is deployed in servers and data centers, and data transmission has a strong periodicity, so the gear selection can be dynamically adjusted according to different application scenarios, ultimately achieving the optimization of bandwidth and power consumption. In the later stage, it can be expanded to add the latest AI (Artificial Intelligence) training algorithm. As the amount of data transmitted by each port increases, the width of each port is predicted, providing a more accurate reference for the control of the system width, thereby more accurately adjusting the width of the PCIe system dynamically.
[0117] The embodiment of the present application solves the problem that the L0p state is newly added in the PCIe 6.0 protocol, but the specific hardware width control method is not defined, and there is a lack of a control method for hardware adaptive switching link width. By adding a hardware traffic monitoring module in a pioneering way, the link width is adaptively adjusted through the L0p method according to the data throughput of each port. Under the premise of not affecting the data service transmission, the link width is dynamically adjusted to save power consumption.
[0118] In addition, the method can also dynamically configure the throughput level of each port according to different application scenarios, so as to more flexibly adjust the link width for different implementation scenarios and optimize system power consumption.
[0119] In addition, by utilizing the newly added L0p state of the PCIe 6.0 protocol, there is no need to add a new LTSSM state. The implementation is simple and versatile, and the newly added port traffic monitoring modules can be easily integrated into the existing solution.
[0120] In this embodiment, a bandwidth adjustment 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.
[0121] This embodiment provides a bandwidth adjustment device, such as Fig. 9 As shown, including:
[0122] An acquisition module 901 is used to acquire the real-time data volume of a target port in a target link;
[0123] A determination module 902 is used to determine the number of target channels corresponding to the target port according to the real-time data volume of the target port;
[0124] An adjustment module 903, configured to generate a channel adjustment instruction according to the target channel number and the enabled channel number if the target channel number and the enabled channel number of the target port are different;
[0125] The updating module 904 is used to send a channel adjustment instruction to the target port to adjust the number of enabled channels of the target port.
[0126] In some optional implementations, the determining module 902 includes:
[0127] A first capacity determination unit, used to obtain the bandwidth and data transmission rate of the target port to determine the first capacity of each channel in the target port;
[0128] The target channel number determination unit is used to determine the target channel number of the target port based on the first capacity and the real-time data volume.
[0129] In some optional implementations, the adjustment module 903 includes:
[0130] A first channel determination unit, configured to determine a first channel of a target port based on a difference between a target channel number and an enabled channel number of the target port;
[0131] A generation unit is specified to generate a channel adjustment instruction for a first channel.
[0132] In some optional implementations, the first channel determining unit includes:
[0133] The disabled channel number acquisition subunit is used to acquire the disabled channel number of the target port when the difference value is greater than zero.
[0134] The first selection subunit is used to select a first number of disabled channels as first channels when the difference is less than the number of disabled channels; the first number is the same as the difference.
[0135] In some optional implementations, the first channel determining unit includes:
[0136] The enabled channel number acquisition subunit is used to acquire the enabled channel number of the target port when the difference is less than zero.
[0137] The second selection subunit is used to select a second number of enabled channels as the first channels; the second number is the same as the absolute value of the difference.
[0138] In some optional implementations, the bandwidth adjustment device includes:
[0139] An updating module, used for updating the real-time data volume of the target port, and determining the difference between the target channel number and the enabled channel number of the target port based on the updated real-time data volume;
[0140] an enabling module, configured to enable a third number of disabled channels in the target port when the difference is greater than zero; the third number is the same as the difference;
[0141] The closing module is used to close a fourth number of enabled channels in the target port when the difference is less than zero; the fourth number is the absolute value of the difference.
[0142] 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.
[0143] The bandwidth adjustment 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.
[0144] The present application also provides a computer device having the above Fig. 9 The bandwidth adjustment device shown.
[0145] See also Fig.10 , Fig.10 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present application, such as Fig.10 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in 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 some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.10 A processor 10 is taken as an example.
[0146] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 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 gate array, a general purpose array logic or any combination thereof.
[0147] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0148] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for 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 20 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 20 may optionally include a memory remotely arranged relative to the processor 10, 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.
[0149] The memory 20 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 20 may also include a combination of the above types of memory.
[0150] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.
[0151] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0152] The embodiment of the present application also provides a computer-readable storage medium. The above method according to the embodiment of the present application 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.
[0153] Part of the present application 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 application through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes but is not limited to source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a 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 can be any available computer-readable storage medium or communication medium accessible to the computer.
[0154] Although the embodiments of the present application are 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 application, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A bandwidth adjustment method, characterized in that: The method is applied to a high-speed serial computer expansion bus standard system, and the method comprises: Get the real-time data volume of the target port in the target link; Determining the number of target channels corresponding to the target port according to the real-time data volume of the target port; If the target channel number and the enabled channel number of the target port are different, generating a channel adjustment instruction according to the target channel number and the enabled channel number; A channel adjustment instruction is issued to the target port to adjust the number of enabled channels of the target port.
2. The method according to claim 1, characterized in that The step of determining the number of target channels corresponding to the target port according to the real-time data volume of the target port includes: Obtaining the bandwidth and data transmission rate of the target port to determine the first capacity of each channel in the target port; A target number of channels of the target port is determined based on the first capacity and the real-time data volume.
3. The method according to claim 1, characterized in that The generating a channel adjustment instruction according to the target number of channels and the number of enabled channels includes: Determining a first channel of the target port based on a difference between a target channel number and an enabled channel number of the target port; A channel adjustment instruction for the first channel is generated.
4. The method according to claim 3, characterized in that: The determining the first channel of the target port based on the difference between the target channel number and the enabled channel number of the target port comprises: When the difference is greater than zero, obtaining the number of disabled channels of the target port; In a case where the difference is less than the number of disabled channels, a first number of disabled channels is selected as first channels; the first number is the same as the difference.
5. The method according to claim 3, characterized in that: The determining the first channel of the target port based on the difference between the target channel number and the enabled channel number of the target port comprises: When the difference is less than zero, obtaining the number of enabled channels of the target port; A second number of enabled channels is selected as the first channel; the second number being the same as the absolute value of the difference.
6. The method according to any one of claims 1 to 3, characterized in that: After sending the channel adjustment instruction to the target port to adjust the number of enabled channels of the target port, the method further includes: Updating the real-time data volume of the target port, and determining the difference between the target channel number and the enabled channel number of the target port based on the updated real-time data volume; When the difference is greater than zero, enabling a third number of disabled channels in the target port; the third number is the same as the difference; When the difference is less than zero, a fourth number of enabled channels in the target port is closed; the fourth number is the absolute value of the difference.
7. A bandwidth adjustment device, characterized in that: The device comprises: An acquisition module, used to acquire the real-time data volume of a target port in a target link; A determination module, used to determine the number of target channels corresponding to the target port according to the real-time data volume of the target port; an adjustment module, configured to generate a channel adjustment instruction according to the target channel number and the enabled channel number if the target channel number and the enabled channel number of the target port are different; The update module is used to send a channel adjustment instruction to the target port to adjust the number of enabled channels of the target port.
8. 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 bandwidth adjustment method according to any one of claims 1 to 6 by executing the computer instructions.
9. 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 bandwidth adjustment method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to enable a computer to execute the bandwidth adjustment method according to any one of claims 1 to 6.
Citation Information
Patent Citations
High performance interconnect physical layer
CN104995614A
Link width adjusting method and device, equipment and storage medium
CN112433596A
Load balancing method and device based on direct memory access channel and medium
CN117807002A
Link width switching method, communication device and communication system
CN118631756A
Dynamic link width adjustment
JP2015505094A
Cited By
Interconnection interface, data transmission method, chip and electronic equipment
CN120658613A