Expansion card repair method, system and device and computer readable storage medium

By detecting the hardware failure information and the number of failures of the expansion card, distinguishing the fault types and performing corresponding repair operations, the business downtime problems caused by expansion card failure are solved, the accuracy and success rate of fault identification and repair are improved, and the server is ensured. Stable operation.

CN119166407APending Publication Date: 2024-12-20INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411282790.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

The prior art is difficult to accurately identify and repair the failure of expansion cards in the server, resulting in service downtime and affecting the stable operation of storage services.

Method used

By detecting the hardware failure information and the number of failures of the expansion card, distinguishing the fault types, and re-initializing and powering up and down operations when the expansion card fails, or repairing the driver to ensure the normal operation of the expansion card.

Benefits of technology

It improves the accuracy of expansion card fault identification and repair success rate, ensures the stable operation of expansion card, and avoids unstable server performance caused by failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166407A_ABST
    Figure CN119166407A_ABST
Patent Text Reader

Abstract

The invention discloses an expansion card repairing method, system and device and a computer readable storage medium, and relates to the technical field of storage, and the method comprises the steps: detecting whether hardware fault information of an expansion card is read or not in response to the situation that a driver cannot read configuration space information of the expansion card; if the hardware fault information of the expansion card is read, detecting whether a reinitialization operation is executed on the expansion card; if the reinitialization operation is executed on the expansion card, performing power-on and power-off operation on the expansion card; if the reinitialization operation is not executed on the expansion card, carrying out the reinitialization operation on the expansion card; if the hardware fault information of the expansion card is not read, repairing the driver; the expansion card comprises an interface card connected between a server mainboard and a hard disk drive. According to the method, the expansion card fault and the driving fault are distinguished through the hardware fault information of the expansion card, so that the fault condition of the expansion card is accurately identified, and the corresponding repair operation is executed to accurately perform fault repair on the expansion card.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and more specifically, to an expansion card repair method, system, device and computer-readable storage medium. Background Art

[0002] Currently, an expansion card is connected between the server motherboard and the hard disk drive to provide better storage performance and data protection for the server system through the expansion card. However, during the operation of the server, the expansion card will inevitably fail, causing business downtime, thus affecting the stable operation of the storage business.

[0003] In summary, how to accurately repair the failure of the expansion card is a problem that needs to be solved urgently by those skilled in the art. Summary of the invention

[0004] The purpose of the present application is to provide an expansion card repair method, which can solve the technical problem of how to accurately repair the expansion card failure to a certain extent. The present application also provides an expansion card repair system, an electronic device and a computer-readable storage medium.

[0005] In order to achieve the above objectives, this application provides the following technical solutions:

[0006] A method for repairing an expansion card, comprising:

[0007] In response to the driver being unable to read the configuration space information of the expansion card, detecting whether hardware fault information of the expansion card is read;

[0008] If the hardware failure information of the expansion card is read, detecting whether a reinitialization operation has been performed on the expansion card;

[0009] If the expansion card has been reinitialized, powering on and off the expansion card;

[0010] If the expansion card has not been re-initialized, re-initialize the expansion card;

[0011] If the hardware fault information of the expansion card is not read, repairing the driver;

[0012] Wherein, the expansion card comprises an interface card connected between a server mainboard and a hard disk drive.

[0013] In an exemplary embodiment, before the power-on and power-off operations on the expansion card, the method further includes:

[0014] Detect whether the expansion card supports power on and off;

[0015] If the expansion card supports power on and off, power on and off the expansion card;

[0016] If the expansion card does not support power on and off, the expansion card is isolated, and prompt information for re-inserting and unplugging the expansion card is generated.

[0017] In an exemplary embodiment, in response to the driver being unable to read the configuration space information of the expansion card, after detecting whether the hardware failure information of the expansion card is read, the method further includes:

[0018] Updating the failure count value of the expansion card;

[0019] Detecting whether the fault number value exceeds a set threshold;

[0020] If the fault count value exceeds the set threshold, the expansion card is isolated, resources used by the expansion card are released, and a prompt message for replacing the expansion card is generated.

[0021] In an exemplary embodiment, it further includes:

[0022] In response to the expansion card being lost due to a link abnormality, obtaining the presence information of the expansion card from a baseboard management controller;

[0023] The presence information is parsed, and if the presence information indicates that the expansion card is in place, powering on and off the expansion card is performed.

[0024] In an exemplary embodiment, it further includes:

[0025] In response to the driver reading the register value of the expansion card being abnormal, the expansion card is powered on and off.

[0026] In an exemplary embodiment, repairing the driver includes:

[0027] Determine a first backup memory mapped to the configuration space address of the expansion card;

[0028] Release the isolation of the first backup memory, and use the mapping relationship between the configuration space address and the first backup memory as the configuration space address mapping result of the driver;

[0029] Determine a second backup memory mapped to the BAR space address of the expansion card;

[0030] Release the isolation of the second backup memory, and use the mapping relationship between the BAR space address and the second backup memory as the BAR space address mapping result of the driver;

[0031] Determine a third backup memory mapped to the register address of the expansion card;

[0032] Release the isolation of the third backup memory, and use the mapping relationship between the register address and the third backup memory as the register address mapping result of the driver;

[0033] Determining a fourth backup memory requested by the driver;

[0034] Release the isolation of the fourth backup memory, and use the fourth backup memory as the DMA address of the driver;

[0035] Migrating the IO instructions of the driver to the DMA address;

[0036] New memories are mapped to the configuration space address, the BAR space address, and the register address, respectively, and the new memories are isolated.

[0037] In an exemplary embodiment, before repairing the driver, the method further includes:

[0038] During the process of the driver initializing the expansion card, the configuration space address is mapped to two memory blocks, and one of the memory blocks is isolated as the first backup memory;

[0039] Mapping the BAR space address to two memory blocks, isolating one of the memory blocks as the second backup memory;

[0040] Mapping the register address to two memory blocks, isolating one of the memory blocks as the third backup memory;

[0041] Two continuous memory blocks are applied for the driver, and one of the memory blocks is isolated as the fourth backup memory.

[0042] An expansion card repair system, comprising:

[0043] A first detection module, configured to detect whether hardware fault information of the expansion card is read in response to the driver being unable to read the configuration space information of the expansion card;

[0044] A second detection module is used to detect whether a reinitialization operation has been performed on the expansion card if hardware fault information of the expansion card is read; if the reinitialization operation has been performed on the expansion card, power on and off the expansion card; if the reinitialization operation has not been performed on the expansion card, reinitialize the expansion card;

[0045] A first repair module, used for repairing the driver if the hardware fault information of the expansion card is not read;

[0046] Wherein, the expansion card comprises an interface card connected between a server mainboard and a hard disk drive.

[0047] An electronic device, comprising:

[0048] Memory for storing computer programs;

[0049] A processor is used to implement the steps of any of the above expansion card repair methods when executing the computer program.

[0050] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above expansion card repair methods are implemented.

[0051] The present application provides an expansion card repair method, in response to a driver being unable to read configuration space information of an expansion card, detecting whether hardware fault information of the expansion card is read; if the hardware fault information of the expansion card is read, detecting whether a reinitialization operation has been performed on the expansion card; if the reinitialization operation has been performed on the expansion card, powering on and off the expansion card; if the reinitialization operation has not been performed on the expansion card, reinitializing the expansion card; if the hardware fault information of the expansion card is not read, repairing the driver; wherein the expansion card includes an interface card connected between a server motherboard and a hard disk drive. In the case where the driver cannot read the configuration space information of the expansion card, the present application distinguishes between the expansion card failure and the driver failure by detecting whether the hardware failure information of the expansion card is read, thereby improving the recognition accuracy of the expansion card failure; and in the case of the expansion card failure, the failure of the expansion card is repaired by first reinitializing the expansion card and then powering on and off, thereby improving the success rate of the failure repair. In the case where the expansion card is not faulty, the driver is repaired to ensure that the driver can operate the expansion card normally, thereby accurately identifying the failure of the expansion card and executing the corresponding repair operation to accurately repair the failure of the expansion card. The expansion card repair system, electronic device and computer-readable storage medium provided by the present application also solve the corresponding technical problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0053] Figure 1 A flowchart of an expansion card repair method provided in an embodiment of the present application;

[0054] Figure 2 This is a schematic diagram for isolating a hot-swap faulty card;

[0055] Figure 3 This is a schematic diagram of isolating the faulty card for node restart;

[0056] Figure 4 This is a schematic diagram for driver repair;

[0057] Figure 5 A schematic diagram for creating backup memory;

[0058] Figure 6 A schematic diagram of the structure of an expansion card repair system provided in an embodiment of the present application;

[0059] Figure 7 Another structural schematic diagram of an expansion card repair system provided by an embodiment of the present application;

[0060] Figure 8 A schematic diagram of repairing a SAS card lost by the repair system;

[0061] Fig. 9 A schematic diagram of repairing abnormal register values ​​of a SAS card by a repair system;

[0062] Fig.10 Schematic diagram of repairing the configuration space anomaly of the SAS card to repair the system

[0063] Fig.11 It is an application flow chart of a data storage device;

[0064] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0065] Fig.13 Another structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0066] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0067] See also Figure 1 , Figure 1 A flowchart of an expansion card repair method provided in an embodiment of the present application.

[0068] An expansion card repair method provided in an embodiment of the present application may include the following steps:

[0069] Step S101: in response to the driver being unable to read the configuration space information of the expansion card, detecting whether the hardware fault information of the expansion card is read; if the hardware fault information of the expansion card is read, executing step S102; if the hardware fault information of the expansion card is not read, executing step S105.

[0070] In actual applications, there are various types of expansion card failures. When the expansion card failure is manifested as the driver being unable to read the configuration idle information of the expansion card, it may be a failure of the expansion card itself or a failure of the expansion card driver. In order to accurately analyze the cause of the failure, it is necessary to further detect whether the hardware failure information of the expansion card is read. Specifically, considering that the hardware failure information of the expansion card is stored in the failure register, the expansion card failure register can be read. If the failure register is empty, it is determined that the hardware failure information of the expansion card is not read. At this time, it can be determined that the expansion card driver is abnormal. Correspondingly, if the failure register is not empty, it is determined that the hardware failure information of the expansion card is read. At this time, it can be determined that the expansion card itself is abnormal.

[0071] It should be noted that the expansion card in the present application refers to an interface card connected between a server motherboard and a hard disk drive, and may specifically be a SAS (Serial Attached SCSI, a storage interface standard based on serial communication technology) card or the like.

[0072] In actual applications, the failure of the expansion card may also be manifested as a link abnormality causing the expansion card to be lost, such as when a PCI link abnormality causes the card to be lost. At this time, the presence information of the expansion card can be obtained from the baseboard management controller (Baseboard Management Controller, BMC); the presence information is parsed, and if the presence information indicates that the expansion card is in place, the expansion card is powered on and off to repair the expansion card through hard repair.

[0073] In actual applications, the failure of the expansion card may also manifest itself as an abnormality in the register value read by the driver of the expansion card. In this case, the expansion card can be powered on and off to repair the expansion card through hard repair.

[0074] It should also be noted that the SAS card driver mainly consists of two parts, the kernel driver and the user-mode driver. The kernel driver is mainly used for mapping registers, configuration space and BAR (Base Address Register) space. The user-mode driver mainly implements IO operations. When the node starts and detects the card, the driver will back up the key resources during initialization. The configuration space is a set of registers in the PCIe device that is used to control the operation and properties of the device. These registers include device ID, vendor ID, interrupt number, etc. By configuring these registers, the control and setting of the device can be achieved. The BAR space is allocated and managed through the PCIe configuration space. Each PCIe device has its own configuration space, which contains a set of BAR registers. These registers are used to inform the operating system and other devices of the resources required by the device, such as memory address range or I / O (Input / Output) port address range. When the operating system initializes the PCIe device, it reads the value of the BAR register and maps the corresponding resources to the system address space so that the application can communicate with the device by accessing these addresses.

[0075] Step S102: Detect whether a re-initialization operation has been performed on the expansion card; if the re-initialization operation has been performed on the expansion card, execute step S103; if the re-initialization operation has not been performed on the expansion card, execute step S104.

[0076] Step S103: Power on and off the expansion card.

[0077] Step S104: reinitialize the expansion card.

[0078] In actual applications, after reading the hardware fault information of the expansion card and determining that the expansion card itself is abnormal, the expansion card can be repaired. In this process, it can be detected whether the expansion card has been soft-repaired, that is, whether the expansion card has been re-initialized; if the expansion card has been re-initialized, the expansion card is directly hard-repaired, that is, the expansion card is directly powered on and off; if the expansion card has not been re-initialized, the expansion card is re-initialized to repair the expansion card fault by combining soft and hard repairs to ensure the success rate of repair. It should be noted that after the expansion card is re-initialized, the effective duration of the re-initialization operation can be flexibly adjusted according to the application scenario, and this application does not make specific restrictions here.

[0079] In specific application scenarios, before powering on and off the expansion card, you can first check whether the expansion card supports power on and off; if the expansion card supports power on and off, then power on and off the expansion card is performed; if the expansion card does not support power on and off, then the expansion card is isolated, and a prompt message is generated to reinsert and unplug the expansion card, so that the expansion card fault can be repaired by reinsert and unplug the expansion card.

[0080] In specific application scenarios, frequent failures of expansion cards will have an adverse impact on the server. In order to avoid this situation, in response to the driver being unable to read the configuration space information of the expansion card, it is detected whether the hardware failure information of the expansion card is read. Specifically, the failure count value of the expansion card can be updated after the expansion card is powered on and off or reinitialized; it is detected whether the failure count value exceeds a set threshold, and the set threshold can be flexibly determined according to actual needs; if the failure count value exceeds the set threshold, the expansion card is isolated to release the resources used by the expansion card, and a prompt message for replacing the expansion card is generated to avoid repeated use of failure-prone expansion cards by replacing the expansion card, thereby ensuring the performance stability of the server.

[0081] It should be noted that the failure count value of the expansion card refers to the cumulative number of failures of the expansion card, and the cumulative duration of the failure count value of the expansion card can be determined according to actual needs. And in specific application scenarios, when there are a large number of expansion cards on the server, the serial number (SN) and the failure count value of the expansion card can be stored accordingly, so that the failure count value of the corresponding expansion card can be quickly and accurately found through the serial number. In addition, in response to the driver being unable to read the configuration space information of the expansion card, the failure count value of the expansion card can also be updated first, and when the failure count value does not exceed the set threshold, the operation of detecting whether the hardware failure information of the expansion card is read is performed, etc. This application does not make specific restrictions here.

[0082] It should also be noted that the solution of isolating expansion cards according to the number of faults can be applied to the scenario of isolating hot-swappable faulty cards, such as Figure 2 As shown, the following steps may be included: inserting an expansion card on the server; the driver obtains the serial number of the current expansion card through the BMC; obtaining the fault count value of the current expansion card according to the serial number; detecting whether the fault count value is obtained, if not, the current expansion card is initialized normally, and if so, detecting whether the fault count value exceeds a set threshold; if it exceeds the set threshold, isolating and prohibiting the use of the current expansion card, releasing the resources used by the current expansion card, reporting an alarm, and suggesting replacing a new expansion card; if it does not exceed the set threshold, the current expansion card is initialized normally.

[0083] Of course, the solution of isolating expansion cards according to the number of failures can be applied to the scenario of isolating the faulty card when the server node restarts, such as Figure 3As shown, the following steps may be included: the business starts after the node is restarted; the driver discovers the expansion card and executes the driver initialization; the driver obtains the serial number of the current expansion card through the BMC; obtains the fault count value of the current expansion card according to the serial number; detects whether the fault count value is obtained, if not, initializes the current expansion card normally, and if so, detects whether the fault count value exceeds a set threshold; if it exceeds the set threshold, isolates and prohibits the use of the current expansion card, releases the resources used by the current expansion card, reports an alarm, and recommends replacing a new expansion card; if it does not exceed the set threshold, initializes the current expansion card normally.

[0084] In a specific application scenario, in the process of detecting whether a reinitialization operation has been performed on an expansion card, the real-time number of times the driver cannot read the configuration space information of the expansion card can be accumulated; in the set duration queue, the real-time number of times the preset duration is obtained starting from the head; the obtained real-time number of times the preset duration is added together to obtain the target duration; it is detected whether a reinitialization operation has been performed on the expansion card within the target duration before the current moment, and if so, it is determined that a reinitialization operation has been performed on the expansion card, and if not, it is determined that a reinitialization operation has not been performed on the expansion card; and in the set duration queue, the later the preset duration is, the shorter it is.

[0085] From this implementation process, it can be seen that the present application sets up a duration queue, and in the duration queue, the later the position of the preset duration is, the shorter it is. In this way, after accumulating the real-time number of times when the driver cannot read the configuration space information of the expansion card, in the set duration queue, the real-time number of preset durations are obtained from the head, and the obtained real-time number of preset durations are added to obtain the target duration. Although the target duration increases with the increase of the real-time number, the increase of the target duration becomes smaller and smaller and tends to be stable, so that the target duration is less affected by the real-time number, thereby ensuring the rationality of the target duration. In this way, when detecting whether the expansion card has been reinitialized within the target duration before the current moment, the real-time number of times when the driver cannot read the configuration space information of the expansion card is referred to, and the real-time number of times that affect the detection result too much is avoided, making the process of detecting whether the reinitialization operation has been performed on the expansion card more reasonable, thereby improving the rationality and effectiveness of repairing the expansion card through the reinitialization operation.

[0086] Step S105: Repair the driver.

[0087] In actual applications, after the hardware fault information of the expansion card is not read, it can be considered that the driver of the expansion card is abnormal, and the expansion card can be made to work normally by repairing the driver of the expansion card.

[0088] In practical applications, such as Figure 4As shown, in the process of repairing the driver, the first backup memory mapped by the configuration space address of the expansion card can be determined; the isolation of the first backup memory is released, and the mapping relationship between the configuration space address and the first backup memory is used as the configuration space address mapping result of the driver; the second backup memory mapped by the BAR space address of the expansion card is determined; the isolation of the second backup memory is released, and the mapping relationship between the BAR space address and the second backup memory is used as the BAR space address mapping result of the driver; the third backup memory mapped by the register address of the expansion card is determined; the isolation of the third backup memory is released, and the mapping relationship between the register address and the third backup memory is used as the register address mapping result of the driver; the fourth backup memory applied by the driver is determined; the isolation of the fourth backup memory is released, and the fourth backup memory is used as the DMA (Direct Memory Access) address of the driver, so that the driver can directly send data to the memory corresponding to this DMA address without the help of the central processing unit, and then the driver can be notified that the repair is completed, and the driver normally executes the migrated IO operation to ensure that the original IO operation continues to be executed; the driver's IO instructions are migrated to the DMA address; new memories are mapped to the configuration space address, BAR space address and register address respectively, and the new memories are isolated.

[0089] From this implementation process, it can be seen that the present application takes into account that the essence of the driver initialization expansion card is to establish a mapping relationship between the memory and the configuration space address, BAR space address, register address and DMA address. Therefore, the corresponding backup memory is set and isolated for the configuration space address, BAR space address, register address and DMA address in advance. In this way, when the driver is normal, the expansion card can be operated through the currently used memory. When the driver is abnormal, the isolation of the backup memory can be released so that the backup memory can be used normally. Then, the backup memory is used as the mapping result of the corresponding address of the expansion card, and the IO instructions of the driver are migrated to the DMA address, so that the driver can operate the expansion card normally through the backup memory, thereby resolving the abnormal situation that the driver cannot read the configuration space information of the expansion card. On this basis, new memory is also mapped for the configuration space address, BAR space address and register address, and the new memory is isolated to ensure that the driver still has backup memory to replace, which is convenient for the next abnormal repair of the driver. In addition, compared with the original solution for initializing the expansion card, the original solution for initializing the expansion card will stop the related IO operations, that is, the ongoing IO operation returns failure, which will cause a brief interruption in the business. However, through this solution, when a problem occurs in the driver, the remapped memory is directly used, and the IO is directly switched to the new DMA memory. There is no need to initialize the driver, nor to stop the related IO operations, and there will be no IO interruption problem. The driver failure can be repaired without the user noticing.

[0090] In specific application scenarios, when the driver initializes the expansion card, a corresponding backup memory can be created for the expansion card, such as Figure 5 As shown, that is, before repairing the driver, in the process of initializing the expansion card of the driver, the configuration space address can be mapped to two blocks of memory, one of which is isolated as the first backup memory, and the other is used as the memory currently used by the driver to operate the configuration space address; the BAR space address is mapped to two blocks of memory, one of which is isolated as the second backup memory, and the other is used as the memory currently used by the driver to operate the BAR space address; the register address is mapped to two blocks of memory, one of which is isolated as the third backup memory, and the other is used as the memory currently used by the driver to operate the register address; two continuous blocks of memory are applied for the driver, one of which is isolated as the fourth backup memory, and the other is used as the DMA address currently used by the driver to process IO. In other words, in the process of the driver's initial initialization of the expansion card, the corresponding address can be mapped to two blocks of memory to obtain the backup memory, and after the initialization is completed, the new memory can be directly mapped to the corresponding address to obtain the backup memory.

[0091] The present application provides an expansion card repair method, in response to a driver being unable to read configuration space information of an expansion card, detecting whether hardware fault information of the expansion card is read; if the hardware fault information of the expansion card is read, detecting whether a reinitialization operation has been performed on the expansion card; if the reinitialization operation has been performed on the expansion card, powering on and off the expansion card; if the reinitialization operation has not been performed on the expansion card, reinitializing the expansion card; if the hardware fault information of the expansion card is not read, repairing the driver; wherein the expansion card includes an interface card connected between a server motherboard and a hard disk drive. In the case where the driver cannot read the configuration space information of the expansion card, the present application distinguishes between an expansion card failure and a driver failure by detecting whether the hardware failure information of the expansion card is read, thereby improving the accuracy of identifying the expansion card failure; and in the case of an expansion card failure, the expansion card failure is repaired by first reinitializing the expansion card and then powering on and off, thereby improving the success rate of fault repair; in the case where the expansion card has no failure, the driver is repaired to ensure that the driver can operate the expansion card normally, thereby achieving accurate identification of the expansion card failure and executing corresponding repair operations to accurately repair the expansion card failure.

[0092] See also Figure 6 , Figure 6 A schematic diagram of the structure of an expansion card repair system provided in an embodiment of the present application.

[0093] An expansion card repair system provided in an embodiment of the present application may include:

[0094] The first detection module 101 is used to detect whether hardware fault information of the expansion card is read in response to the driver being unable to read the configuration space information of the expansion card;

[0095] The second detection module 102 is used to detect whether a reinitialization operation has been performed on the expansion card if the hardware fault information of the expansion card is read; if the reinitialization operation has been performed on the expansion card, power on and off the expansion card; if the reinitialization operation has not been performed on the expansion card, reinitialize the expansion card;

[0096] The first repair module 103 is used to repair the driver if the hardware fault information of the expansion card is not read;

[0097] The expansion card includes an interface card connected between the server mainboard and the hard disk drive.

[0098] An expansion card repair system provided in an embodiment of the present application can further detect whether the expansion card supports power on and off before the second detection module performs power on and off operations on the expansion card; if the expansion card supports power on and off, the expansion card is powered on and off; if the expansion card does not support power on and off, the expansion card is isolated and a prompt message is generated for re-inserting and unplugging the expansion card.

[0099] An expansion card repair system provided in an embodiment of the present application may further include:

[0100] A first updating module, configured to update the failure count value of the expansion card after detecting whether hardware failure information of the expansion card is read in response to the first detection module failing to read the configuration space information of the expansion card;

[0101] The third detection module is used to detect whether the fault count value exceeds a set threshold; if the fault count value exceeds the set threshold, the expansion card is isolated, the resources used by the expansion card are released, and a prompt message for replacing the expansion card is generated.

[0102] An expansion card repair system provided in an embodiment of the present application may further include:

[0103] The second repair module is used to obtain the presence information of the expansion card from the baseboard management controller in response to the expansion card being lost due to link abnormality; parse the presence information, and if the presence information indicates that the expansion card is in place, power on and off the expansion card.

[0104] An expansion card repair system provided in an embodiment of the present application may further include:

[0105] The third repair module is used to perform power on and off operations on the expansion card in response to an abnormality in the register value read by the driver for the expansion card.

[0106] An expansion card repair system provided by an embodiment of the present application, wherein the first repair module may include:

[0107] A first determining unit, used to determine a first backup memory mapped to the configuration space address of the expansion card;

[0108] A first processing unit, used for releasing the isolation of the first backup memory, and using the mapping relationship between the configuration space address and the first backup memory as the configuration space address mapping result of the driver;

[0109] A second determining unit, used to determine a second backup memory mapped to the BAR space address of the expansion card;

[0110] The second processing unit is used to release the isolation of the second backup memory and use the mapping relationship between the BAR space address and the second backup memory as the BAR space address mapping result of the driver;

[0111] A third determining unit, used to determine a third backup memory mapped by a register address of the expansion card;

[0112] A third processing unit, used for releasing the isolation of the third backup memory, and using the mapping relationship between the register address and the third backup memory as the register address mapping result of the driver;

[0113] A fourth determining unit, used for determining a fourth backup memory requested by the driver;

[0114] A fourth processing unit, used for releasing the isolation of the fourth backup memory and using the fourth backup memory as a DMA address of the driver;

[0115] A first migration unit, used for migrating the driver's IO instructions to a DMA address;

[0116] The first mapping unit is used to map new memories for configuration space addresses, BAR space addresses and register addresses respectively, and isolate the new memories.

[0117] An expansion card repair system provided in an embodiment of the present application may further include:

[0118] A first mapping module is used for mapping the configuration space address to two memory blocks and isolating one of the memory blocks as a first backup memory during the process of the driver initializing the expansion card before the first repair module repairs the driver;

[0119] A second mapping module is used to map the BAR space address to two memory blocks, and isolate one of the memory blocks as a second backup memory;

[0120] A third mapping module is used to map the register address to two memory blocks, and isolate one of the memory blocks as a third backup memory;

[0121] The first application module is used to apply for two continuous memory blocks for the driver, and isolate one of the memory blocks as the fourth backup memory.

[0122] It should be noted that the structure of the expansion card repair system in the present application can be flexibly adjusted according to actual needs. Taking the expansion card as a SAS card as an example, the repair system can be as follows: Figure 7 As shown, it includes a fault detection device, a fault alarm device, a fault repair device, a data storage device and an equipment isolation device; the fault detection device is responsible for detecting the operating state of the SAS card and judging whether the current SAS card has a fault; the fault alarm device is used to report a SAS card fault alarm when the SAS card fails or the number of SAS card faults exceeds a threshold when the service is started; the fault repair device is responsible for performing soft repair or hard repair according to the fault type of the SAS card; the data storage device is responsible for storing the serial number and the number of faults of the current SAS card; the equipment isolation device: when the SAS card fault repair fails or the number of SAS card faults exceeds a threshold, the SAS card is isolated and disabled, and all resources used by the SAS card are released.

[0123] In a specific application scenario, the process of repairing the SAS card by the repair system can be as follows: Figure 8 , 9 As shown in 10, the fault detection device detects that the SAS card is lost, the fault alarm device reports a fault alarm, the fault detection device obtains whether the SAS card is in place from the BMC, detects whether the SAS card is in place, and if so, sends a hard repair signal to the fault repair module, the fault repair module detects whether the SAS card supports power on and off, and if so, the fault repair device performs power on and off repair on the card. Alternatively, the fault detection device reads the SAS card register value, finds that the SAS card has a fault, sends a hard repair signal to the fault repair module, the fault alarm device reports a fault alarm, the fault repair module detects whether the SAS card supports power on and off, and if so, the fault repair device performs power on and off repair on the card, and if not, isolates and disables the card. Alternatively, the fault detection device finds that the SAS card configuration space information cannot be read, the fault alarm device reports a fault alarm, the fault detection device sends a soft repair signal, the fault repair module receives the soft repair signal, and detects whether the SAS card has been soft-repaired. If not, the fault repair module performs soft repair to detect whether the problem is repaired. If not, the steps after the fault detection device finds that the SAS card configuration space information cannot be read are executed. If soft repair has been performed, it is detected whether the SAS card supports power on and off. If supported, the fault repair device performs power on and off repair on the card. If not, the card is isolated and disabled, and an alarm that the card cannot be repaired normally is reported.

[0124] In specific application scenarios, the application of data storage devices can be as follows: Fig.11As shown, a fault detection device detects a SAS card fault and sends a repair signal to a fault repair device. After the fault repair device detects the repair signal, it notifies the data storage device to update the number of faults of the card. After receiving the signal, the data storage device obtains the serial number of the current card through the BMC, traverses the data storage pool, and obtains the number of faults of the current card from the data storage pool according to the serial number of the current card. It detects whether the number of faults of the current card is obtained. If the number of faults of the current card is obtained, the number of faults of the card is increased by 1 and updated to the data storage pool; if the number of faults of the current card is not obtained, the number of faults of the serial number of the card is set to 1 and updated to the data storage pool.

[0125] The present application also provides an electronic device and a computer-readable storage medium, both of which have the corresponding effects of the expansion card repair method provided in the embodiment of the present application. Fig.12 , Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0126] An electronic device provided in an embodiment of the present application includes a memory 201 and a processor 202. The memory 201 stores a computer program. When the processor 202 executes the computer program, the steps of the expansion card repair method described in any of the above embodiments are implemented.

[0127] See also Fig.13 , another electronic device provided in the embodiment of the present application may also include: an input port 203 connected to the processor 202, for transmitting commands input from the outside to the processor 202; a display unit 204 connected to the processor 202, for displaying the processing results of the processor 202 to the outside; a communication module 205 connected to the processor 202, for realizing communication between the electronic device and the outside. The display unit 204 can be a display panel, a laser scanning display, etc.; the communication method adopted by the communication module 205 includes but is not limited to mobile high-definition link technology (Mobile High-Definition Link, MHL), Universal Serial Bus (Universal Serial Bus, USB), High-Definition Multimedia Interface (High-DefinitionMultimedia Interface, HDMI), wireless connection: wireless fidelity technology (WIreless Fidelity, WiFi), Bluetooth communication technology, low-power Bluetooth communication technology, and communication technology based on IEEE802.11s.

[0128] An embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the expansion card repair method described in any of the above embodiments are implemented.

[0129] The computer-readable storage medium involved in this application includes random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs (Compact Disc Read-Only Memory), or any other form of storage medium known in the technical field.

[0130] A computer program product provided in an embodiment of the present application includes a computer program / instruction, which, when executed by a processor, implements the steps of the expansion card repair method described in any of the above embodiments.

[0131] For the description of the relevant parts of an expansion card repair system, electronic device, computer-readable storage medium, and computer program product provided in the embodiments of the present application, please refer to the detailed description of the corresponding parts in an expansion card repair method provided in the embodiments of the present application, which will not be repeated here. In addition, the parts of the above technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive elaboration.

[0132] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0133] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for repairing an expansion card, It is characterized in that include: In response to the driver being unable to read the configuration space information of the expansion card, detecting whether hardware fault information of the expansion card is read; If the hardware failure information of the expansion card is read, detecting whether a reinitialization operation has been performed on the expansion card; If the expansion card has been reinitialized, powering on and off the expansion card; If the expansion card has not been re-initialized, re-initialize the expansion card; If the hardware fault information of the expansion card is not read, repairing the driver; Wherein, the expansion card comprises an interface card connected between a server mainboard and a hard disk drive.

2. The method according to claim 1, It is characterized in that Before the expansion card is powered on and off, the method further includes: Detect whether the expansion card supports power on and off; If the expansion card supports power on and off, power on and off the expansion card; If the expansion card does not support power on and off, the expansion card is isolated, and prompt information for re-inserting and unplugging the expansion card is generated.

3. The method according to claim 1, It is characterized in that In response to the driver being unable to read the configuration space information of the expansion card, after detecting whether the hardware failure information of the expansion card is read, the method further includes: Updating the failure count value of the expansion card; Detecting whether the fault number value exceeds a set threshold; If the fault count value exceeds the set threshold, the expansion card is isolated, resources used by the expansion card are released, and a prompt message for replacing the expansion card is generated.

4. The method according to claim 1, It is characterized in that Also includes: In response to the expansion card being lost due to a link abnormality, obtaining the presence information of the expansion card from a baseboard management controller; The presence information is parsed, and if the presence information indicates that the expansion card is in place, powering on and off the expansion card is performed.

5. The method according to claim 1, It is characterized in that Also includes: In response to the driver reading the register value of the expansion card being abnormal, the expansion card is powered on and off.

6. The method according to claim 1, It is characterized in that The repairing of the driver comprises: Determine a first backup memory mapped to the configuration space address of the expansion card; Release the isolation of the first backup memory, and use the mapping relationship between the configuration space address and the first backup memory as the configuration space address mapping result of the driver; Determine a second backup memory mapped to the BAR space address of the expansion card; Release the isolation of the second backup memory, and use the mapping relationship between the BAR space address and the second backup memory as the BAR space address mapping result of the driver; Determine a third backup memory mapped to the register address of the expansion card; Release the isolation of the third backup memory, and use the mapping relationship between the register address and the third backup memory as the register address mapping result of the driver; Determining a fourth backup memory requested by the driver; Release the isolation of the fourth backup memory, and use the fourth backup memory as the DMA address of the driver; Migrating the IO instructions of the driver to the DMA address; New memories are mapped to the configuration space address, the BAR space address, and the register address, respectively, and the new memories are isolated.

7. The method according to claim 6, It is characterized in that Before repairing the driver, the method further includes: During the process of the driver initializing the expansion card, the configuration space address is mapped to two memory blocks, and one of the memory blocks is isolated as the first backup memory; Mapping the BAR space address to two memory blocks, isolating one of the memory blocks as the second backup memory; Mapping the register address to two memory blocks, isolating one of the memory blocks as the third backup memory; Two continuous memory blocks are applied for the driver, and one of the memory blocks is isolated as the fourth backup memory.

8. An expansion card repair system, It is characterized in that include: A first detection module, configured to detect whether hardware fault information of the expansion card is read in response to the driver being unable to read the configuration space information of the expansion card; A second detection module is used to detect whether a reinitialization operation has been performed on the expansion card if hardware fault information of the expansion card is read; if the reinitialization operation has been performed on the expansion card, power on and off the expansion card; if the reinitialization operation has not been performed on the expansion card, reinitialize the expansion card; A first repair module, used for repairing the driver if the hardware fault information of the expansion card is not read; Wherein, the expansion card comprises an interface card connected between a server mainboard and a hard disk drive.

9. An electronic device, It is characterized in that include: Memory for storing computer programs; A processor, configured to implement the steps of the expansion card repair method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the expansion card repair method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Expansion card monitoring method and device, electronic equipment and storage medium

    CN120429202A

  • Expansion chip repairing method and device, electronic equipment and storage medium

    CN120492211A

  • Method, device, electronic device and storage medium for repairing expansion chips

    CN120492211B