PCIE device scanning method and server

Through the collaboration between BIOS and BMC, the status information of the PCIE device is obtained, which solves the identification delay problem caused by the failure of the PCIE device to be initialized during the server startup process, and improves the startup efficiency.

CN115658582BActive Publication Date: 2025-08-15XFUSION DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211251098.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-13
Publication Date
2025-08-15
Estimated Expiration
2042-10-13

AI Technical Summary

Technical Problem

During the server startup process, the BIOS cannot recognize the PCIE device because it has not been initialized, resulting in a longer scan time and affecting the startup efficiency.

Method used

Working in collaboration with BMC through BIOS, first obtain the status information of the PCIE device, determine whether it is initialized, wait accurately or scan in advance, and reduce invalid waiting time.

Benefits of technology

It realizes accurate identification of PCIE devices without extending the server startup time, improving startup efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115658582B_ABST
    Figure CN115658582B_ABST
Patent Text Reader

Abstract

A PCIE device scanning method, the method may include: obtaining an identifier of an adapter card on a server; when the identifier of the adapter card matches an identifier pre-stored on the server, obtaining status information of a PCIE device inserted into the adapter card, the status information being used to indicate whether the PCIE device has completed initialization; and when the PCIE device has completed initialization, starting a PCIE device scan. Before performing a PCIE device scan, first obtain the presence and initialization status of a PCIE device that takes a long time to initialize. Then, determine the time to start scanning the PCIE device based on the presence and initialization status of the acquired PCIE device. While ensuring that the PCIE device can be accurately identified, time is not wasted waiting for the initialization of a PCIE device that takes a long time to start, thereby reducing the startup time of the server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of servers, and in particular to a PCIE device scanning method and a server. Background Art

[0002] As the high-speed peripheral component interconnect express (PCIE) systems deployed on servers become increasingly complex, the time it takes to boot up (initialize) the PCIE device system during server startup is also increasing. When the PCIE device system and the server are powered on together, the server's basic input / output system (BIOS) may not have completed initialization when it begins scanning for PCIE devices, causing the BIOS to fail to recognize the PCIE devices. Summary of the Invention

[0003] The present application provides a PCIE device scanning method and server, which avoids wasting time waiting for the initialization of PCIE devices with long startup times during server startup, thereby reducing the server startup time.

[0004] In a first aspect, the present application provides a PCIE device scanning method, which is applied to a server, and the server includes a BIOS and a BMC. The method includes: during the server startup process, the BIOS sends a query instruction to the BMC, and the query instruction is used to instruct the BMC to obtain the status information of the target PCIE device; the BMC responds to the query instruction, scans the adapter card connected to the server, and determines whether the target adapter card exists based on the scan result; when the BMC scans and finds that the target adapter card exists, the BMC obtains the status information of the target PCIE device inserted in the target adapter card, and the status information is used to indicate whether the target PCIE device has completed initialization; the BMC sends the status information of the target PCIE device to the BIOS; the BIOS determines whether to start PCIE device scanning based on the status information of the target PCIE device.

[0005] That is, before scanning PCIE devices on a server, the BIOS first determines whether a PCIE device with a long initialization time is present by checking whether a matching adapter card is connected to the server. If the PCIE device with a long initialization time is present, the BIOS obtains its initialization status. Once the initialization of the PCIE device with a long initialization time is complete, the BIOS initiates a PCIE device scan. This allows the server to wait accurately when scanning PCIE devices, reducing wait time and thus shortening server startup time.

[0006] In one possible implementation, before the BMC obtains the status information of the target PCIE device inserted in the target adapter card, the method further includes: the BMC obtains the identifier of the target PCIE device inserted in the target adapter card; when the identifier of the target PCIE device inserted in the target adapter card is obtained, the BMC obtains the status information of the target PCIE device inserted in the target adapter card.

[0007] That is to say, when the BIOS determines through the BMC whether a PCIE device with a long initialization time is connected to an electronic device, in order to avoid the situation where an adapter card corresponding to the PCIE device with a long initialization time is connected to the server, but there is no PCIE device inserted in the adapter card, after the BMC determines that an adapter card corresponding to the PCIE device with a long initialization time is connected to the electronic device, it also needs to continue to obtain the identification of the PCIE device with a long initialization time, such as the hardware ID. Only after obtaining the hardware ID of the PCIE device with a long initialization time can the BMC determine that the PCIE device with a long initialization time is connected to the electronic device.

[0008] In a possible implementation, the method further includes: when the identifier of the target PCIE device inserted into the target adapter card is not obtained, the BMC triggers the BIOS to start a PCIE device scan.

[0009] That is to say, if BMC does not obtain the identification of the target PCIE device, BMC can determine that the target PCIE device is not in place. At this time, BMC can directly trigger BIOS to start PCIE device scanning, reducing the startup time of the server.

[0010] In one possible implementation, the BMC responds to a query instruction, scans an adapter card connected to the server, and determines whether a target adapter card exists based on the scan result, including: the BMC scans the adapter card connected to the server to obtain an identifier of the adapter card connected to the server; the BMC matches the obtained identifier of the adapter card with an identifier of the adapter card stored in the BMC; if the match is successful, the BMC determines that the target adapter card is connected to the server.

[0011] That is, when determining whether the target riser card is connected to the server, the BMC may determine whether the riser cards connected to the server include the target riser card by obtaining identifiers of the riser cards connected to the server.

[0012] In one possible implementation, the BIOS determines whether to start a PCIE device scan based on the status information of the target PCIE device, including: if the BIOS determines that the initialization of the target PCIE device is complete, the BIOS starts the PCIE device scan; if the BIOS determines that the initialization of the target PCIE device is not complete, the BIOS obtains the status information of the target PCIE device after a preset time period, and decides whether to start the PCIE device scan based on the status information of the PCIE device.

[0013] That is to say, when the BIOS identifies that a PCIE device with a long initialization time is connected to the server and the PCIE device with a long initialization time has not completed initialization, the BIOS can continue to obtain the initialization status of the PCIE device with a long initialization time after waiting for a period of time, so as to ensure that the BIOS can immediately perform PCIE device scanning after the initialization of the PCIE device with a long initialization time is completed, so as to achieve accurate waiting.

[0014] In a possible implementation, the method further includes: when the BMC scans and detects the presence of a target adapter card, if the status information of the target PCIE device inserted in the target adapter card is not obtained within a first time threshold, the BIOS initiates a PCIE device scan.

[0015] That is, before the BIOS performs a PCIE device scan, in order to avoid the BIOS waiting indefinitely when an exception occurs in a PCIE device with a long initialization time, a first time threshold needs to be pre-set. If the BIOS obtains the status information of the PCIE with a long initialization time within the first time threshold, the BIOS can determine whether to start the PCIE scan based on the obtained status information of the PCIE with a long initialization time. If the BIOS does not obtain the status information of the PCIE device with a long initialization time within the first time threshold, the BIOS can also start the PCIE device scan.

[0016] In a possible implementation, the method further includes: when the BMC fails to scan the target adapter card, the BMC triggers the BIOS to start a PCIE device scan.

[0017] That is, when the BMC does not obtain the adapter card corresponding to the PCIE device with a longer initialization time, the BMC can determine that the PCIE device with a longer initialization time is not in place. At this time, the BIOS can directly start the PCIE device scan.

[0018] In one possible implementation, the BMC obtains status information of a target PCIE device inserted into a target adapter card, including: the BMC obtains the initialization status of the target PCIE device by obtaining information stored in any one of a general input / output port, a complex programmable logic device, and a register on the target PCIE device.

[0019] That is to say, after the target adapter card is initialized, it can present the initialization state through the general input / output port, complex programmable logic device or register on the target PCIE device.

[0020] In a possible implementation, the target PCIE device is connected to the server via a high-speed cable.

[0021] That is to say, in addition to being plugged into a server, the target PCIE device can also be a PCIE device that is independent of the server, powered on separately, and connected to the server via a high-speed cable.

[0022] In a second aspect, the present application provides a server, including: BIOS and BMC,

[0023] During server startup, the BIOS sends a query command to the BMC, which instructs the BMC to obtain the status information of the target PCIE device.

[0024] In response to the query instruction, the BMC scans the adapter card connected to the server and determines whether the target adapter card exists based on the scan result. If the BMC scans and finds the target adapter card exists, the BMC obtains the status information of the target PCIE device inserted in the target adapter card. The status information is used to indicate whether the target PCIE device has completed initialization.

[0025] BMC is also used to send the status information of the target PCIE device to BIOS;

[0026] The BIOS is further configured to determine whether to start a PCIE device scan based on the status information of the target PCIE device.

[0027] In a third aspect, the present application provides an electronic device, characterized in that it includes:

[0028] at least one memory for storing a program;

[0029] At least one processor is used to execute the program stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method described in the first aspect or any possible implementation of the first aspect.

[0030] In a fourth aspect, the present application provides a computer-readable medium, in which instructions are stored. When the instructions are executed on a computer, the computer executes the method described in the first aspect or any possible implementation of the first aspect.

[0031] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computer, causes the computer to execute the method described in the first aspect or any possible implementation of the first aspect.

[0032] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions of 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 paying any creative work.

[0034] Figure 1 A schematic diagram of the structure of a server provided in an embodiment of the present application;

[0035] Figure 2 A schematic diagram of a PCIE device scanning method provided in an embodiment of the present application;

[0036] Figure 3 Schematic diagram of a flow chart of another PCIE device scanning method provided in an embodiment of the present application;

[0037] Figure 4 Schematic diagram of a flow chart of another PCIE device scanning method provided in an embodiment of the present application;

[0038] Figure 5 A schematic diagram of the structure of an identification device provided in an embodiment of the present application;

[0039] Figure 6 A schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.

[0041] In the description of the embodiments of this application, any embodiment or design scheme using "exemplary," "for example," or "for example" should not be understood as being more preferred or advantageous than other embodiments or designs. Rather, the use of words such as "exemplary," "for example," or "for example" is intended to present the relevant concepts in a concrete manner.

[0042] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly identifying the technical features being referred to. Thus, features specified as "first" or "second" may explicitly or implicitly include one or more of such features. The terms "include," "comprising," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.

[0043] PCIE is a high-speed serial point-to-point dual-channel, high-bandwidth transmission technology. Connected devices are allocated exclusive channel bandwidth and do not share bus bandwidth. It primarily supports active power management, error reporting, end-to-end reliable transmission, hot-swapping, and quality of service. Complex computer systems, such as servers, often utilize PCIE devices. Common PCIE devices include network cards, graphics cards, and host bus adapters (HBAs).

[0044] When a PCIE device is deployed on a server, during the server startup process, according to the PCIE protocol, after the server starts, the PCIE device must also meet certain startup time requirements (for example, complete PCIE device initialization within 100ms after power-on). If the PCIE device is not initialized before the server performs a PCIE scan, the server's BIOS may not recognize the PCIE device when scanning for PCIE devices.

[0045] In the related art, since the BIOS and PCIE devices are independent systems, the BIOS cannot sense whether the PCIE device has completed initialization. Therefore, in order to ensure that PCIE devices with long initialization times can be scanned, the BIOS will choose to wait for a long fixed time before scanning the PCIE devices. This will extend the BIOS startup time, thereby extending the startup time of the entire system.

[0046] In view of this, an embodiment of the present application provides a PCIE device scanning method, which is mainly applied to a server, and is aimed at the identification process of PCIE devices with a long initialization time, such as type A, during the server startup process by the BIOS. While ensuring that the BIOS can accurately identify the PCIE device, it can also avoid wasting time waiting for the initialization of the PCIE device with a long startup time, thereby achieving accurate waiting time and reducing the startup time of the BIOS. It is understandable that the type A PCIE device, i.e., the PCIE device with a long initialization time, is determined by the PCIE device itself or set by the user or manufacturer. In some cases, during the production equipment stage of the server, the manufacturer needs to write the hardware information (e.g., hardware ID) of the type A PCIE device into the firmware of the baseboard management controller (BMC), that is, establish a whitelist of type A PCIE devices in the BMC firmware, so that the server can determine whether the PCIE device is a type A PCIE device based on whether the hardware information of the PCIE device inserted into the server is in the whitelist. When the type A PCIE device is connected to the server, a dedicated adapter card, i.e., a dedicated riser card, is required. Among them, the dedicated riser card is also pre-designated by the manufacturer. After the user designates a certain type of riser card as a dedicated riser card, during the production and equipment stage of the server, the manufacturer needs to write the hardware information of the dedicated riser card (for example, the hardware ID) into the BMC firmware and establish a whitelist of dedicated riser cards in the BMC firmware. Alternatively, during use, the user can add the hardware information of the Type A PCIE device and / or the hardware information of the riser card to the server's BMC as needed, that is, the user can modify, add, delete, and other operations on the whitelist of Type A PCIE devices and / or the whitelist of riser cards in the BMC, without any restrictions.

[0047] It is understandable that the Type A PCIE device is not necessarily a device plugged into the server, but can also be a PCIE device that is independent of the server, powered on separately, and connected to the server via a high-speed cable.

[0048] For example, Figure 1 A schematic diagram of the structure of a server is shown. Figure 1As shown, a server includes the BIOS, riser card, BMC, and PCIe devices. The BIOS is a set of programs embedded in a ROM chip on the server's internal motherboard. It stores the computer's (server's) most important basic input and output programs, system settings, post-boot self-test programs, and system startup programs. Its primary function is to provide the computer with the lowest-level, most direct hardware configuration and control. A riser card, also known as a PCIe riser card, generally refers to a function expansion card or adapter card that plugs into a PCIe interface. It is a new generation of bus interfaces. For example, a server motherboard may provide a relatively long slot (a non-standard PCIe interface) into which a riser card plugs. The riser card also provides one or several standard PCIe slots, allowing various PCIe devices (such as network cards, HBAs, and graphics cards) to be plugged into the server. The BMC is a control unit deployed on the server's internal motherboard with an independent power supply and independent I / O interfaces. It operates independently of the server's processor, BIOS, or operating system and is an agentless management subsystem that runs independently within the server.

[0049] The BIOS communicates with the BMC via the enhanced serial peripheral (ESPI) bus. The BMC communicates with the riser card via the inter-integrated circuit (I2C) bus to read riser card information and identify whether the riser card is dedicated to a PCIE device. The BMC reads the hardware ID or initialization information of the PCIE device through the general-purpose I / O ports (GPIO). Alternatively, the BMC obtains the ID or initialization information of the PCIE device by reading the pin signals of the PCA9555 via the I2C bus. Alternatively, the BMC obtains the ID or initialization information of the PCIE device by reading the information in the complex programmable logic device (CPLD) via the I2C bus. The PCIE device communicates with the riser card via the I2C bus.

[0050] Next, based on the above description, a PCIE device scanning method provided in an embodiment of the present application is introduced.

[0051] See also Figure 2 , Figure 2 This is a flow chart of a PCIE device scanning method provided by an embodiment of the present application. Figure 2 As shown, the method includes: S201-S207.

[0052] S201: Before scanning the PCIE device, the BIOS triggers the BMC to obtain status information of the A-type PCIE device.

[0053] In this embodiment, during the server startup process, the BIOS, BMC, and PCIE devices are powered on, essentially starting the BIOS, BMC, and PCIE devices. BIOS startup first involves the POST process, device initialization, and system boot. Specifically, this initializes the hardware devices and establishes a memory space map for the system, thereby bringing the system's hardware and software environment to an appropriate state to prepare the correct environment for the final call to the operating kernel. Ultimately, the boot loader loads the operating system kernel image into random access memory (RAM) and transfers system control to it. Therefore, the BIOS needs to identify the PCIE devices on the server during the startup process. Since the BIOS is an in-band device, while the BMC and PCIE devices are out-of-band software, the BIOS cannot directly obtain PCIE device status information and must instead obtain it through the BMC.

[0054] In a possible example, when the BIOS obtains the status information of the A-type PCIE device, the BIOS may send an intelligent platform management interface (IPMI) command to the BMC through the ESPI channel (bus) to trigger the BMC to obtain the status information of the A-type PCIE device.

[0055] In a possible example, the status information of the A-type PCIE device includes: the in-place status of the PCIE device and the initialization status of the PCIE device, wherein in-place means that the PCIE device is plugged into the server.

[0056] S202: The BMC scans whether a dedicated riser card exists on the server.

[0057] In this embodiment, when the BMC obtains the status information of a Type A PCIE device, it first needs to determine whether the Type A PCIE device exists in the system. Since Type A PCIE devices can be connected to the server via a dedicated riser card, the BMC can determine whether the server has a dedicated riser card to determine whether the Type A PCIE device is connected to the server.

[0058] The BMC can determine whether a riser card is a dedicated riser card by obtaining the hardware information of the riser card. In one possible example, the BMC reads the level signal on the pins of the riser card inserted into the server slot through a bus (such as I2C) to determine the hardware ID of the riser card. The BMC then compares the determined hardware ID of the riser card with the hardware ID of the riser card pre-written in the BMC. When the hardware ID of the riser card obtained by the BMC is the same as the hardware ID information of the riser card stored in the BMC, the BMC determines that the riser card is a dedicated riser card.

[0059] In another possible example, the riser card can write its hardware ID into the erasable programmable read-only memory (EPROM) inside the riser card. The BMC can read the hardware ID stored in the EPROM storage medium inside the riser card through a bus (such as I2C). The BMC then compares the determined hardware ID of the riser card with the hardware ID of the riser card pre-written in the BMC. When the hardware ID of the riser card obtained by the BMC is the same as the hardware ID of the riser card stored in the BMC, the BMC determines that the riser card is a dedicated riser card.

[0060] In some optional embodiments, the BMC stores hardware information, such as an ID, of a non-dedicated riser card, which is used to access a PCIE device with a short initialization time (e.g., an initialization time less than a preset time). If the hardware ID of the riser card obtained by the BMC is different from all the hardware IDs of non-dedicated riser cards stored in the BMC, the BMC determines that the riser card is a dedicated riser card.

[0061] S203: After the BMC determines that a dedicated riser card exists on the server, the BMC obtains hardware ID information of a type A PCIE device connected to the server through the dedicated riser card.

[0062] In this embodiment, after the BMC determines that there is a dedicated riser card on the server, the BMC cannot yet determine whether the Type A PCIE connected to the server through the dedicated riser card is in place. In some cases, a dedicated riser card is inserted into a slot on the server motherboard, but no Type A PCIE device is inserted into the slot of the dedicated riser card. Therefore, the BMC needs to further obtain the hardware ID of the Type A PCIE device connected to the server through the dedicated riser card in order to more accurately confirm that the Type A PCIE device is in place. For example, the BMC can determine whether the Type A PCIE device is inserted into the server by obtaining the hardware ID of the Type A PCIE device inserted into the dedicated riser card. When the BMC can read the hardware ID of the Type A PCIE device inserted into the dedicated riser card, the BMC can determine that the Type A PCIE device is in place. Otherwise, the BMC determines that the Type A PCIE device is not in place.

[0063] In one possible example, a Type A PCIE device includes GPIOs, i.e., pins on the Type A PCIE device that can output high or low levels. The BMC can obtain the hardware ID of the Type A PCIE device by reading the level information of the GPIO pins on the Type A PCIE device plugged into the dedicated riser card via the bus.

[0064] In one possible example, a Type A PCIE device includes a CPLD. During the production phase, the manufacturer can pre-write the hardware ID of the PCIE device into the CPLD of the PCIE device. The BMC can read the hardware ID information stored in the CPLD of the Type A PCIE device inserted into the dedicated riser card via the I2C bus.

[0065] In one possible example, a Type A PCIE device also includes a PCA9555 register. During the production phase, the manufacturer can pre-write the hardware ID of the PCIE device into the PCA9555 register of the PCIE device. The BMC can read the hardware ID information stored in the PCA9555 of the Type A PCIE device inserted into the dedicated riser card via the I2C bus.

[0066] S204: After the BMC obtains the hardware ID information of the A-type PCIE device, the BMC obtains initialization information of the A-type PCIE device.

[0067] In this embodiment, after the BMC obtains the hardware ID information of the A-type PCIE device, the BMC can determine that the A-type PCIE device is in place. The BMC needs to continue to obtain initialization information of the A-type PCIE device.

[0068] In one possible example, the BMC can determine the initialization status of the Type A PCIE device by reading the level information on the GPIO pin of the Type A PCIE device. For example, before the Type A PCIE device is powered on, the level of the GPIO pin of the Type A PCIE device is low. After the Type A PCIE device completes initialization, the level of the GPIO pin of the Type A PCIE device is pulled up to a high level.

[0069] In a possible example, the A-type PCIE device may write its initialization information into a CPLD register, and the BMC may read the value of the CPLD register on the A-type PCIE device through a bus to determine the initialization information of the A-type PCIE device.

[0070] In one possible example, a Type A PCIE device can write its initialization status into the PCA9555 register on the Type A PCIE device. For example, the Type A PCIE device can write the initialization status information of the Type A PCIE device by pulling up or pulling down the electrical signal of the pin in PCA9555. For example, before the Type A PCIE device is powered on, the level of the pin of the PCA9555 register of the Type A PCIE device is low. After the Type A PCIE device completes initialization, the level of the pin of the PCA9555 register of the Type A PCIE device is pulled up to a high level. The BMC can read the pin signal of the PCA9555 register on the Type A PCIE device via the I2C bus to obtain the initialization information of the Type A PCIE device.

[0071] S205: The BMC sends first information to the BIOS, where the first information is used to indicate the status of the A-type PCIE device.

[0072] In this embodiment, the status of the Type A PCIE device includes: the Type A PCIE device is not in place, the Type A PCIE device has completed initialization, and the Type A PCIE device has not completed initialization. Wherein, the Type A PCIE device has completed initialization and the Type A PCIE device has not completed initialization are both determined when the Type A PCIE device is in place.

[0073] In a possible example, when the BMC determines that the Type A PCIE device is not in place, the BMC sends first information to the BIOS, where the first information is used to indicate that the Type A PCIE device is not in place.

[0074] In another possible example, when the BMC determines that the Type A PCIE device is in place, the BMC needs to further determine initialization information of the Type A PCIE device and send the obtained initialization information as the first information to the BIOS. In this case, the first information is used to indicate whether the initialization of the Type A PCIE device is completed or not completed.

[0075] It is understandable that S203 and S204 are optional steps. When the BMC determines that there is no dedicated riser card on the server, or when the BMC determines that there is a dedicated riser card on the server but the BMC does not read the hardware ID information of the Type A PCIE device, the BMC sends a first message to the BIOS, where the first message is used to indicate that there is no Type A PCIE device on the server.

[0076] S206: BIOS determines to start PCIE device scanning based on the first information.

[0077] In this embodiment, there are three situations in which the BIOS is triggered to start PCIE device scanning: (1) the initialization of the Type A PCIE device on the server is completed; (2) the Type A PCIE device does not exist on the server (the Type A PCIE device is not in place); (3) the time the BIOS waits for the Type A PCIE device to complete initialization exceeds a preset first time threshold.

[0078] For the first case, the BIOS determines the initialization status of the Type A PCIE device on the server based on the first information sent by the BMC. When the first information sent by the BMC contains the initialization status information of the Type A PCIE device on the server, the BIOS can directly obtain the initialization status of the Type A PCIE device from the first information. After the BIOS determines that the initialization of the Type A PCIE device on the server is complete, the BIOS directly starts scanning the PCIE device.

[0079] Before the BIOS starts scanning the PCIE devices, it adds the recognition of the initialization status of the A-type PCIE devices, so that the BIOS can immediately scan the PCIE devices after recognizing that the initialization of the A-type PCIE devices is completed, so as to achieve accurate waiting and reduce the waiting time, thereby reducing the startup time of the BIOS.

[0080] It is understandable that when there are multiple Type A PCIE devices on a server, the BIOS needs to wait until all Type A PCIE devices on the server are initialized. When there are both Type A and non-Type A PCIE devices on the server, Type A PCIE devices have a longer initialization time than non-Type A PCIE devices. Therefore, when the initialization of the Type A PCIE devices is completed, the initialization of the non-Type A PCIE devices is also guaranteed to be completed.

[0081] For the second case, when the first information sent by the BMC indicates that there is no Type A PCIE device on the server, the BIOS directly starts scanning the PCIE devices. At this time, the BIOS mainly scans other PCIE devices on the server except the Type A PCIE device to obtain the PCIE device information connected to the server.

[0082] Before the BIOS starts the PCIE device scan, it adds the identification of the presence of type A PCIE devices, so that when the BIOS identifies that the type A PCIE device is not in place, it can immediately perform the PCIE device scan without having to wait in vain. For the third case, the BIOS obtains the waiting time after the BIOS is powered on in real time. When the waiting time of the BIOS exceeds the pre-set first threshold, the BIOS directly starts the PCIE device scan. The first time threshold can be set by the manufacturer according to the performance requirements of the server and burned into the BIOS during the production equipment stage. It can also be set by the user according to the needs during the device use stage.

[0083] In a possible example, the user may enter a server startup setting interface through a system command of the server and enter the first time threshold on the interface.

[0084] S207: The BIOS determines that a Type A PCIE device exists on the server and initialization of the Type A PCIE device is not completed. After a certain time threshold, the BIOS triggers the BMC to obtain status information of the Type A PCIE device.

[0085] In this embodiment, when the BIOS determines that there is a Type A PCIE device on the server based on the first information sent by the BMC, and the initialization of the PCIE device is not completed, the BIOS determines whether the waiting time after power-on exceeds a pre-set first time threshold. When the BIOS determines that the waiting time after power-on does not exceed the first time threshold, the BIOS waits for a period of time (such as 1 second), and the BIOS continues to send messages to the BMC to trigger the BMC to obtain the initialization information of the Type A PCIE device on the server. Then, the BIOS determines whether to start the PCIE device scan based on the status information of the Type A PCIE device returned by the BMC. Among them, the process of the BIOS continuing to send messages to the BMC to trigger the BMC to obtain the initialization information of the Type A PCIE device on the server can be the same as the process described in S202-S205. It will not be repeated here.

[0086] In a possible example, the interval time for the BIOS to trigger the BMC to obtain the service of the Type A PCIE device can be set by the manufacturer according to the performance requirements of the server and burned into the BIOS during the production equipment stage.

[0087] In another possible example, the time interval for the BIOS to trigger the BMC to obtain services for Type A PCIE devices can also be set by the user according to needs during the device usage phase. For example, the user can enter the server startup settings interface through the server system command and enter the interval threshold for the BIOS to trigger the BMC to obtain services for Type A PCIE devices on the interface.

[0088] In an embodiment of the present invention, during the server startup process, for Type A PCIE devices, the server provides a set of out-of-band mechanisms for identifying whether Type A PCIE devices are in place. When the BMC identifies that the Type A PCIE device is in place through this mechanism, the BMC further obtains the initialization status of the Type A PCIE device and returns the initialization status to the BIOS, so that during the server startup process, the BIOS can decide whether to turn on the PCIE device scan or the waiting time before turning on the PCIE device scan based on the initialization status of the Type A PCIE device on the server. Before the BIOS turns on the PCIE device scan, by setting a precise waiting mechanism, the server does not need to make adaptation modifications due to the possible lengthening of the initialization time when the PCIE device inserted in the service evolves later, thereby improving the scalability and compatibility of the server.

[0089] Based on the above description, an embodiment of the present application further provides a PCIE device scanning method. Figure 3This is a flow chart of a PCIE device scanning method provided by an embodiment of the present application. In the embodiment of the present application, a type A PCIE device is used as an intelligent network card as an example. Figure 3 As shown, the method includes: S301-S308.

[0090] S301: The BIOS sends an ipmi command to the BMC, so that the BMC queries the initialization status of the smart network card.

[0091] In this embodiment, during the BIOS startup phase, before the BIOS scans the PCIE device, the BIOS sends an ipmi command to the BMC via the ESPI bus to trigger the BMC to obtain the initialization status of the smart network card.

[0092] S302: The BMC determines whether the smart network card is in place. If the BMC determines that the smart network card is in place, S303 is executed; otherwise, S304 is executed.

[0093] In this embodiment, before obtaining the initialization status of the Smart NIC, the BMC first needs to determine whether the Smart NIC is in place. Specifically, after receiving the IPMI command sent by the BIOS, the BMC scans all riser cards on the server to identify whether there is a riser card dedicated to the Smart NIC. If the BMC identifies a riser card dedicated to the Smart NIC, the BMC further needs to obtain the hardware ID of the Smart NIC plugged into the dedicated riser card. If the BMC can correctly obtain the hardware ID of the Smart NIC, the BMC determines that the Smart NIC is in place. Otherwise, the BMC determines that the Smart NIC is not in place.

[0094] If the BMC scans all riser cards on the server and does not identify the riser card dedicated to the Smart NIC, the BMC determines that the Smart NIC is not in place.

[0095] S303: The BMC obtains initialization information of the smart network card.

[0096] In this embodiment, after the BMC determines that the Smart NIC is in place, the BMC can obtain the initialization information of the Smart NIC. In one possible example, after the BMC recognizes that the Smart NIC is in place, the BMC can read the CPLD register of the Smart NIC via I2C (the Smart NIC writes the initial state to this register), thereby obtaining the initialization state of the Smart NIC.

[0097] The specific process of the BMC obtaining the initialization information of the smart network card can refer to S204 in the above embodiment.

[0098] S304: The BMC sends first information to the BIOS, where the first information is used to indicate the status of the smart network card.

[0099] In this embodiment, after the BMC determines the status of the smart network card, the BMC needs to return the in-place status and initialization status of the smart network card to the BIOS as a response message of the ipmi command.

[0100] In a possible example, the BMC determines that the smart network card is not in place, and the BMC sends first information as a response message of the ipmi command to the BIOS, wherein the first information is used to indicate that the smart network card is not in place.

[0101] In one possible example, the BMC determines that the Smart NIC is in place and obtains initialization information for the Smart NIC. The BMC sends first information to the BIOS as a response message to an IPMI command. The first information includes at least one of initialization information for the Smart NIC and initialization status information for the Smart NIC. The initialization status information for the Smart NIC can be either initialization completed or initialization incomplete.

[0102] S305 , the BIOS determines whether the smart network card is in place according to the first information, and executes S306 when the smart network card is in place, otherwise executes S308 .

[0103] S306: The BIOS determines the initialization status of the smart network card according to the first information. If the initialization status of the smart network card is incomplete, S307 is executed; otherwise, S308 is executed.

[0104] In this embodiment, the BIOS obtains the presence and initialization status of the Smart NIC based on the IPMI message returned by the BMC. The Smart NIC status that the BIOS can confirm based on the first information returned by the BMC includes: the Smart NIC is not in place, the Smart NIC is in place and initialization is complete, or the Smart NIC is in place and initialization is not complete.

[0105] In one possible example, when the first information returned by the BMC only includes the initialization information of the Smart NIC, the BIOS needs to determine the initialization status of the Smart NIC based on the initialization information of the Smart NIC included in the first information. When the first information returned by the BMC includes the initialization status of the Smart NIC, the BIOS can directly obtain the initialization status of the Smart NIC from the first information without performing additional judgment.

[0106] S307, BIOS waits for a fixed interval and executes S301.

[0107] In this embodiment, when the BIOS determines that the smart network card is in place and the initialization status of the smart network card is incomplete, the BIOS starts to trigger the BMC to obtain the initialization status of the smart network card at a fixed interval, that is, the BIOS waits for a period of time (for example, 1 second) and then executes S301-S306 again, where the waiting time of the BIOS can be pre-set.

[0108] When the BIOS determines that the initialization of the Smart NIC is complete, the BIOS stops obtaining the initialization information of the Smart NIC. Alternatively, if the initialization status of the Smart NIC obtained by the BIOS remains incomplete within the first time threshold (waiting timeout period), the BIOS may determine that an abnormality has occurred in the Smart NIC, stop obtaining the initialization information of the Smart NIC, and start PCIE device scanning.

[0109] S308, BIOS starts scanning the PCIE devices on the server.

[0110] In this embodiment, when the BIOS determines that the smart network card is not in place or the smart network card is in place and initialization is complete, the BIOS can start scanning the PCIE device. Alternatively, within the first time threshold (waiting timeout period), when the initialization status of the smart network card obtained by the BIOS is always incomplete, the BIOS can deem that an abnormality has occurred in the smart network card, the BIOS stops obtaining the initialization information of the smart network card, and starts scanning the PCIE device. It can be understood that in the embodiment of the present application, a first time threshold is pre-set. When the BIOS obtains the smart network card (type A PCIE device) in real time within the first time threshold, if at any time within the first time threshold, the BIOS determines that the smart network card is not in place or the smart network card is in place and initialization is complete, the BIOS starts scanning the PCIE devices on the server. If the BIOS determines that the smart network card is in place within the first time threshold, but has not waited until the initialization of the smart network card is completed, the BIOS can deem that the smart network card is abnormal, the BIOS stops obtaining the initialization information of the smart network card and starts scanning the PCIE devices on the server.

[0111] Based on the above description, an embodiment of the present application further provides a PCIE device scanning method. Figure 4 This is a flow chart of a PCIE device scanning method provided by an embodiment of the present application. Figure 4 As shown, the method includes: S401-S405.

[0112] S401, during the server startup process, the BIOS on the server sends a query instruction to the BMC, where the query instruction is used to instruct the BMC to obtain status information of a target PCIE device.

[0113] In this embodiment, the target PCIE device may be a Type A PCIE device. Since Type A PCIE devices require a long initialization time, the BIOS may obtain the status information of the Type A PCIE device through the BMC before starting the PCIE device scan to determine whether the Type A PCIE device has been initialized.

[0114] S402 : In response to the query instruction sent by the BIOS, the BMC scans the adapter card connected to the server and determines whether a target adapter card exists based on the scan result.

[0115] In this embodiment, after the BMC receives the query instruction sent by the BIOS, the BMC can scan the adapter card (i.e., Riser card) connected to the server, and determine whether the target PCIE device is in place by determining whether the target adapter card (i.e., Type A PCIE device dedicated Riser card) is connected to the server. Specifically, the BMC can compare the hardware ID of the acquired adapter card with the hardware ID of the adapter card pre-written in the BMC. When the hardware ID of the adapter card acquired by the BMC is the same as the hardware ID information of the adapter card stored in the BMC, the BMC determines that the adapter card is the target adapter card. Among them, the process of the BMC determining whether there is a dedicated riser card among the risers connected to the server can refer to S202 and will not be repeated here.

[0116] S403 , when the BMC scans and finds that there is a target adapter card, the BMC obtains status information of the target PCIE device plugged into the target adapter card, where the status information is used to indicate whether the target PCIE device has completed initialization.

[0117] In this embodiment, after the BMC scans the target riser card, it can determine that a Type A PCIE device is present. At this point, the BMC can obtain status information about the target PCIE device plugged into the target riser card. The process of the BMC obtaining status information about the target PCIE device plugged into the target riser card can be found in S204 and will not be further described here.

[0118] In one possible example, to avoid the situation where a target riser card is connected to the server but no PCIE device is plugged into it, the BMC needs to further obtain the hardware ID of the target PCIE device connected to the server via the target riser card to more accurately confirm the presence of the target PCIE device. After the BMC determines that the target PCIE device is in place, it can obtain the status information of the target PCIE device.

[0119] S404: The BMC sends the acquired status information of the target PCIE device to the BIOS.

[0120] In this embodiment, after the BMC obtains the status information of the target PCIE device, the BMC also needs to send the obtained status information of the target PCIE device to the BIOS, and the BIOS determines the initialization status of the target PCIE device.

[0121] S405: The BIOS determines whether to start PCIE device scanning according to the status information of the target PCIE device.

[0122] In this embodiment, after obtaining the status information of the target PCIE device, the BIOS determines whether the target PCIE device has completed initialization based on the obtained status of the target PCIE device. If the BIOS determines that the target PCIE device has completed initialization, the BIOS may initiate a PCIE device scan. Because the initialization time of the target PCIE device is relatively long, when the BIOS determines that the initialization of the target PCIE device has completed, the initialization of other PCIE devices on the server has also completed. At this point, the BIOS may initiate a PCIE device scan.

[0123] In a possible example, when the BIOS determines that the target PCIE device does not exist on the server, the BIOS may also immediately initiate a PCIE device scan.

[0124] In one possible example, when the BIOS determines that a target PCIE device exists on the server and that the target PCIE device has not yet completed initialization, the BIOS may wait for a period of time, then obtain the initialization status of the target PCIE device again, and determine whether to enable PCIE device scanning based on the initialization status of the target PCIE device. If the BIOS does not obtain the initialization status of the target PCIE device within a preset time period, the BIOS may directly perform a PCIE device scan after the preset time period has expired.

[0125] Based on the method in the above embodiment, the present application also provides a scanning device, see Figure 5 , Figure 5 This is a schematic diagram of the structure of an identification device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 500 includes: a collection module 510 , a processing module 520 , and a storage module 530 .

[0126] The acquisition module 510 is used to acquire status information of the Type A PCIE device, wherein the status information of the Type A PCIE device includes at least one of: in-place status information of the Type A PCIE device and initialization information of the Type A PCIE device.

[0127] The storage module 530 is used to store the status information of the type A PCIE device collected by the collection module 510 .

[0128] The processing module 520 is configured to determine the status of the Type A PCIE device based on the status information of the Type A PCIE device collected by the collection module 510, and determine whether to scan the PCIE device on the electronic device based on the status of the Type A PCIE device. The status of the Type A PCIE device includes: the Type A PCIE device is not present, the Type A PCIE device is present and initialization is not complete, and the Type A PCIE device is present and initialization is complete.

[0129] In a possible example, after the acquisition module 510 acquires the status information of the Type A PCIE device, it directly sends the acquired status information of the Type A PCIE device to the processing module 520, and the processing module 520 makes a judgment based on the status of the Type A PCIE device acquired by the acquisition module 520.

[0130] In another possible example, after collecting the status information of the Type A PCIE device, the collection module 510 determines the status of the Type A PCIE device based on the collected status information. The collection module 510 then sends the determination result to the processing module 520, so that the processing module 520 can directly obtain the initialization status of the Type A PCIE device without performing additional determination.

[0131] In this embodiment, the specific process of the acquisition module 510 collecting the status information of the Type A PCIE device, and the process of the processing module 520 determining the status of the Type A PCIE device based on the status information of the Type A PCIE device collected by the acquisition module 510, and determining whether to scan the PCIE device on the electronic device based on the status of the Type A PCIE device, can refer to the description of S201-S207 in the above embodiment and will not be repeated here.

[0132] Figure 5 The electronic device embodiments shown are merely illustrative. For example, the module division is merely a logical functional division, and actual implementation may employ other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not implemented. The various functional modules in the various embodiments of the present application may be integrated into a single processing module, each module may exist physically separately, or two or more modules may be integrated into a single module.

[0133] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.

[0134] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product, characterized in that when the computer program product runs on a processor, the processor executes the method in the above embodiment.

[0135] Based on the methods in the above embodiments, an embodiment of the present application provides a computing device, which includes a motherboard and a chip. The chip is integrated on the motherboard, and the chip includes at least one memory for storing programs; and at least one processor for executing the programs stored in the memory. When the programs stored in the memory are executed, the processor is used to execute the methods in the above embodiments. In the embodiments of the present application, the computing device can be a network device such as a server or a host. The chip can be a BMC, a chip storing BIOS, etc. In the embodiments of the present application, there is no limitation on the type of computing device and the type of chip.

[0136] It should be noted that in other embodiments, BMC has different names in different computing devices. For example, the BMC of Huawei servers and Super Fusion servers is called iBMC, the BMC of HPE servers is called iLO, and the BMC of DELL servers is called iDRAC.

[0137] Based on the method in the above embodiment, the present application embodiment also provides a chip. Figure 6 , Figure 6 This is a schematic diagram of the structure of a chip provided in an embodiment of the present application. Figure 6 As shown, the chip 600 includes one or more processors 601 and an interface circuit 602. Optionally, the chip 600 may also include a bus 603.

[0138] The processor 601 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 601 or instructions in the form of software. The above-mentioned processor 601 can be a general-purpose processor, a digital communicator (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The various methods and steps disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0139] The interface circuit 602 can be used to send or receive data, instructions or information. The processor 601 can use the data, instructions or other information received by the interface circuit 602 to process it, and can send the processing completion information through the interface circuit 602.

[0140] Optionally, the chip 600 further includes a memory, which may include a read-only memory and a random access memory, and provides operation instructions and data to the processor. Part of the memory may also include a non-volatile random access memory (NVRAM).

[0141] Optionally, the memory stores an executable software module or a data structure, and the processor can perform corresponding operations by calling an operation instruction stored in the memory (the operation instruction may be stored in an operating system).

[0142] Optionally, the interface circuit 602 may be configured to output the execution result of the processor 601 .

[0143] It should be noted that the corresponding functions of the processor 601 and the interface circuit 602 can be implemented through hardware design, software design, or a combination of hardware and software, which is not limited here.

[0144] It should be understood that each step of the above method embodiment can be completed by a hardware-based logic circuit or a software-based instruction in a processor.

[0145] It is understood that the order of execution of the steps in the above embodiments does not necessarily imply a specific order of execution. The order of execution of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. In addition, in some possible implementations, the steps in the above embodiments can be selectively executed according to actual circumstances, and can be executed partially or completely, which is not limited here.

[0146] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.

[0147] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted via the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)).

[0148] It will be understood that the various numerical numbers involved in the embodiments of the present application are merely distinctions for the convenience of description and are not intended to limit the scope of the embodiments of the present application.

Claims

1. A PCIE device scanning method, characterized in that: Applied to a server, the server including a BIOS and a BMC, the method comprising: During the server startup process, the BIOS sends a query instruction to the BMC, where the query instruction is used to instruct the BMC to obtain status information of a target PCIE device; The BMC responds to the query instruction, scans the adapter card connected to the server, and determines whether a target adapter card exists according to the scan result; When the BMC scans and detects the presence of the target adapter card, the BMC obtains status information of a target PCIE device plugged into the target adapter card, where the status information indicates whether the target PCIE device has completed initialization. The BMC sends the status information of the target PCIE device to the BIOS; The BIOS determines whether to start PCIE device scanning based on the status information of the target PCIE device.

2. The method according to claim 1, characterized in that Before the BMC obtains the status information of the target PCIE device inserted in the target riser card, the method further includes: The BMC obtains an identifier of a target PCIE device inserted into the target adapter card; In a case where the identifier of the target PCIE device inserted into the target adapter card is obtained, the BMC obtains status information of the target PCIE device inserted into the target adapter card.

3. The method according to claim 2, characterized in that The method further comprises: In the case that the identifier of the target PCIE device inserted into the target adapter card is not obtained, the BMC triggers the BIOS to start PCIE device scanning.

4. The method according to claim 1, wherein The BMC responds to the query instruction, scans the adapter card connected to the server, and determines whether a target adapter card exists according to the scan result, including: The BMC scans the adapter card connected to the server to obtain an identifier of the adapter card connected to the server; The BMC matches the acquired identifier of the adapter card with the identifier of the adapter card stored in the BMC; If the match is successful, the BMC determines that a target adapter card is connected to the server.

5. The method according to claim 1, wherein The BIOS determines whether to start PCIE device scanning based on the status information of the target PCIE device, including: If the BIOS determines that the target PCIE device is initialized, the BIOS starts a PCIE device scan; If the BIOS determines that the initialization of the target PCIE device is not completed, the BIOS obtains the status information of the target PCIE device after a preset time period, and determines whether to start PCIE device scanning according to the status information of the PCIE device.

6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: When the BMC scans and finds that the target adapter card exists, if the status information of the target PCIE device inserted into the target adapter card is not obtained within a first time threshold, the BIOS starts a PCIE device scan.

7. The method according to claim 1, characterized in that The method further comprises: In a case where the BMC fails to scan the target adapter card, the BMC triggers the BIOS to start PCIE device scanning.

8. The method according to any one of claims 1 to 7, characterized in that The BMC obtains status information of a target PCIE device inserted in the target adapter card, including: The BMC obtains the initialization state of the target PCIE device by obtaining information stored in any one of a general input / output port, a complex programmable logic device, and a register on the target PCIE device.

9. The method according to any one of claims 1 to 8, characterized in that The target PCIE device is connected to the server via a high-speed cable.

10. A server, characterized in that: include: BIOS and BMC, The BIOS is used to send a query instruction to the BMC during the server startup process, and the query instruction is used to instruct the BMC to obtain status information of the target PCIE device; The BMC scans the adapter card connected to the server in response to the query instruction, and determines whether a target adapter card exists according to the scanning result; When the BMC scans and detects the presence of the target adapter card, the BMC obtains status information of a target PCIE device plugged into the target adapter card, where the status information indicates whether the target PCIE device has completed initialization. The BMC is further configured to send the status information of the target PCIE device to the BIOS; The BIOS is further configured to determine whether to start PCIE device scanning according to the status information of the target PCIE device.

Citation Information

Patent Citations

  • BMC and component asset information management method and device thereof and storage medium

    CN112269601A

  • PCIe link fault detection method, detection device, equipment and medium

    CN115150254A