Link training test method, system, equipment and medium
Through the automated testing methods of link training state machines, including loopback testing and equalization testing, the problem of frequent occurrence of PCIe link training exceptions is solved, the testing efficiency and equipment stability are improved, and the link reliability in complex environments is ensured.
Patent Information
- Application Number
- CN202510564440.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-05
AI Technical Summary
During the PCIe link initialization stage, training abnormalities occur frequently, resulting in device unrecognition or system crashes, seriously affecting the reliability and scalability of PCIe technology. The existing testing methods are inefficient and rely on manual inspections, and cannot realize real-time diagnosis of the root causes of training abnormalities.
Based on the link training state machine, the balanced parameter combination, simulate channel loss and dynamic adjustment are automatically verified. Through loopback testing, dynamic balanced parameter testing, parameter boundary testing and virtual disturbance testing, test reports are generated to realize automated testing of link training.
It improves the testing efficiency of link training, enhances compatibility with multiple scenarios, maximizes the verification of unstable factors, ensures the stability of the link under extreme conditions, reduces manual intervention, and improves device stability and performance.
Smart Images

Figure CN120434149A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a link training test method, system, device, and medium. Background Art
[0002] As PCI Express (PCIe) technology evolves toward higher transmission rates (such as Gen5 / Gen6) and more complex application scenarios (such as AI computing, high-speed storage, and multi-device interconnection), the training process during the PCIe link initialization phase has become crucial for ensuring device stability and performance. By negotiating link rate, channel width, and signal equalization parameters, the device and host are able to adapt to physical and protocol layer communication.
[0003] However, in high-speed, high-density, and multi-device collaborative systems, training anomalies frequently occur, manifesting as link slowdowns, device recognition failures, or system crashes, severely limiting the reliability and scalability of PCIe technology. Therefore, a link training test method is urgently needed to automatically verify anomalies. Summary of the Invention
[0004] The present application provides a link training test method, system, device and medium to at least solve the problem of low test efficiency in related technologies.
[0005] This application provides a link training test method, including:
[0006] Initialize the expansion device and the expansion link connected to the expansion device, and detect the link status of the expansion link;
[0007] In response to detecting that the link state is in a normal working state, triggering a loopback test and outputting a loopback test result;
[0008] and, triggering an equalization test and outputting the equalization test result, wherein the equalization test includes a dynamic equalization parameter test, a parameter boundary test, and a virtual disturbance test;
[0009] Generate and output a test report based on the equalization test results and loopback test results.
[0010] This application also provides a link training test system, such as Figure 5 As shown, including:
[0011] Preparation module 510, used to initialize the extension device and the extension link connected to the extension device, and detect the link status of the extension link;
[0012] A testing module 520 is configured to trigger a loopback test and output a loopback test result in response to detecting that the link status is a normal working state;
[0013] The test module 520 is further configured to trigger an equalization test and output the equalization test results, wherein the equalization test includes a dynamic equalization parameter test, a parameter boundary test, and a virtual disturbance test;
[0014] The processing module 530 is configured to generate and output a test report based on the equalization test results and the loopback test results.
[0015] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned link training test methods when executing the computer program.
[0016] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned link training test methods are implemented.
[0017] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned link training test methods when the computer program is executed by a processor.
[0018] This application designs an automated test for link training, which mainly includes loopback testing and equalization testing. In the equalization test, a dynamic equalization parameter test is set to verify various equalization parameter groups, and the equalization parameter settings in extreme scenarios are verified through parameter boundary testing. Various loss scenarios are simulated through virtual disturbance testing. On the basis of improving test efficiency, the compatibility of verification of multiple scenarios is further improved, the existing unstable factors are verified to the maximum extent, and the test of link training is realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0020] Figure 1 A schematic diagram of a link training test method provided in an embodiment of the present application;
[0021] Figure 2 A state diagram of the existing link training state machine provided for this application;
[0022] Figure 3 The basic principle diagram of the state negotiation provided for this application;
[0023] Figure 4 A test architecture diagram for link training provided in this application;
[0024] Figure 5 A schematic diagram of a link training test system provided in this application. DETAILED DESCRIPTION
[0025] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative work are within the scope of protection of this application.
[0026] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0027] As disclosed in the background technology, in order to improve the stability and performance of PCIe devices, it is necessary to perform anomaly detection during the PCIe link and device initialization phase. Among the existing technologies disclosed in this field, some solutions send error injection commands to the PCIe bus or components through the baseboard management controller to check whether the feedback value of the entire system or component meets expectations, and verify the reliability of the PCIe link or component through a series of RAS (Reliability, Availability, Serviceability) testing methods. There are also some solutions that realize fault location of PCIe devices through in-band detection or out-of-band detection. Among them, the in-band detection method usually requires manual input of commands to check the health status of each PCIe device. There are many command states, which need to be checked item by item, increasing the difficulty and time of the debugging personnel's work; while connecting to the baseboard management controller management network port out-of-band requires additional equipment for debugging, which will bring certain network risks. The existing technology relies too much on manual troubleshooting and cannot achieve real-time diagnosis of the root cause of training anomalies.
[0028] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0029] The embodiment of the present application provides a link testing method, which is based on deploying LTSSM (Link Training and Status State Machine) in the link, automatically verifies various equalization parameter combinations including extreme scenarios, simulates various channel losses, and dynamically adjusts test parameters, verifies the signal, rate, and error of the extended link and the corresponding extended device from the system level, verifies the existing unstable factors to the maximum extent, and realizes the test of link training. Specifically, Figure 1 As shown, the test contents include the following:
[0030] S1. Initialize the expansion device and the expansion link connected to the expansion device, and detect the link status of the expansion link.
[0031] This application briefly describes the link training state machine, which is located in the physical layer of the PCIe bus. Figure 2 As shown, it covers 11 states, including detection, polling, configuration, reset, L0, L0s, L1, L2, hot reset, loopback, and disable. The initialization steps of the above-mentioned extension devices and the extension links connected to the extension devices are mainly to perform normal initialization of the extension link under the link training state machine. When an extension link is established and initialized between two extension devices, the state machine enters the polling state from the detection state, waits for the response between the extension devices to confirm the connection, and then changes to the configuration state to configure the link; finally, the state machine changes to the L0 state, that is, the normal working state, at which time the link is in a normal active state. If there is an abnormality in the initialization, the state machine may enter the L2 state; if the device needs to maintain a low power consumption state, the state machine enters the L0s state or the L1 state. Through initialization, the signal transmission of the link between each extension device is verified. In this application, the L0s state, L1 state and L2 state are collectively referred to as abnormal working states.
[0032] The link status of the extended link is detected by executing a link status check command to obtain the link status of the extended link, where the link status includes a normal working state and an abnormal working state. In a specific implementation scenario, the link status check command can be set to "lspci-s <bdf>-vvv|grep LnkSta", where BDF (Bus, Device, Function, bus device identifier) is used to distinguish the extended devices in the link. Of course, the above link status check instructions are only examples. In specific implementation scenarios, those skilled in the art can make adaptive modifications based on the type and version of the link training state machine actually selected. This application does not limit this. In addition, after detecting the link status of the extended link, the method further includes: in response to detecting that the link status is an abnormal working state, that is, the link status is L0s state, L1 state and L2 state; modifying the configuration space register to force the extended link to be retrained. For specific modification instructions, please refer to "setpci-s <bdf>CAP_EXP+0x10.w=0x20", where CAP_EXP+0x10.w is the configuration space register address.
[0033] Furthermore, the above modification of the configuration space register to force the extension link to be retrained also includes: recording the current timestamp triggered by the retraining; monitoring the link status of the extension link. In response to detecting that the link status has returned to a normal working state, obtain the timestamp in the kernel log (PCIe debugging needs to be started), and record the obtained timestamp as the recovery timestamp. The negotiation time is verified and determined based on the current timestamp and the recovery timestamp and output to the test report. The basic working principle of the state negotiation of the state trainer is as follows: Figure 3 As shown, after the initial negotiation state ends, the silent detection state is entered. Based on the negotiation time obtained in the above steps, after the negotiation time expires, the state training machine then enters the active detection state to start detecting whether the extended device of the receiving end is found (that is, the extended device of the receiving end is detected). If the receiving end device is found and the voltage is stable, the receiving end is entered into the discovered state, at which time operations such as data transmission can be performed; if the extended device of the receiving end is not found, the silent detection state is re-entered to prepare to start detection again. The specific timeout judgment standard is set by a person skilled in the art according to actual conditions, and this application does not limit this.
[0034] Furthermore, recording and outputting the negotiation time in the test report disclosed in this application can facilitate staff to verify the link signal, whether the expansion device is compatible, and whether the power supply is stable based on the negotiation time. Specifically, under ideal conditions, the link can complete retraining and return to the L0 state within 100ms to 500ms; if the negotiation time is significantly extended, such as greater than 1s, it can be determined that the link signal is abnormal; if the negotiation time fluctuates greatly, such as the negotiation time obtained multiple times varies from 200ms to 2s, it can be determined that the expansion device firmware is incompatible; if the negotiation time is unstable, such as the negotiation time obtained multiple times is greater than 50ms, it can be determined that there is a power supply problem. Specifically, if the negotiation time gradually increases, there may be power supply noise. If the negotiation time jumps randomly, there may be a problem with insufficient power supply transient response.
[0035] S2. In response to detecting that the link status is a normal working status, trigger a loopback test and output a loopback test result.
[0036] Specifically, the bus identifier is used as an index to obtain the target receiving device and target transmitting device corresponding to the target identifier, where the bus identifier is used to identify the extended device; the link control register (such as the Link Control Register) that matches the target receiving device and the target transmitting device is searched, with one link control register corresponding to each device. The loopback enable bit of the link controller is enabled to run the loopback test tool, which requires hardware support such as ethtool or lspci tools to route the signal from the target transmitting device to the target receiving device; the link status of the extended link between the target receiving device and the target transmitting device is detected, that is, whether the link status is loopback (loopback state), wherein the detection command can be designed as: watch -n 0.1"lspci -vvv -s <bdf>|grep -E'LnkSta|LTSSM'". This can be modified by those skilled in the art based on actual circumstances. The link status is returned to the loopback test result. Based on the link status, the operator can determine whether the physical layer communication between the devices at both ends of the link is normal. If the loopback test is loopback, communication between the devices at both ends of the link is normal; otherwise, communication is abnormal. Clearing the loopback enable bit of the link controller exits the loopback test and returns to the detection state. In some specific implementations, the above steps can also be implemented using physical layer debug registers. It should be noted that the register addresses vary by manufacturer and are pre-set by those skilled in the art in specific scenarios. For example, the address of the LinkControl Register is typically CAP_EXP+0x10. Similarly, the loopback enable bit of the register varies from device to device; for example, Intel devices are typically set to the sixth bit. By verifying the upstream and downstream ports of the link at the physical layer, the communication status of the expansion devices at both ends of the link is verified and ensured to be normal, eliminating physical layer anomalies and improving the accuracy of verification during other link training processes.
[0037] S3. Triggering an equalization test and outputting the equalization test results, wherein the equalization test includes a dynamic equalization parameter test, a parameter boundary test, and a virtual disturbance test.
[0038] Parallel verification is performed on expansion devices of different generations, negotiating link stability with devices in the link from signal reception and rate matching. The above-mentioned equalization test results include target equalization parameters. The above-mentioned dynamic equalization parameter test specifically includes: obtaining the target receiving device and target transmitting device corresponding to the target identifier using the bus identifier as an index; and performing equalization parameter setting operations on the target receiving device and target transmitting device to determine the target equalization parameters between the target receiving device and the target transmitting device.
[0039] The equalization parameter setting operation includes: traversing a preset equalization parameter set to obtain equalization preset values, wherein the equalization parameter set includes multiple equalization preset values; wherein the specific equalization preset values set in the equalization parameter set are pre-set by a person skilled in the art, such as [0, 1, 2, 3, 4, 5]. According to the equalization preset values, bits in the configuration space registers of the target receiving device and the target transmitting device are set, wherein the selection of bits is adjusted by a person skilled in the art according to the manual of the expansion device to change the equalization parameters of the expansion device. In addition, an expected rate needs to be set, wherein the expected rate is set according to the generation corresponding to the expansion device, such as GEN3 or GEN4. The specific setting is performed by a person skilled in the art according to the actual scenario, and this application does not limit this. After the setting is completed, the extended link between the target receiving device and the target transmitting device is initialized again; the link status of the extended link is verified to be in a normal working state and whether the current rate matches the expected rate; if so, the equalization preset value is determined to be the target equalization parameter and the target equalization parameter is returned to the equalization test result; if not, the equalization parameter setting operation is repeated until the target equalization parameter is determined or the equalization preset values in the equalization parameter set are traversed. That is, when the current rate is less than or equal to the expected rate, it is determined that the current rate matches the expected rate; otherwise, it is determined that the current rate does not match the expected rate. If the link status is normal and the current rate matches the expected rate, the link is determined to be stable; if the link status is not normal and / or the current rate does not match the expected rate, the link is determined to be unstable. Each extended link is tested, and through automatic testing of each equalization parameter included in the equalization parameter set, the corresponding equalization parameter value when the link is stable is obtained. This further verifies whether the extended device supports dynamic equalization parameter adjustment to be compatible with different rates. In addition, through automated parameter setting, labor costs are reduced.
[0040] In a specific implementation scenario, the above dynamic balancing parameter test automation script can refer to the following code. The following code is not binding and is for illustration only:
[0041]
[0042] The parameter boundary test specifically includes: traversing parameter combinations to obtain a combination value to be verified, wherein the parameter combination is a random combination of the maximum signal enhancement value, the minimum signal enhancement value, the maximum equalization preset value, and the minimum equalization preset value. It is understood that the parameter combinations are selected from the maximum signal enhancement value and the minimum signal enhancement value, and from the maximum equalization preset value and the minimum equalization preset value, and are combined in pairs, for a total of four. The equalization preset value is the same as the equalization parameter set in the dynamic equalization parameter test. The signal enhancement parameters and equalization parameters of the target transmitting device are set according to the combination value to be verified; the extended link is retrained and training results are obtained, including success and failure results; in response to detecting a successful training result, the boundary verification is successful to the boundary test result; in response to detecting a failure result, the combination value to be verified is determined to be an incorrect combination value and returned to the boundary test result. In other words, if any combination causes link failure, hardware or firmware issues need to be investigated. By verifying the stability of the link under extreme pre-emphasis and equalization parameters, we ensure that the link can still operate normally under extreme signal conditioning conditions. We further verify the performance of the link under extreme conditions and output the extreme parameter values corresponding to the link anomalies. This provides a reference range for the staff to set the signal and equalization parameters during subsequent link operation.
[0043] In the specific implementation scenario, the above parameter boundary test automation script refers to the following code, which is not binding and is only for illustration:
[0044]
[0045] The above-mentioned virtual perturbation test specifically includes: setting a damage set, the damage set includes damage types and corresponding parameter values, the damage types include attenuation, jitter and noise, this application does not limit the specific damage types, the above three damage types are typical damages, and are used as examples; reading the damage set to obtain the damage value to be verified; setting the extended link according to the damage value to be verified; retraining the extended link and obtaining the training result; returning the perturbation verification success to the perturbation test result when the training result is detected to be a successful result; in response to detecting that the training result is a failed result, determining the combination value to be verified as an incorrect combination value and returning it to the perturbation test result. By simulating the performance of the link under actual channel damage, the fault tolerance capability of the link training is verified. If any damage causes the link to fail, the signal conditioning or equalization algorithm needs to be checked; and the compensation capability for signal damage in link training is tested.
[0046] In a specific implementation scenario, the above virtual disturbance test automation script can refer to the following code, which is non-binding and is for illustration only:
[0047]
[0048]
[0049] Through the above tests, which cover full-load PCI-E links and scenarios of expansion devices of various generations, the correlation between the mutual influences between links can be analyzed more intuitively and clearly at the system level.
[0050] It should be noted that, in the embodiment of the present application, there is no restriction on the order of execution between step S2 and step S3. Step S2 may be executed first and then step S3, or step S3 may be executed first and then step S2.
[0051] S4. Generate a test report based on the equalization test results and loopback test results and output it.
[0052] The test report may be output in JSON format or other formats, which are not limited in this application. The test report includes at least the loopback test results and the balance test results, and may also include information such as link status.
[0053] In a specific implementation scenario, the test report output script can refer to the following code:
[0054]
[0055] Among them, in order to implement the above steps S1 to S4, the master script can be set with reference to the following code. The following code is only briefly explained. In this code, the balance test calls the dynamic balance parameter test. If the aforementioned public parameter boundary test and virtual disturbance test are involved, the corresponding script is directly called. This application will not go into details here:
[0056]
[0057] like Figure 4 As shown, during the link training process, the present application sets initialization steps, retraining steps, loopback tests, equalization tests, and negotiation time processing steps, and performs report output to realize automatic troubleshooting of causes of training failure, such as signal attenuation, etc. At the same time, through dynamic equalization parameter adjustment, the equalization parameter setting of expansion devices of various generations is realized, without relying on traditional debugging methods based on log analysis, thereby speeding up test efficiency.
[0058] In addition, the present application also proposes setting up a recovery capability test in link training, specifically including: in response to detecting a link interruption, forcing the link to enter a dormant state and the dormant time is a first preset time period, and training the link after the dormancy ends. The above-mentioned first preset time period can be set to 100ms; in response to detecting that the training is unsuccessful or the recovery time exceeds the second preset time period, preferably the above-mentioned second preset time period can be set to 200ms, determining that the test has failed, and retraining the link. If the link training is successful, the test is successful; in response to detecting that the number of test failures reaches a preset number, such as 3 times, forcing the link to disconnect, pausing training and releasing the link; in response to detecting that the number of successful tests reaches a preset number, determining that the link recovery capability test has passed. By determining that the link that can be successfully recovered in multiple tests is a successfully trained link, it is ensured that the link put into use has sufficient robustness in actual applications and can quickly resume normal operation after a link failure.
[0059] In a specific implementation scenario, the above recovery capability test script can refer to the following code:
[0060]
[0061] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0062] An embodiment of the present application further provides a link training test system, comprising:
[0063] A preparation module is used to initialize the expansion device and the expansion link connected to the expansion device, and detect the link status of the expansion link;
[0064] A test module, configured to trigger a loopback test and output a loopback test result in response to detecting that the link state is in a normal working state;
[0065] The test module is also used to trigger the equalization test and output the equalization test results, where the equalization test includes dynamic equalization parameter test, parameter boundary test and virtual disturbance test;
[0066] The processing module is used to generate and output a test report based on the equalization test results and loopback test results.
[0067] For the description of the features in the embodiment corresponding to the link training test system, please refer to the relevant description of the embodiment corresponding to the link training test method, which will not be repeated here.
[0068] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned link training test method embodiments.
[0069] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned link training test method embodiments when running.
[0070] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0071] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above-mentioned link training test method embodiments are implemented.
[0072] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned link training test method embodiments are implemented.
[0073] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0074] The above is a detailed introduction to a link training test method provided by this application. This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the scope of protection of the claims of this application.< / bdf> < / bdf> < / bdf>
Claims
1. A link training test method, characterized in that: The method comprises: Initializing the expansion device and the expansion link connected to the expansion device, and detecting the link status of the expansion link; In response to detecting that the link state is a normal working state, triggering a loopback test and outputting a loopback test result; and, triggering an equalization test and outputting the equalization test result, wherein the equalization test includes a dynamic equalization parameter test, a parameter boundary test, and a virtual disturbance test; A test report is generated and outputted based on the equalization test results and loopback test results.
2. The link training test method according to claim 1, wherein: The equalization test result includes target equalization parameters, and the dynamic equalization parameter test includes: Using the bus identifier as an index, obtain the target receiving device and the target sending device corresponding to the target identifier; Performing an equalization parameter setting operation on the target receiving device and the target sending device to determine a target equalization parameter between the target receiving device and the target sending device, the equalization parameter setting operation comprising: Traversing a preset equalization parameter set to obtain an equalization preset value, wherein the equalization parameter set includes a plurality of equalization preset values; setting the configuration space registers of the target receiving device and the target sending device and setting an expected rate according to the equalization preset value; Initializing an extended link between the target receiving device and the target sending device; Verifying whether the link status of the extended link is in a normal working state and whether the current rate matches the expected rate; If so, the equalization preset value is determined to be the target equalization parameter and the target equalization parameter is returned to the equalization test result; if not, the equalization parameter setting operation is repeated until the target equalization parameter is determined, or the equalization preset values in the equalization parameter set are traversed.
3. The link training test method according to claim 2, wherein the equalization test result includes a boundary test result, The parameter boundary test includes: Traversing the parameter combinations to obtain the combination value to be verified, where the parameter combination is a random combination of the signal enhancement maximum value, the signal enhancement minimum value, the equalization preset value maximum value, and the equalization preset value minimum value; Setting the signal enhancement parameters and equalization parameters of the target sending device according to the combination value to be verified; Retraining the extended link and obtaining a training result, wherein the training result includes a success result and a failure result; In response to detecting that the training result is the success result, returning the boundary verification success to the boundary test result; in response to detecting that the training result is the failure result, determining that the combination value to be verified is an incorrect combination value and returning it to the boundary test result.
4. The method according to claim 3, characterized in that The equalization test result includes a disturbance test result, and the virtual disturbance test includes: Setting an impairment set, wherein the impairment set includes impairment types and corresponding parameter values, wherein the impairment types include attenuation, jitter, and noise; Reading the damage set to obtain a damage value to be verified; Setting the extended link according to the damage value to be verified; retraining the extended link and obtaining the training result; In response to detecting that the training result is the success result, returning a perturbation verification success to a perturbation test result; In response to detecting that the training result is the failure result, determining that the combination value to be verified is an erroneous combination value and returning to the disturbance test result.
5. The method according to claim 4, characterized in that The loopback test includes: Using the bus identifier as an index, obtain the target receiving device and the target sending device corresponding to the target identifier; Searching for a link control register that matches the target receiving device and the target sending device; enabling a loopback enable bit of the link controller to run a loopback test tool; Detecting a link status of an extended link between the target receiving device and the target sending device and returning the link status to a loopback test result; Clear the loopback enable bit of the link controller to exit the loopback test.
6. The link training test method according to claim 5, characterized in that: The detecting the link status of the extended link includes: Executing the link status check instruction to obtain the link status of the extended link, where the link status includes a normal working state and an abnormal working state; And, after detecting the link status of the extended link, the method includes: In response to detecting that the link state is an abnormal working state; The configuration space register is modified to force retraining of the extended link.
7. The link training test method according to claim 6, characterized in that: The modifying the configuration space register to force retraining of the extended link includes: Record the current timestamp when retraining is triggered; monitoring the link status of the extended link; In response to detecting that the link state has recovered to a normal working state, obtaining a timestamp in a kernel log and recording the timestamp as a recovery timestamp; The negotiation time is verified and determined according to the current timestamp and the restored timestamp and output to a test report.
8. A link training test system, characterized in that: The system comprises: A preparation module, configured to initialize an extension device and an extension link connected to the extension device, and detect a link status of the extension link; A testing module, configured to trigger a loopback test and output a loopback test result in response to detecting that the link state is a normal working state; The test module is further configured to trigger an equalization test and output equalization test results, wherein the equalization test includes a dynamic equalization parameter test, a parameter boundary test, and a virtual disturbance test; The processing module is used to generate and output a test report based on the equalization test result and the loopback test result.
9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the link training test method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the link training test method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
PCIe link equalization coefficient automatic adjustment method and device
CN112737713A
PCIe device link training management method, management device and server
CN115878540A
Method and device for determining abnormal information of PCIE link
CN117472625A
Link state checking method and device, electronic equipment and nonvolatile storage medium
CN118819987A
Error rate measuring device and parameter acquisition method
JP2022040950A