Bandwidth allocation method, server, device, medium and program product
By monitoring the channel of the PCIe interface, obtaining device information and determining the channel connection, and combining with the system management bus issuing bandwidth configuration instructions, the automatic identification and bandwidth allocation of PCIe devices are realized, and the problem is that the number of Lane devices on the server motherboard cannot recognize and allocate bandwidth. The problem is that bandwidth allocation efficiency and recognition accuracy are improved.
Patent Information
- Application Number
- CN202411104838.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-08-13
AI Technical Summary
The PCIe interface on the server motherboard cannot automatically identify and allocate bandwidth when plugging into devices with small Lane, resulting in waste of resources and loss of functionality.
By monitoring the channel of the PCIe interface, obtaining device information, and determining whether the channels are connected. If the same is true, it is determined to be the same PCIe device. The bandwidth configuration instructions are sent to the PCIe device based on the system management bus, and the device information is sent cyclically through the first and last channels. Determine the number of channels and realize automatic bandwidth allocation.
It realizes automatic identification and bandwidth allocation of PCIe devices, improves bandwidth allocation efficiency, avoids resource waste and identification errors, has high recognition accuracy, and has stable and reliable detection mechanism.
Smart Images

Figure CN118626428B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of servers, and in particular to a bandwidth allocation method, a server, a device, a medium and a program product. Background Art
[0002] PCIe (Peripheral Component Interconnect Express) is a high-speed serial computer expansion card standard, mainly used to connect the CPU (central processing unit) and various expansion cards, such as graphics cards, sound cards, network adapters, etc. The bandwidth of PCIe is closely related to its version and the number of Lanes. For example, the theoretical maximum bandwidth of the PCIe x1 slot is 1GB / s, which is suitable for devices with low data transmission requirements; the theoretical maximum bandwidth of the PCIe x4 slot is 4GB / s, which is suitable for devices with medium bandwidth requirements; the theoretical maximum bandwidth of the PCIe x8 slot is 8GB / s, which is suitable for devices with higher data transmission speed requirements; the PCIe x16 slot has the highest theoretical maximum bandwidth of 16GB / s, which is widely used to connect high-performance graphics cards.
[0003] The PICe interface on the server motherboard generally uses a PCIe x8 slot or a PCIe x16 slot. When a PCIe device with a small number of lanes is inserted, the PCIe device cannot be identified and PCIe resources are wasted. Automatic identification and allocation of PCIe bandwidth are required. Summary of the invention
[0004] In view of this, the present invention provides a bandwidth allocation method, server, device, medium and program product, so as to automatically identify and allocate PCIe bandwidth.
[0005] In a first aspect, the present invention provides a bandwidth allocation method, which is applied to a central processing unit of a server, comprising:
[0006] In the initialization phase of initializing the PCIe device, monitoring the PCIe interface of the central processing unit;
[0007] In a case where first device information is acquired based on a first channel of the PCIe interface and second device information is acquired based on a second channel of the PCIe interface, determining whether the first device information is the same as the second device information; both the first device information and the second device information are device information of a PCIe device connected to the PCIe interface;
[0008] In a case where the first device information is the same as the second device information, determining that the first channel and the second channel correspond to the same PCIe device, and feeding back confirmation signals based on the first channel and the second channel respectively;
[0009] Bandwidth allocation is performed according to the correspondence between the PCIe interface and the PCIe device.
[0010] In some optional implementations, when the first device information is the same as the second device information, determining that the first channel and the second channel correspond to the same PCIe device includes:
[0011] In a case where the first device information is the same as the second device information, if the first channel is adjacent to the second channel, determining that the first channel and the second channel correspond to the same PCIe device;
[0012] If the first channel is not adjacent to the second channel, it is determined that the first channel, the second channel, and other channels between the first channel and the second channel correspond to the same PCIe device.
[0013] In some optional implementations, if the first channel is not adjacent to the second channel, determining that the first channel, the second channel, and other channels between the first channel and the second channel correspond to the same PCIe device includes:
[0014] If the first channel is not adjacent to the second channel, and the device information obtained by other channels between the first channel and the second channel is the same as the first device information and / or the second device information, it is determined that the first channel, the second channel, and other channels between the first channel and the second channel correspond to the same PCIe device.
[0015] In some optional implementations, each channel of the PCIe device is configured to send device information to the central processor, and the method further includes:
[0016] In the case where the first device information is the same as the second device information, if the first channel is not adjacent to the second channel and there is a fourth channel between the first channel and the second channel on which no device information is received, it is determined that the fourth channel link is abnormal.
[0017] In some optional embodiments, the method further comprises:
[0018] When third device information is obtained based on the third channel of the PCIe interface and the third device information is different from other obtained device information, it is determined that the third channel corresponds to a PCIe device with a channel number of 1, and a confirmation signal is fed back based on the third channel.
[0019] In some optional embodiments, the method further comprises:
[0020] If the PCIe interface does not receive device information during the initialization phase of initializing the PCIe device, bandwidth allocation is performed based on a default bandwidth allocation strategy.
[0021] In a second aspect, the present invention provides a bandwidth allocation method, applied to a PCIe device, comprising:
[0022] Obtaining bandwidth configuration instructions issued by a baseboard management controller based on a system management bus;
[0023] Sending device information of the PCIe device to the central processor of the server based on the first channel cycle, and sending the same device information to the central processor based on the last channel cycle; the first channel is the first channel of the PCIe device, and the last channel is the last channel of the PCIe device;
[0024] When confirmation signals are obtained based on both the first channel and the last channel, sending the device information based on the first channel and the last channel is stopped.
[0025] In some optional embodiments, the method further comprises:
[0026] When the number of channels of the PCIe device is not less than 3, cyclically sending the same device information to the central processing unit based on other channels except the first channel and the last channel;
[0027] When a confirmation signal is obtained based on the other channel, sending the device information based on the other channel is stopped.
[0028] In some optional implementations, the acquiring the bandwidth configuration instruction issued by the baseboard management controller based on the system management bus includes:
[0029] Monitoring data frames in the system management bus;
[0030] When a data frame whose address identifier is all zero is monitored, it is determined that a bandwidth configuration instruction is obtained.
[0031] In some optional embodiments, the method further comprises:
[0032] Reading the manufacturer identification of the PCIe device from the manufacturer identification register, and reading the device identification of the PCIe device from the device identification register;
[0033] Device information including the manufacturer identifier and the device identifier is generated.
[0034] In a third aspect, the present invention provides a server, comprising: a baseboard management controller and a central processing unit;
[0035] The baseboard management controller is used to send bandwidth configuration instructions to the PCIe device based on the system management bus;
[0036] The central processing unit is used to execute the bandwidth allocation method of the first aspect or any corresponding implementation manner thereof.
[0037] In a fourth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the bandwidth allocation method of the first aspect, the second aspect or any corresponding embodiment thereof by executing the computer instructions.
[0038] In a fifth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the bandwidth allocation method of the first aspect, the second aspect or any corresponding embodiment thereof.
[0039] In a sixth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the bandwidth allocation method of the first aspect, the second aspect or any corresponding embodiment thereof.
[0040] When the CPU in this embodiment needs to initialize the PCIe device, it obtains the device information uploaded by the corresponding PCIe device based on the channel of the PCIe interface. Based on the same device information, the number of channels of the PCIe device can be simply determined, and which pins in its own PCIe interface are inserted into the PCIe device, so that bandwidth allocation can be automatically performed. This method is based on the link between the PCIe device and the PCIe interface, does not require the use of external resources, and is simple to implement; and does not require the setting of a bandwidth allocation table, which can improve the efficiency of bandwidth allocation. Based on the device information uploaded by each channel, the CPU can identify the specific slot where the PCIe device is connected, with high recognition accuracy and a stable and reliable detection mechanism. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 is a schematic diagram of a framework for bandwidth allocation performed by a CPU according to an embodiment of the present invention;
[0043] Figure 2 is a schematic diagram of a flow chart of a bandwidth allocation method according to an embodiment of the present invention;
[0044] Figure 3 is a flow chart of another bandwidth allocation method according to an embodiment of the present invention;
[0045] Figure 4 is a detailed flow chart for implementing bandwidth allocation according to an embodiment of the present invention;
[0046] Figure 5 is a structural block diagram of a bandwidth allocation device according to an embodiment of the present invention;
[0047] Figure 6 is a structural block diagram of another bandwidth allocation device according to an embodiment of the present invention;
[0048] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0050] The Baseboard Management Controller (BMC) is a hardware component dedicated to monitoring and managing servers and other computer systems. It is located on the motherboard as an independent system, has its own processor and memory, can run independently of the host system, and can be remotely accessed through a network interface. The main functions and features of the BMC include:
[0051] 1. Remote monitoring and management: BMC allows administrators to remotely monitor the health status of the server, including temperature, fan speed, power status, hard disk status, chassis cover switch status, etc., and can even manage it when the operating system is not working.
[0052] 2. Fault diagnosis and alarm: When a system anomaly is detected, such as overheating, voltage abnormality, or hardware failure, the BMC can generate an alarm and send it to the management system through the network, which helps to quickly respond and troubleshoot.
[0053] 3. Hardware control: BMC can control server startup, shutdown, restart and other operations, as well as adjust hardware configurations such as fan speed, thereby optimizing system performance and energy efficiency.
[0054] 4. Event log recording: Records all important events during system operation, including hardware status changes, error messages, etc., to provide historical data for system maintenance.
[0055] 5. Firmware update: BMC itself also supports firmware updates to fix vulnerabilities, add new features or optimize performance, and can usually be updated remotely over the network.
[0056] 6. Comply with industry standards: BMC follows standards such as the Intelligent Platform Management Interface (IPMI) to ensure interoperability between hardware and management software from different manufacturers.
[0057] 7. Security features: Considering the remote access capability of BMC, modern BMC designs usually include security measures such as encrypted communications, access control lists (ACLs), authentication mechanisms, etc. to protect the server from unauthorized access and attacks.
[0058] In short, the baseboard management controller is an indispensable part of modern data centers and enterprise IT infrastructure. It greatly improves the efficiency of server maintenance and system reliability by providing powerful remote management capabilities.
[0059] PCIe has made fundamental changes in bus structure, which are mainly reflected in two aspects: first, it changes from parallel bus to serial bus; second, it adopts point-to-point interconnection. The bus connecting the devices under the bridge in the original parallel bus structure is changed into a link. A link can contain one or more channels. Each channel consists of two pairs of differential signal lines to form a dual-simplex serial transmission channel. There are no dedicated data, address, control and clock lines. Various transactions on the bus are organized into information packets for transmission. Another feature of PCIe that breaks through the traditional bus is the point-to-point interconnection method. Each device is connected by an independent link and has exclusive bandwidth. This is an effective solution to improve the transmission rate.
[0060] The PICe interface on the server motherboard generally uses a PCIe x8 slot or a PCIe x16 slot, which is convenient for plugging in different types of expansion cards later. Even if the gold finger on the expansion card is x2 or x4, it can still be plugged into the PCIe x8 slot or PCIex16 slot; however, the bandwidth directly provided by the CPU to the PCIe x8 slot or PCIe x16 slot is the maximum bandwidth, which causes the expansion card with a small number of lanes to be unable to be effectively identified. The CPU also allocates the maximum bandwidth, resulting in a waste of PCIe resources and a loss of CPU function. For example, two PCIE x8 devices are plugged into the PCIE x16 slot, but it is impossible to support two PCIE x8 devices in one PCIEx16 slot, that is, it is impossible to realize the automatic identification and bandwidth allocation of PCIe.
[0061] At present, you can use GPIO (General Purpose Input Output) expansion devices to dynamically configure bandwidth, or use resistors on physical detection circuit boards to control current or voltage detection. However, whether it is expansion device detection or physical resistance detection, it is necessary to add a bandwidth allocation table. After obtaining the change data, it is necessary to match the value with the corresponding number of lanes in the pre-set bandwidth allocation table, and then the CPU analyzes the corresponding bandwidth for allocation. This requires early statistics of data from different expansion cards to simulate table building. The types and models of corresponding expansion cards are fixed. After the expansion card data that is not in the table is plugged in, there will be recognition errors. The table needs to be matched when used, and the overall recognition and allocation of bandwidth is inefficient.
[0062] The embodiment of the present invention provides a bandwidth allocation method, in which a BMC notifies each PCIe device mounted on a server to configure bandwidth by using a system management bus (SystemManagement Bus, SMBus), and each PCIe device reports its own device information based on its own channel cycle, so that a CPU of the server can determine which pins in a PCIe interface are plugged into the PCIe device based on whether the acquired device information is the same, and can determine the number of channels of these PCIe devices, so that bandwidth can be allocated to these PCIe devices.
[0063] Figure 1 FIG. 1 shows a schematic diagram of a framework for bandwidth allocation by the CPU of a server. Figure 1 As shown, the server includes a central processing unit (CPU) and a baseboard management controller (BMC). When bandwidth allocation is required, the BMC sends a bandwidth configuration instruction to the PCIe device mounted on the server, so that the PCIe device can report its own device information through each channel (Lane), so that the CPU can determine the number of channels of the PCIe device, and then allocate bandwidth based on the number of channels.
[0064] In this embodiment, a bandwidth allocation method is provided, which can be applied to PCIe devices, such as Figure 1 The PCIe devices shown. Figure 2 is a flowchart of a bandwidth allocation method according to an embodiment of the present invention. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0065] like Figure 2 As shown, the bandwidth allocation method includes the following steps S201 to S203.
[0066] Step S201: Obtain a bandwidth configuration instruction issued by a baseboard management controller based on a system management bus.
[0067] In this embodiment, when the bandwidth needs to be reconfigured, the BMC may send an instruction for reconfiguring the bandwidth, namely, a bandwidth configuration instruction, to the system management bus (SMBus); the PCIe device may obtain the bandwidth configuration instruction based on the SMBus.
[0068] The bandwidth configuration instruction is a trigger instruction. After the PCIe device receives the bandwidth configuration instruction, it does not perform bandwidth configuration by itself, but cooperates with the CPU of the server to implement bandwidth configuration. For example, the bandwidth configuration instruction can be a mode switching instruction. When the PCIe device receives the bandwidth configuration instruction, the PCIe device enters the bandwidth configuration mode.
[0069] Table 1 shows the interface definition of the front-end power interface part in the PCIe slot pins, and the A side and the B side are the contact grooves on both sides.
[0070] Table 1
[0071]
[0072] As shown in Table 1, the PCIe slot has reserved SMBus interfaces, namely SMCLK (system management bus clock) and SMDAT (system management bus data). BCM can broadcast bandwidth configuration instructions to the system management bus, so that each PCIe device can obtain the bandwidth configuration instructions broadcast by BMC by monitoring the system management bus.
[0073] Optionally, after the server's BMC is powered on, it can determine whether the bandwidth needs to be reconfigured; specifically, the BMC can determine whether the server has experienced an AC power outage and whether the chassis cover has been opened; specifically, the BMC can determine whether the chassis cover has been opened by monitoring the switch status of the chassis cover. If the server has experienced an AC power outage and the chassis cover has been opened, it means that the server may have a PCIe device plug-in or unplug (for example, a PCIe device has been replaced), so the CPU needs to reconfigure the bandwidth at this time, that is, the BMC broadcasts a bandwidth configuration instruction to the system management bus.
[0074] In some optional implementations, the above step S201 "obtaining a bandwidth configuration instruction issued by a baseboard management controller based on a system management bus" may specifically include: monitoring data frames in the system management bus; and determining that a bandwidth configuration instruction is obtained when a data frame with an address identifier of all zeros is monitored.
[0075] In this embodiment, when the BMC broadcasts a bandwidth configuration instruction to the system management bus, in order to enable all PCIe devices to respond to the bandwidth configuration instruction, the address identifier of the bandwidth configuration instruction is set to all zeros, that is, the address identifier of the bandwidth configuration instruction is all zeros.
[0076] The address identifier is originally used to indicate the address of the receiving device. In this embodiment, the address identifier of the bandwidth configuration instruction is set to all zeros, so that each PCIe device can respond to the bandwidth configuration instruction, and there is no need to send the bandwidth configuration instruction to each PCIe device in sequence. In addition, the data frame with the address identifier of all 0s also has the highest processing priority, so that each PCIe device can process the bandwidth configuration instruction first.
[0077] In addition, after the PCIe device is powered on, it can monitor the system management bus. If a data frame is monitored, it is determined whether it is a bandwidth configuration instruction based on the address identifier of the data frame; if the address identifier of the data frame is all 0, the PCIe device can determine that it has received the bandwidth configuration instruction.
[0078] Generally, after receiving a data frame based on the system management bus, the PCIe device needs to feedback ACK (Acknowledge character); for example, the PCIe device can pull the data line corresponding to SMDAT down by one bit. In this embodiment, since the all-0 address identifier is also different from the address of the PCIe device itself, the PCIe device does not need to feedback ACK after receiving the bandwidth configuration instruction, which complies with the provisions of the SMBus protocol, and multiple PCIe devices do not feedback ACK, which is equivalent to the absence of a slave device with an address of all 0, which can ensure the normal operation of the system management bus.
[0079] Step S202, sending device information of the PCIe device to the central processor of the server based on the first channel cycle, and sending the same device information to the central processor based on the last channel cycle; the first channel is the first channel of the PCIe device, and the last channel is the last channel of the PCIe device.
[0080] Each PCIe device has unique device information, and the device information may specifically include a vendor ID and a device ID of the PCIe device.
[0081] Optionally, the process of obtaining device information may specifically include: reading the manufacturer identification of the PCIe device from the manufacturer identification register, and reading the device identification of the PCIe device from the device identification register; generating device information including the manufacturer identification and the device identification. The PCIe device maintains a manufacturer identification register and a device identification register, both of which are read-only memories; after the PCIe device is powered on (or after receiving a bandwidth configuration instruction), it can determine its own manufacturer identification and device identification by reading these two registers, and then generate the device information to be reported.
[0082] In this embodiment, the PCIe device is connected to the PCIe interface of the CPU. Figure 1 As shown, the PCIe device may be provided with a gold finger, through which the PCIe interface of the CPU can be plugged; and the data of each lane of the PCIe device is transmitted to the CPU. For different PCIe devices, the number of lanes may be different; for example, if the gold finger of the PCIe device is x4, the number of lanes is 4, that is, only four lanes are used for data transmission with the CPU.
[0083] Based on the above Table 1, combined with the following Tables 2 to 5, the pin differences of the PCIe x1 / x4 / x8 / x16 slots are explained.
[0084] Table 2 shows the data interface definition of the PCIe x1 slot. As shown in Table 2, the PCIe x1 slot includes only one channel, namely channel 0. It can be understood that the pins in Table 1 and Table 2 together constitute the pins of the PCIe x1 slot. In other words, the PCIe x1 slot includes 18 pins.
[0085] Table 2
[0086]
[0087] Table 3 shows the subsequent data interface definition of the PCIe x4 slot. As shown in Table 3, three pairs of differential signals and the corresponding ground lines form three channels, plus channel 0 shown in Table 2, forming all the channels of the PCIe x4 slot, that is, the PCIe x4 slot includes four channels, namely channels 0 to 3. Similarly, the pins of Table 1, Table 2 and Table 3 together constitute the pins of the PCIe x4 slot. In other words, the PCIe x4 slot contains 32 pins.
[0088] Table 3
[0089]
[0090] Table 4 shows the subsequent data interface definition of the PCIe x8 slot. Combining Tables 1 to 4, it can be seen that the PCIe x8 slot includes eight channels, namely channels 0 to 7.
[0091] Table 4
[0092]
[0093] Table 5 shows the subsequent data interface definition of the PCIe x8 slot. Combining Tables 1 to 5, it can be seen that the PCIe x16 slot includes sixteen channels, namely channels 0 to 15.
[0094] Table 5
[0095]
[0096] In this embodiment, for ease of description, the first channel of the PCIe device is referred to as the "first channel", and the last channel of the PCIe device is referred to as the "last channel". For example, if the PCIe device is a x8 device, which has channels 0 to 7, the first channel is channel 0, and the last channel is channel 7.
[0097] In bandwidth configuration mode, after obtaining the device information, the PCIe device sends the device information to the server's CPU at least on the first channel and the last channel, that is, the information sent by the first channel and the last channel is the same. In addition, to avoid failure to receive device information due to incomplete startup of the server, the PCIe device cyclically reports the device information on the first channel and the last channel, for example, reporting the device information once every certain period of time (such as 0.5s, 1s, etc.) to ensure that the server can receive the device information. The device information is used by the CPU to determine the number of channels of the PCIe device, which will be explained later.
[0098] It can be understood that if the PCIe device is a x1 device and has only one channel, then its first channel and last channel are one channel. In this case, only the only channel needs to be used to upload device information.
[0099] Step S203: When confirmation signals are obtained based on both the first channel and the last channel, stop sending device information based on the first channel and the last channel.
[0100] In this embodiment, after the CPU of the server receives the device information, it will feed back a confirmation signal (ACK signal) to the PCIe device through each channel. If the PCIe device obtains the confirmation signal based on both the first channel and the last channel, the PCIe device can determine that the CPU has successfully received the device information sent by each channel, and the PCIe device can stop sending the device information.
[0101] The PCIe device can also set the total duration of sending device information. For example, the PCIe device can set the duration of the bandwidth configuration mode, which is, for example, 10 seconds. When the PCIe device receives the bandwidth configuration instruction, it enters the bandwidth configuration mode with a duration of 10 seconds. In the bandwidth configuration mode, the device information is reported cyclically. If an ACK signal fed back by the CPU is received, or the bandwidth configuration mode is exited because the 10-second time has been reached, the PCIe device stops sending device information.
[0102] Optionally, each channel of the PCIe device is used to upload device information. Specifically, the method further includes the following steps A1 to A2.
[0103] Step A1, when the number of channels of the PCIe device is not less than 3, based on other channels except the first channel and the last channel, the same device information is cyclically sent to the central processing unit.
[0104] Step A2: when a confirmation signal is obtained based on other channels, stop sending device information based on other channels.
[0105] For example, if the PCIe device is a x4 device with channels 0 to 3, the PCIe device sends device information based on channel 0 (the first channel) and channel 3 (the last channel), as well as channel 1 and channel 2 in the middle, so that the CPU can receive device information uploaded by all channels. Similarly, if the middle channel 1 and channel 2 also receive confirmation signals fed back by the CPU, the PCIe device stops sending device information to the CPU.
[0106] In addition, if some channels of the PCIe device do not receive the confirmation signal, it can be determined that there is an abnormality in the links of some channels, and link detection at the channel granularity can be implemented.
[0107] Optionally, the method also includes: when one of the first channel and the last channel receives a confirmation signal and the other channel does not receive a confirmation signal, converting the device information into exception information; based on the first channel or the last channel that has received the confirmation signal, sending the exception information to the central processing unit.
[0108] In this embodiment, after sending device information based on the first channel and the last channel, if one channel A (for example, the first channel) receives the confirmation signal fed back by the CPU, but the other channel B (for example, the last channel) has not received the confirmation signal fed back by the CPU, it can be determined that the link corresponding to the other channel B is abnormal. Since the CPU may not receive the device information of the other channel B at this time, the CPU may not know that there is a link abnormality problem; and since the CPU does not receive the device information of the other channel B, it will also lead to a misjudgment of the number of channels of the PCIe device.
[0109] In the above case, the PCIe device converts the original device information into abnormal information. For example, the device information includes the manufacturer identification and the device identification. Since the device identification is generally provided, and when the device identification is all 1, it means that the device identification is invalid, the device identification in the device information can be set to all 1, for example, the device identification is changed to 0xFFFF, thereby generating abnormal information that the device identification is invalid. In addition, the PCIe device sends the abnormal information to the CPU based on channel A that has received the confirmation signal, so that after the CPU receives the abnormal information, it can determine that there is an abnormal link, and then try to determine the abnormal link, or generate an alarm message to remind the operation and maintenance personnel to check the link.
[0110] If both the first channel and the last channel receive confirmation signals, but other channels in the middle do not receive confirmation signals, since the CPU can determine that there is an abnormal link in the middle based on the first channel and the last channel, the PCIe device does not need to notify the CPU of the link abnormality by uploading abnormal information.
[0111] The bandwidth allocation method provided in this embodiment is that after the PCIe device receives the bandwidth configuration instruction sent by the BMC based on the system management bus, it uses the first channel and the last channel to cyclically send unique device information to the CPU of the server, so that the CPU can determine the number of channels of the PCIe device based on the device information, and can determine which pins in its own PCIe interface are inserted into the PCIe device, so that bandwidth allocation can be automatically performed. This method can be implemented based on the system management bus, does not need to occupy GPIO resources, and does not need to occupy additional I2C (Inter-Integrated Circuit, integrated circuit bus) and other communication interfaces, and the implementation method is simple; and there is no need to set a bandwidth allocation table, which can improve the efficiency of bandwidth allocation.
[0112] In addition, the address identifier of the bandwidth configuration instruction is all zero, so that each PCIe device can obtain the bandwidth configuration instruction and can process the bandwidth configuration instruction first. Each channel of the PCIe device is used to upload device information, which can further improve the accuracy of the CPU's recognition of PCIe devices, and can detect whether the PCIe device link is reliable, realizing channel-level link detection.
[0113] In this embodiment, a bandwidth allocation method is provided, which can be applied to a central processing unit (CPU) of a server, such as Figure 1 The CPU is shown. Figure 3 is a flow chart of a bandwidth allocation method according to an embodiment of the present invention. Figure 3 As shown, the bandwidth allocation method includes the following steps S301 to S304.
[0114] Step S301, in the initialization phase of initializing the PCIe device, monitoring the PCIe interface of the central processing unit.
[0115] In this embodiment, after the server system is powered on, for example, after the server power-on button signal is triggered, the server's BIOS (Basic Input Output System) program starts running. When the execution reaches the moment of PCIe device initialization, the CPU can monitor its own PCIe interface to enter a state of receiving device information uploaded by each channel. Among them, the CPU generally includes multiple PCIe interfaces, and the PCIe interface is specifically a PCIe root port.
[0116] Step S302, when the first device information is obtained based on the first channel of the PCIe interface and the second device information is obtained based on the second channel of the PCIe interface, determine whether the first device information is the same as the second device information; the first device information and the second device information are both device information of the PCIe device connected to the PCIe interface.
[0117] In this embodiment, a certain PCIe interface of the CPU includes multiple channels. For example, if the PCIe interface is a x16 interface, it includes 16 channels. For the first channel and the second channel, if both channels obtain device information sent by the PCIe device, the two device information can be compared. For ease of description, the device information obtained by the first channel is referred to as the first device information, and the device information obtained by the second channel is referred to as the second device information.
[0118] Specifically, by utilizing the uniqueness of the device information, the CPU determines whether the first device information is the same as the second device information. If the first device information is the same as the second device information, it means that the first channel and the second channel are connected to the same PCIe device. If the first device information is different from the second device information, it can be considered that the first channel and the second channel are connected to different PCIe devices.
[0119] If a channel of the PCIe interface does not receive device information, it can be considered that the device information is empty, or the device information is all 0.
[0120] Step S303: when the first device information is the same as the second device information, determine that the first channel and the second channel correspond to the same PCIe device, and feed back confirmation signals based on the first channel and the second channel respectively.
[0121] As described above, if the first device information is the same as the second device information, since the device information of different PCIe devices is different, that is, the device information is unique, it can be determined that the first channel and the second channel of the PCIe interface are connected to the same PCIe device. In addition, the CPU also feeds back a confirmation signal (ACK signal) based on the first channel and the second channel respectively to notify the PCIe device that the device information has been successfully received, and can instruct the PCIe device to stop uploading the device information.
[0122] It can be understood that if the first device information is the same as the second device information, the first device information may be device information uploaded by the PCIe device based on its first channel, and the second device information may be device information uploaded by the PCIe device based on its last channel.
[0123] If the PCIe device is a x1 device, the CPU has only one channel to obtain device information. Specifically, the method may also include: when the third device information is obtained based on the third channel of the PCIe interface, and the third device information is different from other obtained device information, determining that the third channel corresponds to a PCIe device with a channel number of 1, and feeding back a confirmation signal based on the third channel.
[0124] In this embodiment, if only one channel of the PCIe interface obtains the device information, that is, the third channel obtains the third device information, but the device information obtained by the other channels is different from the third device information, the CPU can determine that the PCIe device connected to the third channel is a x1 device, and its channel number is 1. Similarly, the CPU will also feedback a confirmation signal based on the third channel to inform the PCIe device to stop sending device information.
[0125] In some optional implementations, the above step S303 "determining that the first channel and the second channel correspond to the same PCIe device when the first device information is the same as the second device information" includes the following steps B1 to B2.
[0126] Step B1, when the first device information is the same as the second device information, if the first channel is adjacent to the second channel, it is determined that the first channel and the second channel correspond to the same PCIe device.
[0127] Step B2: if the first channel and the second channel are not adjacent, determine that the first channel, the second channel, and other channels between the first channel and the second channel correspond to the same PCIe device.
[0128] In this embodiment, for a PCIe interface of the CPU, if the first device information received by the first channel is the same as the second device information received by the second channel, it can be determined that the first channel and the second channel are connected to the same PCIe device.
[0129] If the first channel is adjacent to the second channel, it can be directly determined that the first channel and the second channel correspond to the same PCIe device. For example, if the first channel is channel 0 of the PCIe interface, the second channel is channel 1 of the PCIe interface, and channel 2 of the PCIe interface does not receive device information (or the device information received by channel 2 is different from the first device information), it can be determined that the PCIe device has only two channels, that is, its channel number is 2.
[0130] If the first channel and the second channel are not adjacent, since the gold finger of the PCIe device is a whole, the first channel, the second channel, and other channels between the first channel and the second channel correspond to the same PCIe device. At this time, the number of channels of the PCIe device can be determined based on all the channels corresponding to the PCIe device.
[0131] For example, if the first channel is channel 0 of the PCIe interface and the second channel is channel 3 of the PCIe interface, then channel 1 and channel 2 between the two channels also correspond to the same PCIe device, that is, the PCIe device corresponds to channels 0 to 3, so the number of channels of the PCIe device is 4.
[0132] In this embodiment, the CPU receives the same device information via the first channel and the second channel, and can simply and quickly determine the channel number of the PCIe device. Even if there are other channels between the first channel and the second channel, the recognition result is not affected, and the reliability of the recognition can be guaranteed.
[0133] Optionally, the above step B2 “if the first channel and the second channel are not adjacent, determining that the first channel, the second channel, and other channels between the first channel and the second channel correspond to the same PCIe device” may include the following step B21.
[0134] Step B21: if the first channel and the second channel are not adjacent, and the device information obtained by other channels between the first channel and the second channel is the same as the first device information and / or the second device information, it is determined that the first channel, the second channel, and other channels between the first channel and the second channel correspond to the same PCIe device.
[0135] In this embodiment, each channel of the PCIe device is configured to send device information to the central processor. At this time, if the first channel and the second channel are not adjacent, it is also necessary to determine whether the device information obtained by other channels between the first channel and the second channel is the same as the first device information and / or the second device information, so as to further improve the reliability of identification. Under normal circumstances, if two non-adjacent channels upload the same device identifier, other channels between the two channels will also upload the same device identifier.
[0136] Optionally, each channel of the PCIe device is configured to send device information to the central processing unit, and the method further includes the following step C1.
[0137] Step C1, when the first device information is the same as the second device information, if the first channel is not adjacent to the second channel, and there is a fourth channel between the first channel and the second channel that has not received device information, it is determined that the fourth channel link is abnormal.
[0138] In this embodiment, if the first channel and the second channel receiving the same device information are not adjacent, that is, there are other channels between the two; and if each channel of the PCIe device is configured to send device information to the central processor, then the other channels between the two should also be able to receive the same device information. For ease of description, the channel between the first channel and the second channel is called the fourth channel; it can be understood that the number of the fourth channel can be one or more; since there is no x3 device, the fourth channel is generally multiple.
[0139] If the fourth channel between the first channel and the second channel does not receive any device information, the CPU may determine that the link between the fourth channel and the PCIe device is abnormal, thereby achieving channel-granular link detection.
[0140] In addition, optionally, if the first channel and the second channel correspond to the first channel and the last channel of the PCIe device, even if the fourth channel in the middle does not receive the device information uploaded by the PCIe device, the CPU can accurately determine the number of channels of the PCIe device. However, if the first channel or the second channel does not correspond to the first channel or the last channel of the PCIe device, or the CPU only receives the device information on the third channel, but the PCIe device is actually a multi-channel device, the result of the CPU determining the number of channels of the PCIe device will be inaccurate.
[0141] In this embodiment, if the CPU does not correctly receive the device information sent by the first channel and the last channel of the PCIe device, since the CPU will not feedback the corresponding ACK signal, the PCIe device can determine whether the link is abnormal by whether the first channel and the last channel receive the ACK signal, and then feedback the corresponding information to the CPU. As described above, when one of the first channel and the last channel of the PCIe device receives the confirmation signal and the other channel does not receive the confirmation signal, the PCIe device converts its own device information into abnormal information; based on the first channel or the last channel that has received the confirmation signal, the abnormal information is sent to the central processing unit.
[0142] In addition, the CPU also performs the following steps: after obtaining the fifth device information based on the fifth channel of the PCIe interface and feeding back a confirmation signal based on the fifth channel, if abnormal information different from the fifth device information is obtained based on the fifth channel, it is determined that there is an unidentified channel connected to the PCIe device.
[0143] In this embodiment, the fifth channel can be the third channel mentioned above, or the first channel or the second channel mentioned above; if the CPU obtains the corresponding device information (i.e., the fifth device information) based on the fifth channel, and then obtains abnormal information different from the fifth device information, it can be determined that the first channel or the last channel of the PCIe device did not receive the ACK signal, that is, the link of at least one channel is abnormal, that is, there is a channel between the CPU and the PCIe device that is not recognized by the CPU, and the number of channels determined at this time is inaccurate.
[0144] The CPU may attempt to correct the number of channels of the determined PCIe device; for example, if the number of channels of the currently determined PCIe device is 14 and an abnormality message is received, since there is no x15 device, the PCIe device is a x16 device, and the number of channels of the PCIe device may be corrected to 16. If the number of channels cannot be corrected, an alarm message is generated to remind the operation and maintenance personnel to perform maintenance; and if the number of channels cannot be corrected, when allocating bandwidth, the number of channels determined at this time is used as the minimum number of channels of the PCIe device, and bandwidth allocation is performed based on this.
[0145] Step S304: Allocate bandwidth according to the correspondence between the PCIe interface and the PCIe device.
[0146] In this embodiment, after the correspondence between each channel of the PCIe interface and the PCIe device is determined, PCIe bandwidth allocation can be performed based on this, and the specific allocation process is not limited here.
[0147] Optionally, if the PCIe interface does not receive device information during the initialization phase of initializing the PCIe device, bandwidth allocation is performed based on a default bandwidth allocation policy.
[0148] Figure 4 A detailed flow chart for implementing bandwidth allocation is shown, such as Figure 4 As shown, the process of bandwidth allocation includes the following steps S401 to S405.
[0149] Step S401: After the BMC of the server is powered on, it is determined whether bandwidth needs to be allocated.
[0150] For example, the BMC determines whether the server has experienced an AC power outage and whether the chassis cover has been opened; if the server has experienced an AC power outage and the chassis cover has been opened, it is determined that bandwidth needs to be allocated.
[0151] Step S402: When bandwidth allocation is required, the BMC sends a bandwidth configuration instruction to the PCIe device using the system management bus.
[0152] If bandwidth allocation is not required, the BMC can be started normally. The BMC needs to send bandwidth configuration instructions after the PCIe device is powered on.
[0153] Step S403, after receiving the bandwidth configuration instruction based on the system management bus, the PCIe device cyclically sends its own device information to the CPU of the server based on each channel.
[0154] Step S404: After receiving the device information based on the channel of the PCIe interface, the CPU feeds back a corresponding ACK signal based on the channel.
[0155] Step S405: The CPU determines the correspondence between the PCIe interface and the PCIe device according to the received device information, and performs bandwidth allocation.
[0156] The bandwidth allocation method provided in this embodiment is that when the CPU needs to initialize the PCIe device, it obtains the device information uploaded by the corresponding PCIe device based on the channel of the PCIe interface. Based on the same device information, the number of channels of the PCIe device can be simply determined, and which pins in its own PCIe interface are inserted into the PCIe device, so that bandwidth allocation can be automatically performed. This method is based on the link between the PCIe device and the PCIe interface, does not require the use of external resources, and is simple to implement; and does not require the setting of a bandwidth allocation table, which can improve the efficiency of bandwidth allocation. Based on the device information uploaded by each channel, the CPU can identify the specific slot where the PCIe device is connected, with high recognition accuracy and a stable and reliable detection mechanism.
[0157] This embodiment also provides a server, such as Figure 1 As shown, the server includes: a baseboard management controller and a central processing unit; the baseboard management controller is used to send bandwidth configuration instructions to the PCIe device based on the system management bus; the central processing unit is used to execute the bandwidth allocation method provided by the above embodiment.
[0158] Optionally, the baseboard management controller is specifically used to: determine whether the server has experienced an AC power outage and whether the chassis cover has been opened; if the server has experienced an AC power outage and the chassis cover has been opened, broadcast a bandwidth configuration instruction to the system management bus; the address identifier of the bandwidth configuration instruction is all zero.
[0159] The functional description of the server is the same as that of the corresponding embodiment above and will not be repeated here.
[0160] In this embodiment, a bandwidth allocation device is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0161] This embodiment provides a bandwidth allocation device, which is applied to a central processing unit of a server, such as Figure 5 As shown, including:
[0162] A monitoring module 501 is used to monitor the PCIe interface of the central processor during the initialization phase of initializing the PCIe device;
[0163] A judgment module 502 is used to judge whether the first device information is the same as the second device information when the first device information is obtained based on the first channel of the PCIe interface and the second device information is obtained based on the second channel of the PCIe interface; the first device information and the second device information are both device information of a PCIe device connected to the PCIe interface;
[0164] The processing module 503 is used to determine that the first channel and the second channel correspond to the same PCIe device when the first device information is the same as the second device information, and to feed back confirmation signals based on the first channel and the second channel respectively;
[0165] The bandwidth allocation module 504 is used to allocate bandwidth according to the corresponding relationship between the PCIe interface and the PCIe device.
[0166] In some optional implementations, when the first device information is the same as the second device information, the processing module 503 determines that the first channel and the second channel correspond to the same PCIe device, including:
[0167] In a case where the first device information is the same as the second device information, if the first channel is adjacent to the second channel, determining that the first channel and the second channel correspond to the same PCIe device;
[0168] If the first channel is not adjacent to the second channel, it is determined that the first channel, the second channel, and other channels between the first channel and the second channel correspond to the same PCIe device.
[0169] In some optional implementations, if the first channel is not adjacent to the second channel, the processing module 503 determines that the first channel, the second channel, and other channels between the first channel and the second channel correspond to the same PCIe device, including:
[0170] If the first channel is not adjacent to the second channel, and the device information obtained by other channels between the first channel and the second channel is the same as the first device information and / or the second device information, it is determined that the first channel, the second channel, and other channels between the first channel and the second channel correspond to the same PCIe device.
[0171] In some optional implementations, each channel of the PCIe device is configured to send device information to the central processor, and the processing module 503 is further used to:
[0172] In the case where the first device information is the same as the second device information, if the first channel is not adjacent to the second channel and there is a fourth channel between the first channel and the second channel on which no device information is received, it is determined that the fourth channel link is abnormal.
[0173] In some optional implementations, the processing module 503 is further configured to:
[0174] When third device information is obtained based on the third channel of the PCIe interface and the third device information is different from other obtained device information, it is determined that the third channel corresponds to a PCIe device with a channel number of 1, and a confirmation signal is fed back based on the third channel.
[0175] In some optional implementations, the bandwidth allocation module 504 is further configured to:
[0176] If the PCIe interface does not receive device information during the initialization phase of initializing the PCIe device, bandwidth allocation is performed based on a default bandwidth allocation strategy.
[0177] This embodiment provides a bandwidth allocation device, which is applied to a PCIe device, such as Figure 6 As shown, including:
[0178] An acquisition module 601 is used to acquire a bandwidth configuration instruction issued by a baseboard management controller based on a system management bus;
[0179] The information sending module 602 is used to send the device information of the PCIe device to the central processor of the server based on the first channel cycle, and send the same device information to the central processor based on the last channel cycle; the first channel is the first channel of the PCIe device, and the last channel is the last channel of the PCIe device;
[0180] The response module 603 is configured to stop sending the device information based on the first channel and the last channel when a confirmation signal is obtained based on both the first channel and the last channel.
[0181] In some optional implementations, the information sending module 602 is further used to: when the number of channels of the PCIe device is not less than 3, based on other channels except the first channel and the last channel, cyclically send the same device information to the central processor;
[0182] The response module 603 is further configured to: when a confirmation signal is obtained based on the other channel, stop sending the device information based on the other channel.
[0183] In some optional implementations, the acquisition module 601 acquires the bandwidth configuration instruction issued by the baseboard management controller based on the system management bus, including:
[0184] Monitoring data frames in the system management bus;
[0185] When a data frame whose address identifier is all zero is monitored, it is determined that a bandwidth configuration instruction is obtained.
[0186] In some optional implementations, the device further includes an information generating module, configured to:
[0187] Reading the manufacturer identification of the PCIe device from the manufacturer identification register, and reading the device identification of the PCIe device from the device identification register;
[0188] Device information including the manufacturer identifier and the device identifier is generated.
[0189] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0190] The bandwidth allocation device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, including a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0191] The embodiment of the present invention also provides a computer device having the above Figure 5 or Figure 6 The bandwidth allocation device shown.
[0192] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.
[0193] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0194] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0195] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0196] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0197] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0198] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0199] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0200] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A bandwidth allocation method, It is characterized in that Applied to a central processing unit of a server, the method comprises: In the initialization phase of initializing the PCIe device, the PCIe interface of the central processor is monitored; the PCIe device is configured to send the same device information to the central processor based on the first channel and the last channel in a cycle; In a case where first device information is acquired based on a first channel of the PCIe interface and second device information is acquired based on a second channel of the PCIe interface, determining whether the first device information is the same as the second device information; both the first device information and the second device information are device information of a PCIe device connected to the PCIe interface; In the case where the first device information is the same as the second device information, determining that the first channel and the second channel correspond to the same PCIe device, and determining that the first channel and the second channel correspond to the first channel and the last channel of the PCIe device respectively, and feeding back confirmation signals based on the first channel and the second channel respectively; According to the correspondence between each channel of the PCIe interface and the PCIe device, bandwidth allocation is performed according to the number of channels of the PCIe device.
2. The method according to claim 1, It is characterized in that The step of determining, when the first device information is the same as the second device information, that the first channel and the second channel correspond to the same PCIe device includes: In a case where the first device information is the same as the second device information, if the first channel is adjacent to the second channel, determining that the first channel and the second channel correspond to the same PCIe device; If the first channel is not adjacent to the second channel, it is determined that the first channel, the second channel, and other channels between the first channel and the second channel correspond to the same PCIe device.
3. The method according to claim 2, It is characterized in that If the first channel is not adjacent to the second channel, determining that the first channel, the second channel, and other channels between the first channel and the second channel correspond to the same PCIe device includes: If the first channel is not adjacent to the second channel, and the device information obtained by other channels between the first channel and the second channel is the same as the first device information and / or the second device information, it is determined that the first channel, the second channel, and other channels between the first channel and the second channel correspond to the same PCIe device.
4. The method according to claim 2, It is characterized in that Each channel of the PCIe device is configured to send device information to the central processor, and the method further includes: In the case where the first device information is the same as the second device information, if the first channel is not adjacent to the second channel and there is a fourth channel between the first channel and the second channel on which no device information is received, it is determined that the fourth channel link is abnormal.
5. The method according to claim 1, It is characterized in that Also includes: When third device information is obtained based on the third channel of the PCIe interface and the third device information is different from other obtained device information, it is determined that the third channel corresponds to a PCIe device with a channel number of 1, and a confirmation signal is fed back based on the third channel.
6. The method according to claim 1, It is characterized in that Also includes: If the PCIe interface does not receive device information during the initialization phase of initializing the PCIe device, bandwidth allocation is performed based on a default bandwidth allocation strategy.
7. A bandwidth allocation method, It is characterized in that Applied to a PCIe device, the method comprises: Obtaining bandwidth configuration instructions issued by a baseboard management controller based on a system management bus; Sending device information of the PCIe device to the central processor of the server based on a first channel cycle, and sending the same device information to the central processor based on a last channel cycle; the first channel is the first channel of the PCIe device, and the last channel is the last channel of the PCIe device; the device information sent by the first channel and the last channel is used to instruct the central processor to determine that the first channel and the second channel receiving the same device information in the PCIe interface correspond to the first channel and the last channel of the PCIe device, respectively, and based on the first channel and the second channel respectively feeding back confirmation signals, bandwidth is allocated according to the correspondence between each channel of the PCIe interface and the PCIe device, according to the number of channels of the PCIe device; When confirmation signals are obtained based on both the first channel and the last channel, sending the device information based on the first channel and the last channel is stopped.
8. The method according to claim 7, It is characterized in that Also includes: When the number of channels of the PCIe device is not less than 3, cyclically sending the same device information to the central processing unit based on other channels except the first channel and the last channel; When a confirmation signal is obtained based on the other channel, sending the device information based on the other channel is stopped.
9. The method according to claim 7, It is characterized in that The step of obtaining the bandwidth configuration instruction issued by the baseboard management controller based on the system management bus includes: Monitoring data frames in the system management bus; When a data frame whose address identifier is all zero is monitored, it is determined that a bandwidth configuration instruction is obtained.
10. The method according to claim 7, It is characterized in that Also includes: Reading the manufacturer identification of the PCIe device from the manufacturer identification register, and reading the device identification of the PCIe device from the device identification register; Device information including the manufacturer identifier and the device identifier is generated.
11. A server, It is characterized in that include: Baseboard management controller and central processing unit; The baseboard management controller is used to send bandwidth configuration instructions to the PCIe device based on the system management bus; The central processing unit is used to execute the bandwidth allocation method according to any one of claims 1 to 6.
12. The server according to claim 11, It is characterized in that The baseboard management controller is specifically used for: Determine whether the server has experienced an AC power outage and whether the chassis cover has been opened; If the server has experienced an AC power outage and the chassis cover has been opened, a bandwidth configuration instruction is broadcast to the system management bus; the address identifier of the bandwidth configuration instruction is all zero.
13. A computer device, It is characterized in that include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the bandwidth allocation method according to any one of claims 1 to 10 by executing the computer instructions.
14. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the bandwidth allocation method according to any one of claims 1 to 10.
15. A computer program product, It is characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the bandwidth allocation method according to any one of claims 1 to 10.
