Method for adjusting virtual lane credit of PCIe, communication device and system
By predicting the traffic characteristics of PCIe virtual channels through machine learning and dynamically adjusting credit limits, the problem of uneven resource allocation caused by the static configuration of credit pools in the PCIe protocol is solved, achieving more efficient resource utilization and system stability.
Patent Information
- Application Number
- CN202511310501.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-15
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-09-15
AI Technical Summary
The credit pool configuration of virtual channels in the PCIe protocol is static and cannot be dynamically adjusted, which makes it unable to cope with traffic changes and resource contention, thus affecting system performance.
A machine learning-based traffic prediction model is introduced to dynamically adjust the credit limit of virtual channels. By predicting the traffic probability and credit consumption characteristics of virtual channels and combining them with a global resource limitation mechanism, flexible scheduling of credit limits can be achieved.
This improved system resource utilization, avoided traffic congestion and resource waste, and ensured system stability and timely response.
Smart Images

Figure CN120811925B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of PCIe communication, and more particularly to a PCIe virtual channel credit limit adjustment method, communication equipment, and system. Background Technology
[0002] PCIe (Peripheral Component Interconnect Express) is a high-speed data transmission protocol widely used in computer systems. It is primarily used to connect various hardware devices, such as CPUs, GPUs, storage devices, and network cards. The PCIe protocol supports high-speed, low-latency data transmission and provides flexible bandwidth allocation and device connection methods.
[0003] In the PCIe 6.0 protocol, data is transmitted using a basic unit called a Flit (Flow Control Unit). A FLIT is a fragmented data packet that is transmitted over a physical link. Each PCIe link can be allocated multiple Virtual Channels (VCs). A VC is a mechanism that implements traffic isolation and priority management in hardware. Because VCs provide logical isolation from each other and do not interfere with each other, multiple data flows can share the same physical link through multiple VCs.
[0004] Each virtual channel can have different traffic characteristics, bandwidth requirements, and priorities. Each virtual channel borrows appropriate credit from a shared credit pool based on the current data transmission traffic requirements to ensure smooth data transmission. The borrowed credit is consumed as data is transmitted. When the credit borrowed by a virtual channel is exhausted, the system will wait for its credit to be reclaimed before continuing data transmission.
[0005] In the PCIe protocol, the credit pool is a shared, centralized resource pool used to manage the credit limits of each virtual channel, i.e., the maximum amount of credit that can be borrowed. In traditional PCIe protocols, the borrowing limit for each virtual channel in the credit pool is typically statically configured. This means that the maximum amount of credit to borrow (the maximum borrowable credit value) is set during initialization and cannot be dynamically adjusted during operation. This means that the current credit value of each virtual channel cannot exceed this fixed credit limit. For example, if a virtual channel has a credit limit of 30, then in actual data transmission, for small-volume transmissions, it can borrow 15 credits, and for large-volume transmissions, it can borrow 30 credits, but it cannot exceed this maximum limit. This static configuration mode has limitations; it cannot cope with traffic changes and resource contention, which may lead to uneven resource allocation and affect the overall performance of the system.
[0006] The disclosure of the above background technical content is only for the purpose of assisting in understanding the concept and technical solution of this application, and does not necessarily provide technical instruction. Summary of the Invention
[0007] The purpose of this invention is to provide a PCIe virtual channel credit limit adjustment method based on machine learning, which introduces a predicted traffic and virtual credit limit scheduling mechanism to solve the problem of lack of flexibility in static credit resource allocation and scheduling.
[0008] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0009] A machine learning-based method for adjusting PCIe virtual channel credit limits includes the following steps:
[0010] A pre-built traffic prediction model is used to predict the probability of burst traffic in the virtual channel in the next cycle. The model takes one or more of the following features as input features: traffic intensity, congestion pressure, credit consumption rate, and resource turnover efficiency of the virtual channel. Each feature is configured with a corresponding optimal weight, which is obtained by learning from the sample data through machine learning.
[0011] The probability of burst traffic in each virtual channel is predicted using the traffic prediction model.
[0012] Configure an initial virtual credit limit for each virtual channel, and calculate the credit limit change amount for that virtual channel based on the probability of the corresponding burst traffic, thereby determining the virtual credit budget for each virtual channel;
[0013] By combining the virtual credit budgets of all virtual channels and the remaining credit limit in the global credit pool, a credit limit allocation scheme is generated for each virtual channel. The remaining credit limit in the global credit pool is the credit difference between the total global credit value and the sum of the current virtual credit budgets of all virtual channels.
[0014] Furthermore, based on any one or a combination of the aforementioned technical solutions, the traffic prediction model is as follows:
[0015] ,in, P i To predict the first i The probability value of burst traffic in a virtual channel. σ ( ) is the activation function, which maps the combined values to the probability interval [0,1]. flit_send i Indicates the first i The data packet traffic sent by each virtual channel in the most recent traffic period wait_depth i Indicates the firsti The length of the virtual channel waiting queue used_ratio i Indicates the first i The virtual channel has already borrowed credit ratios. credit_reclaim_rate i Indicates the first i Credit turnover efficiency of each virtual channel in the most recent recycling period. w 1, w 2, w 3, w 4 represents the weighting coefficient. b These are constant coefficients.
[0016] Furthermore, following any one or a combination of the aforementioned technical solutions, the coefficients in the prediction model corresponding to each virtual channel... w 1, w 2, w 3, w 4, b The machine learning approach is as follows:
[0017] Collect traffic data before several bursts of traffic and traffic data before no bursts of traffic in the virtual channel of the PCIe link;
[0018] Based on each piece of traffic data collected, determine the data sent within the most recent traffic cycle of this virtual channel. flit Quantity, items awaiting delivery flit The data includes the quantity, the ratio of borrowed credit value to the current available credit limit, the ratio of credit value reclaimed in the most recent collection period to the global credit pool capacity, and whether the traffic data corresponds to a burst of traffic, to obtain a labeled learning sample.
[0019] Multiple training samples are input into the traffic prediction model for iterative training to obtain coefficients. w 1, w 2, w 3, w 4, b The optimal value.
[0020] Furthermore, based on any one or a combination of the aforementioned technical solutions, the following methods can be used to obtain... flit_send i , wait_depth i , used_ratio i and / or credit_reclaim_rate i :
[0021] In the iA periodically reset counter is added to the existing packet sending path of each virtual channel. This counter is used to count the number of packets sent by the virtual channel in the most recent traffic period. flit Quantity, as flit_send i ;
[0022] PCIe controller directly reads the... i The depth value of the waiting queue corresponding to each virtual channel is output in the FPGA or SoC as the state of a standard register. wait_depth i ;
[0023] PCIe controller utilizes the first i Each virtual channel's existing state logic reads the currently borrowed credit value and obtains the virtual credit budget for that virtual channel. It then calculates the ratio of the borrowed credit value to the virtual credit budget as... used_ratio i ;
[0024] In the i A periodically reset counter is added to the ACK path or return path on the receiving side of each virtual channel to count the number of credit values recovered in the most recent recovery cycle. This counter is then divided by the total global credit value, and the resulting ratio is used as the basis for calculation. credit_reclaim_rate i .
[0025] Furthermore, following any one or a combination of the aforementioned technical solutions, the amount of the virtual channel quota change is calculated in the following manner:
[0026] If the probability prediction of sudden traffic in the virtual channel is greater than the preset trigger threshold, the quota change amount will be calculated using the following formula: , where Δ Credit i For the first i Changes in the quota of each virtual channel P i To predict the first i The probability value of burst traffic in a virtual channel. P 0 is the threshold for triggering sudden traffic. C max The maximum credit score that can be increased in a single transaction is [number]. round [ ] represents the floor function;
[0027] If the probability prediction result of the burst traffic of the virtual channel does not reach the preset trigger threshold, then the quota change amount of the virtual channel is determined to be 0, or the quota change amount is calculated by the following formula: , where Δ Credit i For the first iChanges in the quota of each virtual channel P i To predict the first i The probability value of burst traffic in a virtual channel. P 0 is the threshold for triggering sudden traffic. C max The maximum credit score that can be increased in a single transaction is [number]. round [ ] represents the floor function.
[0028] Furthermore, following any one or a combination of the aforementioned technical solutions, the PCIe virtual channel credit limit adjustment method provided by this invention further includes implementing a global resource restriction mechanism, including:
[0029] In each calculation of the first i After adjusting the credit limit for each virtual channel, assume that the credit limit adjustment is increased, and calculate the total virtual credit budget for all virtual channels. ,in VCB [ i ] indicates the first i Virtual credit budget for each virtual channel N This indicates the total number of virtual channels sharing a PCIe link;
[0030] If the sum of the virtual credit budgets does not exceed the global total credit value, then the first limit change is updated accordingly. i The virtual credit budget for each virtual channel is adjusted; otherwise, the virtual credit budget for that virtual channel is stopped from being updated and / or the current virtual credit budget for other virtual channels is reduced.
[0031] Furthermore, following any one or a combination of the aforementioned technical solutions, the PCIe virtual channel credit limit adjustment method provided by this invention further includes implementing a global resource restriction mechanism, including:
[0032] In the i When a virtual channel sends a borrowing request, assuming that the requested borrowing credit value in the borrowing request is the credit value already borrowed by that virtual channel, the total global credit value is subtracted from the sum of the credit values already borrowed by all virtual channels to obtain the global credit pool reserved credit value.
[0033] If the ratio of the credit value retained in the global credit pool to the total global credit value is greater than or equal to a preset limit threshold, then the first... i The current borrowing request for a virtual channel is rejected; otherwise, the current borrowing request is rejected and / or credits already borrowed and not yet exhausted in other virtual channels are released.
[0034] Furthermore, following any one or a combination of the aforementioned technical solutions, the PCIe virtual channel credit limit adjustment method provided by this invention further includes:
[0035] Statistically determine whether the probability of sudden traffic in each virtual channel exceeds the preset trigger threshold;
[0036] If the probability of a certain virtual channel meeting the predicted burst traffic is lower than the trigger threshold for m consecutive times, or if the ratio of the number of times a certain virtual channel meets the predicted burst traffic with a probability lower than the trigger threshold to the total number of predictions for that virtual channel in a preset recent statistical period exceeds a preset percentage, or if the ratio of the credit value retained in the global credit pool to the total global credit value is lower than a preset limit threshold, then the credit currently borrowed by that virtual channel will be reclaimed or the current virtual credit budget of that virtual channel will be reduced.
[0037] Furthermore, based on any one or a combination of the aforementioned technical solutions, a credit limit allocation scheme is generated for each virtual channel in the following manner:
[0038] Based on the remaining credit limit in the global credit pool, the total amount of credit that can be allocated is determined;
[0039] Based on the virtual credit budget of each virtual channel, the total allocable credit amount is redistributed to each virtual channel, such that the virtual channel with a higher virtual credit budget receives more redistributed credit than the virtual channel with a lower virtual credit budget.
[0040] Furthermore, based on any one or a combination of the aforementioned technical solutions, a credit limit allocation scheme is generated for each virtual channel in the following manner:
[0041] Based on the remaining credit limit in the global credit pool, the total amount of credit that can be allocated is determined;
[0042] Obtain the priority information corresponding to each virtual channel, and determine the priority weight of each virtual channel based on the probability of burst traffic.
[0043] According to the priority weight of each virtual channel, the total allocable credit amount is redistributed to each virtual channel, so that the virtual channel with a higher priority weight receives more credit value redistributed than the virtual channel with a lower priority weight.
[0044] Furthermore, based on any one or a combination of the aforementioned technical solutions, a credit limit allocation scheme is generated for each virtual channel in the following manner:
[0045] Based on the remaining credit limit in the global credit pool, the total amount of credit that can be allocated is determined;
[0046] Obtain the credit value currently borrowed for each virtual channel, calculate its ratio to the corresponding virtual credit budget, and record it as the borrowed credit ratio.
[0047] Each virtual channel is sorted according to the borrowed credit ratio to determine the offset weight of each virtual channel;
[0048] According to the offset weight of each virtual channel, the total allocable credit amount is redistributed to each virtual channel, so that the virtual channel with a higher offset weight receives more credit than the virtual channel with a lower offset weight.
[0049] Furthermore, following any one or a combination of the aforementioned technical solutions, after generating a credit limit allocation scheme for each virtual channel, the method further includes:
[0050] If the credit value required for the current data packet to be sent by the virtual channel is less than or equal to the credit limit in the allocation scheme, then the virtual channel is allowed to send the packet.
[0051] Otherwise, wait for the next credit limit allocation plan to be generated.
[0052] According to another aspect of the present invention, a PCIe communication device is provided, wherein the PCIe controller includes the following modules:
[0053] The traffic prediction module is configured to predict the probability of burst traffic in the virtual channel in the next cycle. The traffic prediction module uses one or more of the following features as input features: traffic intensity, congestion pressure, credit consumption rate, and resource turnover efficiency of the virtual channel. Each feature is configured with a corresponding optimal weight, which is obtained by learning from the sample data through machine learning.
[0054] The virtual credit budget table is configured to assign an initial virtual credit limit to each virtual channel and calculate the amount of credit limit change for that virtual channel based on the probability of the corresponding burst traffic, thereby determining the virtual credit budget for each virtual channel.
[0055] The scheduler is configured to generate a credit allocation scheme for each virtual channel by combining the virtual credit budget of each virtual channel and the remaining credit limit of the global credit pool. The remaining credit limit of the global credit pool is the credit difference between the total global credit value and the sum of the current virtual credit budgets of each virtual channel.
[0056] Furthermore, following any one or a combination of the aforementioned technical solutions, the PCIe controller of the PCIe communication device adjusts the available credit limits for multiple virtual channels sharing the PCIe link using the method described above.
[0057] According to another aspect of the present invention, the present invention provides a PCIe communication system comprising at least two PCIe communication devices as described above.
[0058] The beneficial effects of the technical solution provided by this invention are as follows:
[0059] a. Introducing machine learning to predict traffic: Based on the characteristics of virtual channels such as packet volume, waiting depth, credit utilization rate and recovery rate in future periods, the system can predict the traffic of virtual channels and identify sudden traffic trends in advance;
[0060] b. The traffic prediction mechanism is combined with the virtual credit limit scheduling mechanism to dynamically adjust the credit limit based on the real-time traffic prediction results, avoid resource waste and traffic congestion, improve the system's resource utilization and PCIe data transmission performance, and ensure timely response and system stability during traffic surges;
[0061] c. The intelligent scheduler allocates credits on demand based on traffic prediction probability, priority weights, and global resource status. It also uses a gating mechanism to ensure that the global credit pool always retains at least a preset amount of credits, preventing the system from being depleted due to the exhaustion of all credits in the global credit pool. Attached Figure Description
[0062] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0063] Figure 1 A flowchart of a machine learning-based PCIe virtual channel credit limit adjustment method provided as an exemplary embodiment of the present invention;
[0064] Figure 2 A flowchart of a machine learning-based traffic prediction model training method is provided as an exemplary embodiment of the present invention;
[0065] Figure 3 A flowchart of a first scheme for generating credit limit allocation for a virtual channel is provided as an exemplary embodiment of the present invention;
[0066] Figure 4 A flowchart of a second scheme for generating credit limit allocation for virtual channels is provided as an exemplary embodiment of the present invention;
[0067] Figure 5 A flowchart of a third method for generating credit limit allocation for virtual channels, provided as an exemplary embodiment of the present invention;
[0068] Figure 6 A conceptual architecture diagram of a PCIe controller for a PCIe communication device provided as an exemplary embodiment of the present invention;
[0069] Figure 7 A flowchart illustrating the implementation of a first global resource limiting mechanism as an exemplary embodiment of the present invention;
[0070] Figure 8 A flowchart illustrating the implementation of a second global resource limiting mechanism as an exemplary embodiment of the present invention;
[0071] Figure 9 A general flowchart of dynamic invocation of PCIe virtual channel credit limits is provided as an exemplary embodiment of the present invention. Detailed Implementation
[0072] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0073] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0074] In current PCIe communication protocols, the shared credit pool configuration must be preset during system initialization and cannot be changed throughout operation. This makes the system unable to efficiently respond to dynamic traffic demands and resource contention; in other words, the static maximum borrowable credit limit cannot respond to real-time traffic fluctuations. For example, during traffic bursts, the static credit pool configuration may not be able to provide sufficient credit for some virtual channels, leading to data transmission congestion and delays. Conversely, during low traffic periods, the credit pools of some virtual channels may remain idle for extended periods, resulting in uneven resource allocation and wasting credit that should have been allocated to other virtual channels.
[0075] This invention introduces a machine learning-based traffic prediction and virtual credit limit scheduling mechanism to address the lack of flexibility in static credit resource allocation and scheduling. This allows the credit limit (the upper limit of the borrowable credit value) of each virtual channel to be dynamically adjusted based on real-time traffic prediction results, avoiding resource waste and traffic congestion, improving system resource utilization and PCIe data transmission performance, and ensuring timely response and system stability during traffic surges.
[0076] In one embodiment of the present invention, a PCIe virtual channel credit limit adjustment method based on machine learning is provided, such as... Figure 1 As shown, the credit limit adjustment method includes the following steps:
[0077] S100: A pre-built traffic prediction model is used to predict the probability of burst traffic in the virtual channel in the next cycle. The model takes one or more of the following features as input features: traffic intensity, congestion pressure, credit consumption rate, and resource turnover efficiency of the virtual channel. Each feature is configured with a corresponding optimal weight, which is obtained by learning from the sample data through machine learning.
[0078] Specifically, the pre-built flow prediction model is as follows:
[0079] ,in, P i To predict the first i The probability value of burst traffic in a virtual channel. σ ( ) is the activation function, which maps the combined values to the probability interval [0,1]. flit_send i Indicates the first i The data packet traffic sent by each virtual channel in the most recent traffic period wait_depth i Indicates the first i The length of the virtual channel waiting queue used_ratio i Indicates the first i The virtual channel has already borrowed credit ratios.credit_reclaim_rate i Indicates the first i Credit turnover efficiency of each virtual channel in the most recent recycling period. w 1, w 2, w 3, w 4 represents the weighting coefficient. b Constant coefficients, i.e., coefficients w 1, w 2, w 3, w 4, b This is for objects that require subsequent machine learning to determine the optimal value, and each virtual channel has its corresponding coefficient. w 1, w 2, w 3, w 4, b Therefore, it is necessary to train the coefficients in the prediction model for each virtual channel separately. w 1, w 2, w 3, w 4, b Through machine learning, such as Figure 2 As shown:
[0080] S101: Collect traffic data before several bursts of traffic and traffic data before no bursts of traffic in the virtual channel of the PCIe link respectively;
[0081] S102: Based on each piece of traffic data collected, determine the data sent within the most recent traffic cycle of this virtual channel. flit Quantity (i.e.) flit_send i (Reflecting traffic intensity) and waiting to be sent flit Quantity (i.e.) wait_depth i (Reflecting congestion pressure), the ratio of borrowed credit to currently available credit (i.e., used_ratio i This reflects the rate of credit consumption, and is the ratio of the credit value recovered in the most recent recovery period to the global credit pool capacity (i.e., the ratio of the credit value recovered in the most recent recovery period to the global credit pool capacity). credit_reclaim_ rate i (Reflecting resource turnover efficiency), and labeling the traffic data based on whether it corresponds to a burst of traffic, in order to obtain a labeled learning sample;
[0082] in, flit_send i It can be obtained in the following ways: at the iA periodically reset counter is added to the existing packet sending path of each virtual channel. This counter is used to count the number of packets sent by the virtual channel in the most recent traffic period. flit Quantity, as flit_send i ;
[0083] wait_depth i This can be obtained through the following methods: directly reading the PCIe controller. i The depth value of the waiting queue corresponding to each virtual channel is output in the FPGA or SoC as the state of a standard register. wait_ depth i ;
[0084] used_ratio i It can be obtained in the following ways: PCIe controller utilizes the first... i Each virtual channel's existing state logic reads the currently borrowed credit value and obtains the virtual credit budget for that virtual channel. It then calculates the ratio of the borrowed credit value to the virtual credit budget as... used_ratio i ;
[0085] credit_reclaim_rate i It can be obtained in the following ways: at the i A periodically reset counter is added to the ACK path or return path on the receiving side of each virtual channel to count the number of credit values recovered in the most recent recovery cycle. This counter is then divided by the total global credit value, and the resulting ratio is used as the basis for calculation. credit_reclaim_rate i The acquisition methods for the above four features are shown in Table 1 below:
[0086] Table 1 Feature Acquisition Methods
[0087]
[0088] flit_send This reflects the activity level of the virtual channel in the current period, i.e., the data traffic intensity. It is obtained by adding a periodically reset counter to each VC path to count the number of flits sent in the current period. The result is updated every N periods as feature input. Implementation simplicity: no new paths are needed; simply check a signal in the existing VC data transmission path.
[0089] wait_depthThe number of FLITs currently waiting to be sent is used as a characterization to reflect whether there is packet sending pressure or backlog in the virtual channel. It is obtained by directly reading the depth value in the corresponding send queue (FIFO or circular queue) of the VC; in FPGAs or SoCs, this is usually a standard register or status output, and the reading cost is very small. Periodic update: It only needs to be read once per prediction cycle.
[0090] used_ratio The ratio of the currently borrowed credit value of a virtual channel to its virtual credit budget is used as a metric to reflect the credit utilization saturation of the virtual channel. This ratio is calculated using two variables: the currently borrowed credit value is obtained based on existing PCIe controller registers or status maintenance; the virtual credit cap is maintained based on the virtual credit budget table. used_ratio It is a feature that can be directly combined without adding hardware paths, only computational logic is required.
[0091] credit_reclaim_rate The timely recovery of a VC's credit value reflects resource recycling. This is achieved by configuring a periodically reset credit recovery counter for each VC in the ACK or return path on the receiving side; the recovery rate is calculated by counting the number of recovered credit values each period and dividing by the total credit values. This requires adding a lightweight hardware counter, but it is low-cost.
[0092] The above four feature acquisitions are centrally completed in a lightweight virtual channel state sampling module. Each virtual channel maintains a set of states (number of transmissions, queue depth, borrowed value, and reclaimed value); every N scheduling cycles, the data is read, normalized (or transformed by table lookup); the four normalized feature vectors are output and fed into the prediction logic.
[0093] S103: Collect multiple labeled learning samples;
[0094] S104: Input multiple training samples into the traffic prediction model for iterative training, and obtain coefficients through validation. w 1, w 2, w 3, w 4, b The optimal value.
[0095] The traffic prediction model training is now complete and can be used in step S200 for traffic prediction.
[0096] S200: Utilize the aforementioned traffic prediction model to predict the probability of burst traffic in each virtual channel. P i .
[0097] Therefore, during the prediction phase, it is necessary to obtain the current parameters of each virtual channel: the data sent within the most recent traffic period.flit Quantity (i.e.) flit_send i ), waiting to be sent flit Quantity (i.e.) wait_depth i The ratio of the credit value already borrowed to the current available credit limit (i.e.) used_ratio i The ratio of the credit value recovered in the most recent recovery period to the total capacity of the global credit pool (i.e.) credit_reclaim_rate i Substitute it into the traffic prediction model
[0098] In the middle, the coefficient here w 1, w 2, w 3, w 4, b The optimal value has been determined, and this optimal value can be stored in SARAM or EEPROM; furthermore, the probability value of burst traffic can be calculated based on the traffic prediction model. P i .
[0099] In PCIe resource management, the goal of traffic forecasting is to predict traffic fluctuations and sudden events for each virtual channel. Based on the forecast results, the system can dynamically adjust virtual credit limits, thereby achieving more efficient resource utilization. By acquiring traffic data in real time, the system can perform forecasts every few periods and adjust virtual credit limits in real time. Predicting whether each virtual channel is likely to experience sudden traffic spikes in the future, the forecast results serve as a crucial basis for virtual credit limit adjustment and scheduling in S300. This is the core of the perception capability of the entire credit limit adjustment method embodiment and determines the foundation for the PCIe system to achieve on-demand resource allocation.
[0100] This embodiment can use a logistic regression model for traffic prediction, which has the following advantages:
[0101] 1) Low computational cost: Only basic addition and multiplication operations are required, making it suitable for hardware implementation;
[0102] 2) High interpretability: The model outputs probability values, making it easy to set decision thresholds;
[0103] 3) Fast cycle response: Prediction calculations can be completed within one PCIe scheduling cycle, making it suitable for embedded real-time system deployment.
[0104] S300: The virtual credit budget table configures an initial virtual credit limit for each virtual channel and calculates the amount of credit change for that virtual channel based on the probability of the corresponding burst traffic, thereby determining the virtual credit budget for each virtual channel.
[0105] The Virtual Credit Budget (VCB) is used to dynamically adjust the maximum credit limit available for each virtual channel based on the burst probability output by the traffic prediction module.
[0106] By introducing this intermediate variable of the "soft layer", this module can dynamically adjust the packet sending window in a soft control manner without modifying the PCIe native maximum credit register (hard limit), thus realizing the system's perception and response to traffic changes.
[0107] Working principle: Each VC corresponds to a virtual credit limit value VCB[i]; the initial value is equal to the static maximum credit value specified by the protocol, and can be dynamically adjusted during operation, but the adjustment is limited by the available resources of the shared pool. The dynamic adjustment mechanism is based on the probability value provided by the traffic prediction module. P i Control the credit limit changes for each VC.
[0108] Specifically, the amount of credit limit change for the virtual channel is calculated as follows:
[0109] If the probability prediction of sudden traffic in the virtual channel is greater than the preset trigger threshold, the quota change amount will be calculated using the following formula: , where Δ Credit i For the first i Changes in the quota of each virtual channel P i To predict the first i The probability value of burst traffic in a virtual channel. P 0 is the threshold for triggering sudden traffic. C max The maximum credit score that can be increased in a single transaction is [number]. round [ ] represents the floor function;
[0110] Therefore, if the probability prediction result is greater than the trigger threshold, the formula for calculating the virtual credit budget is as follows: Budget-VC = Budget-ori +Δ Credit i ,in, Budget-VC Indicates virtual credit budget, Budget-ori This indicates the initial virtual credit limit.
[0111] In one embodiment of the present invention, if the probability prediction result of the burst traffic of the virtual channel does not reach a preset trigger threshold, the quota change amount of the virtual channel is determined to be 0; in another embodiment, if the probability prediction result of the burst traffic of the virtual channel does not reach a preset trigger threshold, the quota change amount is calculated by the following formula: At this time Δ Credit i A negative number indicates the current virtual credit budget. Budget-VC Initial virtual credit limit Budget-ori .
[0112] S400: The scheduler integrates the virtual credit budgets of all virtual channels and the remaining credit limit of the global credit pool to generate a credit limit allocation scheme for each virtual channel. The remaining credit limit of the global credit pool is the credit difference between the total global credit value and the sum of the current virtual credit budgets of all virtual channels.
[0113] The intelligent scheduler is the system's "central control brain," responsible for dynamically adjusting and scheduling the virtual credit budget for each virtual channel in the virtual credit budget table by integrating traffic prediction results, current credit usage status, priority information (such as QoS or TC category), and the remaining status of the global credit pool. This achieves rational resource allocation and overall system control. The scheduler runs once every fixed period (e.g., 8 PCIe scheduling cycles), collecting the input information shown in Table 2.
[0114] Table 2. Description of Information Collected by the Scheduler
[0115]
[0116] The core process of the scheduler is as follows: for each virtual channel, the scheduler determines whether the conditions for increasing the credit limit are met; when multiple virtual channels apply for an expansion of the credit limit, factors such as the probability of traffic bursts, priority level, and currently borrowed credit need to be considered to balance the credit limit scheduling among multiple virtual channels and generate a corresponding allocation plan.
[0117] The hardware implementation is integrated into the scheduler of the PCIe controller and runs periodically; it includes configurable parameters such as weights and thresholds to adapt to different deployment environments.
[0118] The overall process is as follows Figure 9 As shown: The data stream originates from the virtual channel's runtime status acquisition, and four features are extracted ( flit_send i , wait_depth i , used_ratio i , credit_reclaim_rate iThe traffic prediction module processes these characteristics and outputs the probability of traffic bursts. P i The virtual credit budget table dynamically modifies the virtual maximum credit value (i.e., virtual credit budget) of each virtual channel based on the prediction results. The intelligent scheduler integrates global information to perform final scheduling and credit allocation, and ultimately controls the logic of whether to allow packet sending.
[0119] There are several implementation examples of generating credit limit allocation schemes for each virtual channel as described here:
[0120] The allocation scheme is as follows Figure 3 As shown:
[0121] S411: Based on the remaining credit limit of the global credit pool, determine the total amount of credit that can be allocated; in a specific numerical embodiment, the global credit pool capacity (i.e., the total global credit value) is 200, there are four virtual channels, and their respective virtual credit budgets are 20, 30, 40, and 50, respectively. Then the credit value not included in the budget, i.e., the remaining credit limit of the global credit pool, is 60, which can be used as the total amount of credit that can be allocated. Alternatively, to prevent resource depletion, a safety credit margin can be reserved in the credit pool. For example, if the safety credit margin is 32, then the total amount of credit that can be allocated is 28.
[0122] S412: Based on the virtual credit budget of each virtual channel, the total allocable credit amount is redistributed to each virtual channel, such that the virtual channel with a higher virtual credit budget receives more credit value redistributed than the virtual channel with a lower virtual credit budget.
[0123] In step S412, this allocable total credit is redistributed to the four virtual channels, following the rule that the higher the virtual credit budget, the higher the redistribution amount. For example, credit values of 4, 6, 8, 10, 5, 6, 8, 9, or 4, 5, 9, 10 are redistributed to the four virtual channels respectively. Taking 4, 6, 8, 10 as an example, the final actual credit budgets for virtual channels I, II, III, and IV are 24, 36, 48, and 60 respectively.
[0124] Allocation Plan Two Figure 4 As shown:
[0125] S421: Based on the remaining credit limit of the global credit pool, determine the total amount of credit that can be allocated, in the same way as S411.
[0126] S422: Obtain the priority information corresponding to each virtual channel, and determine the priority weight of each virtual channel based on the probability of burst traffic.
[0127] S423: According to the priority weight of each virtual channel, the total amount of allocable credit is redistributed to each virtual channel, so that the virtual channel with higher priority weight receives more credit value redistributed than the virtual channel with lower priority weight.
[0128] Unlike the first allocation scheme embodiment, this embodiment considers the priority weight of virtual channels, which involves two influencing factors: priority level and the probability of burst traffic. This means that the higher the priority level and the higher the probability of burst traffic, the more priority is needed for secondary allocation. In a specific numerical embodiment, the virtual credit budgets of the four virtual channels I, II, III, and IV are 20, 30, 40, and 50, respectively, with priority information of 0.8, 0.7, 0.9, and 1 (a larger value indicates a higher priority), and burst traffic probabilities of 65%, 80%, 75%, and 55%, respectively. In this embodiment, the priority weight is determined by the product of the priority information and the probability of burst traffic, in the order of virtual channels III, II, IV, and I. According to the preset allocation rules, the total allocable credit of 28 is divided into 10, 8, 6, and 4 from most to least. Therefore, the final actual credit budgets of virtual channels I, II, III, and IV are 24, 38, 50, and 56, respectively.
[0129] Allocation Plan Three Figure 5 As shown:
[0130] S431: Based on the remaining credit limit of the global credit pool, determine the total amount of credit that can be allocated, as in S411.
[0131] S432: Obtain the current borrowed credit value of each virtual channel, calculate its ratio with the corresponding virtual credit budget, and record it as the borrowed credit ratio;
[0132] S433: Each virtual channel is sorted according to the borrowed credit ratio to determine the offset weight of each virtual channel;
[0133] S434: According to the offset weight of each virtual channel, the total amount of allocable credit is redistributed to each virtual channel, so that the virtual channel with a higher offset weight receives more credit than the virtual channel with a lower offset weight.
[0134] Unlike the first allocation scheme embodiment, this embodiment considers the offset weight of virtual channels, and the influencing factor is the borrowed credit ratio. The higher this ratio, the greater the possibility that the credit budget of the virtual channel will be exceeded. Therefore, the secondary allocation needs to tilt resources towards the virtual channel. In a specific numerical embodiment, the virtual credit budgets of the four virtual channels I, II, III, and IV are 20, 30, 40, and 50, respectively, and their borrowed credit values are 10, 12, 18, and 24, respectively. The corresponding borrowed credit ratios are 50%, 40%, 45%, and 48%, respectively. In this embodiment, the offset weight is determined by the borrowed credit ratio in descending order as virtual channels I, IV, III, and II. According to the preset allocation rules, the total allocable credit of 28 is divided into 10, 8, 6, and 4 from the highest to the lowest. Then, the final actual credit budgets of virtual channels I, II, III, and IV are 30, 34, 46, and 58, respectively.
[0135] After generating credit limit allocation schemes for each virtual channel, the following operations are also included:
[0136] If the credit value required for the current data packet to be sent in a virtual channel is less than or equal to the virtual credit budget in the allocation scheme (i.e., the actual credit budget mentioned above), then the virtual channel is allowed to send packets; otherwise, it waits for the next credit allocation scheme to be generated. The corresponding hardware implementation allocates a small register or on-chip SRAM block to each virtual channel to store the virtual credit budget in the current allocation scheme; the control logic includes adders / subtractors and threshold judgments, and can be integrated with the traffic prediction module within the scheduler. Compared to the conventional approach of allowing packet sending only if the maximum borrowed credit value in the register is met, this embodiment of the invention allows the system to expand the packet sending window in advance based on traffic prediction results, before the credit is exhausted, to adapt to upcoming high-traffic scenarios.
[0137] This invention not only changes the structure and scheduling process of the existing PCIe virtual channel credit management system, but also significantly changes its working principle: from "static configuration-driven credit management" to "prediction-driven dynamic credit scheduling mechanism". Its core innovation lies in introducing machine learning prediction logic to perceive the traffic behavior of virtual channels and dynamically adjust resource allocation accordingly, thereby achieving intelligent credit control.
[0138] The PCIe virtual channel credit limit adjustment method provided by this invention also includes implementing a global resource restriction mechanism, one restriction method being as follows: Figure 7 As shown:
[0139] In each calculation of the first i After adjusting the credit limit for each virtual channel, assume that the credit limit adjustment is increased, and calculate the total virtual credit budget for all virtual channels. ,in VCB [ i ] indicates the first i Virtual credit budget for each virtual channel N This indicates the total number of virtual channels sharing a PCIe link;
[0140] If the sum of the virtual credit budgets does not exceed the global total credit value, then the first limit change is updated accordingly. i The virtual credit budget for each virtual channel is adjusted; otherwise, the virtual credit budget for that virtual channel is stopped from being updated and / or the current virtual credit budget for other virtual channels is reduced.
[0141] This mechanism ensures that the virtual scheduling behavior of the virtual credit budget will not go out of bounds, that is, it ensures that the sum of the virtual credit budgets of all virtual channels will not exceed the total physical credit of the entire system (i.e., the global total credit value).
[0142] Another way to implement a global resource limiting mechanism is as follows: Figure 8 As shown:
[0143] In the i When a virtual channel sends a borrowing request, assuming that the requested borrowing credit value in the borrowing request is the credit value already borrowed by that virtual channel, the total global credit value is subtracted from the sum of the credit values already borrowed by all virtual channels to obtain the global credit pool reserved credit value.
[0144] If the ratio of the credit value retained in the global credit pool to the total global credit value is greater than or equal to a preset limit threshold, then the first... i The current borrowing request for a virtual channel is rejected; otherwise, the current borrowing request is rejected and / or credits already borrowed and not yet exhausted in other virtual channels are released.
[0145] This mechanism ensures that a preset amount of credit is always maintained in the global credit pool, preventing the system resources from being exhausted due to the complete borrowing of all credit in the global credit pool.
[0146] The PCIe virtual channel credit limit adjustment method provided by this invention also includes:
[0147] Statistically determine whether the probability of sudden traffic in each virtual channel exceeds the preset trigger threshold;
[0148] If the probability of a certain virtual channel meeting the predicted burst traffic is lower than the trigger threshold for m consecutive times, or if the ratio of the number of times a certain virtual channel meets the predicted burst traffic with a probability lower than the trigger threshold to the total number of predictions for that virtual channel in a preset recent statistical period exceeds a preset percentage, or if the ratio of the credit value retained in the global credit pool to the total global credit value is lower than a preset limit threshold, then the credit currently borrowed by that virtual channel will be reclaimed or the current virtual credit budget of that virtual channel will be reduced.
[0149] In one embodiment of the present invention, a PCIe communication device is provided, which includes a PCIe controller as the interface and manager of the PCIe link, such as... Figure 6 As shown, the PCIe controller includes the following modules:
[0150] The traffic prediction module is configured to predict the probability of burst traffic in the virtual channel in the next cycle. The traffic prediction module uses one or more of the following features as input features: traffic intensity, congestion pressure, credit consumption rate, and resource turnover efficiency of the virtual channel. Each feature is configured with a corresponding optimal weight, which is obtained by learning from the sample data through machine learning.
[0151] The virtual credit budget table is configured to assign an initial virtual credit limit to each virtual channel and calculate the amount of credit limit change for that virtual channel based on the probability of the corresponding burst traffic, thereby determining the virtual credit budget for each virtual channel.
[0152] The scheduler is configured to generate a credit allocation scheme for each virtual channel by combining the virtual credit budget of each virtual channel and the remaining credit limit of the global credit pool. The remaining credit limit of the global credit pool is the credit difference between the total global credit value and the sum of the current virtual credit budgets of each virtual channel.
[0153] An embodiment of the present invention also provides a PCIe communication system, including at least two PCIe communication devices as described above.
[0154] It should be noted that the PCIe controller uses the method described above to adjust the available credit limit for multiple virtual channels sharing the PCIe link. That is, the PCIe communication device provided in this embodiment and the PCIe virtual channel credit limit adjustment method provided in the above embodiment belong to the same inventive concept. Here, the entire contents of the PCIe virtual channel credit limit adjustment method embodiment are incorporated into this PCIe communication device embodiment and PCIe communication system embodiment by reference.
[0155] This application proposes a machine learning-based method for dynamically adjusting PCIe virtual channel credit limits, overcoming the limitation that traditional PCIe credit limits are immutable after initialization, and achieving intelligent scheduling of resources during operation. By introducing a lightweight logistic regression model, traffic prediction is performed on virtual channels based on features such as packet volume, waiting depth, credit utilization rate, and recovery rate in future periods. The system can identify sudden traffic trends in advance, thereby dynamically adjusting the maximum virtual credit limit for each virtual channel. Compared with traditional static configuration, this method has stronger adaptability and can significantly improve resource utilization and data throughput efficiency while ensuring protocol compatibility. The intelligent scheduler allocates resources on demand based on traffic prediction probability, priority weight, and global resource status, and uses a gating mechanism to prevent credit pool depletion caused by multiple channels competing for resources. The overall solution has low implementation cost and fast cycle response, and is applicable to various scenarios such as data centers, high-performance computing, and NVMe storage. It is a dynamic flow control optimization mechanism with engineering practicality and industry universality.
[0156] This application has a wide range of applications, covering multiple industries such as computer hardware, network optimization, virtualization resource management, and embedded systems. Particularly in high-speed data transmission, cloud computing, virtualization, embedded systems, and the Internet of Things, machine learning can be used for intelligent traffic prediction and dynamic credit scheduling, significantly improving system performance and resource utilization. In the future, with the development of PCIe and related protocols, the technology of this invention will become an important component of high-performance computing, data center management, and intelligent hardware scheduling.
[0157] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0158] The above description is only a specific embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for adjusting PCIe virtual lane credit based on machine learning, characterized in that, The method comprises the following steps: a flow prediction model is built to predict the probability of burst flow of a virtual channel in the next cycle, the model taking one or more of the following features of the virtual channel as input features: flow intensity, congestion pressure, credit consumption rate, and resource turnover efficiency, each feature being configured with a corresponding optimal weight obtained by machine learning on sample data; the probability of burst flow of each virtual channel is predicted using the flow prediction model; an initial virtual credit limit is configured for each virtual channel, and the credit change amount of each virtual channel based on the initial virtual credit limit is calculated according to the corresponding probability of burst flow, and then the virtual credit budget of each virtual channel is determined; the credit allocation scheme for each virtual channel is generated by comprehensively considering the virtual credit budget of each virtual channel and the remaining credit limit of the global credit pool, wherein the remaining credit limit of the global credit pool is the credit difference between the global total credit value and the sum of the virtual credit budgets of the current virtual channels.
2. The PCIe virtual lane credit adjustment method of claim 1, wherein, The flow prediction model is: wherein, P i is a prediction of the probability value of the bursty traffic of the i th virtual channel, σ () is an activation function used to map the combined value to the [0,1] probability interval, flit_send i represents the data packet traffic sent in the recent traffic period of the i th virtual channel, wait_ depth i represents the length of the waiting queue of the i th virtual channel, used_ratio i represents the borrowed credit ratio of the i th virtual channel, credit_reclaim_rate i represents the credit turnover efficiency in the recent recycling period of the i th virtual channel, w 1, w 2, w 3, w 4 are weight coefficients, b is a constant coefficient.
3. The PCIe virtual lane credit adjustment method of claim 2, wherein, coefficients in the prediction model corresponding to each virtual channel w 1, w 2, w 3, w 4, b by means of machine learning as follows: The flow data before the burst flow and the flow data before the non-burst flow of the virtual channel of the PCIe link are collected respectively; According to each piece of flow data collected, the number of the virtual channel's sent flow in the recent flow period, the number of the flow waiting to be sent, the ratio of the borrowed credit value to the current available credit limit, the ratio of the recycled credit value in the recent recycling period to the global credit pool capacity, and the tag according to whether the piece of flow data corresponds to burst flow are determined to obtain a labeled learning sample. flit flit According to each piece of flow data collected, the number of the virtual channel's sent flow in the recent flow period, the number of the flow waiting to be sent, the ratio of the borrowed credit value to the current available credit limit, the ratio of the recycled credit value in the recent recycling period to the global credit pool capacity, and the tag according to whether the piece of flow data corresponds to burst flow are determined to obtain a labeled learning sample. a plurality of learning samples are input into the flow prediction model for iterative training to obtain the coefficients w 1, w 2, w 3, w 4, b optimal values.
4. The method of claim 2, wherein, By the following means flit_send i , wait_depth i , used_ratio i and / or credit_reclaim_rate i : In the i A periodically reset counter is added to the existing packet sending path of each virtual channel. This counter is used to count the number of packets sent by the virtual channel in the most recent traffic period. flit Quantity, as flit_send i ; The PCIe controller directly reads the depth value of the waiting sending queue corresponding to the first i virtual channel, which is output in the state of a standard register in the FPGA or SoC as wait_depth i ; PCIe controller utilizes the first i Each virtual channel's existing state logic reads the currently borrowed credit value and obtains the virtual credit budget for that virtual channel. It then calculates the ratio of the borrowed credit value to the virtual credit budget as... used_ratio i ; In the ACK channel or return path of the receiving side of the first i virtual channel, a periodically cleared counter is added to count the number of credit values recycled in the recent recycling period, which is divided by the total global credit value, and the ratio obtained is used as the credit_ reclaim_rate i .
5. The method of claim 1, wherein, The credit change amount of the virtual channel is calculated in the following way: If the probability prediction result of the burst traffic of the virtual channel is greater than a preset trigger threshold, the quota change amount is calculated by the following formula: wherein, Δ Credit i is the quota change amount of the i i th virtual channel, P i is the predicted probability value of the burst traffic of the i i th virtual channel, P 0 is the trigger threshold of the burst traffic, C max is the maximum credit value that can be increased at a time, round [ ] is the rounding function; If the probability prediction result of the burst traffic of the virtual channel does not reach the preset trigger threshold, the quota change amount of the virtual channel is determined as 0, or the quota change amount is calculated through the following formula: , wherein Δ Credit i is the quota change amount of the i i th virtual channel, P i is the predicted probability value of the burst traffic of the i i th virtual channel, P 0 is the trigger threshold of the burst traffic, C max is the maximum credit value that can be increased at a time, round [] is the rounding function.
6. The method of claim 5, wherein, It also includes implementing a global resource limiting mechanism, including: In each calculation of the first i After changing the credit limit for each virtual channel, assume that the credit limit change is increased, and calculate the total virtual credit budget for all virtual channels. ,in VCB [ i ] indicates the first i Virtual credit budget for each virtual channel N This indicates the total number of virtual channels sharing a PCIe link; If the sum of the virtual credit budgets does not exceed the global total credit value, the virtual credit budget of the first i virtual channel is updated with the amount of the change; otherwise, updating the virtual credit budget of the first virtual channel and / or reducing the current virtual credit budgets of other virtual channels is stopped.
7. The method of claim 1, wherein, It also includes implementing a global resource limiting mechanism, including: In the first i When the borrowing request is sent in the virtual channel, assuming that the requested borrowing credit value in the borrowing request is the credit value borrowed by the virtual channel, the global total credit value is subtracted by the sum of the credit values borrowed by all virtual channels to obtain the reserved credit value of the global credit pool. If the ratio of the global credit pool reserved credit value to the global total credit value is greater than or equal to a preset limit ratio threshold, the current borrowing request of the first virtual channel is granted; otherwise, the current borrowing request is rejected and / or the credit value that has been borrowed but not consumed by other virtual channels is released. i If the ratio of the global credit pool reserved credit value to the global total credit value is greater than or equal to a preset limit ratio threshold, the current borrowing request of the first virtual channel is granted; otherwise, the current borrowing request is rejected and / or the credit value that has been borrowed but not consumed by other virtual channels is released.
8. The method of claim 1, wherein, It also includes: Statistics are made on whether the predicted probability of burst flow of each virtual channel exceeds the preset trigger threshold; If the predicted probability of burst flow of a certain virtual channel is lower than the trigger threshold for m times in a row, or the ratio of the number of times that the predicted probability of burst flow of a certain virtual channel is lower than the trigger threshold to the total number of predictions of the virtual channel in a preset recent statistical cycle exceeds a preset ratio, or the ratio of the reserved credit value of the global credit pool to the global total credit value is lower than a preset limit ratio threshold, the credit currently borrowed by the virtual channel is reclaimed or the virtual credit budget of the virtual channel is reduced.
9. The method of claim 1, wherein, The credit allocation scheme for each virtual channel is generated in the following way: Based on the remaining credit limit of the global credit pool, the total allocatable credit is determined; According to the high and low of the virtual credit budget of each virtual channel, the total allocatable credit is allocated to each virtual channel again, so that the virtual channel with a higher virtual credit budget is allocated more credit than the virtual channel with a lower virtual credit budget.
10. The method of claim 1, wherein, The credit allocation scheme for each virtual channel is generated in the following way: determining a total allocable credit based on the remaining credit of the global credit pool; obtaining priority information corresponding to each virtual lane, and determining a priority weight of each virtual lane in combination with the probability of burst traffic; allocating the total allocable credit to each virtual lane according to the priority weight of each virtual lane, so that a virtual lane with a higher priority weight is allocated more credit than a virtual lane with a lower priority weight.
11. The method of claim 1, wherein, The credit allocation scheme for each virtual lane is generated in the following manner: determining a total allocable credit based on the remaining credit of the global credit pool; obtaining the credit value currently borrowed by each virtual lane, calculating the ratio of the credit value to the corresponding virtual credit budget, and recording it as the borrowed credit ratio; each virtual lane is sorted according to the borrowed credit ratio to determine the offset weight of each virtual lane; allocating the total allocable credit to each virtual lane according to the offset weight of each virtual lane, so that a virtual lane with a higher offset weight is allocated more credit than a virtual lane with a lower offset weight.
12. The PCIe virtual lane credit adjustment method of any of claims 1-11, wherein, After generating the credit allocation scheme for each virtual lane, it further includes: if the credit value required by the current data packet to be sent by the virtual lane is less than or equal to the credit in the allocation scheme, the virtual lane is allowed to send the packet; otherwise, wait for the next generation of credit allocation scheme.
13. A PCIe communication device, comprising: The PCIe controller includes the following modules: a traffic prediction module configured to predict the probability of burst traffic of a virtual lane in the next cycle, the traffic prediction module taking one or more features of the traffic intensity, congestion pressure, credit consumption speed, and resource turnover efficiency of the virtual lane as input features, each feature being configured with a corresponding optimal weight obtained by machine learning on sample data; a virtual credit budget table configured to configure each virtual lane with an initial virtual credit, and calculate the credit change amount of the virtual lane based on the corresponding probability of burst traffic, and further determine the virtual credit budget of each virtual lane; a scheduler configured to generate a credit allocation scheme for each virtual lane by synthesizing the virtual credit budget of each virtual lane and the remaining credit of the global credit pool, wherein the remaining credit of the global credit pool is the credit difference between the total global credit and the sum of the virtual credit budgets of the current virtual lanes.
14. The PCIe communication device of claim 13, wherein, The PCIe controller adjusts the applicable credit of multiple virtual lanes sharing a PCIe link using the method of any one of claims 1 to 12.
15. A PCIe communication system, characterized in that, The PCIe communication device of claim 13 or 14 includes at least two PCIe communication devices. The PCIe communication device of claim 13 or 14 includes at least two PCIe communication devices.
Citation Information
Patent Citations
Link flow control limit adjusting method and device and on-chip processing system
CN114979008A
Shared flow control credits
US20160182391A1