A PCIe topology switching method and server

By detecting the processor's operating status through BIOS and actively switching the PCIe topology mode using GPIO level values, the problem of poor fault tolerance caused by relying on out-of-band controllers in existing technologies is solved, enabling wider application and higher fault tolerance.

CN117950919BActive Publication Date: 2026-11-17HENAN KUNLUN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410065049.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-16
Publication Date
2026-11-17
Estimated Expiration
2044-01-16

AI Technical Summary

Technical Problem

In existing technologies, PCIe topology switching relies entirely on out-of-band controllers, resulting in poor fault tolerance mechanisms and an inability to achieve topology switching when out-of-band controllers fail.

Method used

The processor's operating status is detected by the Basic Input/Output System (BIOS). The PCIe topology mode is actively switched using the preset GPIO output level values, achieving topology switching without relying on the BIOS. Combined with reading the level values ​​from the signal connector and firmware loading, automatic topology mode switching is achieved.

Benefits of technology

It improves the fault tolerance mechanism for PCIe topology switching, expands the application scope, reduces hardware costs, avoids resource waste, and supports in-band and out-of-band switching mechanisms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117950919B_ABST
    Figure CN117950919B_ABST
Patent Text Reader

Abstract

This application provides a PCIe topology switching method and server, relating to the field of computer technology. The method is applied to a server, which includes at least two processors, and includes: detecting the processor's operating status via BIOS; when it is determined that only one processor is operating normally, setting the output level value of a preset GPIO to a first level value; when it is determined that more than one processor is operating normally, setting the output level value of the preset GPIO to a second level value. When it is determined that only one processor is operating normally, the PCIe topology mode is actively switched to cascaded mode, or when it is determined that more than one processor is operating normally, the PCIe topology mode is actively switched to balanced mode. That is, active switching of the PCIe topology is achieved through the preset GPIO settings, and it no longer relies on the BMC for PCIe topology switching, thus having a wider application range and higher fault tolerance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method for switching PCIe topology and a server. Background Technology

[0002] Server scalability is a crucial performance characteristic, referring to the flexibility of hardware configuration to meet specific needs. Server scalability can be achieved by adding Peripheral Component Interconnect Express (PCIe) slots to the motherboard. Each PCIe slot can accommodate one PCIe card, which can connect to multiple different PCIe devices to meet the requirements of various users and application scenarios. For example, installing a Graphics Processing Unit (GPU) in a PCIe slot expands the server's video processing capabilities, while installing an SSD expands its storage capacity. With the diversification of customer needs, to accommodate different customer requirements for PCIe topologies, the server needs to be compatible with multiple PCIe topologies and capable of switching between them.

[0003] Current PCIe topology switching typically involves an out-of-band controller, such as a baseboard management controller (BMC), receiving link switching commands from a remote server. The BMC then controls the PCIe switching devices to switch the active uplink path based on these commands. Current PCIe topology switching relies entirely on the out-of-band controller (e.g., the BMC). However, if the out-of-band controller fails, this method will fail.

[0004] In summary, the current technology relies entirely on out-of-band controllers for PCIe topology switching, which has a limited application scope and poor fault tolerance. Summary of the Invention

[0005] This application provides a PCIe topology switching method and server, which can achieve PCIe topology switching without completely relying on the out-of-band controller. It has a wider range of applications and a higher fault tolerance mechanism, enabling PCIe topology switching to still be achieved even if the out-of-band controller fails.

[0006] To achieve the above objectives, this application adopts the following technical solution:

[0007] Firstly, this application provides a method for switching PCIe topology, comprising: detecting the operating status of the server's processors through the Basic Input / Output System (BIOS); when it is determined that only one processor in the server is operating normally, setting the output level value of a preset GPIO to a first level value; when it is determined that more than one processor in the server is operating normally, setting the output level value of the preset GPIO to a second level value. When the BIOS determines that only one processor in the server is operating normally, it actively sets the output level value of the GPIO to the first level value, i.e., actively switches the PCIe topology mode to cascade mode; or when the BIOS determines that more than one processor in the server is operating normally, it actively sets the output level value of the GPIO to the second level value, i.e., actively switches the PCIe topology mode to balanced mode. This method achieves active switching of the PCIe topology through the preset GPIO settings and no longer relies on the BMC for PCIe topology switching, thus broadening its application scope and improving its fault tolerance.

[0008] In one possible implementation, the output level value of the preset GPIO is read through a signal connector to determine the PCIe topology mode of the server. This instructs at least two switching devices to load firmware corresponding to the PCIe topology mode, thereby enabling the switching of the server's PCIe topology mode. Since the signal connector is essentially a programmable logic device, it can read the output level value of the GPIO and determine the PCIe topology mode based on the preset GPIO output level value, thus instructing the switching device racks to load the corresponding firmware and achieve the switching of the server's PCIe topology.

[0009] In one possible implementation, when it is determined that only one processor in the server's processors is operating normally, the BIOS reads the output level value of a preset GPIO; when the output level value of the preset GPIO read by the BIOS is a second level value, the output level value of the preset GPIO is set to a first level value. Alternatively, when it is determined that more than one processor in the server's processors is operating normally, the BIOS reads the output level value of a preset GPIO; when the output level value of the preset GPIO read by the BIOS is a first level value, the output level value of the preset GPIO is set to a second level value. The current PCIe topology mode of the server is determined, and it is then determined whether the current PCIe topology mode is the same as the PCIe topology mode after switching. If they are different, the output level value of the preset GPIO is set to facilitate subsequent PCIe topology switching based on the preset GPIO output level value.

[0010] In one possible implementation, in response to the server's power-on startup, a power-on self-test (POST) is performed via the Basic Input / Output System (BIOS) to detect the server's processor's operational status during the startup process. This is achieved through the BIOS's POST function.

[0011] In one possible implementation, the BIOS generates a read command; this read command instructs the signal connector to reread the output level value of a preset GPIO; in response to the read command, the signal connector rereads the output level value of the preset GPIO to determine the server's PCIe topology mode. During the power-on startup process, before the signal connector reads the output level value of the preset GPIO, the BIOS generates a read command instructing the signal connector to reread the output level value of the preset GPIO, thereby achieving PCIe topology switching. Since the server has not yet completed power-on, the signal connector rereading the output level value of the preset GPIO is sufficient to achieve PCIe topology switching.

[0012] In one possible implementation, the BIOS (Basic Input / Output System) monitors the server's processor status during server operation. The BIOS's real-time monitoring function detects the processor's operational status during server operation.

[0013] In one possible implementation, the server is restarted via the BIOS. In response to the server restart, the signal connector rereads the preset GPIO output level values ​​to determine the server's PCIe topology mode. During server operation, before the signal connector reads the preset GPIO output level values, the server is restarted via the BIOS to allow the signal connector to reread the preset GPIO output level values, thereby enabling PCIe topology switching. Because the server is running (i.e., after power-on startup), a server restart is required for the signal connector to read the preset GPIO output level values.

[0014] In one possible implementation, the BIOS, through the out-of-band controller (BMC), controls the server's programmable logic device (CPLD) to set the preset GPIO output level value to a first level value; the BIOS, through the BMC, also controls the CPLD to set the preset GPIO output level value to a second level value. By controlling the CPLD through the BMC to set the preset GPIO output level values, the BIOS can simultaneously update the preset GPIO output level values ​​in the BMC, thus synchronizing the configuration information stored in the BMC with the server's current configuration information.

[0015] In one possible implementation, the BIOS directly controls the server's programmable logic device (CPLD) to set the preset GPIO output level value to a first level value; the BIOS also directly controls the server's CPLD to set the preset GPIO output level value to a second level value. Because the BIOS can directly control the server's CPLD and set the preset GPIO output level values, PCIe topology switching can still be achieved even when the BMC malfunctions or cannot operate normally, meaning PCIe topology switching can be achieved without relying on the BMC.

[0016] In one possible implementation, when the BIOS reads the preset GPIO output level as a first level value, it maintains that preset GPIO output level value; when the BIOS reads the preset GPIO output level value as a second level value, it maintains that preset GPIO output level value as a second level value. If the preset GPIO output level value read by the BIOS is the same as the set preset GPIO output level value, it indicates that the current server's PCIe topology mode does not need to be switched, and the preset GPIO output level value remains unchanged. In another possible implementation, when it is determined that only one processor in the server is operating normally, the BIOS reports the server's fault information to the out-of-band controller (BMC) so that the BMC can display the fault information. When it is determined that only one processor in the server is operating normally, the BIOS reports the server's fault information to the BMC, and the BMC can display the fault information to the user to indicate that the current server's processor is faulty.

[0017] In one possible implementation, during normal server operation, the BIOS receives a PCIe topology mode configuration operation input by the user through the BIOS configuration interface; in response to the PCIe topology mode configuration operation, it determines the target topology mode; and sets the preset GPIO level value to the level value corresponding to the target topology mode. During normal server operation, the BIOS configuration interface is displayed to the user. When the BIOS receives the PCIe topology mode configuration operation input by the user through the BIOS configuration interface, after determining the target topology mode based on this PCIe topology mode configuration operation, it sets the preset GPIO level value to the level value corresponding to the target topology mode, so as to facilitate subsequent PCIe topology switching, and can achieve passive PCIe topology mode switching without relying on the BMC.

[0018] In one possible implementation, the server is restarted via BIOS; in response to the server restart, the output level value of a preset GPIO is read through the signal connector to determine the PCIe topology mode as the target topology mode, so as to instruct at least two switching devices to load the firmware corresponding to the target topology mode, thereby realizing the switching of the server's PCIe topology mode.

[0019] In a second aspect, this application provides a server, comprising: at least two processors, and a memory communicatively connected to the at least two processors; the memory is used to store computer-executed instructions; the at least two processors are used to instruct the computer-executed instructions stored in the memory to implement the method of the first aspect.

[0020] Thirdly, this application provides a PCIe topology switching device, comprising: a running detection module for detecting the running status of the server's processors via the Basic Input / Output System (BIOS); a running judgment module for determining whether more than one processor in the server is running normally; and a level setting module, including a first level setting module and a second level setting module. The first level setting module sets the output level value of a preset GPIO to a first level value when it is determined that only one processor in the server is running normally; the second level setting module sets the output level value of a preset GPIO to a second level value when it is determined that more than one processor in the server is running normally. When the BIOS determines that only one processor in the server is running normally, it actively sets the output level value of the GPIO to the first level value, i.e., actively switches the PCIe topology mode to cascade mode; or when the BIOS determines that more than one processor in the server is running normally, it actively sets the output level value of the GPIO to the second level value, i.e., actively switches the PCIe topology mode to balanced mode, thus realizing active switching of the PCIe topology and no longer relying on the BMC to achieve PCIe topology switching. Furthermore, when a processor failure is detected in the server, the system can proactively switch the PCIe topology, allowing the PCIe devices to continue operating normally, thus further improving the fault tolerance mechanism.

[0021] Fourthly, this application provides a computer-readable storage medium storing a computer program or instructions that, when executed, implement the method described in the first aspect.

[0022] Fifthly, this application provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the method described in the first aspect. Attached Figure Description

[0023] Figure 1 This is a schematic diagram of the structure of a PCIe topology switching system in the current technology;

[0024] Figure 2 This is a schematic diagram of another PCIe topology switching system in current technology;

[0025] Figure 3 This application provides a schematic diagram of the structure of a PCIe topology switching system.

[0026] Figure 4 A schematic flowchart illustrating a PCIe topology loading process provided in an embodiment of this application;

[0027] Figure 5AThis application provides a schematic diagram of the code configuration of a PCIe device tree corresponding to a cascading mode.

[0028] Figure 5B This application provides a schematic diagram of the structure of a PCIe device tree corresponding to a cascading mode.

[0029] Figure 6A This application provides a schematic diagram of the code configuration of a PCIe device tree corresponding to a load balancing mode in an embodiment of the present application.

[0030] Figure 6B This is a schematic diagram of the PCIe device tree structure corresponding to a balancing mode provided in an embodiment of this application;

[0031] Figure 7 A flowchart illustrating a PCIe topology switching method provided in an embodiment of this application;

[0032] Figure 8 A flowchart illustrating another PCIe topology switching method provided in this application embodiment;

[0033] Figure 9 A flowchart illustrating another PCIe topology switching method provided in this application embodiment;

[0034] Figure 10A A schematic diagram of a BIOS configuration interface provided in an embodiment of this application;

[0035] Figure 10B A schematic diagram of another BIOS configuration interface provided in an embodiment of this application;

[0036] Figure 10C A schematic diagram of another BIOS configuration interface provided in an embodiment of this application;

[0037] Figure 11 A flowchart illustrating the process of setting a target topology mode via BMC, provided for an embodiment of this application;

[0038] Figure 12 A flowchart illustrating another PCIe topology switching method provided in this application embodiment;

[0039] Figure 13 A flowchart illustrating another PCIe topology switching method provided in this application embodiment;

[0040] Figure 14 This is a schematic diagram of a PCIe topology switching device provided in an embodiment of this application. Detailed Implementation

[0041] The terms "first," "second," and "third," etc., used in this application specification, claims, and drawings are used to distinguish different objects, not to limit a specific order.

[0042] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0043] To ensure clarity and conciseness in the description of the following embodiments, a brief introduction to the relevant technical terms is given first:

[0044] PCIe is a high-speed serial computer expansion bus standard, primarily used to expand the data throughput of computer system buses and improve device communication speed. It belongs to high-speed serial point-to-point (P2P) dual-channel high-bandwidth transmission, where each connected device is allocated its own dedicated channel bandwidth and does not share the bus bandwidth.

[0045] PCIe typically uses a tree topology and does not allow loops or other complex topologies in order to maintain backward compatibility with PCI software.

[0046] A typical PCIe topology consists of a root complex, a switch, and PCIe devices (e.g., GPU devices).

[0047] The root complex (RC) is the interface between the central processing unit (CPU) and the PCIe bus. In a broader sense, the RC can be understood as the interface between the system CPU and the PCIe topology; the PCIe port is labeled "root port" in the configuration space.

[0048] Switches are one of the most common device types in PCIe, providing expansion or aggregation capabilities and allowing more devices to connect to a single PCIe port. They act as packet routers, identifying the path a given packet should take based on its address or other routing information. A switch is a PCIe-to-PCIe bridge, typically used to connect multiple devices so they can share the bandwidth of the PCIe bus.

[0049] For the interconnection of CPU and PCIe devices in servers, two common PCIe topologies are Balance Mode and Cascade Mode.

[0050] Balanced mode, also known as dual-root configuration, ensures that each CPU has the same number of PCIe devices (PCIe interfaces) connected to its switch. These PCIe devices request resources from their respective CPU's CPU stack. The CPU stack manages memory and processor resources.

[0051] Cascading mode, also known as single-root mode, involves all PCIe devices connected to a single CPU via a switch, with all devices requesting resources from the CPU's central processing unit stack.

[0052] In addition to the above, there is a PCIe topology called Common Mode. In Common Mode, all PCIe devices are directly connected to the root complex, meaning all PCIe devices are directly connected to a single CPU. In Cascaded Mode, all PCIe devices are connected to a single CPU via a switch. In other words, in Common Mode, each PCIe device occupies a dedicated PCIe port; in Cascaded Mode, all PCIe devices share a single PCIe port via a switch. Therefore, Common Mode and Cascaded Mode PCIe topologies offer similar processing capabilities, but Common Mode consumes more PCIe interface resources, making it rarely used in practice.

[0053] A multiplexer (MUX) is a combinational logic circuit that can combine multiple signal inputs into a single signal output, or decompose a single signal input into multiple signal outputs. The function of a MUX is to transmit multiple signals on a single signal line. It can select the signal from multiple signal sources based on different control signals and output it to a single signal line.

[0054] The Platform Configuration Database (PCD) is a database that stores UEFI-accessible data. PCD is the global configuration mechanism used in EDK2, playing a significant role in code reuse and modularization. PCD extracts configurable options from the code, allowing for platform modifications without altering the source code. Parameter configuration can be performed during compilation, runtime, and even within the binary file.

[0055] The Unified Extensible Firmware Interface (UEFI) is a model for the interface between the operating system and platform firmware. UEFI is easier to implement, has stronger fault tolerance and error correction capabilities, and can shorten system development time.

[0056] The advantages of the PCIe topology configuration method provided in this application are illustrated below by comparing it with other PCIe topology switching methods.

[0057] In one related PCIe topology switching technology, the purpose of PCIe topology switching is achieved by directly opening the box and changing the cable configuration, such as manually plugging and unplugging cables to achieve PCIe topology switching. This method cannot achieve automatic PCIe topology switching, which consumes a great deal of time and manpower, and cannot be implemented in a timely manner when facing urgent switching needs.

[0058] To achieve automatic switching of PCIe topology, current technologies typically use out-of-band controllers such as Baseboard Manager Controllers (BMCs) to issue commands / instructions to switch PCIe topology.

[0059] The following is combined Figure 1 and Figure 2 Here is a brief introduction to two common PCIe topology switching methods in current technology.

[0060] In a prior art, such as Figure 1 The prior art illustrates a topology device where a first CPU, a second CPU, and a BMC are mounted on a CPU board, and a first group of GPUs and a second group of GPUs are mounted on a GPU board (it should be noted that both the first and second groups of GPUs are exemplified by having four GPUs). The uplink of the first group of GPUs is connected to the first CPU via a first PCIe switch; the uplink of the second group of GPUs is connected to the first CPU or the second CPU via a second PCIe switch and a MUX via different uplink paths. Specifically, the BMC receives a link switching command from a remote computer and transmits this command to the MUX via the I2C bus. The MUX then switches the uplink path of the second PCIe switch connected to the CPU via the MUX according to the link switching command. This method relies entirely on the BMC and can only perform out-of-band PCIe topology switching through the BMC. PCIe topology switching is only achieved when the BMC receives a link switching command. In summary, in the prior art, including... Figure 1The server (electronic device) of the illustrated topology can only passively perform PCIe topology switching in response to the BMC receiving a link switching command; it cannot actively perform PCIe topology switching. Furthermore, under this prior art, when the BMC malfunctions and becomes unusable, the prior art cannot perform PCIe topology switching. Moreover, this prior art requires manual intervention for PCIe topology switching; for example, a link switching command must be sent to the BMC remotely by a person before the prior art can perform PCIe topology switching based on that command.

[0061] Furthermore, in this prior art, an x16 PCIe bus interface (x16 port) is reserved in advance, which would be a waste of PCIe Port resources due to the limited PCIe Port resources.

[0062] In another existing technology, such as Figure 2 A prior art device for dynamically switching CPU and GPU topologies includes: a configuration module, a local area switching module, a BMC, a CPU module, and a GPU module. The BMC is applied to the CPU module. The configuration module is connected to the local area switching module via TCP or IP protocol. The local area switching module is connected to the CPU module. The BMC is connected to the main switch of the PCIe switch unit via I2C. The CPU module includes a first CPU, a second CPU, a first CPU terminal A and a first CPU terminal B corresponding to the first CPU, and a second CPU terminal corresponding to the second CPU. The GPU module includes a first GPU terminal, a second GPU terminal, a third GPU terminal, a PCIe switch unit, and a PCIe bus unit. The PCIe switch unit includes a main switch, a first switch, and a second switch. Specifically, the BMC controls the main switch to determine the corresponding PCIe topology mode by identifying the source of the uplink signal, and then switches the current PCIe topology mode to the corresponding PCIe topology mode. This switching is only passive and cannot be actively performed by the main switch under the control of the BMC. Furthermore, in this prior art, when the BMC fails and becomes unusable, the prior art cannot achieve PCIe topology switching.

[0063] Furthermore, in this prior art, signal terminals are set on both the CPU and GPU sides, consuming significant hardware resources and increasing hardware costs. At least three signal terminals are required on the CPU side, making this method less feasible for general-purpose servers; moreover, the method pre-designs corresponding category identifiers, which may not be applicable to other servers, thus limiting its applicability.

[0064] In summary, current PCIe topology switching methods rely on out-of-band controllers such as the BMC to achieve PCIe topology switching. They can only perform PCIe topology switching out of band, specifically passively switching via BMC pass-through, and do not support active PCIe topology switching. Furthermore, current technologies cannot achieve server PCIe topology switching when the BMC fails. Current PCIe topology switching methods have weak implementation capabilities, limited application scope, and poor fault tolerance mechanisms. This application provides a PCIe topology switching system that utilizes the BIOS's own detection function to actively switch PCIe topology when the CPU fails, achieving PCIe topology switching without completely relying on the BMC. In addition, while achieving out-of-band PCIe topology switching via the BMC, it can also achieve in-band PCIe topology switching through the BIOS configuration interface, avoiding the inability to achieve PCIe topology switching due to BMC failure, thus providing a more robust fault tolerance mechanism.

[0065] Furthermore, based on the PCIe topology switching system provided in this application, the PCIe topology mode identifier is transmitted by pre-setting the output level value of GPIO, eliminating the need for additional signal terminals and reducing hardware costs; it also eliminates the need to pre-reserve a x16 PCIe bus interface, avoiding waste of PCIe Port resources. Furthermore, in terms of software, communication can be achieved through common protocols (IPMI protocol, Local Bus, etc.), resulting in lower communication costs and more convenient information transmission.

[0066] Furthermore, by using preset GPIO output level values ​​to transmit the PCIe topology mode identifier, the loading and switching of PCIe topology can be realized without the need to pre-design corresponding category identifier codes. This allows it to be applied to other general-purpose server devices, thus broadening its application range.

[0067] To facilitate understanding of the technical solution of this application, the following will first combine... Figure 3 This application will introduce a PCIe topology switching system provided in its embodiments.

[0068] Please see Figure 3 The present invention provides a PCIe topology switching system, including a motherboard 10 and a switch board 20.

[0069] The motherboard 10 includes: a first CPU, a second CPU, a BIOS chip, an out-of-band controller, and a programmable logic device (CPLD).

[0070] Specifically, the first CPU and the second CPU are connected via a bus, with the first CPU being the master CPU. The out-of-band controller is connected to the BIOS chip via the IPMI bus, and the out-of-band controller is connected to the programmable logic device via the local bus.

[0071] Among them, the CPU (central processing unit) is the core of the server system for operation and control, and is the final execution unit for information processing and program execution.

[0072] It should be noted that, in this embodiment, the motherboard 10 is provided with a first CPU and a second CPU, and the first CPU and the second CPU are coupled to each other through one or more buses to jointly form a processor group. In addition, the motherboard 10 may also have one CPU or more than two CPUs. This application does not make a specific limitation on the number of CPUs on the motherboard 10.

[0073] The out-of-band controller is a management component independent of the CPU. It can remotely maintain and manage the server through a dedicated data channel and communicate with the CPU through the server's out-of-band management interface. For example, the out-of-band controller can be an external monitoring and management unit, a management system in an external management chip, a baseboard management controller (BMC), or a system management mode (SMM). It should be noted that the specific form of the out-of-band controller in this application is not limited; the above is merely illustrative. In the following embodiments, only a BMC is used as an example of an out-of-band controller.

[0074] Taking the BMC as an example of an out-of-band controller, in this embodiment of the application, the BMC can remotely maintain and manage the motherboard 10 through a dedicated data channel, and can communicate with the first CPU and the second CPU through the out-of-band management interface.

[0075] The BIOS chip is a specific ROM chip used to store the BIOS program. The BIOS (Basic Input Output System) is a set of programs embedded in a ROM chip on the server's motherboard. The BIOS stores the server's most important basic input / output programs, including the power-on self-test (POST) program and the system boot program. The BIOS's main function is to provide the lowest-level and most direct hardware settings and control for the server. Furthermore, the BIOS runs before the operating system (OS) after the server is powered on. That is, the BIOS provides functions such as initializing the chip, allocating PCIe device resources, and booting the server.

[0076] The ROM chip is a physical object, essentially a storage device. It's a small rectangular or square chip on the motherboard's flash EEPROM memory module board, used to store the BIOS program. Besides this, the ROM chip can also store other programs and code.

[0077] It should be noted that BIOS and OS belong to the server's software layer and are not included in... Figure 3 As shown in the image.

[0078] A complex programmable logic device (CPLD) is a high-density, high-speed, low-power programmable logic device. It is a digital integrated circuit in which the user constructs the logic function according to their own needs.

[0079] The motherboard 10 can also be configured with at least one preset GPIO ( Figure 3 (Not shown in the image) indicates the current PCIe topology mode of the server. GPIO (General Purpose Input Output), also simply called IO port, uses its output level to indicate cascading mode and equalization mode. GPIO consists of pins and hardware registers; different frameworks use different GPIO packages, and the number of pins and hardware registers used varies.

[0080] It should be noted that the number of preset GPIOs can be set according to actual conditions. For example, the output level value of one preset GPIO can be used to indicate cascading mode and equalization mode. For instance, the output level value of the preset GPIO could be 1 to indicate equalization mode, and the output level value of the preset GPIO could be 0 to indicate cascading mode. Alternatively, the output level values ​​of two preset GPIOs can also be used to indicate cascading mode and equalization mode. For example, the output level values ​​of two preset GPIOs could both be 1 to indicate equalization mode, and the output level values ​​of two preset GPIOs could both be 0 to indicate cascading mode. This application does not specifically limit the number of preset GPIOs used to indicate PCIe topology modes or the method of indicating their output level values. For ease of understanding, the following embodiment uses the example of setting one GPIO, with the preset GPIO output level value of 1 indicating equalization mode and the preset GPIO output level value of 0 indicating cascading mode.

[0081] like Figure 3 As shown, the switching board 20 includes: a signal connector, a first switching device, and a second switching device.

[0082] Specifically, the first and second switching devices are respectively connected to the signal connectors.

[0083] The signal connector is actually a small circuit board with a CPLD embedded on it, which enables the CPLD on the signal connector to transmit signals with the CPLD on the motherboard 10, allowing the signal connector to read the preset GPIO output level value set on the motherboard 10.

[0084] Specifically, in order for the signal connector to read the preset GPIO output level value set on the motherboard 10, at least one GPIO ( Figure 3 (not shown in the image) is used to connect to at least one preset GPIO on the motherboard 10, so that the output level value of the preset GPIO on the motherboard 10 can be obtained.

[0085] In one possible implementation, the CPLD on the signal connector can read and write the output level values ​​of preset GPIOs on the motherboard 10 by setting at least one SGPIO interface. The SGPIO interface is obtained by instantiating GPIOs and is a communication interface based on the SGPIO protocol. The SGPIO (Serial General Purpose Input / Output) protocol is a protocol for serial communication, primarily used for input / output control between the server motherboard and external devices.

[0086] For example, after reading the output level value of a preset GPIO on the motherboard 10, the signal connector can determine the corresponding PCIe topology mode, and the signal connector can act as a switch. When the PCIe topology mode is determined to be cascade mode, the signal connector is turned on, so that the second switching device is connected to the first switching device, so as to realize the cascade mode in the future; when the PCIe topology mode is determined to be balanced mode, the signal connector is turned off, so that the first switching device and the second switching device are connected to the first CPU and the second CPU respectively in the future, so as to further realize the balanced mode.

[0087] Furthermore, the signal connector can also detect the presence of the first and second switching devices and determine whether the first and second switching devices can be used normally.

[0088] The first and second switching devices have identical structures. Upon leaving the factory, the chips of the first and second switching devices are respectively programmed with a first firmware supporting cascading mode and a second firmware supporting balanced mode. Firmware (FW) is software embedded in hardware devices, typically located in flash memory, EEPROM, or PROM within an application-specific integrated circuit (ASIC) or programmable logic device (PLD). Taking the first switching device as an example, when the first switching device loads the first firmware, it enables cascading mode PCIe topology; when the first switching device loads the second firmware, it enables balanced mode PCIe topology.

[0089] It should be pointed out that, Figure 3 The structure shown does not constitute a limitation of the PCIe topology switching system, except Figure 3In addition to the components shown, the system may include more or fewer components than illustrated, or combine certain components, or arrange different components. For example, the PCIe topology switching system also includes a display screen for displaying images, videos, etc. The display screen includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the server may include one or N displays, where N is a positive integer greater than 1. In the embodiments of this application, the display screen is mainly used to display the BIOS configuration interface, the management interface of the out-of-band controller, the BIOS settings interface of configuration items, etc. The display screen is also used to display the current server fault information and PCIe topology information, etc.

[0090] It should be noted that the system architecture and application scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0091] Example 1:

[0092] The following is combined Figure 4 Figure 6 provides a detailed introduction to the data based on... Figure 3 The PCIe topology switching system shown implements the server power-on process. Example 1 applies to the following scenario: assuming that neither the first nor the second CPU on the motherboard 10 is faulty, meaning no fault is detected during the server's power-on self-test (POST). Furthermore, there is no passive PCIe topology switching operation (e.g., switching via an out-of-band controller or the BIOS). Switching via the BIOS is an in-band mechanism; switching via an out-of-band controller is an out-of-band mechanism.

[0093] It should be noted that the server has a pre-configured default PCIe topology mode before power-on (before initialization). Furthermore, the default PCIe topology mode is generally a balanced mode, and this application does not limit the default PCIe topology mode pre-configured for the server.

[0094] The Power On Self Test (POST) process is a routine self-check performed by the server system after the server is powered on and the power-on process begins.

[0095] Before the server powers on, the server's BIOS pre-defines two sets of PCIe device trees based on the server configuration: a cascaded PCIe device tree and a balanced PCIe device tree. This allows the server to enumerate the PCIe topology based on the corresponding PCIe device tree for each PCIe topology mode.

[0096] A device tree is a data structure that describes hardware devices, using a structured text format to describe the hardware components in a server system and the connections between them. PCIe devices contain hardware resources and configuration information related to the PCIe bus within the server.

[0097] Specifically, the two pre-set PCIe device counts are actually based on the preset paths corresponding to cascading mode and cascading mode respectively, as set by the server.

[0098] To make it easier to understand, the following example will be used to illustrate the point. Figure 3 Taking the PCIe topology switching system shown as an example, such as Figure 5A and Figure 5B As shown, where Figure 5A The diagram shows one code implementation of a cascaded PCIe topology tree, where "cpu1" represents the first CPU, "sw1 bridge" represents the first switching device, "sw2 bridge" represents the second switching device, and "00.0", "01.0", etc., represent the PCIe port numbers of the switching devices. Figure 5B The diagram shows a schematic of the tree structure of a cascaded PCIe topology. Figure 5A The diagram shows a PCIe device tree configuration. The cascading mode of the PCIe device tree can represent the connection between the first CPU and the first switch, and the connection between the first switch and the second switch; for example... Figure 6A and Figure 6B As shown, where Figure 6AThe diagram shows one code implementation of a balanced PCIe topology tree, where "cpu1" represents the first CPU, "cpu2" represents the second CPU, "sw1 bridge" represents the first switching device, "sw2 bridge" represents the second switching device, and "00.0", "01.0", etc., represent the PCIe port numbers of the switching devices. Figure 6A The diagram shows the tree structure of a PCIe topology in a balanced mode. Figure 6A The PCIe device tree configuration shown is another example of a balanced mode. The PCIe device tree corresponding to this balanced mode can represent the connection between the first CPU and the first switch, and the connection between the second CPU and the second switch.

[0099] Before the server powers on, the server's BIOS configures the corresponding PCD data for cascade mode and balanced mode, respectively, to adjust the CPU's MMIO resources.

[0100] MMIO (Memory Mapping I / O) is part of the PCI specification. In MMIO, I / O devices are placed in memory space instead of I / O space. From the processor's perspective, accessing system devices via MMIO is the same as accessing main memory. This means the CPU can access peripheral PCIe devices using the same assembly instructions as reading from and writing to main memory, simplifying program design and reducing interface complexity. Simply put, MMIO maps peripheral PCIe devices to main memory space, making them easier for the CPU to access.

[0101] MMIO resources refer to the size of the memory address space provided by the CPU for MMIO, that is, the size of the memory space in the CPU used to store the virtual addresses mapped by peripheral PCIe devices. MMIO resources can be likened to a memory pool. Corresponding PCDs are configured for cascaded mode and balanced mode to adjust the CPU's MMIO resources. Specifically, when the BIOS obtains and applies the PCD corresponding to cascaded mode, the memory address space provided by the CPU for MMIO is larger; when the BIOS obtains and applies the PCD corresponding to balanced mode, the memory address space provided by the CPU for MMIO is smaller. Since the PCIe topology is in cascaded mode, where all peripheral PCIe devices are connected to one CPU through a switch, a larger MMIO memory space needs to be adapted, i.e., a larger MMIO resource is required. In contrast, in balanced mode, peripheral PCIe devices are evenly distributed across two CPUs (this application uses two CPUs as an example, without specifying the exact number of CPUs), and each CPU in cascaded mode requires a smaller MMIO memory space, i.e., a smaller MMIO resource is needed. Therefore, this application configures corresponding PCDs for cascading mode and balanced mode to adjust the CPU's MMIO resources, so as to avoid the two PCIe topology modes from being adapted to the same MMIO resource, that is, the two PCIe topology modes are adapted to the same memory space for storing MMIO. This would result in insufficient memory space for storing MMIO in cascading mode, causing some peripheral PCIe devices to be unable to access and operate normally.

[0102] S401, the server powers on and starts up.

[0103] Specifically, after the server powers on and starts up, the BIOS runs first, and after the BIOS finishes running, it boots the operating system (OS).

[0104] For example, after the server is powered on, it may start in response to user operation and begin the initialization process; or the server may be pre-configured to start automatically upon power-on, that is, the server will start automatically and begin the initialization process after the power is powered on.

[0105] It should be noted that a default PCIe topology is pre-configured when the server leaves the factory or before its first power-on. Generally, the default PCIe topology mode is set to balanced mode.

[0106] S402, BIOS obtains the topology identifier of the current configuration.

[0107] The topology identifier is represented by the output level value of a preset GPIO. In this embodiment, a preset GPIO output level of 1 indicates a topology identifier for equalization mode, and a preset GPIO output level of 0 indicates a topology identifier for cascading mode. The preset GPIO is powered by a standby power supply, meaning that the preset GPIO can maintain its current state under normal power-off conditions.

[0108] It should be noted that the currently configured topology identifier is the topology identifier corresponding to the pre-set default PCIe topology mode.

[0109] Specifically, the BIOS obtains the output level value of the preset GPIO on the current motherboard 10, and then obtains the topology identifier of the current configuration.

[0110] In one possible implementation, the BIOS sends an IPMI command to the BMC, and the BMC passes it through the local bus to the CPLD to obtain the topology identifier of the current configuration.

[0111] IPMI (Intelligent Platform Management Interface) is an open hardware management protocol that provides remote management and monitoring capabilities for servers, storage, and network devices. Communication between the BMC and the BIOS chip (i.e., BIOS) is based on IPMI.

[0112] The Local Bus, also known as the System Bus, allows for rapid data transfer within the system to support efficient system operation. Typically implemented on a motherboard, the Local Bus is used within the system to enable fast and efficient communication between various hardware components. Communication between the BMC and programmable logic devices is based on the Local Bus.

[0113] In another possible implementation, the BIOS obtains the topology identifier of the current configuration directly by sending a command to the CPLD.

[0114] Of the two specific paths for obtaining the current configuration topology identifier, the method where the BIOS sends the identifier to the BMC via IPMI commands, and the BMC then passes it through the local bus to the CPLD, has higher priority. The method where the BIOS directly sends a command to the CPLD to obtain the current configuration topology identifier also has higher priority. Therefore, when the BMC is functioning normally (without malfunction), the method where the BIOS sends the identifier to the BMC via IPMI commands, and the BMC then passes it through the local bus to the CPLD, is preferred. Since the BMC is not currently configured to actively obtain configuration updates from the CPLD and BIOS, obtaining the current configuration topology identifier through this method allows the topology identifier to be updated in the BMC during server startup, ensuring that the configuration information stored in the BMC is synchronized with the current configuration.

[0115] Furthermore, when the BMC cannot function properly (e.g., BMC malfunction, BMC power supply problem, etc.), the BIOS can directly obtain the currently configured topology identifier by sending a command to the CPLD, thus preventing the inability to load the topology mode properly when the BMC cannot function properly.

[0116] S403, BIOS allocates PCIe bandwidth to the first CPU and the second CPU.

[0117] This step is essential during the server's power-on startup process. The PCIe bandwidth allocated to the first and second CPUs is primarily pre-designed by the motherboard manufacturer before the motherboard leaves the factory. During BIOS operation, the PCIe bandwidth allocation is automatically completed based on the pre-designed PCIe bandwidth for the first and second CPUs by the motherboard manufacturer.

[0118] S404 and BIOS obtain the PCD data corresponding to the obtained topology identifier.

[0119] Specifically, when the topology identifier indicates that the currently configured topology mode is cascading mode, the PCD data corresponding to the cascading mode is obtained; when the topology identifier indicates that the currently configured topology mode is balanced mode, the PCD data corresponding to the balanced mode is obtained.

[0120] S405 and BIOS allocate MMIO resources based on the PCD data corresponding to the obtained topology identifier.

[0121] Based on the acquired topology identifier, the corresponding PCD data is adapted and applied to allocate MMIO resources for the first and second CPUs. In other words, the BIOS adapts the MMIO resources corresponding to the topology identifier for each CPU, so as to provide corresponding mapped address storage memory space for peripheral PCIe devices connected to the switching device connected to that CPU.

[0122] After the server powers on and starts up, while the BIOS implements steps S402-S405, the programmable logic device (CPLD) on the signal connector of the switch board 20 transmits signals to the programmable logic device (CPLD) on the motherboard 10. After the server powers on and starts up, the switch board 20 can perform specific processing steps such as S406-S407.

[0123] S406. Through communication between the CPLD of the signal connector and the CPLD of the motherboard 10, the signal connector obtains the topology identifier of the current configuration.

[0124] Specifically, the CPLD of the signal connector reads and writes the output level value of the preset GPIO on the motherboard 10 through the SGPIO interface to obtain the topology identifier of the current configuration.

[0125] S407. The switching device loads the firmware corresponding to the topology mode based on the currently configured topology identifier.

[0126] Specifically, after the signal connector reads the output level value of the preset GPIO on the motherboard 10 through the SGPIO interface, it will also write to the GPIO on the signal connector according to the obtained output level value of the preset GPIO. The switching device actively reads the output level value of the GPIO on the signal connector to determine the current configured topology mode. The switching device loads the corresponding firmware according to the current configured topology mode, thereby completing the topology mode configuration operation.

[0127] Furthermore, after the switching device loads the firmware corresponding to the topology mode based on the currently configured topology identifier, the server physical layer performs PCIe link training according to the PCIe link bandwidth allocation and correctly negotiates and establishes links with the PCIe devices connected to the switching device. At this point, the CPU can communicate normally with the PCIe devices via the PCIe Bus. The system then determines whether the link information meets the preset link requirements, i.e., whether the current PCIe topology mode conforms to the currently configured topology mode, until the link information meets the preset link requirements. This ensures that address mapping can be correctly performed according to the resources requested by the PCIe devices during the PCIe enumeration phase.

[0128] S408 and BIOS complete the enumeration process of PCIe devices based on the PCIe device tree corresponding to the currently configured topology identifier.

[0129] The enumeration process for PCIe devices is performed during the BDS (Boot Device Selection) phase, which is located later in the server startup process.

[0130] Specifically, the topology mode is determined based on the currently configured topology identifier, and the PCIe device enumeration process is completed based on the PCIe device tree corresponding to the pre-set topology mode.

[0131] For example, the currently configured topology identifier indicates that the currently configured topology mode is balanced mode. An enumeration scan operation is performed based on the preset path (DevPath) in the PCIe device tree of the balanced mode to match the device information of the PCIe devices for the preset path in the PCIe device tree of the balanced mode. The device information can be silkscreen markings designed by the manufacturer of the PCIe chip of the PCIe device.

[0132] S409. The BIOS fills in the device information of the PCIe device according to the SMBIOS specification and reports it to the BMC.

[0133] Among them, SMBIOS (System Management BIOS) is a unified specification that motherboard or system manufacturers must follow to display product management information in a standard format.

[0134] Among them, PCIe devices are the PCIe devices matched during the BIOS's enumeration of PCIe devices.

[0135] For example, in accordance with the SMBIOS standard, detailed information about the PCIe device is written into the BIOS, and the device information of the PCIe device is written into memory. The completed device information is then reported to the BMC, so that the BMC can display the complete device information, topology mode, etc. of the PCIe device to the user through the display screen, allowing the user to intuitively understand the detailed information of the currently available PCIe device.

[0136] S410, BIOS boots the operating system.

[0137] In this embodiment, the PCIe topology mode identifier is transmitted by preset GPIO output level value, and communication can be carried out through a common protocol (IPMI protocol, Local Bus, etc.). Therefore, the versatility of the method and system provided in this embodiment is greatly improved, making the application scope wider.

[0138] Furthermore, by using preset GPIO output level values ​​to transmit the PCIe topology mode identifier, no new special transmission instructions need to be designed, making signal transmission simpler and significantly improving practicality and feasibility. In other words, PCIe topology identifier transmission can be achieved without excessive software or hardware design.

[0139] Example 2:

[0140] The following is combined Figure 7This paper details a method for switching PCIe topologies, which is based on... Figure 3 The PCIe topology switching system shown demonstrates the process of a server actively switching its PCIe topology. Example 2 applies to scenarios where there is no passive PCIe topology switching operation (e.g., modifying the server's PCIe topology mode out of band, modifying the server's PCIe topology mode in-band, etc.).

[0141] Before powering on the server, the server's BIOS pre-defines two sets of PCIe device trees based on the server's configuration: a cascaded mode PCIe device tree and a balanced mode PCIe device tree. This allows the server to perform PCIe topology enumeration based on the PCIe device tree corresponding to the PCIe topology mode. It also configures the corresponding PCD data for cascaded and balanced modes to adjust the CPU's MMIO resources.

[0142] S701, the server powers on and starts up.

[0143] Specifically, when a server powers on and starts up, it signifies that the BIOS has begun running.

[0144] For example, in response to the server powering on, the BIOS starts running and begins the BIOS chip (chipset) initialization process.

[0145] S702, BIOS obtains the topology identifier of the current configuration.

[0146] Specifically, the BIOS reads the output level value of the preset GPIO to obtain the topology identifier of the current configuration.

[0147] S703, BIOS detects the presence of the CPU in the server.

[0148] Among them, the BIOS has a self-test function, namely the power-on self-test (POST), which can perform a self-check on the server system.

[0149] Detecting the CPU availability in the server can be understood as detecting the server's operational status. For example, if the first CPU is detected to be present and the second CPU is absent, it means that only one CPU in the server is functioning normally; if the first CPU is detected to be present and the second CPU is malfunctioning, it means that only one CPU in the server is functioning normally; if both the first and second CPUs are detected to be present, it means that both the first and second CPUs in the server are functioning normally.

[0150] If both the first and second CPUs in the server are running normally, then proceed directly to S705.

[0151] If only one CPU of the server is functioning properly, then S704 is executed.

[0152] S704, BIOS switches PCIe topology mode to cascade mode.

[0153] Specifically, the BIOS determines whether the obtained topology identifier indicates that the currently configured topology mode is cascade mode. If the currently configured topology mode is cascade mode, no switching is required, and the server power-on process is the same as the power-on process provided in Example 1. If the currently configured topology mode is balanced mode, the BIOS needs to switch the currently configured topology mode to cascade mode.

[0154] If the current topology mode is balanced mode, the BIOS needs to use the CPLD to set the output level value of the preset GPIO to the output level value that represents the cascade mode.

[0155] In one possible implementation, when the BMC is not malfunctioning (in abnormal operation), the BIOS sends a switching command to the BMC via IPMI commands. The BMC then passes this command through the local bus to the CPLD to set the output level of the preset GPIO to the level representing the cascading mode. For example, the output level of the preset GPIO is switched from 1 to 0. Simultaneously with switching the PCIe topology mode to cascading mode, the topology identifier corresponding to the updated cascading mode is updated in the BMC, thus synchronizing the configuration information stored in the BMC with the current configuration information.

[0156] In another possible implementation, when the BMC malfunctions (cannot operate normally), the BIOS can directly set the output level of a preset GPIO to a level representing the cascading mode via the CPLD. For example, the preset GPIO output level can be switched from 1 to 0. This avoids the inability to switch topology modes properly when the BMC fails to operate normally.

[0157] It should be noted that whether the BMC is faulty (whether it can operate normally) can be directly detected during the BIOS power-on self-test.

[0158] In one possible implementation, when the BIOS detects that only one CPU in the server is functioning normally, it reports fault information (e.g., the second CPU is not present or is malfunctioning) to the BMC. The BMC then collects this fault information and displays it to the user, indicating the specific fault condition of the server. For example, the fault information can be displayed directly on the server's own screen, or it can be displayed to the user via a remote server or a web page.

[0159] Furthermore, after BMC collects fault information, BMC will also issue fault alarms based on the collected fault information to quickly notify users that there is a fault in the server.

[0160] S705, BIOS allocates PCIe bandwidth to the first and second CPUs.

[0161] S706 and BIOS obtain the PCD data corresponding to the cascading mode based on the topology identifier corresponding to the cascading mode.

[0162] S707 and BIOS allocate MMIO resources based on the PCD data corresponding to the cascading mode obtained.

[0163] The specific implementation of steps S705-S707 above is the same as that of S403-S405 in Embodiment 1. For details, please refer to S403-S405 in Embodiment 1, which will not be repeated here.

[0164] After the server powers on and boots up, while the BIOS implements S701-S707, the programmable logic device (CPLD) on the signal connector of the switch board 20 transmits signals to the programmable logic device (CPLD) on the motherboard 10. The specific processing steps that can be performed on the switch board 20 after the server powers on and boots up are as follows.

[0165] In one possible implementation, when the BIOS detects that only one CPU in the server is functioning normally and the default topology mode is cascaded mode, there is no need to switch the PCIe topology, and the steps are the same as S406 and S407 in Embodiment 1.

[0166] In one possible implementation, when the BIOS detects that only one CPU in the server is running normally and the default topology mode is balanced mode, a PCIe topology switch is required. The specific processing steps performed on the switch board 20 at this time are as follows: S708-S711.

[0167] S708: Through communication between the CPLD of the signal connector and the CPLD of the motherboard 10, the signal connector obtains the topology identifier of the current configuration.

[0168] It should be noted that this step occurs before the topology mode switching, so the topology identifier obtained by the signal connector at this time is the topology identifier of the topology mode before the switch, that is, the topology identifier corresponding to the equalization mode.

[0169] Specifically, the CPLD of the signal connector reads and writes the level values ​​of the preset GPIO on the motherboard 10 through the SGPIO interface to obtain the topology identifier of the current configuration.

[0170] S709: The switching device loads the firmware corresponding to the load balancing mode based on the currently configured topology identifier.

[0171] After the BIOS switches the PCIe topology mode to cascading mode, S710 is performed.

[0172] S710, through communication between the CPLD of the signal connector and the CPLD of the motherboard 10, the signal connector re-acquires the topology identifier of the current configuration.

[0173] Specifically, after the BIOS switches the PCIe topology mode to cascade mode (that is, after setting the output level value of the preset GPIO to the output level value corresponding to the cascade mode), the BIOS generates a read command, which instructs the signal connector to reread the output level value of the preset GPIO; in response to the read command, the BIOS re-acquires the currently configured topology identifier through the signal connector (that is, rereads the output level value of the preset GPIO through the signal connector).

[0174] It should be noted that this step occurs after the PCIe topology switch, so the topology identifier obtained by the signal connector at this time is the topology identifier of the updated topology mode, that is, the topology identifier corresponding to the cascade mode.

[0175] S711 The switching device reloads the firmware corresponding to the cascade mode based on the currently configured topology identifier.

[0176] After the switching device reloads the firmware corresponding to the cascade mode, it achieves active switching of the PCIe topology.

[0177] S712 and BIOS complete the enumeration process of PCIe devices based on the PCIe device tree corresponding to the currently configured topology identifier.

[0178] At this point, the currently configured topology identifier is the updated topology identifier, which is the topology identifier for cascading mode.

[0179] S713, the BIOS fills in the device information of the PCIe device according to the SMBIOS specification and reports it to the BMC.

[0180] The S714 BIOS boots the operating system.

[0181] The specific implementation of steps S712-S714 above is the same as that of S408-S410 in Embodiment 1. For details, please refer to S408-S410 in Embodiment 1, which will not be repeated here.

[0182] In this embodiment, when only one CPU in the server is running normally during the BIOS self-test, automatic PCIe topology switching is implemented. Specifically, when only one CPU in the server is running normally, the PCIe topology is switched to cascade mode to ensure all PCIe devices can operate normally. This relies on the BIOS's power-on self-test function; in response to the detection result that only one CPU in the server is running normally, the BIOS switches the PCIe topology to cascade mode, proactively switching the PCIe topology mode in response to server failures. This achieves proactive PCIe topology switching without entirely relying on the BMC.

[0183] Furthermore, it needs to be explained that, for example Figure 7 The illustrated process involves the BIOS detecting a CPU failure during the power-on self-test (POST) and then performing a PCIe topology switch. This primarily concerns the scenario where a proactive PCIe topology switch occurs before the server has fully powered on. Another proactive switch scenario exists where, after the server has powered on, the BIOS monitors the internal hardware in real-time using its detection functions. If it detects that the second CPU in the server is not functioning correctly, it proactively switches the PCIe topology. The specific steps in this case are as follows... Figure 8 As shown.

[0184] S801 and BIOS real-time detection revealed that only one CPU in the server was functioning normally.

[0185] For example, the BIOS monitors the server's internal hardware in real time and detects a situation where the server changes from having two CPUs running normally to having only one CPU running normally.

[0186] S802, BIOS switches PCIe topology mode to cascade mode.

[0187] Specifically, the BIOS sets the output level of the preset GPIO on the motherboard 10 to the level corresponding to the cascading mode, that is, sets the output level of the preset GPIO to 0.

[0188] When the preset GPIO output level value is set, the server has already been powered on, so active PCIe topology switching cannot be achieved.

[0189] The S803 BIOS control server is powered on and restarted.

[0190] At this point, the server needs to be restarted for the updated topology mode to take effect, enabling the CPU to communicate with PCIe devices using the updated topology mode.

[0191] S804, BIOS obtains the topology identifier of the current configuration.

[0192] At this point, the topology mode corresponding to the currently configured topology identifier is the updated topology mode (i.e., cascading mode).

[0193] S805 and BIOS allocate PCIe bandwidth to the first and second CPUs.

[0194] S806 and BIOS obtain the PCD data corresponding to the obtained topology identifier.

[0195] S807 and BIOS allocate MMIO resources based on the PCD data corresponding to the obtained topology identifier.

[0196] After the server powers on, while the BIOS implements steps S401-S405, the programmable logic device (CPLD) on the signal connector of the switch board 20 transmits signals to the programmable logic device (CPLD) on the motherboard 10. The specific processing steps performed simultaneously on the switch board 20 at this time are as described in steps S808-S809.

[0197] S808: Through communication between the CPLD of the signal connector and the CPLD of the motherboard 10, the signal connector obtains the topology identifier of the current configuration.

[0198] Specifically, in response to the server's power-on restart, the preset GPIO output level value is reread through the signal connector to determine the currently configured topology mode.

[0199] S809: The switching device loads the firmware corresponding to the topology mode based on the currently configured topology identifier.

[0200] The S810 and BIOS complete the enumeration process of PCIe devices based on the PCIe device tree corresponding to the currently configured topology identifier.

[0201] S811, the BIOS fills in the device information of the PCIe device according to the SMBIOS specification and reports it to the BMC.

[0202] The S812 BIOS boots the operating system.

[0203] The specific implementation of steps S804-S812 above is the same as that of S402-S410 in Embodiment 1. For details, please refer to S402-S410 in Embodiment 1, which will not be repeated here.

[0204] In this embodiment, after the server has booted up (or is in normal operation), if the BIOS self-test indicates that only one CPU in the server is running normally, a proactive PCIe topology switch is achieved in conjunction with a server power-on restart. This achieves proactive PCIe topology switching without relying entirely on the BMC, thus expanding the application scope of the PCIe topology method. Furthermore, the fault tolerance mechanism is greatly improved, enabling proactive detection of CPU faults and thus proactive PCIe topology switching.

[0205] Example 3:

[0206] The following is combined Figure 9 , Figure 10A , Figure 10B and Figure 10C This paper details a method for switching PCIe topologies, which is based on... Figure 3 The PCIe topology switching system shown demonstrates the process of switching PCIe topology via an in-band mechanism. Example 3 applies to scenarios where PCIe topology switching is performed via an in-band mechanism, assuming that both the first and second CPUs within the server are functioning normally.

[0207] S901, the server starts up and enters the BIOS configuration interface.

[0208] The server's BIOS provides a configuration interface based on a human interface infrastructure (HII), also known as the BIOS setup interface. In this embodiment, a one-click PCIe topology switching option is pre-added to the BIOS setup interface, providing two options for PCIe topology modes, corresponding to cascade mode and balanced mode, respectively.

[0209] To facilitate understanding the BIOS configuration interface, the following will combine... Figure 10A Let's illustrate with examples.

[0210] The BIOS configuration interface offers a variety of configuration options, including: main information, advanced settings, security options, power management settings, and exit options.

[0211] The main information section records key server information, such as time and date.

[0212] The advanced settings include various configuration items, such as video configuration, southbridge configuration, system event log, and CPU-related settings. The configuration item for one-click PCIe topology switching provided in this embodiment is located under the IIO configuration item within the CPU-related settings.

[0213] Among them, the security options are configurations related to the server's password.

[0214] The power management settings are used to configure the computer's power options to save energy, improve performance, and protect hardware in different working environments.

[0215] The Exit option is used to exit the current BIOS configuration interface.

[0216] For example, during server startup or operation, a user can enter the BIOS configuration interface by pressing a specific key / key combination. For instance, pressing the Del key allows the user to access the BIOS configuration interface and configure various settings.

[0217] S902, In response to the user's topology mode configuration operation in the BIOS configuration interface, determine the target topology mode.

[0218] For example, users can switch PCIe topology configuration options with a single click in the BIOS configuration interface to set the target topology mode. For instance, a user can access the BIOS configuration interface by pressing a button, select the desired PCIe topology mode, and the target topology mode will be the selected PCIe topology mode.

[0219] The following is combined Figures 10A-10C For example, we will illustrate this.

[0220] After the user starts the server and enters the BIOS configuration interface, the server's display shows the following: Figure 10A The BIOS configuration interface shown is illustrated; users can select advanced settings using the mouse, and the server's display shows the following: Figure 10B The BIOS configuration interface shown; as Figure 10B The displayed BIOS configuration interface shows the user various configuration items under advanced settings, such as... Figure 10B The video configuration, southbridge configuration, system event log, and CPU-related settings are shown. Users can select CPU-related settings using the mouse, and the server's display shows the following: Figure 10C The BIOS configuration interface shown; at this time, based on... Figure 10C In the BIOS configuration interface shown, users can select either Balanced Mode or Cascading Mode as the target topology mode according to their needs. After making the selection, users can click Save with the mouse to make the selected target topology mode take effect and complete the target topology mode setting.

[0221] S903, BIOS responds to the target topology mode setting by setting the PCIe topology mode to the target topology mode.

[0222] Specifically, in response to the setting of the target topology mode, the BIOS sets the topology identifier to the identifier corresponding to the target topology mode.

[0223] For example, after the user selects the target topology mode and clicks save with the mouse, the BIOS responds to the save operation by setting the output level of the preset GPIO to the GPIO level value corresponding to the target topology mode.

[0224] Furthermore, the BIOS updates the target topology mode to the BMC to keep the configuration information of the BIOS and BMC synchronized.

[0225] After the S904 BIOS completes the setting of the target topology mode, the BIOS controls the server to power on and restart.

[0226] PCIe topology switching is performed through in-band mechanisms. The server must be restarted after the target topology mode is set to enable PCIe topology switching and allow the CPU to communicate with PCIe devices in the target topology mode.

[0227] S905, BIOS obtains the topology identifier of the current configuration.

[0228] S906, BIOS allocates PCIe bandwidth to the first CPU and the second CPU.

[0229] S907 and BIOS obtain the PCD data corresponding to the obtained topology identifier.

[0230] S908 and BIOS allocate MMIO resources based on the PCD data corresponding to the obtained topology identifier.

[0231] After the server powers on, while the BIOS implements S905-S908, the programmable logic device (CPLD) on the signal connector of the switch board 20 transmits signals to the programmable logic device (CPLD) on the motherboard 10. The specific processing steps performed on the switch board 20 at this time are as follows: S909-S910.

[0232] S909: Through communication between the CPLD of the signal connector and the CPLD of the motherboard 10, the signal connector obtains the topology identifier of the current configuration.

[0233] The S910 switching device loads the firmware corresponding to the topology mode based on the currently configured topology identifier.

[0234] S911 and BIOS complete the enumeration process of PCIe devices based on the PCIe device tree corresponding to the currently configured topology identifier.

[0235] S912, the BIOS fills in the device information of the PCIe device according to the SMBIOS specification and reports it to the BMC.

[0236] S913, BIOS boots the operating system.

[0237] The specific implementation of steps S904-S912 above is the same as that of S402-S410 in Embodiment 1. For details, please refer to S402-S410 in Embodiment 1, which will not be repeated here.

[0238] In this embodiment, a configuration item for one-click PCIe topology switching is pre-added to the BIOS configuration interface, enabling in-band PCIe topology switching via the BIOS configuration interface. Since this embodiment relies on the communication between the CPLD of the signal connector on the switch board 20 and the CPLD of the motherboard 10 to read and write GPIO level values, thereby loading and switching the PCIe topology mode, and since the communication between the CPLD of the signal connector on the switch board 20 and the CPLD of the motherboard 10 is a universal communication link, PCIe topology switching can be achieved without the need for out-of-band modules / devices to control the signal connector. Therefore, by setting the preset GPIO output level value through the in-band mechanism, in-band PCIe topology switching can be achieved, no longer completely relying on the BMC to achieve PCIe topology switching, thus avoiding the phenomenon of PCIe topology switching failure due to BMC malfunction.

[0239] Example 4:

[0240] The following is combined Figure 11 This application provides a detailed description of a PCIe topology switching method based on an embodiment of the present application. Figure 3 The PCIe topology switching system shown demonstrates the process of switching PCIe topology via an out-of-band mechanism. Example 4 applies to scenarios where PCIe topology switching is performed via an out-of-band mechanism, assuming that both the first and second CPUs within the server are functioning normally.

[0241] S1101, Users set the target topology mode through a remote server.

[0242] For example, a user sets a target topology mode via a remote server and generates a signal about the target topology mode to send to the BMC.

[0243] S1102, BMC receives the target topology pattern sent from the remote server.

[0244] S1103 and BMC set the PCIe topology mode to the target topology mode according to the target topology mode.

[0245] Specifically, BMC sets the topology identifier to the topology identifier corresponding to the target topology pattern.

[0246] For example, the BMC sets the output level of the preset GPIO on the motherboard 10 to the GPIO level corresponding to the target topology mode via the CPLD. This facilitates subsequent PCIe topology switching based on the target topology mode set by the BMC.

[0247] Furthermore, out-of-band mechanisms enable PCIe topology switching. S1101-S1103 can be implemented as follows: Before the server powers on, the BMC has a separate power supply. As long as the BMC is powered on, it can complete the setting of the PCIe topology mode to the target topology mode. After the target topology mode is set, the server powers on and starts up, thereby achieving PCIe topology switching; Alternatively, during the server startup process, when the BMC sets the PCIe topology mode to the target topology mode, the BIOS will reacquire the currently configured topology identifier, and the signal connector of the switch board 20 will reread the preset GPIO output level value on the motherboard 10, thereby achieving PCIe topology switching; Alternatively, during normal server operation, when the BMC sets the PCIe topology mode to the target topology mode, the BIOS will control the server to power on and restart, thereby achieving PCIe topology switching.

[0248] The embodiments of this application, in combination with other embodiments, illustrate the PCIe topology switching method provided by this application, which can achieve PCIe topology switching with in-band mechanism and active PCIe topology switching, while still being able to achieve PCIe topology switching with out-of-band mechanism.

[0249] Example 5:

[0250] The following is combined Figure 12 This application provides a detailed description of a PCIe topology switching method based on embodiments of the present application. It describes a PCIe topology switching method executed primarily by the BIOS.

[0251] S1201: The server powers on and starts up, instructing the BIOS to execute the server's chipset initialization process.

[0252] S1202, BIOS obtains the topology identifier of the current configuration.

[0253] There are several scenarios for the topology identifier of the current configuration obtained by the BIOS. The following examples illustrate four of these scenarios.

[0254] For example, the currently configured topology identifier can be the topology identifier corresponding to the default PCIe topology mode. That is, the user has not passively switched the PCIe topology through in-band and out-of-band mechanisms, so the currently configured topology identifier has not been switched and is still the topology identifier corresponding to the default PCIe topology mode.

[0255] For example, the currently configured topology identifier can be the topology identifier corresponding to the target topology mode set by the user through a remote server, received by the BMC. That is, the user sets the target topology mode using a remote server via out-of-band mechanism. The BMC receives the target topology mode sent by the remote server and sets the currently configured topology identifier to the topology identifier corresponding to the target topology mode. When the BMC sets the currently configured topology identifier to the topology identifier corresponding to the target topology mode before the server powers on, the server powers on directly, and the BIOS obtains the topology identifier directly corresponding to the target topology mode set by the user through the out-of-band mechanism. When the BMC sets the currently configured topology identifier to the topology identifier corresponding to the target topology mode during the server startup process, the BIOS first obtains the topology identifier corresponding to the default topology mode. After the BMC completes the setting, the BIOS obtains the topology identifier corresponding to the target topology mode again. When the BMC sets the currently configured topology identifier to the topology identifier corresponding to the target topology mode while the server is running (after startup is complete), the BIOS controls the server to power on again, and the BIOS obtains the topology identifier directly corresponding to the target topology mode.

[0256] For example, the currently configured topology identifier can be the target topology mode set by the user through the BIOS configuration interface. That is, the user sets and saves the target topology mode through the BIOS configuration interface via an in-band mechanism. In response to the save operation, the BIOS sets the currently configured topology identifier to the topology identifier corresponding to the target topology mode, based on the target topology mode set by the user through the BIOS configuration interface. After the topology identifier corresponding to the target topology mode is set, the BIOS control server powers on again, and the currently configured topology identifier obtained by the BIOS is directly the topology identifier corresponding to the target topology mode.

[0257] S1203, BIOS detects the CPU presence status in the server.

[0258] If only one CPU of the server is functioning normally, then S1204 and S1205 are executed.

[0259] If both CPUs in the server are running normally, proceed directly to S1206.

[0260] S1204, BIOS switches PCIe topology mode to cascade mode.

[0261] For example, the BIOS sets the currently configured topology identifier to the topology identifier corresponding to the cascading mode, and at the same time, the topology identifier currently configured obtained by the BIOS is directly updated to the topology identifier corresponding to the cascading mode.

[0262] S1205, the BIOS reports the fault information to the BMC.

[0263] The BMC collects fault information sent by the BIOS and displays the server's fault information to the user.

[0264] After collecting the fault information sent by the BIOS, the BMC will also generate alarms to quickly alert the user that the server has a fault.

[0265] It should be noted that S1205 and S1206 can be executed synchronously or asynchronously, and this application does not make specific limitations.

[0266] S1206, BIOS allocates PCIe bandwidth to the first CPU and the second CPU.

[0267] S1207. Determine the PCIe topology mode based on the obtained topology identifier of the current configuration.

[0268] If the PCIe topology mode is determined to be cascaded mode, proceed to step S1208; if the PCIe topology mode is determined to be balanced mode, proceed to step S1209.

[0269] S1208. Obtain the PCD data corresponding to the cascade mode, and allocate MMIO resources based on the PCD data corresponding to the cascade mode.

[0270] S1209. Obtain the PCD data corresponding to the balanced mode, and perform MMIO resource allocation based on the PCD data corresponding to the balanced mode.

[0271] After S1201 is performed, while the BIOS implements S1201-S1209, the CPLD of the motherboard 10 communicates with the signal connector of the switching board 20 so that the first switching device and the second switching device can load or switch firmware according to the PCIe topology mode.

[0272] Specifically, through communication between the CPLD of the signal connector and the CPLD of the motherboard 10, the signal connector obtains the currently configured topology identifier, and the switching device loads / switches the firmware corresponding to the topology mode according to the currently configured topology identifier.

[0273] After the first and second switching devices complete the firmware loading or switching according to the PCIe topology mode, the BIOS proceeds to S1210.

[0274] S1210, BIOS completes the enumeration process of PCIe devices.

[0275] S1211. The BIOS fills in the device information of the PCIe device according to the SMBIOS specification and reports it to the BMC.

[0276] After receiving the PCIe device information submitted according to the SMBIOS specification, the BMC displays this information to the user. This prompts the user to understand the server's current PCIe information (e.g., PCIe topology mode, PCIe device connection status, and PCIe device information).

[0277] S1212, BIOS boots the operating system.

[0278] Furthermore, during the S1201-S1212 process, after the user enters the BIOS configuration interface in response to the user's operation, the user sets the target topology mode through the BIOS configuration interface and saves it. In response to the save operation, the BIOS will set the currently configured topology identifier to the topology identifier corresponding to the target topology mode, and then the BIOS will directly control the server to power on and start again.

[0279] Furthermore, for example, during the process of S1201-S1212, the CPLD of the motherboard simultaneously detects the presence of the first and second switching devices of the switching board 20; when neither the first nor the second switching device is present, it reports fault information to the BMC (e.g., the first switching device is not present, etc.), the BMC collects the fault information sent by the CPLD and displays the fault information of the switching device to the user.

[0280] This application provides a PCIe topology switching method that can passively switch PCIe topology in response to user settings, or actively switch PCIe topology by detecting the CPU status in the server through BIOS. For passive PCIe topology switching, it does not rely entirely on the out-of-band mechanism of the BMC; it can also achieve PCIe topology switching through the in-band mechanism of the BIOS configuration interface. This has a wider range of applications, and even when the BMC fails and cannot be used, passive PCIe topology switching can still be achieved through the BIOS configuration interface, avoiding the situation where a BMC failure prevents PCIe topology switching when relying entirely on the BMC, thus providing high fault tolerance.

[0281] Furthermore, compared to existing technologies, the embodiments of this application do not require the use of an additional x16 PCIe Port resource, thus saving resource waste; and the embodiments of this application do not require setting multiple signal terminals, which would lead to wasted hardware resource operations. Therefore, the embodiments of this application avoid resource waste.

[0282] Furthermore, the signal transmission in the embodiments of this application can be achieved using industry-standard IPMI, basic bus, and SGPIO interfaces, which results in lower costs, more convenient information transmission, and high versatility, further expanding the application scope of the embodiments of this application.

[0283] Example 6:

[0284] The following is combined Figure 13 This application provides a detailed description of a PCIe topology switching method. The method is applied to a server, which includes at least two processors, and includes the following steps:

[0285] S1301. Detect the server's processor operation status through the Basic Input / Output System (BIOS).

[0286] Specifically, operational status includes: whether the server's processor is faulty, and whether the processor is properly positioned.

[0287] In one possible implementation, in response to the server's power-on startup, a power-on self-test is performed via the Basic Input / Output System (BIOS) to detect the server's processor operation during the power-on startup process.

[0288] In another possible implementation, during server operation, i.e. after the server has been powered on and started up, the BIOS detects the server's processor status.

[0289] S1302. Determine whether there is more than one processor in the server's processors that is running normally.

[0290] If it is determined that there are no more than one processor operating normally on the server, that is, if it is determined that there is only one processor operating normally on the server, then proceed to S1303.

[0291] If it is determined that more than one processor in the server is operating normally, then proceed to S1304.

[0292] S1303: Set the preset GPIO output level value to the first level value.

[0293] The first voltage level indicates that the server's PCIe topology is in cascade mode.

[0294] In one possible implementation, when it is determined that only one processor in the server is operating normally, the BIOS reads the output level value of a preset GPIO. When the BIOS reads the preset GPIO output level value, it sets the preset GPIO output level value to a first level value. When the BIOS reads the preset GPIO output level value as a second level value, it indicates that the current server's PCIe topology mode is balanced mode. Therefore, the server's PCIe topology mode needs to be set to cascaded mode to ensure that PCIe devices can still function normally when a processor fails.

[0295] Furthermore, when the BIOS reads the preset GPIO output level value as the first level value, it maintains the preset GPIO output level value as the first level value.

[0296] In one possible implementation, the BIOS controls the server's programmable logic device (CPLD) to set the preset GPIO output level value to the first level value via the out-of-band controller (BMC); or the BIOS directly controls the server's CPLD to set the preset GPIO output level value to the first level value. This avoids the inability to switch PCIe topology when the BMC is faulty and unusable.

[0297] Furthermore, if it is determined that only one processor in the server is operating normally, it indicates that there is a faulty processor in the server. The BIOS then reports the server's fault information to the out-of-band controller (BMC) so that the BMC can display the fault information and thus inform the user of the current processor's fault status.

[0298] S1304. Set the preset GPIO output level value to the second level value.

[0299] The second level value indicates that the server's PCIe topology mode is balanced mode.

[0300] In one possible implementation, when it is determined that more than one processor in the server is operating normally, the BIOS reads the output level value of a preset GPIO. When the preset GPIO output level value read by the BIOS is a first level value, the preset GPIO output level value is set to a second level value. The preset GPIO output level value of the first level value indicates that the current PCIe topology mode of the server is cascaded mode. When more than one processor in the server is operating normally, the PCIe topology mode can be switched to balanced mode. Therefore, setting the server's PCIe topology mode to balanced mode can maintain better processing performance.

[0301] Furthermore, when the BIOS reads the preset GPIO output level value as the second level value, it maintains the preset GPIO output level value as the second level value.

[0302] In one possible implementation, the BIOS controls the server's programmable logic device (CPLD) to set the preset GPIO output level value to a second level value via the out-of-band controller (BMC); or the BIOS directly controls the server's CPLD to set the preset GPIO output level value to the second level value. This avoids the inability to switch PCIe topology when the BMC is faulty and unusable.

[0303] S1305: Read the output level value of the preset GPIO through the signal connector to determine the PCIe topology mode of the server, so as to instruct at least two switching devices to load the firmware corresponding to the PCIe topology mode, so as to realize the switching of the server's PCIe topology mode.

[0304] In one possible implementation, when setting the output level value of a preset GPIO based on the server's processor operating status obtained from the power-on self-test during the server's power-on startup process, before S1305, the following steps are included: the BIOS generates a read instruction; the read instruction is used to instruct the signal connector to reread the output level value of the preset GPIO; in response to the read instruction, the output level value of the preset GPIO is reread through the signal connector to determine the server's PCIe topology mode.

[0305] In another possible implementation, when the server's processor is detected during server operation and a preset GPIO output level value is set, before S1305, the process includes: restarting the server via BIOS; in response to the server restart, rereading the preset GPIO output level value via the signal connector, and determining that the PCIe topology mode is cascaded mode.

[0306] Furthermore, the PCIe topology of the server can be switched through the BIOS configuration interface. Specifically: during normal server operation, the BIOS receives the PCIe topology mode configuration operation input by the user based on the BIOS configuration interface; in response to the PCIe topology mode configuration operation, the target topology mode is determined; the preset GPIO level value is set to the level value corresponding to the target topology mode; the server is restarted through the BIOS; in response to the server restart, the output level value of the preset GPIO is read through the signal connector to determine the PCIe topology mode as the target topology mode, so as to instruct at least two switching devices to load the firmware corresponding to the target topology mode, thereby realizing the switching of the server's PCIe topology mode.

[0307] This application provides a PCIe topology switching method. The method involves detecting the server's processor operation status through the server's Basic Input / Output System (BIOS). When only one processor is running normally, the preset GPIO output level is set to a first level value, indicating that the server's PCIe topology mode is cascaded. When more than one processor is running normally, the preset GPIO output level is set to a second level value, indicating that the server's PCIe topology mode is balanced. This facilitates PCIe topology switching based on the GPIO output level. When the BIOS determines that only one processor is running normally, it actively sets the GPIO output level to the first level value, i.e., actively switches the PCIe topology mode to cascaded mode. Alternatively, when the BIOS determines that more than one processor is running normally, it actively sets the GPIO output level to the second level value, i.e., actively switches the PCIe topology mode to balanced mode. This application's embodiment achieves active PCIe topology switching without relying on the BMC.

[0308] Furthermore, this application provides a PCIe topology switching method. During server operation, the BIOS receives a PCIe topology mode configuration operation input by the user through the BIOS configuration interface, determines the target topology mode, and sets the preset GPIO level value to the level value corresponding to the target topology mode, so as to realize PCIe topology switching based on the preset GPIO output level value. This application can realize in-band mechanism passive PCIe topology switching through the BIOS configuration interface, that is, it realizes PCIe topology switching in response to user operation, and does not completely rely on the BMC to realize the server's PCIe switching, avoiding the situation where PCIe topology switching cannot be realized due to BMC failure.

[0309] Example 7:

[0310] The following is combined Figure 14 This application provides a detailed description of a PCIe topology switching device, which is applied to a server and includes:

[0311] The operation detection module 1410 is used to detect the operating status of the server's processor through the Basic Input / Output System (BIOS).

[0312] The operation judgment module 1420 is used to determine whether there is more than one processor in the server's processors that is running normally;

[0313] The level setting module 1430 includes a first level setting module 1431 and a second level setting module 1432.

[0314] The first level setting module 1431 is used to set the output level value of the preset GPIO to the first level value when it is determined that only one processor of the server is running normally; the second level setting module 1432 is used to set the output level value of the preset GPIO to the second level value when it is determined that more than one processor of the server is running normally.

[0315] The firmware loading module 1440 is used to read the output level value of a preset GPIO through the signal connector, determine the PCIe topology mode of the server, and instruct at least two switching devices to load firmware corresponding to the PCIe topology mode in order to realize the switching of the server's PCIe topology mode.

[0316] Furthermore, the first level setting module 1431 is specifically used to, when it is determined that only one processor in the server's processors is operating normally, read the output level value of a preset GPIO; when the output level value of the preset GPIO read by the BIOS is a second level value, set the output level value of the preset GPIO to the first level value. The second level setting module 1432 is specifically used to, when it is determined that more than one processor in the server's processors is operating normally, read the output level value of a preset GPIO; when the output level value of the preset GPIO read by the BIOS is a first level value, set the output level value of the preset GPIO to the second level value.

[0317] Furthermore, the operation detection module 1410 is specifically used to respond to the power-on startup of the server by performing a power-on self-test through the Basic Input / Output System BIOS, so as to detect the running status of the server's processor during the power-on startup process.

[0318] When the detection module 1410 detects the operation of the server's processor during the server's power-on startup process, the device also includes: a read instruction generation module for the BIOS to generate read instructions; the read instructions are used to instruct the signal connector to reread the output level value of the preset GPIO; and a firmware loading module 1440, specifically used to respond to the read instructions by rereading the output level value of the preset GPIO through the signal connector to determine the server's PCIe topology mode.

[0319] Furthermore, the operation detection module 1410 is specifically used to detect the operating status of the server's processor through the Basic Input / Output System BIOS during the server's operation.

[0320] When the detection module 1410 is running, it detects the operating status of the server's processor. The device also includes: a server restart module, used to restart the server via BIOS; and a firmware loading module 1440, specifically used to reread the output level value of the preset GPIO via the signal connector in response to the server restart, and determine the server's PCIe topology mode.

[0321] Furthermore, the first level setting module 1431 is specifically used to control the server's programmable logic device CPLD to set the output level value of the preset GPIO to the first level value when it is determined that only one processor in the server is running normally; the second level setting module 1432 is specifically used to control the server's programmable logic device CPLD to set the output level value of the preset GPIO to the second level value when it is determined that more than one processor in the server is running normally.

[0322] Furthermore, the first level setting module 1431 is specifically used to, when it is determined that only one processor in the server is running normally, the BIOS directly controls the programmable logic device CPLD of the server to set the output level value of the preset GPIO to the first level value; the second level setting module 1432 is specifically used to, when it is determined that more than one processor in the server is running normally, the BIOS directly controls the programmable logic device CPLD of the server to set the output level value of the preset GPIO to the second level value.

[0323] Furthermore, the device also includes a level holding module; the level holding module includes a first level holding module and a second level holding module. The first level holding module is used to maintain the output level of the preset GPIO at the first level value when the output level value of the preset GPIO read by the BIOS is the first level value; the second level holding module is used to maintain the output level of the preset GPIO at the second level value when the output level value of the preset GPIO read by the BIOS is the second level value.

[0324] Furthermore, the device also includes a fault reporting module, which, when it is determined that only one processor in the server is operating normally, reports the server's fault information to the out-of-band controller (BMC) so that the BMC can display the fault information.

[0325] Furthermore, the device also includes: an interface configuration module, used to receive a PCIe topology mode configuration operation input by the user based on the BIOS configuration interface during normal server operation; determine the target topology mode in response to the PCIe topology mode configuration operation; and set the preset GPIO level value to the level value corresponding to the target topology mode.

[0326] Furthermore, the server restart module is used to restart the server via BIOS; the firmware loading module 1440 is also used to respond to the server restart by reading the output level value of a preset GPIO through a signal connector, determining the PCIe topology mode as the target topology mode, and instructing at least two switching devices to load the firmware corresponding to the target topology mode, so as to realize the switching of the server's PCIe topology mode.

[0327] This application provides a PCIe topology switching device, including: a running detection module 1410, used to detect the running status of the server's processor through the Basic Input / Output System (BIOS); a running judgment module 1420, used to determine whether more than one processor in the server is running normally; a level setting module 1430, including a first level setting module 1431 and a second level setting module 1432; the first level setting module 1431 is used to set the output level value of a preset GPIO to a first level value when it is determined that only one processor in the server is running normally; the second level setting module 1432 is used to set the output level value of a preset GPIO to a second level value when it is determined that more than one processor in the server is running normally; and a firmware loading module 1440, used to read the output level value of the preset GPIO through a signal connector, determine the PCIe topology mode of the server, and instruct at least two switching devices to load firmware corresponding to the PCIe topology mode to realize the switching of the server's PCIe topology mode. When the BIOS determines that only one processor is running normally in the server, it actively sets the output level of the GPIO to the first level value, that is, actively switches the PCIe topology mode to cascade mode. Or when the BIOS determines that more than one processor is running normally in the server, it actively sets the output level of the GPIO to the second level value, that is, actively switches the PCIe topology mode to balanced mode. The embodiments of this application realize the active switching of PCIe topology and no longer rely on the BMC to realize the switching of PCIe topology.

[0328] Furthermore, in-band passive PCIe topology switching can be achieved through the BIOS configuration interface. This means that PCIe topology switching is implemented in response to user operations, without relying entirely on the BMC to achieve PCIe switching for the server. This avoids the situation where passive PCIe topology switching cannot be achieved due to BMC failure.

[0329] This application also provides a server, which includes a processor and a memory. The processor is connected to the memory, and the memory stores computer execution instructions. When the processor executes the computer execution instructions, it implements the PCIe topology switching method in the above embodiments.

[0330] This application also provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to execute the PCIe topology switching method described in the above embodiments.

[0331] For explanations of the relevant content and descriptions of the beneficial effects in any of the computer-readable storage media provided above, please refer to the corresponding embodiments described above, which will not be repeated here.

[0332] This application also provides a chip. This chip integrates a control circuit for implementing the functions of the aforementioned server and one or more ports. Optionally, the functions supported by this chip can be referred to above, and will not be repeated here. Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium. The aforementioned storage medium can be a read-only memory, random access memory, etc. The aforementioned processing unit or processor can be a central processing unit, a general-purpose processor, an application-specific integrated circuit (ASIC), a microprocessor (digital signal processor, DSP), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof.

[0333] This application also provides a computer program product containing instructions that, when executed on a computer, cause the computer to perform any of the methods described in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions may be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or may include one or more data storage devices such as servers or data centers that can be integrated with the medium. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., SSD), etc.

[0334] It should be noted that the devices for storing computer instructions or computer programs provided in the embodiments of this application, such as but not limited to the memory, computer-readable storage medium and communication chip, are all non-transitory.

[0335] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. 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 from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device containing one or more servers, data centers, etc., that can be integrated with the medium. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks, SSDs).

[0336] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, the disclosure, and the appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.

[0337] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.

Claims

1. A method for switching PCIe topology, characterized in that, Applied to a server, the server including at least two processors, the method includes: The server's processor operation is detected through the Basic Input / Output System (BIOS); When it is determined that only one processor in the server is operating normally, the output level value of the preset GPIO is set to the first level value; the first level value indicates that the PCIe topology mode of the server is cascaded mode. When it is determined that more than one processor in the server is operating normally, the output level value of the preset GPIO is set to the second level value; the second level value indicates that the PCIe topology mode of the server is balanced mode. The method further includes: The output level value of the preset GPIO is read by the signal connector to determine the PCIe topology mode of the server, so as to instruct at least two switching devices to load firmware corresponding to the PCIe topology mode, thereby realizing the switching of the PCIe topology mode of the server. When it is determined that only one processor in the server's processors is operating normally, setting the preset GPIO output level value to a first level value includes: When it is determined that only one processor in the server is operating normally, the BIOS reads the output level value of the preset GPIO; When the BIOS reads the output level value of the preset GPIO as the second level value, it sets the output level value of the preset GPIO as the first level value. When it is determined that more than one processor in the server's processors is operating normally, setting the preset GPIO output level value to a second level value includes: When it is determined that more than one processor in the server is operating normally, the BIOS reads the output level value of the preset GPIO. When the BIOS reads the output level value of the preset GPIO as a first level value, it sets the output level value of the preset GPIO to a second level value.

2. The method according to claim 1, characterized in that, The method of detecting the server's processor operating status via the Basic Input / Output System (BIOS) includes: In response to the power-on startup of the server, a power-on self-test is performed through the Basic Input / Output System (BIOS) to detect the operating status of the server's processor during the power-on startup process.

3. The method according to claim 2, characterized in that, Before reading the output level value of the preset GPIO through the signal connector, the method further includes: The BIOS generates a read instruction; the read instruction is used to instruct the signal connector to reread the output level value of the preset GPIO; The step of reading the output level value of the preset GPIO through the signal connector to determine the PCIe topology mode of the server includes: In response to the read command, the output level value of the preset GPIO is reread through the signal connector to determine the PCIe topology mode of the server.

4. The method according to claim 1, characterized in that, The method of detecting the server's processor operating status via the Basic Input / Output System (BIOS) includes: During the operation of the server, the BIOS (Basic Input / Output System) monitors the operation of the server's processor.

5. The method according to claim 4, characterized in that, Before reading the output level value of the preset GPIO through the signal connector, the method further includes: Restart the server using the BIOS; The step of reading the output level value of the preset GPIO through the signal connector to determine the PCIe topology mode of the server includes: In response to the server restart, the output level value of the preset GPIO is reread through the signal connector to determine the PCIe topology mode of the server.

6. The method according to claim 1, characterized in that, Setting the output level value of the preset GPIO to the first level value includes: The BIOS controls the server's programmable logic device (CPLD) to set the output level value of the preset GPIO to the first level value via the out-of-band controller (BMC). Setting the preset GPIO output level value to a second level value includes: The BIOS controls the server's programmable logic device (CPLD) to set the output level value of the preset GPIO to the second level value via the out-of-band controller (BMC).

7. The method according to claim 1, characterized in that, Setting the output level value of the preset GPIO to the first level value includes: The BIOS directly controls the server's programmable logic device (CPLD) and sets the output level value of the preset GPIO to the first level value. Setting the preset GPIO output level value to a second level value includes: The BIOS directly controls the server's programmable logic device (CPLD) and sets the output level value of the preset GPIO to the second level value.

8. The method according to claim 1, characterized in that, When it is determined that only one processor in the server is operating normally, the method further includes: When the BIOS reads the output level value of the preset GPIO as a first level value, it maintains the output level value of the preset GPIO as the first level value. When it is determined that more than one processor in the server's processors is operating normally, the method further includes: When the BIOS reads the output level value of the preset GPIO as the second level value, it maintains the output level value of the preset GPIO as the second level value.

9. The method according to claim 1, characterized in that, The method further includes: When it is determined that only one processor in the server is operating normally, the BIOS reports the server's fault information to the out-of-band controller (BMC) so that the BMC can display the fault information.

10. The method according to claim 1, characterized in that, The method further includes: During normal server operation, the BIOS receives PCIe topology mode configuration operations input by the user based on the BIOS configuration interface; In response to the configuration operation of the PCIe topology mode, the target topology mode is determined; Set the preset GPIO level value to the level value corresponding to the target topology mode.

11. The method according to claim 10, characterized in that, The method further includes: Restart the server using the BIOS; In response to the server restart, the output level value of the preset GPIO is read through the signal connector to determine the PCIe topology mode as the target topology mode, so as to instruct the at least two switching devices to load the firmware corresponding to the target topology mode, thereby realizing the switching of the server's PCIe topology mode.

12. A server, characterized in that, include: At least two processors, and a memory communicatively connected to the at least two processors; The memory is used to store computer-executed instructions; The at least two processors are used to instruct the computer execution instructions stored in the memory to implement the PCIe topology setup method according to any one of claims 1-11.

Citation Information

Patent Citations

  • Method, device and equipment for switching GPU topology without cable

    CN110347625A

  • Device for dynamically switching topology of CPU and topology of GPU and use method

    CN113194048A