Link flow control quota adjustment method, device, and on-chip processing system

By dynamically adjusted the flow control quota between the PCIE bus virtual channels, the problem of uneven distribution of virtual channel resources in existing technologies was solved, and the bus utilization rate and system performance were improved.

CN114979008BActive Publication Date: 2025-01-2458TH RES INST OF CETC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210545028.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-19
Publication Date
2025-01-24
Estimated Expiration
2042-05-19

AI Technical Summary

Technical Problem

In the prior art, the virtual channel traffic control quota of the PCIe bus cannot be dynamically adjusted, resulting in a large amount of quota remaining in some virtual channels, while other virtual channels lack resources, resulting in low link utilization and affecting system efficiency.

Method used

By monitoring the fluctuation of the flow control quota of each virtual channel, calculate the equivalent value of the flow control limit, and dynamically adjust the flow control amount between different virtual channels to ensure that the virtual channel resources with sufficient flow control quota are allocated to insufficient virtual channels.

Benefits of technology

Improved the utilization of PCIE bus, ensured the reasonable distribution of system resources, and improved system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114979008B_ABST
    Figure CN114979008B_ABST
Patent Text Reader

Abstract

The present invention relates to a link flow control quota adjustment method, device, and on-chip processing system, wherein the method comprises: monitoring the flow control quota fluctuations corresponding to different virtual channels, obtaining the flow control quota equivalent values ​​corresponding to each virtual channel within a specified time period; based on the flow control quota equivalent values, dynamically adjusting the flow control quota allocation between different virtual channels, allocating the resources of the virtual channel with sufficient flow control quota to the virtual channel with insufficient flow control quota; sending the reallocated flow control quota to the link peer via a link layer data packet, and making corresponding adjustments at the link peer. The scheme of the present invention allocates the flow control quota of the virtual channel with sufficient flow quota to the virtual channel with insufficient flow control quota, so that the virtual channel with larger flow obtains more resources, improves the utilization rate of the resources related to the flow control quota, and thus improves the performance of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chip design, and in particular to an adaptive link flow control quota adjustment method, device, and on-chip processing system. Background Art

[0002] PCIe (Peripheral Component Interconnect Express) bus is a high-speed serial computer expansion bus standard, which is developed from PCI and PCI-X bus, but has a faster communication rate. It is widely used in computers, servers, mobile phones, system-on-chip SOC and other fields.

[0003] Specifically, the PCIe bus protocol is divided into three layers, including the protocol layer (transaction layer), the data link layer (DataLink layer) and the physical layer (physical layer). In a typical PCIe data transmission, data is usually provided by the core, and is processed by the protocol layer, data link layer and physical layer in turn, and the data packet is sent to the other end via the PCIe link. The receiving end processes the received data packet through the physical layer, data link layer and protocol layer in turn, obtains the required data and finally sends it to the core for further processing.

[0004] Due to the limitation that there is only one physical link between two devices directly connected through a PCIe link, a virtual channel is used to distinguish logically unrelated data packets. However, physical resources, including buffer memory, are limited, so the total amount of data in a single virtual channel must be controlled in the form of a flow control quota. The flow control quota reflects the remaining resources of the virtual channel corresponding to the other end of the link. According to the protocol, there are three different types of data packets, and each data packet includes two different flow control quotas: header information and data load. Therefore, the flow control quota can control the transmission speed of the data packet in the corresponding virtual channel, and thus control the transmission efficiency of the PCIe bus.

[0005] In the prior art, for a given link, the virtual channel flow control quota is initialized by means of a data link layer data packet when the link is initialized, and the flow control quota is updated at regular intervals after entering the normal working state, and the total amount of the flow control quota cannot be dynamically adjusted. However, the data load of different virtual channels is usually different, which will cause some virtual channels to have a large amount of flow control quota remaining, and some virtual channels to have a shortage of flow control quota, so that the virtual channels with insufficient flow control quota can only wait, and the link is in an idle or low-utilization state, thereby affecting the efficiency of the system. Summary of the invention

[0006] In order to solve the above technical problems, the present invention provides a method for adaptively adjusting link flow control quota, the method comprising:

[0007] Monitor the fluctuation of the flow control quota corresponding to different virtual channels, and obtain the equivalent value of the flow control quota corresponding to each virtual channel within a specified time period;

[0008] Based on the flow control quota equivalent value, dynamically adjust the flow control quota allocation between the unconnected virtual channels, and allocate the resources of the virtual channel with sufficient flow control quota to the virtual channel with insufficient flow control quota;

[0009] The reallocated flow control quota is sent to the link peer via a link layer data packet, and the link peer makes corresponding adjustments.

[0010] In one embodiment of the present invention, the monitoring of the fluctuation of the flow control quota corresponding to different virtual channels includes: taking the system clock as a reference, a number of clock cycles as a monitoring cycle, obtaining the flow control quota corresponding to each virtual channel once in each clock cycle, and generating statistical information after each monitoring cycle to obtain the fluctuation of the flow control quota corresponding to different virtual channels.

[0011] In one embodiment of the present invention, obtaining the fluctuation of the flow control quotas corresponding to the different virtual channels includes: accumulating the different flow control quotas corresponding to a single virtual channel, including the data and header packet quotas of non-mailing messages, the data and header packet quotas of mailing messages, and the data and header packet quotas of completed messages, a total of six different flow control quotas, based on the clock cycle, to obtain the respective equivalent values ​​of the flow control quotas;

[0012] Corresponding operations are performed on each virtual channel to obtain equivalent values ​​of different flow control quotas of different virtual channels.

[0013] In one embodiment of the present invention, the equivalent value calculation method of the flow control quota in the detection period is as follows:

[0014] X_CR_n=X_CR×clk_num

[0015] Wherein X_CR_n is the equivalent value of the flow control quota corresponding to the X type of the nth virtual channel, and X can be the six different flow control quota types described in claim 3 above; X_CR is the instantaneous value of the flow control quota of the X type of the virtual channel obtained at the clock cycle; clk_num is the number of clock cycles in the monitoring cycle.

[0016] In one embodiment of the present invention, according to the equivalent value of the flow control quota calculated within the monitoring period, for the same type of flow control quota, the quota of the virtual channel with sufficient flow control quota is allocated to the virtual channel with insufficient flow control quota.

[0017] In one embodiment of the present invention, the quota of a virtual channel with sufficient flow control quota is allocated to a virtual channel with insufficient flow control quota. After one or several monitoring cycles, the adjusted flow control quota of the virtual channel is sent to the link peer device via a link layer data packet to update the flow control quota.

[0018] On the other hand, a dynamically adaptive link flow control quota adjustment device is provided, the device comprising:

[0019] Monitoring module: used to monitor different types of flow control quotas of each virtual channel and calculate the equivalent value of the flow control quota within a monitoring period;

[0020] Adjustment module: dynamically adjusts the flow control quota between different virtual channels according to the equivalent value of the flow control quota obtained.

[0021] On the other hand, an on-chip processing system is also provided. The on-chip processing system is a general-purpose machine with a built-in computing program, and the method steps described above can be executed by the computing program or implemented by hardware design.

[0022] The above-mentioned technical scheme of the present invention has the following advantages over the prior art: the above-mentioned dynamic adaptive link flow control quota adjustment method and device described in the present invention can monitor the flow control quota fluctuation of each virtual channel when the link is working normally, and allocate the flow control quota of the virtual channel with sufficient flow quota to the virtual channel with insufficient flow control quota, so that the virtual channel with larger flow obtains more resources, improves the utilization rate of the bus, and thus improves the performance of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to make the contents of the present invention more clearly understood, the present invention is further described in detail below based on specific embodiments of the present invention in conjunction with the accompanying drawings.

[0024] Figure 1 It is a flow chart of the adaptive link flow control quota adjustment method of the present invention;

[0025] Figure 2 It is a schematic diagram of the adaptive link flow control quota adjustment device described in the present invention. DETAILED DESCRIPTION

[0026] like Figure 1 and Figure 2 As shown, this embodiment provides a method for adaptively adjusting link flow control quota, the method comprising:

[0027] Monitor the fluctuation of the flow control quota corresponding to different virtual channels, and obtain the equivalent value of the flow control quota corresponding to each virtual channel within a specified time period;

[0028] Based on the flow control quota equivalent value, dynamically adjust the flow control quota allocation between the unconnected virtual channels, and allocate the resources of the virtual channel with sufficient flow control quota to the virtual channel with insufficient flow control quota;

[0029] The reallocated flow control quota is sent to the link peer via a link layer data packet, and the link peer makes corresponding adjustments.

[0030] The monitoring of the fluctuation of the flow control quota corresponding to different virtual channels includes: taking the system clock as a reference, taking several clock cycles as a monitoring cycle, obtaining the flow control quota corresponding to each virtual channel once in each clock cycle, generating statistical information after each monitoring cycle, and obtaining the fluctuation of the flow control quota corresponding to different virtual channels.

[0031] Obtaining the fluctuation of the flow control quotas corresponding to the different virtual channels includes: different flow control quotas corresponding to a single virtual channel, including data and header packet quotas of non-post (NP) messages, data and header packet quotas of post (P) messages, and data and header packet quotas of completion (Completion) messages, a total of six different flow control quotas, accumulating based on clock cycles to obtain respective equivalent values ​​of flow control quotas;

[0032] Corresponding operations are performed on each virtual channel to obtain equivalent values ​​of different flow control quotas of different virtual channels.

[0033] In one embodiment of the present invention, the equivalent value calculation method of the flow control quota in the detection period is as follows:

[0034] X_CR_n=X_CR×clk_num

[0035] Wherein X_CR_n is the equivalent value of the flow control quota corresponding to the X type of the nth virtual channel, and X can be the six different flow control quota types described in claim 3 above; X_CR is the instantaneous value of the flow control quota of the X type of the virtual channel obtained at the clock cycle; clk_num is the number of clock cycles in the monitoring cycle.

[0036] Furthermore, monitor the fluctuations of the flow control quotas corresponding to different virtual channels, and obtain the equivalent values of the flow control quotas corresponding to each virtual channel within a specified time period.

[0037] Secondly, the virtual channel takes an integer value between 0 and 7, namely VC0-VC7. Denote the instantaneous flow control quota of type X corresponding to a certain virtual channel n as X_CR_n, and obtain this value once at the rising edge of each reference clock cycle, and accumulate it within a monitoring period. Denote the number of reference clock cycles included in this time period as clk_num. Then, the equivalent value of the flow control quota of type X corresponding to a certain virtual channel n within a monitoring period can be obtained as AVR_X_CR_n = X_CR_n × clk_num.

[0038] According to the equivalent values of the flow control quotas calculated within the monitoring period, for the flow control quotas of the same type, allocate the quotas of the virtual channels with sufficient flow control quotas to the virtual channels with insufficient flow control quotas.

[0039] Furthermore, set a threshold TH_X_value for the equivalent value of the flow control quota of a specific type X. After each monitoring period ends, compare the equivalent values of the flow control quotas monitored for virtual channels 0-7 within this period with TH_X_value. If the equivalent value of the flow control quota AVR_X_CR_i of a certain virtual channel i < TH_X_value, then reallocate the flow control quotas of one or more virtual channels with equivalent values greater than the threshold to virtual channel i.

[0040] Among them, allocate the quotas of the virtual channels with sufficient flow control quotas to the virtual channels with insufficient flow control quotas. After one or several monitoring periods, send the adjusted flow control quotas of the virtual channels to the link peer device through link layer data packets to update the flow control quotas.

[0041] Send the reallocated flow control quota to the link peer through link layer data packets, and make corresponding adjustments at the link peer.

[0042] A dynamic adaptive link flow control quota adjustment device, the device includes:

[0043] Monitoring module: used to monitor different types of flow control quotas of each virtual channel, and calculate the equivalent value of the flow control quota within a monitoring period;

[0044] Adjustment module: Dynamically adjust the flow control quota between different virtual channels according to the obtained equivalent value of the flow control quota.

[0045] A chip processing system is a general-purpose machine with a built-in computing program, and the method steps described above can be implemented by computing programs or hardware design.

[0046] Obviously, the above embodiments are merely examples for clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from these are still within the protection scope of the invention.

Claims

1. A method for adaptively adjusting link flow control quota, characterized in that: The method includes: Monitoring the fluctuation of the traffic control quota corresponding to different virtual channels, and obtaining the equivalent value of the traffic control quota corresponding to each virtual channel within a specified time period; Based on the equivalent value of the traffic control quota, dynamically adjusting the distribution of the traffic control quota between different virtual channels, and allocating the resources of the virtual channel with sufficient traffic control quota to the virtual channel with insufficient traffic control quota; Sending the reallocated traffic control quota to the opposite end of the link through a link layer data packet for corresponding adjustment at the opposite end of the link; The monitoring of the fluctuation of the traffic control quota corresponding to different virtual channels includes: taking the system clock as a reference, using several clock cycles as a monitoring period, obtaining the traffic control quota corresponding to each virtual channel once in each clock cycle, generating statistical information after each monitoring period, and obtaining the fluctuation of the traffic control quota corresponding to different virtual channels; Obtaining the fluctuation of the traffic control quota corresponding to different virtual channels includes: for the different traffic control quotas corresponding to a single virtual channel, including the data quota of non-mailing messages, the header packet quota of non-mailing messages, the data quota of mailing messages, the header packet quota of mailing messages, the data quota of completion messages, and the header packet quota of completion messages, a total of six different traffic control quotas, accumulating based on the clock cycle to obtain their respective equivalent values of the traffic control quota; Performing corresponding operations on each virtual channel to obtain the equivalent values of different traffic control quotas of different virtual channels; The calculation method of the equivalent value of the traffic control quota within the detection period is as follows: X_CR_n = X_CR × clk_num Where X_CR_n is the equivalent value of the traffic control quota of the X type corresponding to the nth virtual channel, and the X type is one of the above six different traffic control quota types; X_CR is the instantaneous value of the traffic control quota of the X type of this virtual channel obtained at the clock cycle; clk_num is the number of clock cycles in the monitoring period; Comparing the equivalent value X_CR_n of the traffic control quota of the nth virtual channel with a threshold TH_X_value set for the equivalent value of the traffic control quota of X. For X_CR_n < TH_X_value, it is considered that the traffic control quota of the X type within this virtual channel is sufficient, otherwise it is insufficient. For the traffic control quota of the same type, allocate the quota of the virtual channel with sufficient traffic control quota to the virtual channel with insufficient traffic control quota.

2. The method according to claim 1, characterized in that: Among them, allocating the quota of the virtual channel with sufficient traffic control quota to the virtual channel with insufficient traffic control quota. After one or several monitoring periods, send the adjusted traffic control quota of the virtual channel to the opposite end device of the link through a link layer data packet to update the traffic control quota.

3. A dynamic and adaptive link flow control quota adjustment device, characterized in that: The device includes: Monitoring module: The flow control quota corresponding to each virtual channel is obtained once per clock cycle, and statistical information is generated once at the end of each monitoring cycle. Then, this module is used to obtain the fluctuation of the flow control quota corresponding to different virtual channels, obtain the six different flow control quotas corresponding to each virtual channel, and calculate the equivalent value X_CR_n of the flow control quota within a monitoring cycle: X_CR_n = X_CR × clk_num where X_CR_n is the equivalent value of the flow control quota corresponding to the X type of the nth virtual channel, and the X type is one of the six different flow control quota types, including the data quota of non-mail packets, the header packet quota of non-mail packets, the data quota of mail packets, the header packet quota of mail packets, the data quota of completion packets, and the header packet quota of completion packets, a total of six different flow control quotas; X_CR is the instantaneous value of the flow control quota of the X type of this virtual channel obtained at the clock cycle; clk_num is the number of clock cycles in the monitoring cycle; Arbitration module: In each monitoring cycle, the equivalent value of the obtained flow control quota is input into this module and compared with the preset virtual channel flow control quota threshold TH_X_value. For X_CR_n < TH_X_value, it is considered that the flow control quota of the X type within this virtual channel is sufficient, otherwise it is insufficient, and then the input of the flow control quota adjustment is controlled; Adjustment module: Dynamically adjust the flow control quota between different virtual channels according to the obtained equivalent value of the flow control quota, and allocate the resources of the virtual channel with sufficient flow control quota to the virtual channel with insufficient flow control quota; where the flow control quota reflects the remaining resources of the virtual channel corresponding to the opposite end of the link, and the flow control quota controls the data packet transmission speed within the corresponding virtual channel, and the data packets include the above-mentioned non-mail packets, mail packets, and completion packets.

4. A processing system on a chip, characterized in that: The on-chip processing system described above is a computer, and its storage part has a calculation program built in, and the method steps described in claim 1 are implemented through the program in the computer.

Citation Information

Patent Citations

  • Network connection traffic flow distribution method and device and storage medium

    CN112448895A

  • Shared flow control credits

    US20160182391A1