Server
By introducing the substrate management controller and hot-swap processing components into the server, an additional channel is formed, which solves the problem of notifying hot-swap in the prior art, and achieves safe and stable hot-removal of PCIe devices under the switch chip.
Patent Information
- Application Number
- CN202411747660.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-05-02
AI Technical Summary
The prior art cannot implement notification hot-swap in PCIe devices mounted under CPU-connected switching chips, especially where devices include hot-swapable and non-hot-swapable.
By introducing the substrate management controller (BMC) and hot-swap processing components into the server, an additional channel "CPU-BMC-hot-swap processing components" is formed to achieve notification hot-removal of PCIe devices mounted under the switching chip.
In the case of hot-swapable and non-hot-swapable devices, notification-based hot-removal of PCIe devices mounted under the switching chip is realized, avoiding data loss and system instability caused by violent hot-removal.
Smart Images

Figure CN119917438A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a server. Background Art
[0002] PCIe (Peripheral Component Interface Express) is a high-speed serial computer expansion bus standard with the advantages of large bandwidth and strong data transmission capacity. It is increasingly used for data transmission between the central processing unit (CPU) and devices in server systems. Given the limited number of PCIe slots in the CPU, switch chips (i.e., PCIe switch chips) are increasingly used in server systems as a device chip that expands the number of PCIe slots.
[0003] Hot plug refers to the technology that allows you to safely insert or remove external devices during system operation without shutting down the system or restarting the device. That is, hot plug allows users to remove or add PCIe devices attached to the CPU without shutting down the system or cutting off the power supply, without affecting the operation of the server system, thereby improving the system's ability to recover from disasters in a timely manner, scalability, and flexibility.
[0004] In the current technology, the CPU can implement notification-based hot-plugging of its directly connected PCIe devices through its built-in hot-plug controller, regardless of whether the directly connected PCIe devices are hot-pluggable devices or non-hot-pluggable devices; or when the PCIe devices hung under the switch chip connected to the CPU are all hot-pluggable devices / non-hot-pluggable devices, notification-based hot-plugging of the PCIe devices hung under the switch chip can also be implemented.
[0005] In summary, in the current technology, when the PCIe devices hanging under the switch chip connected to the CPU include hot-pluggable devices and non-hot-pluggable devices, it is impossible to implement notification hot plugging of the PCIe devices hanging under the switch chip. Summary of the invention
[0006] A server provided by an embodiment of the present application can implement notification-based hot plugging of PCIe devices hung under a switching chip connected to a CPU when the PCIe devices hung under the switching chip include hot-pluggable devices and non-hot-pluggable devices.
[0007] In order to achieve the above objectives, this application adopts the following technical solutions:
[0008] In the first aspect, an embodiment of the present application provides a server, including: a central processing unit CPU, a baseboard management controller BMC, a hot-swap processing component, and a switching chip; the CPU is connected to the upstream interface of the switching chip, and the downstream interface of the switching chip is used to connect a PCIe device; the CPU is connected to the BMC for transmitting a hot-plug command to the BMC; the hot-plug command is used to instruct the BMC to control the device to be hot-plugged to execute a corresponding hot-plug process; the BMC is connected to the hot-plug processing component for transmitting a control instruction corresponding to the hot-plug command to the hot-plug processing component after receiving the hot-plug command; wherein the device to be hot-plugged is a PCIe device connected to the downstream interface of the switching chip; the hot-plug processing component is used to convert the control instruction corresponding to the hot-plug command into a corresponding GPIO signal and output it, so as to control the device to be hot-plugged to complete the corresponding hot-plug process. In an embodiment of the present application, an additional channel is formed by the "CPU-BMC-hot-swap processing component", which no longer completely relies on the channel of the hot-swap processing component directly managed by the CPU in the current technology. When the PCIe devices hung under the switching chip connected to the CPU include hot-swappable devices and non-hot-swappable devices, the PCIe devices hung under the switching chip can be hot-plugged by notification.
[0009] In a possible implementation, the CPU is also used to respond to the hot unplug command to migrate or terminate the business run by the device to be hot unplugged, thereby avoiding the problems of data loss or damage, system crash (system instability) and the like that may be caused by the hot unplug operation of the device to be hot unplugged.
[0010] In a possible implementation, the BMC is specifically used to generate a reset control instruction and a power control instruction corresponding to the hot-plug command, and transmit them to the hot-plug processing component; the hot-plug processing component is specifically used to convert the reset control instruction into a corresponding reset signal, and output the reset signal through the corresponding GPIO pin to control the hot-plug device to reset; and convert the power control instruction into a corresponding power enable signal, and output the power enable signal through the corresponding GPIO pin to control the power off of the hot-plug device. The corresponding reset control instruction and power control instruction are generated by the BMC to control the hot-plug device to reset and control the power off of the hot-plug device, thereby realizing the notification-based hot-plugging of the device through an additional channel formed by "CPU-BMC-hot-plug processing component".
[0011] In a possible implementation, the BMC is further configured to return unplugging completion status information to the CPU in response to the power of the device to be hot-plugged being turned off, thereby prompting the CPU that the hot unplugging of the device to be hot-plugged has been completed.
[0012] In a possible implementation, the hot-swap processing component is also used to respond to the access of the device to be hot-plugged and transmit an interrupt signal to the BMC; the BMC is also used to obtain the in-place status information of all devices after receiving the interrupt signal, and determine the unique identifier of the device to be hot-plugged based on the in-place status information; wherein the interrupt signal and the unique identifier of the device to be hot-plugged constitute a hot-plug command, and the hot-plug command is used to instruct the BMC to control the device to be hot-plugged to execute the corresponding hot-plug process; the BMC is also used to transmit a control instruction corresponding to the hot-plug command to the hot-plug processing component; the hot-plug processing component is used to convert the control instruction corresponding to the hot-plug command into a corresponding GPIO signal and output it to control the device to be hot-plugged to complete the corresponding hot-plug process. By forming an additional channel through "CPU-BMC-hot-plug processing component", it is no longer completely dependent on the channel of the CPU directly managing the hot-plug processing component in the current technology. In the case where the PCIe device hanging under the switch chip connected to the CPU includes hot-pluggable devices and non-hot-pluggable devices, the notification hot-plugging of the hot-pluggable device can be realized.
[0013] In a possible implementation, the BMC is specifically used to generate a reset control instruction and a power control instruction corresponding to the hot-plug command, and transmit them to the hot-plug processing component; the hot-plug processing component is specifically used to convert the power control instruction into a corresponding power enable signal, and output the power enable signal through the corresponding GPIO pin to control the power on of the device to be hot-plugged; convert the reset control instruction into a corresponding reset signal, and output the reset signal through the corresponding GPIO pin to control the hot-plug device to be de-reset. The corresponding reset control instruction and power control instruction are generated by the BMC to control the power on of the device to be hot-plugged, and control the hot-plug device to be de-reset, thereby realizing the hot plugging of the device through an additional channel formed by "CPU-BMC-hot-plug processing component".
[0014] In a possible implementation, the CPU is also used to receive device access information corresponding to the device to be hot-plugged sent by the switching chip, and complete the access to the device to be hot-plugged in response to the device access information; the CPU is also used to send access completion status information to the BMC when the access to the device to be hot-plugged is completed. When the device to be hot-plugged is inserted, the CPU will reserve necessary resources for the downlink interface of the switching chip (that is, the device to be hot-plugged), but the reserved necessary resources will not be immediately allocated to the device to be hot-plugged until the device to be hot-plugged successfully establishes a link with the switching chip; when the device to be hot-plugged successfully establishes a PCIe link with the switching chip, the switching chip reports the device access information to the CPU, and when the access to the device to be hot-plugged is completed, the insertion completion status information is returned to the BMC to prompt the BMC to complete the hot insertion of the device to be hot-plugged.
[0015] In a possible implementation, the BMC is further used to send an indicator light control instruction corresponding to a target mode to the hot-swap processing component; the hot-swap processing component is further used to convert the indicator light control instruction corresponding to the target mode into an indicator light signal corresponding to the target mode, so as to control the indicator light of the device to be hot-plugged or the device to be hot-plugged to flash according to the target mode. The indicator light control instruction corresponding to the target mode is used to control the indicator light of the device to be hot-plugged to flash according to the target mode, so as to indicate the current state of the hot-plug device.
[0016] In a possible implementation, the hot-swap processing component includes a logic device and a hot-swap execution device; the hot-swap execution device is used to convert the control instruction into a corresponding GPIO signal and output it to control the device to be hot-swapped to complete the corresponding hot-swap process; wherein the device to be hot-swapped includes: a device to be hot-unplugged or a device to be hot-inserted, and the hot-swap process includes: a hot-unplug process or a hot-insertion process. Specifically, the hot-swap execution device is a device used to convert the system internal bus signal (i.e., the control instruction) into a GPIO signal.
[0017] In a possible implementation, there are multiple hot-swap execution devices, and the logic device includes: a bus expansion module; the bus expansion module is used to expand the bus into multiple buses to connect multiple hot-swap execution devices. The bus expansion module expands the bus to connect more hot-swap execution devices, thereby supporting more devices to perform hot-swap operations.
[0018] In the second aspect, the embodiment of the present application provides a hot-plug method, which is applied to a baseboard management controller, and the method includes: obtaining a hot-plug command; based on the hot-plug command, transmitting a corresponding control instruction to a hot-plug processing component, so that the hot-plug processing component converts the corresponding control instruction into a corresponding GPIO signal and outputs it, so as to control the device to be hot-plugged to complete the corresponding hot-plug process. The control instruction for the device to be hot-plugged is transmitted through the BMC, thereby realizing an additional channel formed by "CPU-BMC-hot-plug processing component", and no longer completely relying on the channel of the CPU directly managing the hot-plug processing component in the current technology. In the case where the PCIe device hanging under the switch chip connected to the CPU includes a hot-pluggable device and a non-hot-pluggable device, the notification-based hot-plugging of the PCIe device hanging under the switch chip can be realized.
[0019] In a possible implementation, a reset control instruction and a power control instruction corresponding to the hot-plug command are generated and transmitted to the hot-plug processing component, so that the hot-plug processing component converts the reset control instruction into a corresponding reset signal, and outputs the reset signal through the corresponding GPIO pin to control the hot-plug device to reset; and converts the power control instruction into a corresponding power enable signal, and outputs the power enable signal through the corresponding GPIO pin to control the power off of the hot-plug device. The corresponding reset control instruction and power control instruction are generated by the BMC to control the hot-plug device to reset and control the power off of the hot-plug device, thereby realizing the notification-based hot-plugging of the device through an additional channel formed by "CPU-BMC-hot-plug processing component".
[0020] In a possible implementation, in response to the power of the device to be hot-plugged being turned off, unplugging completion status information is returned to the central processor to prompt the central processor that hot unplugging of the device to be hot-plugged has been completed.
[0021] In a possible implementation, an interrupt signal is obtained; in response to the interrupt signal, the in-place status information of all devices is obtained, and based on the in-place status information, a unique identifier of the device to be hot-plugged is determined; wherein the interrupt signal and the unique identifier of the device to be hot-plugged constitute a hot-plug command for the device to be hot-plugged; a control instruction corresponding to the hot-plug command is transmitted to the hot-plug processing component, so that the hot-plug processing component converts the control instruction corresponding to the hot-plug command into a corresponding GPIO signal and outputs it, so as to control the device to be hot-plugged to complete the corresponding hot-plug process. The control instruction for the device to be hot-plugged is transmitted through the BMC, thereby realizing the formation of an additional channel through "CPU-BMC-hot-plug processing component", no longer completely relying on the channel of the CPU directly managing the hot-plug processing component in the current technology, and in the case where the PCIe device hanging under the switch chip connected to the CPU includes hot-pluggable devices and non-hot-pluggable devices, the notification-type hot plugging of the hot-pluggable device can be realized.
[0022] In a possible implementation, a reset control instruction and a power control instruction corresponding to the hot-plug command are generated and transmitted to the hot-plug processing component, so that the hot-plug processing component converts the power control instruction into a corresponding power enable signal, and outputs the power enable signal through the corresponding GPIO pin to control the power on of the device to be hot-plugged; converts the reset control instruction into a corresponding reset signal, and outputs the reset signal through the corresponding GPIO pin to control the hot-plug device to be de-reset. The corresponding reset control instruction and power control instruction are generated through the BMC to control the power on of the device to be hot-plugged and control the hot-plug device to be de-reset, thereby realizing the hot plugging of the device through an additional channel formed by "CPU-BMC-hot-plug processing component".
[0023] In a possible implementation, an indicator light control instruction corresponding to a target mode is sent to a hot-swap processing component, so that the hot-swap processing component converts the indicator light control instruction corresponding to the target mode into an indicator light signal corresponding to the target mode, so as to control the indicator light of the device to be hot-plugged or the device to be hot-inserted to flash according to the target mode. The indicator light control instruction corresponding to the target mode is used to control the indicator light of the device to be hot-plugged to flash according to the target mode, so as to indicate the current state of the hot-plug device. The hot-plug device includes: a hot-plug device or a hot-plug device.
[0024] In the third aspect, the embodiment of the present application provides a hot-plug method, which is applied to a central processing unit (CPU), including: in response to a user's triggering operation for a hot-plug process of a device to be hot-plugged, obtaining a hot-plug command for the device to be hot-plugged, and transmitting it to a baseboard management controller (BMC). The central processing unit sends a hot-plug command to the BMC to trigger the overall hot-plug operation. The CPU also provides a new operation interface for triggering hot-plugging.
[0025] In a possible implementation, in response to the hot unplug command, the service running on the device to be hot unplugged is closed or migrated, thereby avoiding problems such as data loss or damage, system crash (system instability), etc. that may be caused by the hot unplug operation of the device to be hot unplugged.
[0026] In a possible implementation, device access information corresponding to the device to be hot-plugged is received; in response to the device access information, the access operation of the device to be hot-plugged is completed, and access completion status information is returned to the BMC to prompt the completion of the hot-plug process of the device to be hot-plugged. When the device to be hot-plugged is inserted, the CPU will reserve necessary resources for the downlink interface of the switching chip (that is, the device to be hot-plugged), but the reserved necessary resources will not be immediately allocated to the device to be hot-plugged until the device to be hot-plugged successfully establishes a link with the switching chip; when the device to be hot-plugged successfully establishes a PCIe link with the switching chip, the switching chip reports the device access information to the CPU, and when the access to the device to be hot-plugged is completed, the insertion completion status information is returned to the BMC to prompt the BMC to complete the hot-plugging of the device to be hot-plugged. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A schematic diagram of the structure of a server provided in an embodiment of the present application;
[0028] Figure 2 A schematic diagram of the composition of a hot-swap management module on a baseboard management controller provided in an embodiment of the present application;
[0029] Figure 3A schematic diagram of the composition of a hot-swap processing component provided in an embodiment of the present application;
[0030] Figure 4 A schematic diagram of the composition of a group of GPIO signals in a hot-swap execution device provided in an embodiment of the present application;
[0031] Figure 5 A schematic diagram of a hot swap method provided in an embodiment of the present application;
[0032] Figure 6 A flowchart of another hot-swap method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] The terms "first", "second", "third", etc. in the specification, claims and drawings of this application are used to distinguish different objects rather than to limit a specific order.
[0034] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0035] In order to make the description of the following embodiments clear and concise, a brief introduction to the related technology is first given:
[0036] PCIe is a high-speed serial computer expansion bus standard used to connect various devices in a computer system, providing higher bandwidth and lower latency.
[0037] PCIe devices refer to devices that are connected to a computer system using the PCIe bus standard. Exemplary PCIe devices include: graphics card (GPU), solid state drive (SSD), network adapter (NIC), FPGA accelerator card, sound card, etc.
[0038] Depending on the implementation method, hot swapping can be divided into two main types: notification hot swapping and brute force hot swapping.
[0039] Notification-based Hot Plug: It is a mechanism that works through the collaboration of hardware and software. When a device is inserted or removed, the system automatically detects this change (i.e., the device is inserted or removed) and takes appropriate measures to handle the insertion or removal of the device. Specifically, when a device is inserted or removed, the hardware detects this change and generates an interrupt signal; after the operating system receives the terminal signal, it calls the corresponding driver to handle this event; the driver is responsible for identifying / unloading new devices, loading / unloading necessary drivers, allocating / releasing resources (such as IRQ, DMA channels, memory addresses, etc.) and initializing the device.
[0040] Brute-force Hot Plug: refers to the user directly inserting or removing a device without system support. This method does not rely on hardware detection and interrupt processing, but relies on the user's manual intervention to make the device work properly. Specifically, the user directly inserts or removes the device; the user manually restarts the system or reloads the driver to make the device work properly.
[0041] Hot-pluggable devices are hardware devices that can be safely inserted or removed without shutting down the system or device. The design and manufacture of such devices take into account the needs of hot plugging, ensuring that the system or device will not be damaged during the plugging and unplugging process. Exemplary hot-pluggable devices include: solid-state drives, network adapters, etc.
[0042] Non-Hot-Pluggable Devices refer to hardware that requires the system or device to be shut down when inserted or removed. The design and manufacture of such devices do not take into account the needs of hot plugging, and direct plugging and unplugging may cause damage to the device or system. Exemplary non-hot-pluggable devices include: integrated network cards, SATA hard drives, etc.
[0043] The embodiment of the present application provides a server, including: a central processing unit CPU, a baseboard management controller BMC, a hot-swap processing component, and a switching chip; the CPU is connected to an uplink interface of the switching chip, and a downlink interface of the switching chip is used to connect a PCIe device; the CPU is connected to the BMC, and is used to transmit a hot-plug command to the BMC; the hot-plug command is used to instruct the BMC to control a device to be hot-plugged to execute a corresponding hot-plug process; the BMC is connected to the hot-plug processing component, and is used to transmit a control instruction corresponding to the hot-plug command to the hot-plug processing component after receiving the hot-plug command; wherein the device to be hot-plugged is a PCIe device connected to the downlink interface of the switching chip; the hot-plug processing component is used to convert the control instruction corresponding to the hot-plug command into a corresponding GPIO signal and output it, so as to control the device to be hot-plugged to complete the corresponding hot-plug process. In an embodiment of the present application, an additional channel is formed by the "CPU-BMC-hot-swap processing component", which no longer completely relies on the channel of the hot-swap processing component directly managed by the CPU in the current technology. When the PCIe devices hung under the switching chip connected to the CPU include hot-swappable devices and non-hot-swappable devices, the PCIe devices hung under the switching chip can be hot-plugged by notification.
[0044] Embodiment 1:
[0045] In order to facilitate the understanding of the technical solution of the present application, the following first combines Figure 1-Figure 4 , a server provided in an embodiment of the present application is introduced, that is, a server to which the hot-swap method is applied.
[0046] like Figure 1 As shown, a server 100 provided in an embodiment of the present application includes: a central processing unit 110, a switching chip 120, a baseboard management controller 130, and a hot-swap processing component 140.
[0047] The central processing unit 110 is connected to the switching chip 120 via a PCIe bus, which can be understood as the switching chip 120 being connected to a PCIe slot on the central processing unit 110 .
[0048] The uplink interface of the switching chip 120 is used to connect to the central processing unit 110, and the downlink interface of the switching chip 120 is used to connect to the PCIe device.
[0049] Among them, the switching chip 120 can also be called a PCIe switching chip. The switching chip 120 has an upstream interface (UpstreamPort) and multiple downstream interfaces (DownstreamPorts). The upstream interface is used to connect to the central processing unit 110, and the multiple downstream interfaces are used to connect PCIe devices. The switching chip 120 provides additional PCIe channels for the central processing unit 110, thereby allowing more PCIe devices to be connected to the central processing unit 110, that is, the switching chip 120 serves as an I / O expansion unit of the central processing unit 110, mainly used to expand the input and output capabilities between the CPU and external devices. The switching chip can effectively increase the bandwidth and flexibility of the system, so that a single CPU (i.e., the central processing unit 110) can manage more device connections.
[0050] In the embodiment of the present application, the PCIe devices connected to the downlink interface of the switch chip 120 include hot-pluggable devices and non-hot-pluggable devices. Figure 1 In the example, the switching chip 120 includes two downstream interfaces, and the two downstream interfaces are respectively connected to one hot-pluggable device and one non-hot-pluggable device. Figure 1 As shown, the central processor 110 may also be connected to a plurality of switching chips, and the switching chip 120 may also include 3, 4, etc. downlink interfaces, which is not specifically limited in this application.
[0051] The central processing unit 110 is connected to the baseboard management controller 110. Specifically, the central processing unit 110 is connected to the baseboard management controller 130 through an in-band channel. The in-band channel refers to communication through a standard bus or interface inside the system without the need for additional hardware support. The in-band channel includes: SMBus (system management bus), IIC bus, etc.; the out-band channel refers to a dedicated channel independent of the internal bus of the system. The out-band channel includes the PCIe bus.
[0052] It should be noted that, for the convenience of description, the following description of the in-band channel / system internal bus takes the IIC (I2C) bus as an example.
[0053] The central processor 110 is used to transmit a hot-plug command to the baseboard management controller 130 , wherein the hot-plug command is used to instruct the baseboard management controller 130 to control the device to be hot-plugged to execute a corresponding hot-plug process.
[0054] The CPU 110 is the core component of the server, responsible for executing instructions and processing data. Specifically, the CPU 110 is responsible for controlling and coordinating all operations of the server, and performs various calculations and logical operations by executing the instructions stored in the memory.
[0055] The central processing unit 110 is one of the sources of initiating the hot plug command, that is, the central processing unit 110 is the source of initiating the hot unplug command in the hot plug command. For example, the central processing unit 110 responds to the unplug trigger operation of the device A connected to the switching chip 120, and sends a hot unplug command to the baseboard management controller 110 to trigger the subsequent hot plug operation for the device A.
[0056] In a possible implementation, the central processor 110 is also used to migrate or terminate the services running on the device to be hot-plugged in response to the hot-plug command. That is, the central processor 110 is also responsible for the management of the running services. For example, when the central processor 110 receives a pull-out trigger operation for device A connected to the switch chip 120, it obtains a hot-plug command for device A; the central processor 110 will query the services running on device A in response to the hot-plug command, and migrate or terminate the services running on device A, so as to avoid data loss or damage, system crash (system instability) and other problems that may be caused by the hot-plug operation of device A.
[0057] In a possible implementation, the central processor 110 is further configured to receive device access information corresponding to the device to be hot-plugged sent by the switch chip 120, and complete access to the device to be hot-plugged in response to the device access information.
[0058] Specifically, when the device to be hot-plugged is inserted, the central processor 110 will reserve necessary resources (such as memory, interrupt, DMA buffer, etc.) for the downstream interface of the switching chip 120 (that is, the device to be hot-plugged), but the reserved necessary resources will not be immediately allocated to the device to be hot-plugged until the device to be hot-plugged successfully establishes a link with the switching chip 120; when the device to be hot-plugged successfully establishes a PCIe link with the switching chip 120, the switching chip 120 reports the device access information to the central processor 110.
[0059] Furthermore, the CPU 110 is further configured to send access completion information to the BMC 130 when the access to the device to be hot-plugged is completed, so as to inform / prompt the BMC 130 that the hot plugging of the device to be hot-plugged has been completed.
[0060] Specifically, an operating system (OS) runs on the CPU 110, and the CPU 110 completes the above functions through its own operating system.
[0061] Among them, the operating system is a set of programs in the server that manages and controls the server's hardware and software resources and provides an interface between users and applications and the hardware.
[0062] In an embodiment of the present application, the operating system includes a newly added hot-swap module, that is, a newly added hot-swap plug-in or process is running under the operating system. The newly added hot-swap module is used to connect the hot-swap command and the service interface under the operating system. For example, the newly added hot-swap module is used to receive the hot-plug command initiated by the operating system, and respond to the hot-plug command of the device to be hot-plugged, detect the service running on the hot-plugged device, and migrate or close the service running on the hot-plugged device; the newly added hot-swap module is used to connect the in-band channel connected to the baseboard management controller 130. For example, after the newly added hot-swap module receives the hot-plug command initiated by the operating system and migrates or closes the running service corresponding to the hot-plug command, the newly added hot-swap module transmits the hot-plug command to the baseboard management controller 130 through the in-band channel.
[0063] The baseboard management controller 130 is connected to the hot-swap processing component 140 . Specifically, the baseboard management controller 130 is connected to the hot-swap processing component 140 via a system internal bus.
[0064] The baseboard management controller 130 is used to transmit a control instruction corresponding to the hot plug command to the hot plug processing device 140 after receiving the hot plug command.
[0065] The baseboard management controller (BMC) 130 is a management component independent of the CPU, which can remotely maintain and manage the server through a dedicated data channel and can communicate with the CPU through the out-of-band management interface of the server.
[0066] In a possible implementation, the baseboard management controller 130 is specifically configured to generate a reset control instruction and a power control instruction corresponding to the hot plug command after receiving the hot plug command, and transmit the reset control instruction and the power control instruction to the hot plug processing component 140 .
[0067] The reset control instruction corresponding to the hot unplug command is used to control the device to be hot unplugged to reset; the power control instruction corresponding to the hot unplug command is used to control the power of the device to be hot unplugged to turn off.
[0068] Furthermore, the baseboard management controller 130 is further configured to return unplugging completion status information to the central processor 110 in response to the power of the device to be hot-plugged being turned off, so as to prompt the central processor 110 that the hot-plugging of the device to be hot-plugged has been completed.
[0069] The baseboard management controller 130 is further configured to obtain the in-place status information of all devices after receiving the interrupt signal, and determine the unique identifier of the device to be hot-plugged based on the in-place status information.
[0070] The interrupt signal is sent by the hot-plug processing component 140 to the baseboard management controller 130 in response to the access of the device to be hot-plugged.
[0071] The interrupt signal and the unique identifier of the device to be hot-plugged constitute a hot-plug command. The hot-plug command is used to instruct the baseboard management controller 130 to control the device to be hot-plugged to execute a corresponding hot-plug process.
[0072] Furthermore, the baseboard management controller 130 is further configured to transmit a control instruction corresponding to the hot plug command to the hot plug processing component 140 .
[0073] In a possible implementation, the baseboard management controller 130 is specifically configured to generate a reset control instruction and a power control instruction corresponding to the hot plug command, and transmit the instructions to the hot plug processing component 140 .
[0074] The reset control instruction corresponding to the hot plug command is used to control the hot plug device to reset; the power control instruction corresponding to the hot plug command is used to control the power on of the hot unplug device.
[0075] As can be seen from the above description, the baseboard management controller 130 is a core processing device of a hot-swap method provided in an embodiment of the present application, and is used to receive a hot-swap command, and generate a corresponding control instruction based on the hot-swap command to trigger / control the hot-swap processing component 140 to complete the hot-swap of the device to be hot-swapped; and when the power of the device to be hot-swapped is turned off, the baseboard management controller 130 returns the unplugging completion status information to the central processor 110. Further, the baseboard management controller 130 is also used to receive an interrupt signal reported by the hot-swap processing component 140, query the in-place status information, and generate a control instruction corresponding to the hot-insert command to trigger / control the hot-insert processing component 140 to complete the hot-plugging of the device to be hot-plugged; and the baseboard management controller 130 is also used to receive the insertion completion status information.
[0076] Exemplarily, for hot unplugging, the baseboard management controller 130 is used to receive a hot unplug command from the central processing unit 110, and in response to the hot unplug command, sends a control instruction corresponding to the hot unplug command to the hot plug processing component 140 to control the power, reset, and indicator light of the device to be hot unplugged; after the hot unplugging of the device to be hot unplugged is completed, the baseboard management controller 130 is also used to feedback the unplugging completion status information to the central processing unit 110 (the operating system running on the central processing unit 110).
[0077] Exemplarily, for hot plugging, the baseboard management controller 130 is used to receive an interrupt signal reported by the hot-swap processing component 140; in response to the interrupt signal, the in-place status information of all devices is obtained to determine the unique identification of the device to be hot-plugged; based on the unique identification of the device to be hot-plugged and the interrupt signal (hot-plug command), a control instruction corresponding to the hot-plug command is sent to the hot-plug processing component 140 to control the power supply, reset, and indicator light of the device to be hot-plugged; after the hot plugging of the device to be hot-plugged is completed, the baseboard management controller 130 is also used to receive the insertion completion status information fed back by the central processing unit 110.
[0078] Further, in summary, the baseboard management controller 130 is used to transmit a control instruction corresponding to a hot plug command to the hot plug processing component 140. The hot plug command includes: a hot insert command and a hot unplug command.
[0079] In a possible implementation, the baseboard management controller 130 is further configured to transmit an indicator light control instruction corresponding to the target mode to the hot-swap processing component 140 .
[0080] The indicator light control instruction corresponding to the target mode is used to control the indicator light of the device to be hot-plugged to flash according to the target mode to indicate the current state of the hot-plugged device. The device to be hot-plugged includes: a device to be hot-inserted or a device to be hot-unplugged.
[0081] Specifically, the baseboard management controller 130 manages the hot-plug devices through a hot-plug management module, which is a set of programs running on the baseboard management controller 130 .
[0082] For ease of understanding, the following Figure 2 , a hot-swap management module running in the baseboard management controller 130 is introduced in detail.
[0083] like Figure 2 As shown, the baseboard management controller 130 is connected to the central processing unit 110 through an uplink out-of-band / in-band interface, thereby realizing the connection between the central processing unit 110 and the baseboard management controller 130 through an in-band channel / out-of-band channel; the baseboard management controller 130 is connected to the hot-swap processing component 140 through a downlink management bus interface, thereby realizing the connection between the baseboard management controller 130 and the hot-swap processing component 140 through the IIC bus.
[0084] The hot-swap management module includes: a lighting module, a power management module, a reset module and an interrupt module.
[0085] Among them, the lighting module is used to control the indicator light of the device to be hot-plugged (for example: the PCIe device connected to the switching chip 120) to flash according to the preset / specified color and frequency, so as to indicate the current state of the PCIe device. Exemplarily, the lighting module can control the indicator light of PCIe device A to flash at a frequency of once every 1 second to indicate / prompt that the PCIe device is currently in the hot-plug process. That is, the lighting module is used to control the indicator light of the PCIe device to flash according to the target mode to indicate the current state of the device to be hot-plugged.
[0086] The target mode is used to represent the flashing frequency and / or color of the indicator light.
[0087] Specifically, the lighting module is used to output an indicator light control instruction corresponding to the target mode, so as to control the indicator light of the device to be hot-plugged to flash according to the color and / or frequency specified by the target mode.
[0088] The power management module is used to control the power on or off of the device to be hot-plugged. For example, when a hot-plug command for PCIe device A is received, the power management module is used to control the power off of PCIe device A (ie, control PCIe device A to be powered off).
[0089] Specifically, the power management module is used to output a power control instruction to control the power of the device to be hot-plugged.
[0090] The reset module is used to control whether the hot-swappable device is reset or released.
[0091] Control the hot-swappable device to reset and restore it to a known initial state. The reset operation can ensure that the hot-swappable device can be properly initialized when it is started or restarted, avoiding problems caused by the state left over from the last operation. Control the hot-swappable device to de-reset and restore it from the initial state to the normal working state, ensuring that the hot-swappable device can operate normally.
[0092] Specifically, the reset module is used to output a reset control instruction to control whether the hot-swappable device is reset or released.
[0093] The interrupt module is used to receive an interrupt signal reported by the hot-swap processing component 140 .
[0094] The hot-swap processing component 140 is connected to the baseboard management controller 130 .
[0095] The hot-plug processing component 140 is used to convert the control instruction corresponding to the hot-plug command into a corresponding GPIO signal and output it to control the hot-plug device to complete the corresponding hot-plug process.
[0096] In a possible implementation, the hot-plug processing component 140 is used to convert the control instruction corresponding to the hot-plug command into a corresponding GPIO signal and output it, so as to control the device to be hot-plugged to complete the corresponding hot-plug process.
[0097] Specifically, the hot-plug processing component 140 is used to convert the reset control instruction corresponding to the hot-plug command into a corresponding reset signal and output it to control the hot-plug device to reset; and convert the power control instruction corresponding to the hot-plug command into a corresponding power enable signal to control the power off of the hot-plug device.
[0098] Specifically, the hot-plugging process includes: resetting and powering off the hot-plugged device.
[0099] In a possible implementation, the hot-plug processing component 140 is used to convert the control instruction corresponding to the hot-plug command into a corresponding GPIO signal and output it to control the device to be hot-plugged to complete the corresponding hot-plug process.
[0100] Specifically, the hot-swap processing component 140 is used to convert the power control instruction corresponding to the hot-plug command into a corresponding power enable signal to control the power on of the hot-plug device; and convert the reset control instruction corresponding to the hot-plug command into a corresponding reset signal and output it to control the hot-plug device to be reset.
[0101] Specifically, the hot-plugging process includes: powering on and resetting the device to be hot-plugged.
[0102] In a possible implementation, the hot-swap processing component 140 is used to convert the indicator light control instruction corresponding to the target mode into a corresponding indicator light signal and output it to control the indicator light of the device to be hot-swapped to flash according to the target mode.
[0103] Furthermore, the hot-plugging process (hot-plugging process and hot-inserting process) further includes: an indicator light of the device to be hot-plugged flashes according to a target mode.
[0104] Furthermore, in a possible implementation, the hot-swap processing component 140 includes: a logic device and a hot-swap execution device. The logic device is connected to the baseboard management controller 130, and the logic device is also connected to the hot-swap execution device.
[0105] The logic device, also known as a complex programmable logic device (CPLD), is a high-density, high-speed, low-power programmable logic device. The logic device is connected to the baseboard management controller 130 through the system internal bus (IIC bus) and is connected to the hot-swap actuator through the IIC bus.
[0106] Specifically, the logic device is used as a transmission channel between the baseboard management controller 130 and the hot-swap execution device.
[0107] Exemplarily, the baseboard management controller 130 sends a control instruction to the hot-swap execution device through a logic device; and the hot-swap execution device also sends a reporting interrupt signal to the baseboard management controller 130 through a logic device.
[0108] Combine the following Figure 3 , the specific composition of a hot-swap processing component 140 provided in an embodiment of the present application is introduced in detail.
[0109] like Figure 3 As shown, the hot-swap processing component 140 includes a logic device and a plurality of hot-swap execution devices.
[0110] Specifically, the logic device includes a bus expansion module. The bus expansion module is used to expand and manage the bus resources of the system to support more hot-swappable execution devices. Specifically, the bus expansion module expands the bus into multiple buses to connect the multiple hot-swappable execution devices, thereby supporting more devices to perform hot-swappable operations.
[0111] Specifically, the logic device further includes an interrupt processing module, and the interrupt processing module is used for filtering and transmitting interrupt signals.
[0112] The interrupt processing module (int processing module) in the logic device is used to manage and filter interrupt signals from different devices / equipment to ensure that the system can correctly respond to valid interrupt signals while filtering out falsely triggered signals, thereby improving the reliability and stability of the system.
[0113] For ease of understanding, the following Figure 3 , give examples to introduce the bus expansion module and interrupt processing module of logic devices.
[0114] like Figure 3 As shown, the baseboard management controller 130 is connected to the logic device through bus 1, and the bus expansion module expands bus 1 into bus 2, bus 3 and bus 4, each bus is connected to a hot-swappable execution device, and each hot-swappable execution device includes a group of GPIO signals, that is, each hot-swappable execution device corresponds to a device to be hot-plugged. Then the bus expansion module expands bus 1 into bus 2, bus 3 and bus 4, which can support the hot plugging of three devices to be hot-plugged; if bus 1 is not expanded, only one hot-swappable execution device can be connected, and only one device to be hot-plugged can be hot-plugged. By comparison, it can be seen that the bus expansion module expands one bus into multiple buses to support the hot plugging of more devices.
[0115] It should be noted that Figure 3 It is only shown that the logic device is connected to the hot-swap execution device through the bus 4 extended by the bus extension module.
[0116] like Figure 3 Taking the example of the logic device shown being connected to the hot-swappable execution device through the bus 4 extended by the bus extension module, the interrupt processing module is used to receive the interrupt signal reported by the hot-swappable execution device and transmit the interrupt signal to the baseboard management controller. Exemplarily, the hot-swappable execution device detects that the device to be hot-plugged is inserted into the downstream interface corresponding to the switching chip and the hot-swappable execution device, and the hot-swappable execution device generates an interrupt signal and transmits it to the interrupt processing module of the logic device, so that the interrupt processing module transmits the interrupt signal to the baseboard management controller 130, and the interrupt signal is an interrupt signal corresponding to the device to be hot-plugged.
[0117] Further, if Figure 3 As shown, the hot-swap execution device is used to convert the control instruction into a corresponding GPIO signal and output it to control the hot-swap device to complete the corresponding hot-swap process.
[0118] In a possible implementation, the hot-plug execution device is used to convert the control instruction corresponding to the hot-plug command into a corresponding GPIO signal and output it, so as to control the device to be hot-plugged to complete the corresponding hot-plug process.
[0119] Specifically, the hot-swap execution device is used to convert the reset control instruction corresponding to the hot-plug command into a corresponding reset signal and output it to control the hot-plug device to reset; and convert the power control instruction corresponding to the hot-plug command into a corresponding power enable signal to control the power off of the hot-plug device.
[0120] In a possible implementation, the hot-plug execution device is used to convert the control instruction corresponding to the hot-plug command into a corresponding GPIO signal and output it, so as to control the device to be hot-plugged to complete the corresponding hot-plug process.
[0121] Specifically, the hot-swap execution device is used to convert the power control instruction corresponding to the hot-plug command into a corresponding power enable signal to control the power on of the hot-plug device; convert the reset control instruction corresponding to the hot-plug command into a corresponding reset signal and output it to control the hot-plug device to be reset.
[0122] In a possible implementation, the hot-swap execution device is used to convert the indicator light control instruction corresponding to the target mode into a corresponding indicator light signal and output it, so as to control the indicator light of the device to be hot-swapped to flash according to the target mode.
[0123] Among them, the hot-plug execution device (Hot-Pluggable Execution Device) is a hardware component specifically used to manage and control the device to be hot-plugged, and is used to generate and manage various GPIO (General Purpose Input / Output) signals to realize the hot-plug function of the device to be hot-plugged. That is, the hot-plug execution device converts the system internal bus signal into a GPIO signal, thereby generating a GPIO signal for realizing the hot-plug process of the device to be hot-plugged. Exemplarily, the hot-plug execution device can be an IIC-to-GPIO chip (such as: PCA9555) that converts the IIC bus signal into a GPIO signal, so that the baseboard management controller 130 sends control instructions through the IIC bus, and the hot-plug execution device can convert these instructions into corresponding GPIO signals to control the hot-plug function of the device to be hot-plugged.
[0124] In an embodiment of the present application, a group of GPIO pins on a hot-swap execution device corresponds to a group of GPIO signals, and the group of GPIO signals is used to control the hot-swap function of a device to be hot-swapped.
[0125] Specifically, in the embodiment of the present application, a group of GPIO signals composed of GPIO signals corresponding to four GPIO pins, that is, four GPIO signals constitute a group of GPIO signals, which are used to implement the hot-plug function of a device to be hot-plugged.
[0126] For ease of understanding, the following Figure 4 , a detailed introduction is given to the GPIO signals corresponding to a group of GPIO pins of the hot-swap actuator, that is, a detailed introduction is given to the composition of a group of GPIO signals.
[0127] like Figure 4 As shown, the hot-swap execution device includes a group of GPIO pins, namely GPIO pin 401, GPIO pin 402, GPIO pin 403 and GPIO pin 404, GPIO pin 401 is used to output a present signal (Present signal), GPIO pin 402 is used to output an indicator light signal (LED signal), GPIO pin 403 is used to output a power enable signal (Power EN signal), and GPIO pin 404 is used to output a reset signal (Reset signal). That is, the present signal, the indicator light signal, the power enable signal and the reset signal are a group of GPIO signals, which are used to control the hot-swap of the hot-swappable device A of the switching chip 120.
[0128] The in-place signal is used to detect whether the hot-plug device A is connected to the system, that is, in the embodiment of the present application, to detect whether the hot-plug device A is connected to the downlink interface of the switch chip 120. Exemplarily, when the hot-plug device A is connected, the in-place signal becomes high level.
[0129] It should be noted that it can also be designed that when the hot-swappable device A is connected, the in-place signal becomes a low level, which depends on the pre-setting of the GPIO signal.
[0130] Among them, the indicator light signal is used to control the indicator light on the hot-plug device A to flash according to a preset color and / or frequency to indicate the current state of the hot-plug device (such as: normal operation, in the hot-plug process, the hot-plug process is completed, in the hot-plug process, the hot-plug process is completed, etc.).
[0131] Specifically, the baseboard management controller 130 converts the indicator light control instruction corresponding to the target mode sent by the IIC bus through the logic device into an indicator light signal corresponding to the target mode, and outputs it through the GPIO pin 402 to control the indicator light of the hot-swappable device A to flash according to the target mode.
[0132] The power enable signal is used to control the power supply of the hot-plug device A. Exemplarily, when the hot-plug device A is connected to the system (i.e., the hot-plug device A is plugged in), the GPIO pin 403 outputs a high-level power enable signal to supply power to the hot-plug device A; when the hot-plug device A is removed from the system (i.e., the hot-plug device A is unplugged), the GPIO pin 403 outputs a low-level power enable signal to cut off the power supply of the hot-plug device A.
[0133] Specifically, the baseboard management controller 130 converts the power control instruction sent by the IIC bus into a power enable signal through a logic device, and outputs the power enable signal through the GPIO pin 403 to control the power supply of the device A to be hot-plugged.
[0134] Among them, the reset signal is an electrical signal used to initialize or reset an electronic device, and is used to restore the hot-plug device A to a known initial state so that the device can start or restart working correctly. The known initial state usually refers to the factory default state of the device or a predefined startup state. Exemplarily, when the hot-plug device A is connected to the system, the GPIO pin 404 outputs a low-level power enable signal, and the hot-plug device A is reset; when the hot-plug device A is removed from the system, the GPIO pin 404 outputs a high-level reset signal, and the hot-plug device A is reset.
[0135] Specifically, the baseboard management controller 130 converts the reset control instruction sent by the IIC bus through the logic device into a reset signal, and outputs it through the GPIO pin 404 to control the reset or release of the device A to be hot-plugged.
[0136] A server for implementing a hot-swap method provided in an embodiment of the present application provides an additional hot-swap channel, namely, a central processing unit-baseboard management controller-logic device-hot-swap execution device, for a case where the current technology cannot support notification-based hot-swap, that is, when the PCIe devices hung under the switch chip connected to the CPU include: hot-swappable devices and non-hot-swappable devices, thereby implementing notification-based hot-swap.
[0137] Furthermore, since the notification hot plugging of the PCIe device hanging under the switch chip is realized through the additional channel, there is no need to violently hot plug the PCIe device hanging under the switch chip, thereby avoiding problems such as data loss, damage and system instability caused by violent hot plugging.
[0138] Furthermore, a new thermal management plug-in is added to the operating system running on the central processing unit, thereby realizing the interaction between the central processing unit and the baseboard management controller, thereby assisting in forming an additional channel of "central processing unit-baseboard management controller-logic device-hot-swappable execution device".
[0139] The above is combined with Example 1 to introduce in detail a server for implementing a hot-swap method provided by an embodiment of the present application. The following is combined with Example 2 to introduce in detail a hot-swap method provided by an embodiment of the present application.
[0140] Embodiment 2:
[0141] Combine the following Figure 5 and Figure 6 , a hot plug method provided in an embodiment of the present application is introduced in detail.
[0142] Combine the following Figure 5 , a hot plug method provided in an embodiment of the present application is introduced in detail, how to hot plug out a PCIe device connected to a switching chip, that is, a hot plug method provided in an embodiment of the present application is introduced in detail.
[0143] like Figure 5 As shown, a hot removal method provided in an embodiment of the present application includes the following steps:
[0144] S501: The central processing unit obtains a hot-plug command for a device to be hot-plugged.
[0145] Specifically, the operating system running on the central processing unit obtains a hot unplug command for the device to be hot unplugged.
[0146] The device to be hot-plugged refers to a PCIe device hung under a switch chip connected to the central processing unit.
[0147] Specifically, the central processing unit obtains the hot unplugging process for the device to be hot unplugged in response to the user's triggering operation for the hot unplugging process of the device to be hot unplugged.
[0148] The hot-plug command for the device to be hot-plugged includes: a hot-plug command triggered by a user through an interface provided by an operating system running on a central processing unit, and a hot-plug command triggered by a user through a hot-plug button on a device with hot-plugging. Exemplarily, a user triggers a hot-plug operation for the device to be hot-plugged based on an interface provided by the operating system, and the operating system obtains a hot-plug command for the device to be hot-plugged based on the hot-plug operation; or a user clicks a hot-plug button on the device to be hot-plugged (i.e., a hot-plug operation), and the operating system running on the central processing unit obtains a hot-plug command for the device to be hot-plugged based on the user's click operation on the hot-plug button.
[0149] S502: The central processor migrates or terminates the running service corresponding to the device to be hot-plugged based on the hot-plug command for the device to be hot-plugged.
[0150] Specifically, the operating system detects the running business corresponding to the device to be hot-plugged based on the hot-plug command for the device to be hot-plugged; if there is a running business corresponding to the device to be hot-plugged, the running business corresponding to the device to be hot-plugged is migrated or terminated; if there is no running business corresponding to the device to be hot-plugged, S503 is directly performed.
[0151] The running services corresponding to the device to be hot-plugged (i.e., the running services corresponding to the PCIe device) depend on the type and purpose of the device. For example, the running services corresponding to the graphics card (GPU) include: graphics rendering services, graphics service services, etc.; the running services corresponding to the network adapter (NIC) include: network connection services, network service services, etc.
[0152] When the hot-plugged device needs to be removed or unplugged from the system, the running business corresponding to the hot-plugged device is closed or migrated to avoid abnormal interruption of the running business due to hot plugging, thereby causing problems such as data loss or system instability.
[0153] S503: The central processing unit transmits a hot-plug command for the device to be hot-plugged to the baseboard management controller.
[0154] Specifically, a hot-plug command for the device to be hot-plugged is transmitted to a baseboard management controller (BMC) through an out-of-band channel or an in-band channel (IIC bus) through a newly added hot-plug plug-in running under the operating system.
[0155] In a possible implementation, the newly added hot-swappable plug-in transmits a hot-plug command for the device to be hot-plugged to the baseboard management controller in response to the shutdown or completion of the migration of the running service corresponding to the device to be hot-plugged.
[0156] S504: The baseboard management controller controls the indicator light of the device to be hot-plugged to flash in a first mode based on the received hot-plug command for the device to be hot-plugged.
[0157] The indicator light of the device to be hot-plugged flashes in a first mode, which is used to indicate / characterize that the device to be hot-plugged is in the hot-plugging process (ie, the hot-plugging process is being performed).
[0158] Specifically, the hot-swap management module run by the baseboard management controller generates an indicator light control instruction corresponding to the first mode based on the received hot-swap command for the device to be hot-plugged, and transmits the indicator light control instruction to the hot-swap execution device through a logic device and a system management bus (such as an IIC bus); the hot-swap execution device converts the indicator light control instruction corresponding to the first mode into an indicator light signal (LED signal) corresponding to the first mode, and outputs the indicator light signal through the corresponding GPIO pin to control the indicator light of the device to be hot-plugged to flash according to the first mode.
[0159] S505: The baseboard management controller controls the device to be hot-plugged to reset based on the received hot-plug command for the device to be hot-plugged.
[0160] Specifically, the hot-swap management module run by the baseboard management controller generates a reset control instruction based on the received hot-swap command for the device to be hot-plugged, and transmits the reset control instruction to the hot-swap execution device through the logic device and the system management bus (such as the IIC bus); the hot-swap execution device converts the reset control instruction into a reset signal (Reset signal) and outputs the reset signal through the corresponding GPIO pin to control the device to be hot-plugged to reset and restore the device to be hot-plugged to an initial state, so that the device to be hot-plugged can be correctly initialized when it is started again.
[0161] S506: After the device to be hot-plugged is reset, the baseboard management controller controls the power supply of the device to be hot-plugged to be turned off based on the received hot-plug command for the device to be hot-plugged.
[0162] Specifically, the hot-swap management module run by the baseboard management controller generates a power control instruction based on the received hot-swap command for the device to be hot-plugged, and transmits the power control instruction to the hot-swap execution device through the logic device and the system management bus (such as the IIC bus); the hot-swap execution device converts the power control instruction into a power enable signal (Power EN signal) and outputs the power enable signal through the corresponding GPIO pin to control the power off of the device to be hot-plugged.
[0163] S507: In response to the power of the device to be hot-plugged being turned off, the baseboard management controller controls the indicator light of the device to be hot-plugged to flash according to the second mode.
[0164] The indicator light of the device to be hot-plugged flashes in a second mode to indicate / characterize that the hot-plugging operation of the device to be hot-plugged is completed.
[0165] Specifically, the hot-swap management module run by the baseboard management controller generates an indicator light control instruction corresponding to the second mode in response to the power of the device to be hot-plugged being turned off, and transmits the indicator light control instruction to the hot-swap execution device through a logic device and a system management bus (such as an IIC bus); the hot-swap execution device converts the indicator light control instruction corresponding to the second mode into an indicator light signal (LED signal) corresponding to the second mode, and outputs the indicator light signal through the corresponding GPIO pin to control the indicator light of the device to be hot-plugged to flash according to the second mode.
[0166] S508: In response to the power of the device to be hot-plugged being turned off, the baseboard management controller returns unplugging completion status information to the central processing unit.
[0167] Specifically, in response to the power off of the device to be hot-plugged, the baseboard management controller returns hot-plug process completion information to the operating system running on the central processor to prompt the device to be hot-plugged to complete the hot-plug process and remove (i.e., unplug) the hot-plugged device from the system.
[0168] In a possible implementation, the operating system running on the central processor displays a specific completion interface on the display in response to the unplugging completion status information to prompt the user that the hot unplugging process of the device to be hot unplugged has been completed.
[0169] It should be noted that S507 and S508 are performed simultaneously or almost simultaneously, and there is no need to specify a time sequence.
[0170] Further, based on the indicator light of the device to be hot-plugged flashing in the second mode and / or the display of a specific completion interface, the user unplugs the device to be hot-plugged from the system, that is, unplugs it from the slot of the switch chip.
[0171] The above combination Figure 5 , a hot-swap method provided by an embodiment of the present application is described in detail, which is how to hot-swap a PCIe device hung under a switch chip connected to a CPU; the following is combined with Figure 6 , a hot-plug method provided in an embodiment of the present application is introduced in detail, which is how to hot-plug a PCIe device into a switching chip connected to a CPU, that is, a hot-plug method provided in an embodiment of the present application.
[0172] like Figure 6 As shown, a hot insertion method provided in an embodiment of the present application includes the following steps:
[0173] S601: In response to the insertion of a device to be hot-plugged, the hot-plug execution component reports a hot-plug command to a baseboard management controller.
[0174] Specifically, the hot-swap execution device monitors changes in the present signal (Present signal). When it detects that the change in the present signal indicates that the device to be hot-plugged is inserted into the downstream interface of the switching chip connected to the CPU (that is, the device to be hot-plugged is connected to the system); the hot-swap execution device reports an interrupt signal to the baseboard management controller through the logic device via the system management bus (such as the IIC bus).
[0175] S602: The baseboard management controller obtains in-place status information in response to the interrupt signal, and determines a unique identifier of the device to be hot-plugged based on the in-place status information.
[0176] Specifically, the baseboard management controller responds to the interrupt signal, obtains the in-place status information of all devices, monitors whether the in-place status of all devices changes, and determines that the device whose in-place status changes from no longer in place to in-place is the device to be hot-plugged; the baseboard management controller reads the unique identifier of the device to be hot-plugged itself (such as: SAS address, SCSI ID, etc.).
[0177] In a possible implementation, the baseboard management controller compares the unique identifier of the device to be hot-plugged with a known device list to determine the unique identifier corresponding to the device to be hot-plugged in the server.
[0178] It should be noted that the interrupt signal and the unique identifier of the device to be hot-plugged together constitute a hot-plug command.
[0179] S603: The baseboard management controller controls the indicator light of the device to be hot-plugged to flash in a third mode based on the unique identifier of the device to be hot-plugged.
[0180] The indicator light of the device to be hot-plugged flashes in a third mode, which is used to indicate / characterize that the device to be hot-plugged is in the hot-plugging process (ie, the hot-plugging process is being performed).
[0181] Specifically, the hot-swap management module run by the baseboard management controller generates an indicator light control instruction corresponding to the third mode based on the unique identifier of the device to be hot-plugged and the interrupt signal (i.e., the hot-plug command for the device to be hot-plugged), and transmits the indicator light control instruction to the hot-swap execution device through a logic device via a system management bus (such as an IIC bus); the hot-swap execution device converts the indicator light control instruction corresponding to the third mode into an indicator light signal (LED signal) corresponding to the third mode, and outputs the indicator light signal through the corresponding GPIO pin to control the indicator light of the device to be hot-plugged to flash according to the third mode.
[0182] S604: The baseboard management controller controls the power on of the device to be hot-plugged based on the unique identifier of the device to be hot-plugged.
[0183] Specifically, the hot-swap management module run by the baseboard management controller generates a power control instruction based on the unique identification of the device to be hot-plugged and the interrupt signal (i.e., the hot-plug command for the device to be hot-plugged), and transmits the power control instruction to the hot-swap execution device through a logic device via a system management bus (such as an IIC bus); the hot-swap execution device converts the power control instruction into a power enable signal (Power EN signal) and outputs the power enable signal through the corresponding GPIO pin to control the power on of the device to be hot-plugged and power it on correctly.
[0184] S605 : After the power of the device to be hot-plugged is turned on, the baseboard management controller controls the device to be hot-plugged to reset based on the unique identifier of the device to be hot-plugged.
[0185] Specifically, the hot-swap management module run by the baseboard management controller generates a reset control instruction based on the unique identification of the device to be hot-plugged and the interrupt signal (i.e., the hot-plug command for the device to be hot-plugged), and transmits the reset control instruction to the hot-swap execution device via the system management bus (such as the IIC bus); the hot-swap execution device converts the reset control instruction into a reset signal (Reset signal), and outputs the reset signal through the corresponding GPIO pin to control the device to be hot-plugged to reset, and restore the device to be plugged in from an initial state to a normal working state, so as to ensure that the device to be hot-plugged can operate normally.
[0186] S606: When the switch chip successfully establishes a link with the device to be hot-inserted, the switch chip reports device access information to the central processor.
[0187] Specifically, when the switch chip successfully establishes a link with the device to be hot-plugged, the device to be hot-plugged reports device access information to the operating system running under the central processor.
[0188] Specifically, when the device to be hot-plugged is inserted, the operating system will reserve necessary resources for it (such as memory, interrupts, DMA buffers, etc.), but the reserved necessary resources will not be immediately allocated to the device to be hot-plugged until the device to be hot-plugged successfully establishes a PCIe link with the switching chip; when the device to be hot-plugged successfully establishes a PCIe link with the switching chip, the switching chip reports the device access information to the operating system.
[0189] In a possible implementation, the switch chip may report device access information to the operating system through an interrupt or a status register.
[0190] S607: The central processing unit completes the access of the device to be hot-plugged in response to the device access information.
[0191] Specifically, the operating system running under the central processing unit responds to the device access information and completes the access of the device to be hot-plugged under the operating system.
[0192] Exemplarily, the operating system responds to the device access information, enumerates the device to be hot-plugged, and obtains the unique identifier of the device to be hot-plugged; allocates reserved resources (such as memory, interrupt, DMA buffer, etc.) to the device to be hot-plugged; the operating system loads the corresponding driver, etc., initializes the device to be hot-plugged, and enables the device to be hot-plugged to work normally.
[0193] S608: When the central processing unit completes access to the device to be hot-plugged, it sends access completion status information to the baseboard management controller.
[0194] Specifically, after the central processor completes access to the device to be hot-plugged, the newly added hot-swappable plug-in running under the operating system detects that the device to be hot-plugged has completed access, and then sends access completion status information to the baseboard management controller to inform / prompt the baseboard management controller that the hot plug process of the device to be hot-plugged has been completed.
[0195] S609: In response to the access completion status information, the baseboard management controller controls the indicator light of the device to be hot-plugged to flash in a fourth mode.
[0196] The indicator light of the device to be hot-plugged flashes in a fourth mode, which is used to indicate / characterize that the device to be hot-plugged has completed the hot-plug process, that is, the device to be hot-plugged has been successfully connected to the server.
[0197] Specifically, the hot-swap management module run by the baseboard management controller generates an indicator light control instruction corresponding to the fourth mode based on the access completion status information, and transmits the indicator light control instruction to the hot-swap execution device through a logic device via a system management bus (such as an IIC bus); the hot-swap execution device converts the indicator light control instruction corresponding to the fourth mode into an indicator light signal (LED signal) corresponding to the fourth mode, and outputs the indicator light signal through the corresponding GPIO pin to control the indicator light of the device to be hot-plugged to flash according to the fourth mode.
[0198] The above combined Figure 5 and Figure 6 A hot-swap method provided in an embodiment of the present application is introduced, which describes how to implement the hot-unplug process and the hot-insert process. Specifically, through the additional channels formed by the central processing unit, the baseboard management controller, the logic device and the hot-swap execution device, when the PCIe devices hanging under the switch chip connected to the CPU include hot-swappable devices and non-hot-swappable devices, the notification-based hot-swap of the PCIe devices hanging under the switch chip can be effectively implemented, thereby avoiding data damage and loss caused by violent hot-swap.
[0199] In addition, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed on a computer, the computer executes the hot plug method in the above embodiment.
[0200] For the explanation of the relevant contents and description of the beneficial effects of any of the above-mentioned computer-readable storage media, reference may be made to the above-mentioned corresponding embodiments, which will not be repeated here.
[0201] The embodiment of the present application also provides a chip. The chip integrates a control circuit and one or more ports for implementing the functions of the above-mentioned server. Optionally, the functions supported by the chip can be referred to above and will not be repeated here. A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned embodiment can be completed by instructing the relevant hardware through a program. The program can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a random access memory, etc. The above-mentioned 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 (field programmable gatearray, FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.
[0202] The embodiment of the present application also provides a computer program product including instructions, when the instructions are run on a computer, the computer executes any one of the methods in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. 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 computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more servers that can be integrated with the medium. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD), etc.
[0203] It should be noted that the above-mentioned devices for storing computer instructions or computer programs provided in the embodiments of the present application, such as but not limited to the above-mentioned memories, computer-readable storage media and communication chips, etc., are all non-transitory.
[0204] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more servers that can be integrated with a medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0205] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other changes to the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.
[0206] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A server, characterized in that: include: Central processing unit CPU, baseboard management controller BMC, hot-swap processing component, switching chip; the CPU is connected to the uplink interface of the switching chip, and the downlink interface of the switching chip is used to connect to the PCIe device; The CPU is connected to the BMC and is used to transmit a hot-plug command to the BMC; The hot unplug command is used to instruct the BMC to control the device to be hot unplugged to execute the corresponding hot unplug process; The BMC is connected to the hot-plug processing component and is used to transmit a control instruction corresponding to the hot-plug command to the hot-plug processing component after receiving the hot-plug command; wherein the device to be hot-plugged is a PCIe device connected to the downlink interface of the switching chip; The hot-plug processing component is used to convert the control instruction corresponding to the hot-plug command into a corresponding GPIO signal and output it, so as to control the device to be hot-plugged to complete the corresponding hot-plug process.
2. The server according to claim 1, characterized in that: The CPU is further configured to migrate or terminate the service running on the device to be hot-plugged in response to a hot-plug command.
3. The server according to claim 1, characterized in that: The BMC is specifically used to generate a reset control instruction and a power control instruction corresponding to the hot plug command, and transmit them to the hot plug processing component; The hot-plug processing component is specifically used to convert the reset control instruction into a corresponding reset signal, and output the reset signal through the corresponding GPIO pin to control the device to be hot-plugged to reset; and convert the power control instruction into a corresponding power enable signal, and output the power enable signal through the corresponding GPIO pin to control the power off of the device to be hot-plugged.
4. The server according to claim 3, characterized in that: The BMC is further configured to return unplugging completion status information to the CPU in response to power off of the device to be hot-plugged.
5. The server according to claim 1, characterized in that: The hot-plug processing component is further used to transmit an interrupt signal to the BMC in response to the access of the device to be hot-plugged; The BMC is further configured to obtain in-place status information of all devices after receiving the interrupt signal, and determine a unique identifier of the device to be hot-plugged based on the in-place status information; The interrupt signal and the unique identifier of the device to be hot-plugged constitute a hot-plug command, and the hot-plug command is used to instruct the BMC to control the device to be hot-plugged to execute a corresponding hot-plug process; The BMC is further used to transmit a control instruction corresponding to the hot plug command to the hot plug processing component; The hot-plug processing component is used to convert the control instruction corresponding to the hot-plug command into a corresponding GPIO signal and output it, so as to control the device to be hot-plugged to complete the corresponding hot-plug process.
6. The server according to claim 5, characterized in that: The BMC is specifically used to generate a reset control instruction and a power control instruction corresponding to the hot plug command, and transmit them to the hot plug processing component; The hot-swap processing component is specifically used to convert the power control instruction into a corresponding power enable signal, and output the power enable signal through the corresponding GPIO pin to control the power on of the device to be hot-plugged; convert the reset control instruction into a corresponding reset signal, and output the reset signal through the corresponding GPIO pin to control the device to be hot-plugged to reset.
7. The method according to claim 6, characterized in that The CPU is further configured to receive device access information corresponding to the device to be hot-plugged sent by the switching chip, and complete access to the device to be hot-plugged in response to the device access information; The CPU is further configured to send access completion status information to the BMC when the access to the device to be hot-plugged is completed.
8. The server according to claim 5, characterized in that: The BMC is further used to send an indicator light control instruction corresponding to the target mode to the hot-swap processing module; The hot-plug processing component is also used to convert the indicator light control instruction corresponding to the target mode into an indicator light signal corresponding to the target mode, so as to control the indicator light of the device to be hot-plugged or the device to be hot-inserted to flash according to the target mode.
9. The server according to claim 5, characterized in that: The hot-swap processing component includes a logic device and a hot-swap execution device; The hot-swap execution device is used to convert the control instruction into a corresponding GPIO signal and output it to control the device to be hot-swapped to complete the corresponding hot-swap process; wherein, the device to be hot-swapped includes: the device to be hot-unplugged or the device to be hot-inserted, and the hot-swap process includes: the hot-unplug process or the hot-insertion process.
10. The server according to claim 9, characterized in that The number of the hot-swap execution devices is multiple, and the logic device includes: a bus expansion module; The bus expansion module is used to expand the bus into multiple buses to connect multiple hot-swappable execution devices.