Equipment exception handling system and method based on PCIe and fault restorer
By introducing a fault recovery device in a PCIe-based system, monitoring read and write requests and generating automatic responses, the problem of Host processor downtime caused by endpoint device exceptions is solved, and precise fault location and reduced abnormal recovery overhead is achieved.
Patent Information
- Application Number
- CN202411494843.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-02-18
AI Technical Summary
In PCIe-based systems, the abnormal and unresponsiveness of the endpoint device can easily cause the Host processor to go down. The traditional reset method has a great and complex impact on the Host processor, and it is impossible to accurately locate the faulty functional components.
A PCIe-based device exception handling system is designed, including a Host processor, a PCIe switch, multiple endpoint devices and a failure recovery device. The fault recovery device includes an exception monitoring circuit, an exception reporting circuit and an automatic response circuit, which is used to monitor read and write requests, generate an exception reporting request and transmit it to the Host processor, and generate automatic response information to proxy the endpoint device's response.
The system can accurately locate faulty functional components in the endpoint device, reduce abnormal recovery overhead, improve system robustness, and avoid Host processor downtime.
Smart Images

Figure CN119473738A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a PCIe-based device exception processing system, method and fault recovery device. Background Art
[0002] With the development of computer technology, the system architecture based on the high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCIe) has been widely used in personal computers, servers and embedded systems. In a PCIe-based system, endpoint devices may have device abnormalities due to hardware abnormalities or software usage errors in their functional components.
[0003] In the prior art, abnormal non-response of endpoint devices can cause the Host processor in the PCIe system to crash (hang). In the traditional way, the root complex (RC) of the PCIe architecture can detect the device completion timeout, and then reset the entire device or functional component for recovery, but the impact and overhead on the Host processor are relatively large. In fact, due to some restrictions (such as the reset process requires waiting for all responses to return, etc.), the Host processor cannot complete the reset of the device or functional component. In addition, abnormal access to the abnormal endpoint device by other endpoint devices will also cause the Host processor in the PCIe system to hang.
[0004] Based on this, an embodiment of the present invention provides a PCIe-based device exception handling system, which enables the Host processor to accurately locate faulty functional components in the endpoint device, reduce exception recovery overhead, and improve system robustness. Summary of the invention
[0005] The present invention provides a PCIe-based device exception processing system, method and fault recovery device to reduce exception recovery overhead and improve system robustness.
[0006] According to one aspect of the present invention, a PCIe-based device exception handling system is provided, the system comprising: a host processor, a PCIe switch, a plurality of endpoint devices and a fault recovery device, wherein:
[0007] Each endpoint device is connected to the Host processor through a PCIe switch;
[0008] Each endpoint device is provided with a fault recovery device, and each functional component in the endpoint device performs abnormality monitoring and abnormality processing through the fault recovery device;
[0009] The fault recovery device comprises: an abnormality monitoring circuit, an abnormality reporting circuit and an automatic response circuit;
[0010] The abnormality monitoring circuit is used to monitor the read and write requests of the endpoint device, and when it is determined that an abnormality exists, send an abnormality identification to the abnormality reporting circuit and the automatic response circuit;
[0011] The abnormality reporting circuit is used to generate an abnormality reporting request according to the abnormality identifier through the endpoint device where it is located, and transmit the abnormality reporting request to the Host processor;
[0012] The automatic response circuit is used to generate a response from the endpoint device where the automatic response information agent is located according to the abnormal identification.
[0013] According to another aspect of the present invention, a method for handling device exceptions based on PCIe is provided. The method is applied to a device exception handling system based on PCIe provided in any embodiment of the present invention. The method comprises:
[0014] The read and write requests of the endpoint device are monitored through the abnormality monitoring circuit, and when it is determined that an abnormality exists, an abnormality identification is sent to the abnormality reporting circuit and the automatic response circuit;
[0015] Generate an exception reporting request according to the exception identifier through the endpoint device where the exception reporting circuit is located, and transmit the exception reporting request to the Host processor through the exception reporting circuit;
[0016] The automatic response circuit generates a response from the endpoint device where the automatic response information agent is located according to the abnormal identification.
[0017] According to another aspect of the present invention, a fault recovery device is provided. The fault recovery device is applied to a PCIe-based device exception handling system provided in any embodiment of the present invention. The fault recovery device comprises: an exception monitoring circuit, an exception reporting circuit and an automatic response circuit; wherein:
[0018] The abnormality monitoring circuit is used to monitor the read and write requests of the endpoint device, and when it is determined that an abnormality exists, send an abnormality identification to the abnormality reporting circuit and the automatic response circuit;
[0019] The abnormality reporting circuit is used to generate an abnormality reporting request according to the abnormality identifier through the endpoint device where it is located, and transmit the abnormality reporting request to the Host processor;
[0020] The automatic response circuit is used to generate a response from the endpoint device where the automatic response information agent is located according to the abnormal identification.
[0021] According to another aspect of the present invention, a computer is provided, the computer comprising: a PCIe-based device exception handling system as provided in any embodiment of the present invention.
[0022] The technical solution of the embodiment of the present invention is to construct a device exception handling system based on PCIe, wherein the system includes: a host processor, a PCIe switch, multiple endpoint devices and a fault recovery device, each endpoint device is connected to the host processor through the PCIe switch; a fault recovery device is provided in each endpoint device, and each functional component in the endpoint device performs abnormal monitoring and abnormal handling through the fault recovery device; the fault recovery device includes: an abnormal monitoring circuit, an abnormal reporting circuit and an automatic response circuit; the abnormal monitoring circuit is used to monitor the read and write requests of the endpoint device where it is located, and when it is determined that there is an abnormality, the abnormal identification is sent to the abnormal reporting circuit and the automatic response circuit; the abnormal reporting circuit is used to generate an abnormal reporting request according to the abnormal identification through the endpoint device where it is located, and transmit the abnormal reporting request to the host processor; the automatic response circuit is used to generate an automatic response information according to the abnormal identification The response of the endpoint device where it is located is solved, and the problem that the functional abnormality of the endpoint device is easy to cause the PCIe system to hang can be solved, and the faulty functional component in the endpoint device can be accurately located, the abnormal recovery overhead can be reduced, and the system robustness can be improved.
[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0025] Figure 1 It is a structural diagram of a PCIe-based device exception handling system provided according to an embodiment of the present invention;
[0026] Figure 2 is a schematic diagram of the structure of a fault recovery device provided according to an embodiment of the present invention;
[0027] Figure 3 is a structural schematic diagram of an abnormality monitoring circuit provided according to an embodiment of the present invention;
[0028] Figure 4is a schematic diagram of an uncompleted request table provided according to an embodiment of the present invention;
[0029] Figure 5 is a structural schematic diagram of an abnormality reporting circuit provided according to an embodiment of the present invention;
[0030] Figure 6 is a structural schematic diagram of an automatic response circuit provided according to an embodiment of the present invention;
[0031] Figure 7 is a structural schematic diagram of an abnormal isolation circuit provided according to an embodiment of the present invention;
[0032] Figure 8 is a flow chart of a method for handling device exceptions based on PCIe according to an embodiment of the present invention;
[0033] Fig. 9 It is a schematic diagram of the structure of a computer provided according to an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0036] Figure 1 1 is a schematic diagram of a PCIe-based device exception handling system according to an embodiment of the present invention. This embodiment is applicable to the failure recovery of a device exception in a PCIe system. Figure 1 As shown, the system includes: a host processor, a PCIe switch, multiple endpoint devices and a fault recovery device. Among them:
[0037] Each endpoint device (PCIe EndPoint, PCIe EP) is connected to the host processor through a PCIe switch. The endpoint device can receive read and write requests from the host processor or other endpoint devices and perform data transmission accordingly. The host processor can be a central processing unit (CPU), a single processor chip, or a processor group composed of multi-core processors. The host processor is the core component responsible for executing computing tasks and controlling system operations.
[0038] In the embodiment of the present invention, each endpoint device is provided with a fault recovery device, and each functional component in the endpoint device performs abnormality monitoring and abnormality processing through the fault recovery device. Figure 1 As shown in FIG. 1 , the fault recovery device can be connected between the endpoint device port (PCIe EP port) and the network on chip (NOC). NOC can be implemented through a system on chip (SOC). NOC is an on-chip centralized routing mechanism that can set functions such as flow control management, request routing, and on-chip management system. Figure 1 As shown in FIG. 1 , each functional component can be connected to the fault recovery device through the NOC, thereby realizing multifunctional communication of the endpoint devices. Figure 1 The connection method shown can monitor abnormalities when the functional components of the endpoint device receive and respond to read and write requests, and perform fault recovery when abnormalities occur.
[0039] Figure 2 FIG. 1 is a schematic diagram of the structure of a fault recovery device provided according to an embodiment of the present invention. Figure 2 As shown, in order to realize the abnormal monitoring and abnormal handling of each functional component in the endpoint device in the PCIe system, in an embodiment of the present invention, the fault recovery device includes: an abnormal monitoring circuit, an abnormal reporting circuit and an automatic response circuit. The abnormal monitoring circuit is used to monitor the read and write requests of the endpoint device, and when it is determined that there is an abnormality, send the abnormal identification to the abnormal reporting circuit and the automatic response circuit; the abnormal reporting circuit is used to generate an abnormal reporting request according to the abnormal identification through the endpoint device, and transmit the abnormal reporting request to the Host processor; the automatic response circuit is used to generate an automatic response information agent according to the abnormal identification to respond to the endpoint device.
[0040] Among them, the abnormal monitoring circuit for abnormal read and write requests of the endpoint device may include multiple situations. For example, the abnormal monitoring circuit performs abnormal monitoring on one or more of the request handshake time, response time, and response data volume of the read and write requests of the endpoint device. Specifically, the abnormal monitoring circuit can determine whether the read and write request handshake has timed out, whether the response has timed out, whether the response quantity matches the request, and whether the response carries an abnormal flag, etc.
[0041] Figure 3 1 is a schematic diagram of the structure of an abnormality monitoring circuit provided according to an embodiment of the present invention. Figure 3 As shown, optionally, the abnormality monitoring circuit includes: a request handshake timer, an uncompleted request table, and a completion time timer.
[0042] Among them, the request handshake timer is used to time the handshake time of the read and write requests of the endpoint device. When the handshake time exceeds the preset handshake threshold, it is determined that there is a request handshake timeout exception. At this time, the exception monitoring circuit can transmit the exception identifier of the request handshake timeout exception to the exception reporting circuit. The exception reporting circuit can record the exception information corresponding to the request handshake timeout exception, generate an exception reporting request, and transmit the exception reporting request to the Host processor. Among them, the exception information corresponding to the request handshake timeout exception includes but is not limited to: the request function identifier, request address, accessed functional component identifier, request length and exception type of the request corresponding to the exception information corresponding to the request handshake timeout exception. At this time, the automatic response circuit can generate a response from the endpoint device where the automatic response information agent is located corresponding to the read and write request data volume.
[0043] like Figure 3 As shown, when the abnormal monitoring circuit determines through the request handshake timer that the read / write request of the endpoint device has completed the handshake normally, the read / write request is recorded in the uncompleted request table.
[0044] Figure 4 FIG. 1 is a schematic diagram of an uncompleted request table provided according to an embodiment of the present invention. Figure 4 As shown, the unfinished request table can be a linked list. Specifically, the read and write requests can be strung into a linked list in the order of ID. Each row in the unfinished request table can be a separate linked list item. A row of the unfinished request table can include: read and write request ID, information validity mark, linked list head mark, linked list tail mark, and linked list next item mark and other linked list management information. A row of the completed request table can also include: the number of remaining responses for the read and write request, the remaining time length of the preset life time of the read and write request, and other management information. Other management information includes but is not limited to: the ID and address of the read and write request. When the unfinished request table records the read and write request, it can request an idle item in the first in first out memory (First In First Out, FIFO) to obtain the idle number of the FIFO. When the read and write request response is completed and cleared in the unfinished request table, it is returned in the FIFO to update the request idle item of the FIFO.
[0045] like Figure 3As shown, the completion time timer is used to time the read and write requests in the unfinished request table. If no response is received when the preset life time is reached, it is determined that there is a request response timeout exception. The completion time timer can count up or count down. For example, the completion time timer can start counting up from 0. If no response is received when the preset life time is reached, it is determined that there is a request response timeout exception. Alternatively, the completion time timer can start counting down from the preset life time. If no response is received when the countdown reaches 0, it is determined that there is a request response timeout exception.
[0046] At this time, the exception monitoring circuit can transmit the exception identifier of the request response timeout exception to the exception reporting circuit. The exception reporting circuit can record the exception information corresponding to the request response timeout exception, generate an exception reporting request, and transmit the exception reporting request to the Host processor. Among them, the exception information corresponding to the request response timeout exception includes but is not limited to: the request function identifier, request address, accessed functional component identifier, request length and exception type of the request corresponding to the exception information corresponding to the request response timeout exception. At this time, the automatic response circuit can generate a response from the endpoint device where the automatic response information agent corresponding to the read and write request data volume is located.
[0047] In the embodiment of the present invention, when the abnormal monitoring circuit determines through the completion time timer that the read / write request of the endpoint device receives a response before reaching the preset life time, the corresponding read / write request in the unfinished request table is cleared.
[0048] On the basis of the above implementation, optionally, the abnormality monitoring circuit is also used to: before clearing the corresponding read and write request in the unfinished request table, query the unfinished request table, and when the completed response data volume does not match the corresponding read and write request data volume, determine that there is an abnormal response data volume. The data volume mismatch at this time is that the completed response data volume is more or less than the read and write request data volume. The abnormality monitoring circuit can transmit the abnormal identification of the abnormal response data volume to the abnormality reporting circuit. The abnormality reporting circuit can record the abnormal information corresponding to the abnormal response data volume, generate an abnormality reporting request, and transmit the abnormality reporting request to the Host processor. Among them, the abnormal information corresponding to the abnormal response data volume includes but is not limited to: the request function identification, request address, accessed functional component identification, request length and abnormal type of the abnormal information corresponding to the request corresponding to the abnormal response data volume. At this time, the automatic response circuit can truncate and discard the response that exceeds the read and write request data volume, or generate the remaining number of responses corresponding to the read and write request, and obtain the response of the endpoint device where the automatic response information agent is located.
[0049] When the abnormality monitoring circuit determines that an abnormality exists, the abnormality reporting circuit can generate an abnormality reporting request and transmit the abnormality reporting request to the Host processor. In an optional implementation of an embodiment of the present invention, the abnormality reporting circuit is specifically used to: obtain the request function identifier, request address, accessed functional component identifier, request length and abnormality type of the corresponding read and write request according to the abnormal identifier through the endpoint device where it is located, and generate abnormal information; generate an abnormal queue according to the abnormal information, and take out the abnormal information in the abnormal queue in turn, generate an abnormality reporting request, and transmit the abnormality reporting request to the Host processor; wherein the abnormality reporting request includes at least one of the following: an interrupt request, an advanced error reporting request, and a vendor-specified capability request.
[0050] Figure 5 1 is a schematic diagram of a structure of an abnormality reporting circuit provided according to an embodiment of the present invention. Figure 5 As shown, the exception reporting circuit can push the exception information into the exception queue. Then, the exception information is popped out from the exception queue in sequence to generate an exception reporting request. Among them, push can be to add exception information at the end of the exception queue. Pop can be to remove exception information from the head of the exception queue. The exception reporting request can be an interrupt request (Interrupt, INT), an advanced error reporting request (Advanced Error Reporting, AER), or a vendor-specific capability request (Vendor-SpecificCapability, VSC).
[0051] When the abnormality monitoring circuit determines that an abnormality exists, the abnormality reporting circuit can generate an abnormality reporting request and transmit the abnormality reporting request to the Host processor. At the same time, the automatic response circuit can generate a response from the endpoint device where the automatic response information agent is located according to the abnormality identifier.
[0052] In an optional implementation of an embodiment of the present invention, the automatic response circuit includes: a response switching control subcircuit and an automatic response generation subcircuit; the response switching control subcircuit is used to switch the original response link to the automatic response generation subcircuit according to the abnormal identification; the automatic response generation subcircuit is used to generate a response of the endpoint device where the automatic response information agent is located according to the abnormal identification; the response switching control subcircuit is also used to switch the automatic response generation subcircuit to the original response link after the automatic response information is responded.
[0053] Figure 6 is a schematic diagram of the structure of an automatic response circuit provided according to an embodiment of the present invention. Figure 6As shown, the automatic response circuit includes: a response switching control subcircuit and an automatic response generation subcircuit. The response switching control subcircuit switches the original response link to the automatic response generation subcircuit according to the abnormal flag. Specifically, the response switching control subcircuit switches the original response link to the automatic response generation subcircuit when the read / write request handshake times out, the request response returned by the functional component through the endpoint device times out, the request response data volume does not reach the read / write request data volume, or the request response data volume exceeds the read / write request data volume.
[0054] like Figure 6 As shown, the automatic response generation subcircuit is used to generate a response from the endpoint device where the automatic response information agent is located according to the abnormal identification. Specifically, when the abnormal identification is a request handshake timeout abnormality, the automatic response generation subcircuit generates a response from the endpoint device where the automatic response information agent is located corresponding to the read and write request data volume; when the abnormal identification is a request response timeout abnormality, the automatic response generation subcircuit generates a response from the endpoint device where the automatic response information agent is located corresponding to the read and write request data volume; when the abnormal identification is a response data volume abnormality, the redundant response corresponding to the read and write request is truncated and discarded, or the remaining number of responses corresponding to the read and write request is generated to obtain the response from the endpoint device where the automatic response information agent is located.
[0055] After the automatic response generation subcircuit receives a response from the endpoint device where the automatic response information agent is located, the response switching control subcircuit is also used to switch the automatic response generation subcircuit to the original response link after the automatic response information is responded. By switching the automatic response generation subcircuit to the original response link, the response routing transmission of the normal working functional component can be performed after the functional component is abnormal and before the host processor has completed the abnormal recovery.
[0056] In the embodiment of the present invention, the abnormality before the host processor performs abnormal recovery can still be monitored, reported and automatically responded. In order to reduce repeated monitoring of abnormalities, before the host processor performs abnormal recovery, the response of the abnormal functional component that has been monitored can be processed by the abnormal isolation circuit.
[0057] Through the above-mentioned fault recovery device composed of an abnormality monitoring circuit, an abnormality reporting circuit and an automatic response circuit, an automatic response can be performed when each functional component in the endpoint device is abnormal, so as to ensure the normal use of the endpoint device and avoid causing the host processor to crash. Among them, the transmission of the abnormality reporting request to the host processor can enable the host processor to locate the abnormality and perform recovery processing on the specific functional components of the specific endpoint device.
[0058] Specifically, after receiving an interrupt request, an advanced error report request, or a vendor-specified capability request, the HOST processor can query the exception information. The HOST processor locates the abnormal functional component of the endpoint device based on the exception information, and flushes and isolates it by configuring the NOC, etc. The HOST processor can perform abnormal recovery operations such as resetting and initializing the abnormal functional component, thereby avoiding the Hang risk of the entire PCIe system, improving the system robustness, resetting and initializing within a limited range, and reducing the abnormal recovery overhead.
[0059] On the basis of the above implementation, optionally, in order to further ensure the robustness of the system before and during abnormal recovery, as follows Figure 2 As shown, the fault recovery device also includes: an abnormal isolation circuit. The abnormal isolation circuit is used to obtain an abnormal reporting request and determine the abnormal functional component according to the abnormal reporting request; when a read or write request is sent to an abnormal functional component, or a response comes from an abnormal functional component, the information is discarded. Figure 1 As shown, the abnormal isolation circuit can also be set in the NOC to isolate the requests and responses of the functional components. The control information of the abnormal isolation circuit in the NOC can come from the processor configuration. Once the abnormal isolation circuit in the NOC is configured to isolate a certain functional component, all requests sent to the functional component will be automatically responded to by the abnormal isolation circuit. Requests sent to other functional components are not affected.
[0060] Figure 7 1 is a schematic diagram of a structure of an abnormal isolation circuit provided according to an embodiment of the present invention. Figure 7 As shown, the abnormal isolation circuit mainly determines whether the read and write request is sent to the abnormal functional component, or whether the response comes from the abnormal functional component. Specifically, the abnormal isolation circuit can determine the abnormal functional component according to the identification information of the abnormal functional component in the abnormal reporting request. The abnormal isolation circuit can determine whether the read and write request is sent to the abnormal functional component according to the request address of the read and write request. The abnormal isolation circuit can use the functional component identification information carried in the response information packet to determine whether the response comes from the abnormal functional component. The abnormal isolation circuit can discard the read and write request sent to the abnormal functional component. The abnormal isolation circuit can discard the response from the abnormal functional component. For normal communication with non-abnormal functional components such as requests or influences, the abnormal isolation circuit can forward normally. After the abnormal functional component is restored, the HOST processor can configure the NOC and other devices to release the isolation of the abnormal functional component.
[0061] The technical solution of this embodiment is to construct a device exception handling system based on PCIe, wherein the system includes: a host processor, a PCIe switch, multiple endpoint devices and a fault recovery device, each endpoint device is connected to the host processor through the PCIe switch; a fault recovery device is provided in each endpoint device, and each functional component in the endpoint device performs exception monitoring and exception handling through the fault recovery device; the fault recovery device includes: an exception monitoring circuit, an exception reporting circuit and an automatic response circuit; the exception monitoring circuit is used to monitor the read and write requests of the endpoint device where it is located, and when it is determined that there is an exception, the exception identification is sent to the exception reporting circuit and the automatic response circuit; the exception reporting circuit is used to generate an exception reporting request according to the exception identification through the endpoint device where it is located, and transmit the exception reporting request to the Host processor; the automatic response circuit is used to generate an automatic response information agent according to the exception identification to respond to the endpoint device where it is located, thereby solving the problem that the functional abnormality of the endpoint device is easy to cause the PCIe system to hang, and can accurately locate the faulty functional components in the endpoint device, reduce the exception recovery overhead, and improve the system robustness.
[0062] Figure 8 1 is a flowchart of a PCIe-based device exception handling method provided in an embodiment of the present invention. The method can be applied to a PCIe-based device exception handling system provided in any embodiment of the present invention. Figure 8 As shown, the method includes:
[0063] Step 810: Monitor the read and write requests of the endpoint device through the abnormality monitoring circuit, and when it is determined that an abnormality exists, send the abnormality identification to the abnormality reporting circuit and the automatic response circuit.
[0064] Optionally, an exception monitoring circuit includes: a request handshake timer, an incomplete request table, and a completion time timer; the read and write requests of the endpoint device are monitored by the exception monitoring circuit, and when it is determined that an exception exists, an exception identifier is sent to the exception reporting circuit and the automatic response circuit, including: timing the handshake time of the read and write requests of the endpoint device by the request handshake timer, and when the handshake time exceeds a preset handshake threshold, determining that there is a request handshake timeout exception; when the exception monitoring circuit determines through the request handshake timer that the read and write requests of the endpoint device have completed the handshake normally, the read and write requests are recorded in the incomplete request table; the read and write requests in the incomplete request table are timed by the completion time timer, and no response is received when the preset life time is reached, determining that there is a request response timeout exception; when the exception monitoring circuit determines through the completion time timer that the read and write requests of the endpoint device receive a response before the preset life time is reached, the corresponding read and write requests in the incomplete request table are cleared.
[0065] Based on the above implementation, optionally, the method further includes: querying the incomplete request table through an abnormality monitoring circuit before clearing the corresponding read and write requests in the incomplete request table, and determining that there is a response data volume abnormality when the response data volume does not match the corresponding read and write request data volume.
[0066] Step 820: Generate an exception reporting request according to the exception identifier through the endpoint device where the exception reporting circuit is located, and transmit the exception reporting request to the Host processor through the exception reporting circuit.
[0067] Optionally, an exception reporting request is generated according to the exception identifier by the endpoint device where the exception reporting circuit is located, and the exception reporting request is transmitted to the Host processor through the exception reporting circuit, including: obtaining the request function identifier, request address, accessed functional component identifier, request length and exception type of the corresponding read and write request according to the exception identifier by the endpoint device where the exception reporting circuit is located, and generating exception information; generating an exception queue according to the exception information through the exception reporting circuit, and taking out the exception information from the exception queue in sequence, generating an exception reporting request, and transmitting the exception reporting request to the Host processor; wherein the exception reporting request includes at least one of the following: an interrupt request, an advanced error reporting request, and a vendor-specified capability request.
[0068] Step 830: Generate a response from the endpoint device where the automatic response information agent is located according to the abnormal identification through the automatic response circuit.
[0069] Optionally, the automatic response circuit includes: a response switching control subcircuit and an automatic response generation subcircuit; generating a response of the endpoint device where the automatic response information agent is located according to the exception identifier through the automatic response circuit, including: switching the original response link to the automatic response generation subcircuit according to the exception identifier through the response switching control subcircuit; generating a response of the endpoint device where the automatic response information agent is located according to the exception identifier through the automatic response generation subcircuit; and switching the automatic response generation subcircuit to the original response link after the automatic response information is responded through the response switching control subcircuit.
[0070] Optionally, a response of the endpoint device where the automatic response information agent is located is generated according to the exception identifier by the automatic response generation subcircuit, including: when the exception identifier is a request handshake timeout exception, the automatic response generation subcircuit generates a response of the endpoint device where the automatic response information agent is located corresponding to the read and write request data volume; when the exception identifier is a request response timeout exception, the automatic response generation subcircuit generates a response of the endpoint device where the automatic response information agent is located corresponding to the read and write request data volume; when the exception identifier is a response data volume exception, the automatic response generation subcircuit truncates and discards excess responses corresponding to the read and write requests, or generates responses corresponding to the remaining number of read and write requests, to obtain a response of the endpoint device where the automatic response information agent is located.
[0071] On the basis of the above implementation mode, optionally, the fault recovery device also includes: an abnormal isolation circuit; the method also includes: obtaining an abnormal reporting request through the abnormal isolation circuit, and determining the abnormal functional component according to the abnormal reporting request; when a read or write request is sent to the abnormal functional component, or a response comes from the abnormal functional component, information is discarded.
[0072] The technical solution of the embodiment of the present invention monitors the read and write requests of the endpoint device through an abnormality monitoring circuit, and when it is determined that an abnormality exists, sends an abnormality identification to the abnormality reporting circuit and the automatic response circuit; the endpoint device where the abnormality reporting circuit is located generates an abnormality reporting request according to the abnormality identification, and transmits the abnormality reporting request to the Host processor through the abnormality reporting circuit; the automatic response circuit generates a response from the endpoint device where the automatic response information agent is located according to the abnormality identification, which solves the problem that the functional abnormality of the endpoint device easily leads to the Hang of the PCIe system, can accurately locate the faulty functional components in the endpoint device, reduce the abnormality recovery overhead, and improve the robustness of the system.
[0073] The embodiment of the present invention further provides a fault recovery device. The fault recovery device is applied to a PCIe-based device exception handling system provided in any embodiment of the present invention. Figure 2 As shown, the fault recovery device includes: an abnormality monitoring circuit, an abnormality reporting circuit and an automatic response circuit; wherein: the abnormality monitoring circuit is used to monitor the read and write requests of the endpoint device where it is located, and when it is determined that there is an abnormality, the abnormality identification is sent to the abnormality reporting circuit and the automatic response circuit; the abnormality reporting circuit is used to generate an abnormality reporting request according to the abnormality identification through the endpoint device where it is located, and transmit the abnormality reporting request to the Host processor; the automatic response circuit is used to generate a response to the endpoint device where the automatic response information agent is located according to the abnormality identification.
[0074] Optionally, the exception monitoring circuit includes: a request handshake timer, an incomplete request table, and a completion time timer; the request handshake timer is used to time the handshake time of the read and write requests of the endpoint device, and when the handshake time exceeds a preset handshake threshold, it is determined that there is a request handshake timeout exception; when the exception monitoring circuit determines through the request handshake timer that the read and write requests of the endpoint device have completed the handshake normally, the read and write requests are recorded in the incomplete request table; the completion time timer is used to time the read and write requests in the incomplete request table, and when no response is received when the preset lifetime time is reached, it is determined that there is a request response timeout exception; when the exception monitoring circuit determines through the completion time timer that the read and write requests of the endpoint device have received a response before the preset lifetime time is reached, the corresponding read and write requests in the incomplete request table are cleared.
[0075] Optionally, the abnormality monitoring circuit is also used to: query the incomplete request table before clearing the corresponding read and write requests in the incomplete request table, and determine that there is a response data volume abnormality when the response data volume does not match the corresponding read and write request data volume.
[0076] Optionally, the exception reporting circuit is specifically used to: obtain the request function identifier, request address, accessed functional component identifier, request length and exception type of the corresponding read and write request according to the exception identifier through the endpoint device, and generate exception information; generate an exception queue according to the exception information, and take out the exception information from the exception queue in sequence, generate an exception reporting request, and transmit the exception reporting request to the Host processor; wherein the exception reporting request includes at least one of the following: an interrupt request, an advanced error reporting request, and a vendor-specified capability request.
[0077] Optionally, the automatic response circuit includes: a response switching control subcircuit and an automatic response generation subcircuit; the response switching control subcircuit is used to switch the original response link to the automatic response generation subcircuit according to the exception identifier; the automatic response generation subcircuit is used to generate a response of the endpoint device where the automatic response information agent is located according to the exception identifier; the response switching control subcircuit is also used to switch the automatic response generation subcircuit to the original response link after the automatic response information is responded.
[0078] Optionally, the automatic response generation subcircuit is specifically used to: when the exception identifier is a request handshake timeout exception, generate a response from the endpoint device where the automatic response information agent is located for the corresponding read or write request data volume; when the exception identifier is a request response timeout exception, generate a response from the endpoint device where the automatic response information agent is located for the corresponding read or write request data volume; when the exception identifier is a response data volume exception, truncate and discard excess responses corresponding to the read or write request, or generate the remaining number of responses corresponding to the read or write request, to obtain a response from the endpoint device where the automatic response information agent is located.
[0079] Optionally, the fault recovery device also includes: an abnormal isolation circuit; an abnormal isolation circuit used to obtain an abnormal reporting request and determine the abnormal functional component based on the abnormal reporting request; when a read or write request is sent to the abnormal functional component, or a response comes from the abnormal functional component, information is discarded.
[0080] The technical solution of the embodiment of the present invention solves the problem that functional abnormalities of endpoint devices easily lead to PCIe system Hang through a fault recovery device, can accurately locate faulty functional components in endpoint devices, reduce abnormal recovery overhead, and improve system robustness.
[0081] Fig. 9 Schematic diagram of a computer structure provided according to an embodiment of the present invention. Fig. 9As shown, the computer includes a PCIe-based device exception handling system as provided in any embodiment of the present invention. Thus, the PCIe-based device exception handling system solves the problem that the functional abnormality of the endpoint device easily leads to the PCIe system hanging, and can accurately locate the faulty functional components in the endpoint device, reduce the abnormality recovery overhead, and improve the system robustness.
[0082] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0083] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A PCIe-based device exception handling system, characterized in that: The system includes: a host processor, a PCIe switch, multiple endpoint devices and a fault recovery device, wherein: Each endpoint device is connected to the Host processor through a PCIe switch; Each endpoint device is provided with a fault recovery device, and each functional component in the endpoint device performs abnormality monitoring and abnormality processing through the fault recovery device; The fault recovery device comprises: an abnormality monitoring circuit, an abnormality reporting circuit and an automatic response circuit; The abnormality monitoring circuit is used to monitor the read and write requests of the endpoint device, and when it is determined that an abnormality exists, send an abnormality identification to the abnormality reporting circuit and the automatic response circuit; The abnormality reporting circuit is used to generate an abnormality reporting request according to the abnormality identifier through the endpoint device where it is located, and transmit the abnormality reporting request to the Host processor; The automatic response circuit is used to generate a response from the endpoint device where the automatic response information agent is located according to the abnormal identification.
2. The system according to claim 1, characterized in that The abnormality monitoring circuit includes: a request handshake timer, an uncompleted request table, and a completion time timer; A request handshake timer is used to time the handshake time of the read and write requests of the endpoint device. When the handshake time exceeds a preset handshake threshold, it is determined that there is a request handshake timeout exception. When the abnormal monitoring circuit determines through the request handshake timer that the read / write request of the endpoint device has completed the handshake normally, the read / write request is recorded in the uncompleted request table; A completion time timer is used to time the read and write requests in the unfinished request table, and if no response is received when the preset survival time is reached, it is determined that there is a request response timeout exception; When the abnormal monitoring circuit determines through the completion time timer that the read / write request of the endpoint device receives a response before reaching the preset survival time, the corresponding read / write request in the unfinished request table is cleared.
3. The system according to claim 2, characterized in that The abnormality monitoring circuit is also used for: Before clearing the corresponding read and write requests in the incomplete request table, the incomplete request table is queried, and when the response data volume does not match the corresponding read and write request data volume, it is determined that there is a response data volume abnormality.
4. The system according to claim 1, characterized in that The abnormality reporting circuit is specifically used for: Obtaining, by the endpoint device according to the exception identifier, a request function identifier, a request address, an accessed functional component identifier, a request length, and an exception type of a corresponding read / write request, and generating exception information; Generate an exception queue according to the exception information, take out the exception information in the exception queue in sequence, generate an exception reporting request, and transmit the exception reporting request to the Host processor; The exception reporting request includes at least one of the following: an interruption request, an advanced error reporting request, and a vendor-specified capability request.
5. The system according to claim 1, characterized in that The automatic response circuit comprises: a response switching control subcircuit and an automatic response generation subcircuit; A response switching control subcircuit, used for switching the original response link to an automatic response generation subcircuit according to the abnormal identification; An automatic response generation subcircuit is used to generate a response from the endpoint device where the automatic response information agent is located according to the abnormal identification; The response switching control subcircuit is also used to switch the automatic response generation subcircuit to the original response link after the automatic response information is responded.
6. The system according to claim 5, characterized in that Automatic response generation subcircuit, specifically for: When the abnormal identification is a request handshake timeout abnormality, generating a response from the endpoint device where the automatic response information agent corresponding to the read and write request data volume is located; When the abnormal identification is a request response timeout abnormality, generating a response from the endpoint device where the automatic response information agent corresponding to the read and write request data volume is located; When the abnormality is marked as abnormal response data volume, redundant responses corresponding to the read and write requests are truncated and discarded, or responses corresponding to the remaining number of read and write requests are generated to obtain a response from the endpoint device where the automatic response information agent is located.
7. The system according to claim 1, characterized in that The fault recovery device further includes: an abnormal isolation circuit; The abnormal isolation circuit is used to obtain the abnormal reporting request and determine the abnormal functional component according to the abnormal reporting request; when a read or write request is sent to the abnormal functional component, or a response comes from the abnormal functional component, information is discarded.
8. A device exception handling method based on PCIe, characterized in that: The method is applied to the PCIe-based device exception handling system according to any one of claims 1 to 7, and the method comprises: The read and write requests of the endpoint device are monitored through the abnormality monitoring circuit, and when it is determined that an abnormality exists, an abnormality identification is sent to the abnormality reporting circuit and the automatic response circuit; Generate an exception reporting request according to the exception identifier through the endpoint device where the exception reporting circuit is located, and transmit the exception reporting request to the Host processor through the exception reporting circuit; The automatic response circuit generates a response from the endpoint device where the automatic response information agent is located according to the abnormal identification.
9. A fault recovery device, characterized in that: The fault recovery device is applied to the PCIe-based device exception handling system according to any one of claims 1 to 7, and the fault recovery device comprises: an exception monitoring circuit, an exception reporting circuit and an automatic response circuit; wherein: The abnormality monitoring circuit is used to monitor the read and write requests of the endpoint device, and when it is determined that an abnormality exists, send an abnormality identification to the abnormality reporting circuit and the automatic response circuit; The abnormality reporting circuit is used to generate an abnormality reporting request according to the abnormality identifier through the endpoint device where it is located, and transmit the abnormality reporting request to the Host processor; The automatic response circuit is used to generate a response from the endpoint device where the automatic response information agent is located according to the abnormal identification.
10. A computer, characterized in that: The computer includes the PCIe-based device exception handling system as described in any one of claims 1-7.
Citation Information
Cited By
Queue-level automatic answering method and device, equipment and storage medium
CN120508619A