PCIe (Peripheral Component Interconnect Express) equipment error injection method, device and equipment and readable storage medium
By obtaining the BDF number and error register address of the PCIe device, and using the EINJ module to make the address segment errors, the problem of difficulty in testing the Endpoint device in the Switch structure server is solved, and efficient and convenient error injection test is achieved, which improves the coverage and reliability of RAS tests.
Patent Information
- Application Number
- CN202411337650.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-06-03
AI Technical Summary
In servers with Switch structure, traditional tools have difficulty directly accessing or controlling Endpoint devices connected to the Switch, making it difficult to implement RAS characteristics testing of these devices.
By obtaining the BDF number and its error register address of the PCIe device to be noted, using the preloaded EINJ error module and configured as the address segment error mode, the specified device is directly injected in the operating system environment.
It realizes low-cost, efficient and convenient error simulation tests of Endpoint devices hanging under the Switch in the server, without the need for special hardware, simplifies the test process and significantly improves the coverage and reliability of server RAS tests.
Smart Images

Figure CN120086083A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of communication technologies, and particularly to a method, device, equipment, and readable storage medium for injecting errors into PCIe devices. Background Art
[0002] With the development of information technology, servers, as one of the core components of data centers, their stability and reliability have become crucial. To ensure the reliable operation of servers, the RAS (Reliability, Availability, Serviceability) characteristics have become important indicators for measuring server performance. Among them, the RAS characteristics include the system's ability to detect, isolate, and recover from errors. Especially in the case of server hardware failures, it can effectively guarantee data security and service continuity. At the server hardware level, the RAS characteristics are mainly reflected in the handling of CE (Correctable Error) correctable errors and UCE (Uncorrectable Error) uncorrectable errors.
[0003] During the development of servers, to verify the effectiveness of the RAS characteristics, a series of error injection tests are usually performed on the servers. These tests involve simulating fault conditions for key components such as CPUs, memories, and PCIe buses to check whether the system can correctly detect errors and make corresponding responses. In the error injection test on the PCIe bus, a common practice is to use special tools provided by manufacturers to simulate CE or UCE errors. However, in some servers with a Switch structure, due to the limitations of traditional tools in terms of topology, it is often impossible to directly access or control the Endpoint devices connected behind the Switch, which makes it difficult to implement the RAS characteristics test for these devices.
[0004] To address this problem, existing solutions in the market mostly rely on physically inserting a dedicated PCIe error injection card to simulate errors. Although this method can solve the test problem to a certain extent, it has obvious defects: First, the price of the PCIe error injection card is relatively high and requires additional procurement, increasing the test cost; Second, due to the large size of the error injection card, it may be difficult to install in some compact server designs; In addition, using a PCIe error injection card also requires a supporting software environment, resulting in an extended test preparation cycle. Summary of the Invention
[0005] In view of this, this specification provides a method, device, and electronic equipment, and readable storage medium for injecting errors into PCIe devices to improve the problem that it is difficult to inject errors into the Endpoint devices behind the Switch.
[0006] Specific technical solutions are as follows:
[0007] This specification provides a PCIe device error injection method, which is applied to a server. The method includes: obtaining the BDF number of the PCIe device to be error-injected, and obtaining the corresponding error register address information according to the BDF number; calling the pre-loaded EINJ error injection module, and configuring the error injection method of the EINJ error injection module as address segment error injection; according to the obtained error register address information, performing error injection on the PCIe device to be error-injected through the EINJ error injection module.
[0008] As a technical solution, the obtaining the BDF number of the PCIe device to be error-injected, and obtaining the corresponding error register address information according to the BDF number includes: through the lspci command, obtaining the address information of the PCIe device to be error-injected according to the BDF number, and obtaining the error register address information of the PCIe device according to the address information of the PCIe device and the SPEC.
[0009] As a technical solution, the calling the pre-loaded EINJ error injection module and configuring the error injection method of the EINJ error injection module as address segment error injection includes: pre-loading the pre-confirmed installed EINJ module through the Modprobe command, calling the EINJ module, and re-configuring the error injection method as address segment error injection.
[0010] As a technical solution, the performing error injection on the PCIe device to be error-injected through the EINJ error injection module according to the obtained error register address information includes: according to the obtained error register address information and the pre-configured error type, performing error injection on the PCIe device to be error-injected through the EINJ error injection module, and verifying whether the error injection is successful.
[0011] As a technical solution, the PCIe device is a PCIe Endpoint device mounted under a PCIe Switch device in the server.
[0012] This specification also provides a PCIe device error injection device, which is applied to a server. The device includes: a first module, configured to obtain the BDF number of the PCIe device to be error-injected, and obtain the corresponding error register address information according to the BDF number; a second module, configured to call the pre-loaded EINJ error injection module, and configure the error injection method of the EINJ error injection module as address segment error injection; a third module, configured to perform error injection on the PCIe device to be error-injected through the EINJ error injection module according to the obtained error register address information.
[0013] As a technical solution, obtaining the BDF number of the PCIe device to be injected with errors and obtaining the corresponding error register address information according to the BDF number includes: through the lspci command, obtaining the address information of the PCIe device to be injected with errors according to the BDF number, and obtaining the error register address information of the PCIe device according to the address information of the PCIe device and the SPEC.
[0014] As a technical solution, calling the pre-loaded EINJ error injection module and configuring the error injection method of the EINJ error injection module as address segment error injection includes: pre-loading the EINJ module that has been pre-confirmed to be installed through the Modprobe command, calling the EINJ module, and reconfiguring the error injection method as address segment error injection.
[0015] As a technical solution, injecting errors into the PCIe device to be injected with errors through the EINJ error injection module according to the obtained error register address information includes: injecting errors into the PCIe device to be injected with errors through the EINJ error injection module according to the obtained error register address information and the pre-configured error type, and verifying whether the error injection is successful.
[0016] As a technical solution, the PCIe device is a PCIe Endpoint device mounted under a PCIe Switch device in a server.
[0017] This specification also provides an electronic device, including a processor and a readable storage medium. The readable storage medium stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the foregoing PCIe device error injection method.
[0018] This specification also provides a readable storage medium. The readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the foregoing PCIe device error injection method.
[0019] The above technical solutions provided by this specification at least bring the following beneficial effects:
[0020] By obtaining the BDF number of the PCIe device to be tested and its error register address, using the pre-loaded EINJ module and configuring it as the address segment error injection mode, injecting errors into the specified device directly in the operating system environment, realizing low-cost, efficient, and convenient error simulation testing for the Endpoint device under the Switch in the server, without the need for dedicated hardware, and simplifying the testing process. Description of the Drawings
[0021] To more clearly illustrate the technical solutions in the embodiments of this specification or in the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments of this specification or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments recorded in this specification. For those of ordinary skill in the art, other accompanying drawings can also be obtained based on these accompanying drawings of the embodiments of this specification.
[0022] Figure 1 is a flowchart of a PCIe device error injection method in an embodiment of this specification;
[0023] Figure 2 is a structural diagram of a PCIe device error injection apparatus in an embodiment of this specification;
[0024] Figure 3 is a hardware structural diagram of an electronic device in an embodiment of this specification.
[0025] Reference numerals: first module 21, second module 22, third module 23. Detailed embodiments
[0026] The terms used in the embodiments of this specification are only for the purpose of describing specific embodiments and do not limit this specification. The singular forms "a", "the", and "said" used in this specification and the claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to any or all possible combinations of one or more of the associated listed items.
[0027] It should be understood that although the terms first, second, third, etc. may be used in the embodiments of this specification to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, in addition, the word "if" may be interpreted as "when" or "while" or "in response to determining".
[0028] With the rapid development of information technology, servers play an increasingly important role in the fields of data centers and cloud computing. The reliability, availability, and serviceability (RAS) of servers are key metrics for measuring their performance. To ensure that servers can operate stably for a long time, they must have strong fault tolerance capabilities to handle various hardware failures and recover in a timely manner. In the evaluation system of servers, the RAS function is one of the important criteria for measuring their quality.
[0029] During the testing process of the server, the testing of the RAS function is a crucial part. This usually involves using fault injection tools to simulate fault injection on hardware components such as CPUs, memory, and PCIe to verify the system's fault tolerance and fault recovery mechanism. Traditional fault injection tools, such as XDP + C scripts provided by Intel, can perform CE (correctable error) and UCE (uncorrectable error) injection tests on PCIe Endpoints directly connected to the CPU. However, with the complexity of server architectures, there have emerged some special server designs, such as heterogeneous products, which use a Switch structure to connect different hardware components.
[0030] In this design, the Endpoint devices under the Switch cannot be directly recognized and tested by traditional fault injection tools. This is mainly because traditional fault injection tools can only read the PCIe Endpoints directly connected to the CPU and cannot perform in-depth scanning through the Switch. This has led to the problem of RAS fault injection testing for the Endpoint devices under the Switch.
[0031] In a technical solution, a PCIe fault injection card is used. This solution inserts the fault injection card into the PCIe Endpoint under the Switch and uses a special script tool to simulate PCIe faults, thereby achieving fault injection for the Endpoint devices under the Switch. Although this method solves the problem to a certain extent, it also has some obvious drawbacks. For example, PCIe fault injection cards are usually expensive and need to be purchased separately, which increases the testing cost and the complexity of asset management; the size of the fault injection card is large, and it is difficult to install and maintain for a chassis with limited space; using a fault injection card requires supporting fault injection software, and the environment setup and configuration process is cumbersome and time-consuming.
[0032] This specification aims to provide a new solution to perform simulated fault injection on the Endpoint devices under the Switch in a more economical, efficient, and easy-to-manage manner, thereby improving the coverage and efficiency of server RAS testing.
[0033] The specific technical solution is as follows.
[0034] In one implementation, this specification provides a method for fault injection of PCIe devices, which is applied to a server. The method includes: obtaining the BDF number of the PCIe device to be fault-injected, and obtaining the corresponding error register address information according to the BDF number; calling the pre-loaded EINJ fault injection module, and configuring the fault injection method of the EINJ fault injection module as address segment fault injection; according to the obtained error register address information, performing fault injection on the PCIe device to be fault-injected through the EINJ fault injection module.
[0035] The above PCIe device error injection method effectively solves the problem that traditional error injection tools cannot cover the Endpoint devices under the Switch. By using the EINJ module built into the operating system, it realizes low-cost, simple and efficient error injection testing, significantly improving the coverage and reliability of server RAS testing.
[0036] Specifically, as Figure 1 , it includes the following steps:
[0037] Step S11, obtain the BDF number of the PCIe device to be injected with errors, and obtain the corresponding error register address information according to the BDF number.
[0038] The PCIe device is configured with a unique identifier - the BDF number (Bus:Device:Function), and this number can help determine the device's location in the network. For example, after entering the operating system, the lspci command can be used to list all connected PCIe devices and identify the BDF number of the target Endpoint device from them. Once the BDF number is obtained, the next step is to find the error register address related to this device. This step involves referring to the PCIe SPEC (specification) to determine the register location for a specific error type. For example, for correctable errors (CE) and uncorrectable errors (UCE), it is necessary to know their corresponding register addresses for subsequent error injection operations.
[0039] Step S12, call the pre-loaded EINJ error injection module, and configure the error injection method of the EINJ error injection module as error injection by address segment.
[0040] In the Linux system, the EINJ (Error Injection) module allows developers or testers to simulate hardware errors, which is very useful for testing the robustness of the system and RAS (Reliability, Availability, Serviceability) characteristics. To use the EINJ module, first ensure that it has been loaded into the kernel, which can be confirmed by checking the existence of the / sys / kernel / debug / apei / einj path. If it has not been loaded, the modprobe einj command can be used to load it. Then, considering that the native EINJ module injects errors based on the BDF number, it needs to be customized to support error injection based on the address segment. This means converting the error register address information obtained in the second step into a format that the EINJ module can recognize and setting the parameters of EINJ to inject errors in the way of the address segment.
[0041] Step S13, according to the obtained error register address information, inject errors into the PCIe device to be injected with errors through the EINJ error injection module.
[0042] At this stage, all the necessary information is already available, including the address of the device to be fault-injected and the type of error to be injected. Now, it is only necessary to write an appropriate script to call the EINJ module and pass the previously converted address segment information to it. The type of error to be injected is selected by modifying the error_type field of the EINJ module, such as CE or UCE, etc. Once the script is executed, EINJ will inject the specified type of error into the target device, thus simulating the fault scenarios that may occur in the real world. The advantage of doing this is that it can effectively test the behavior of the system when facing various error situations without using an expensive PCIe fault injection card.
[0043] Through the above steps, the RAS function test of the Endpoint devices attached to the Switch is achieved, while maintaining a low cost and simplifying the process of setting up the test environment.
[0044] In one implementation, each PCIe device is identified by a unique BDF number. The bus number represents the bus where the PCIe device is located, the device number represents the position of the device on the bus, and the function number represents the specific function module on the device. Use command-line tools such as lspci in the server operating system to query. After executing this command, the system will list the detailed information of all PCIe devices, including their BDF numbers. For example:
[0045] $lspci -v ...
[0047] 01:00.0 Ethernet controller: Intel Corporation Ethernet Controller 10-Gigabit X540-AT2 (rev 01) ...
[0049] Assume that in this example, 01:00.0 is the BDF number of the PCIe device to be fault-injected. Then, it is necessary to find the corresponding error register address information based on this BDF number.
[0050] EINJ (Error Injection) is an operating system-level error injection mechanism that allows developers to simulate various hardware errors without directly intervening in the hardware. Use the EINJ module to simulate the error injection of PCIe devices. Ensure that the EINJ module has been loaded into the operating system. In the Linux system, the EINJ module can be loaded through the following command:
[0051] bash
[0052] $sudo modprobe einj
[0053] Once the EINJ module is successfully loaded, the EINJ module can be configured by accessing the files in the / sys / kernel / debug / apei / einj directory. Configure the EINJ module for the address segment misannotation method, and modify the parameters of the EINJ module so that it can accept and process specific address segments as the target of error injection.
[0054] After configuring the EINJ module, perform error injection operations based on the error register address information of the previously obtained PCIe device. In the specific operation, first find the register address information of the device to be misannotated.
[0055] Suppose the target device is a network controller, and its error register address information can be obtained by referring to the device manual or through the tools of the operating system. Once the error register address is determined, such as 0x0000:01:00.0, error injection can be performed on it through the EINJ module.
[0056] For example, the command is as follows:
[0057] bash
[0058] $echo"0x0000:01:00.0"|sudo tee / sys / kernel / debug / apei / einj / inject_address
[0059] $echo"0x04"|sudo tee / sys / kernel / debug / apei / einj / inject_type
[0060] In the above command, inject_address represents the address to inject the error, and inject_type represents the type of error to inject. Through such operations, error injection of PCIe devices can be successfully simulated, thereby testing the RAS function of the server.
[0061] Through the detailed elaboration and example illustration of the above steps, it can be seen that the technical solution of the present invention provides an efficient, low-cost and easy-to-implement method to simulate misannotation of PCIe Endpoint devices under the Switch through the EINJ module at the operating system level. This not only improves the test coverage of the server, but also reduces the complexity and cost of testing.
[0062] In one implementation, obtaining the BDF number of the PCIe device to be fault-injected and obtaining the corresponding error register address information according to the BDF number includes: using the lspci command to obtain the address information of the PCIe device to be fault-injected according to the BDF number, and obtaining the error register address information of the PCIe device according to the address information of the PCIe device and the SPEC.
[0063] In one implementation, calling the pre-loaded EINJ fault injection module and configuring the fault injection method of the EINJ fault injection module as address segment fault injection includes: pre-loading the EINJ module that has been pre-confirmed to be installed using the Modprobe command, calling the EINJ module, and reconfiguring the fault injection method as address segment fault injection.
[0064] In one implementation, fault-injecting the PCIe device to be fault-injected through the EINJ fault injection module according to the obtained error register address information includes: fault-injecting the PCIe device to be fault-injected through the EINJ fault injection module according to the obtained error register address information and the pre-configured error type, and verifying whether the fault injection is successful.
[0065] In one implementation, the PCIe device is a PCIe Endpoint device mounted under a PCIe Switch device in a server.
[0066] In one implementation, the Topology structure of PCIe can be queried under the OS. At the same time, each device will be assigned a BDF number and an address space. It is necessary to find the BDF of the device mounted under the Switch and the address of the error register. The EINJ under the OS provides a hardware error injection mechanism. Therefore, the Endpoint address can be simulated and fault-injected by using the EINJ method, so as to achieve the purpose of fault-injecting the Endpoint device mounted under the Switch.
[0067] Use the modprobe command under the OS to load the EINJ module. For example, for the Linux system, use / sys / kernel / debug / apei / einj to confirm whether the OS has installed the EINJ module, and then use Modprobe einj to load the EINJ module.
[0068] Enter the OS, find the address of the PCIe device to be fault-injected through the lspci command, and record the address of the Endpoint. The PCIe Endpoint has its specific allocated address, and the corresponding fault injection register address is found through the SPEC of PCIe.
[0069] Convert the address of the PCIe Endpoint device into a specific address segment recognizable by EINJ. Since the EINJ module built into the system uses BDF for PCIe annotation errors, it is necessary to rewrite the EINJ module to use address segment annotation errors instead, and then write the register address into the param4 field of EINJ.
[0070] Inject PCIe errors into the PCIe Endpoint through the EINJ function under the OS to achieve the effect of simulated annotation errors. Inject errors into the PCIe Endpoint device by running the rewritten EINJ module, and implement different types of annotation errors, such as CE and UCE, by modifying the error_type.
[0071] In one implementation, such as Figure 2 , this specification also provides a PCIe device error injection device applied to a server. The device includes: a first module for obtaining the BDF number of the PCIe device to be error-injected and obtaining the corresponding error register address information according to the BDF number; a second module for calling the pre-loaded EINJ error injection module and configuring the error injection method of the EINJ error injection module as address segment error injection; a third module for error-injecting the PCIe device to be error-injected through the EINJ error injection module according to the obtained error register address information.
[0072] In one implementation, the step of obtaining the BDF number of the PCIe device to be error-injected and obtaining the corresponding error register address information according to the BDF number includes: obtaining the address information of the PCIe device to be error-injected according to the BDF number through the lspci command, and obtaining the error register address information of the PCIe device according to the address information of the PCIe device and the SPEC.
[0073] In one implementation, the step of calling the pre-loaded EINJ error injection module and configuring the error injection method of the EINJ error injection module as address segment error injection includes: pre-loading the pre-confirmed installed EINJ module through the Modprobe command, calling the EINJ module, and reconfiguring the error injection method as address segment error injection.
[0074] In one implementation, the step of error-injecting the PCIe device to be error-injected through the EINJ error injection module according to the obtained error register address information includes: error-injecting the PCIe device to be error-injected through the EINJ error injection module according to the obtained error register address information and the pre-configured error type, and verifying whether the error injection is successful.
[0075] In one implementation, the PCIe device is a PCIe Endpoint device mounted under a PCIe Switch device in the server.
[0076] The device embodiments are the same as or similar to the corresponding method embodiments, and will not be elaborated here.
[0077] In one embodiment, this specification provides an electronic device, including a processor and a readable storage medium. The readable storage medium stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the aforementioned PCIe device error injection method. In terms of the hardware level, the schematic diagram of the hardware architecture can be seen Figure 3 as shown.
[0078] In one embodiment, this specification provides a readable storage medium. The readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the aforementioned PCIe device error injection method.
[0079] Here, the readable storage medium can be any electronic, magnetic, optical or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, the readable storage medium can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or a combination thereof.
[0080] The systems, devices, modules or units described in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, and the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver device, a game console, a tablet computer, a wearable device, or a combination of any several of these devices.
[0081] For the convenience of description, when describing the above device, various units are described separately according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0082] Those skilled in the art should understand that the embodiments of this specification can be provided as a method, a system, or a computer program product. Therefore, this specification can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0083] This specification is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of this specification. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of blocks.
[0084] Moreover, these computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing devices to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of blocks.
[0085] These computer program instructions can also be loaded onto a computer or other programmable data processing devices, such that a series of operation steps are executed on the computer or other programmable devices to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable devices provide steps for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of blocks.
[0086] Those skilled in the art should understand that the embodiments of this specification can be provided as a method, a system, or a computer program product. Therefore, this specification can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this specification can take the form of a computer program product implemented on one or more computer-usable storage media (which may include, but are not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0087] The above are only the embodiments of this specification and are not intended to limit this specification. For those skilled in the art, various changes and modifications can be made to this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of this specification shall be included within the scope of the claims of this specification.
Claims
1. A PCIe device error injection method, characterized in that: Applied to a server, the method comprises: Get the BDF number of the PCIe device to be annotated with an error, and get the corresponding error register address information according to the BDF number; Call the preloaded EINJ error injection module and configure the error injection mode of the EINJ error injection module to address segment error injection; According to the acquired error register address information, the EINJ error annotation module is used to perform error annotation on the PCIe device to be annotated with an error.
2. The method according to claim 1, characterized in that The step of obtaining the BDF number of the PCIe device to be annotated with an error and obtaining corresponding error register address information according to the BDF number includes: The lspci command is used to obtain the address information of the PCIe device to be annotated with an error according to the BDF number, and the error register address information of the PCIe device is obtained according to the address information and SPEC of the PCIe device.
3. The method according to claim 1, characterized in that The calling of the preloaded EINJ error injection module and configuring the error injection mode of the EINJ error injection module as address segment error injection include: The Modprobe command loads the EINJ module that has been confirmed to be installed in advance, calls the EINJ module, and reconfigures the error injection mode to address segment error injection.
4. The method according to claim 1, characterized in that: According to the acquired error register address information, the EINJ error injection module is used to inject an error into the PCIe device to be injected with an error, including: According to the acquired error register address information and the pre-configured error type, the EINJ error injection module is used to inject an error into the PCIe device to be injected, and verify whether the injection is successful.
5. The method according to claim 1, characterized in that The PCIe device is a PCIe Endpoint device mounted under a PCIe Switch device in a server.
6. A PCIe device injection error detection device, characterized in that: Applied to a server, the device comprises: The first module is used to obtain the BDF number of the PCIe device to be annotated with an error, and obtain the corresponding error register address information according to the BDF number; The second module is used to call the preloaded EINJ error injection module and configure the error injection mode of the EINJ error injection module to address segment error injection; The third module is used to perform error annotation on the PCIe device to be annotated with an error through the EINJ error annotation module according to the acquired error register address information.
7. The device according to claim 6, characterized in that The step of obtaining the BDF number of the PCIe device to be annotated with an error and obtaining corresponding error register address information according to the BDF number includes: The lspci command is used to obtain the address information of the PCIe device to be annotated with an error according to the BDF number, and the error register address information of the PCIe device is obtained according to the address information and SPEC of the PCIe device.
8. The device according to claim 6, characterized in that The calling of the preloaded EINJ error injection module and configuring the error injection mode of the EINJ error injection module as address segment error injection include: The Modprobe command loads the EINJ module that has been confirmed to be installed in advance, calls the EINJ module, and reconfigures the error injection mode to address segment error injection.
9. The device according to claim 6, characterized in that According to the acquired error register address information, the EINJ error injection module is used to inject an error into the PCIe device to be injected with an error, including: According to the acquired error register address information and the pre-configured error type, the EINJ error injection module is used to inject an error into the PCIe device to be injected, and verify whether the injection is successful.
10. The device according to claim 6, characterized in that The PCIe device is a PCIe Endpoint device mounted under a PCIe Switch device in a server.
11. An electronic device, characterized in that: include: A processor and a readable storage medium, wherein the readable storage medium stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement any method described in claims 1-5.
12. A readable storage medium, characterized in that: The readable storage medium stores machine executable instructions, and when the machine executable instructions are called and executed by a processor, the machine executable instructions prompt the processor to implement any one of the methods of claims 1-5.