A network card hot-swap configuration method, device, system and storage medium
By obtaining the network card configuration supported by the CPU and automatically adapting the network card access information, the problem of small configuration available space and poor BIOS adaptability caused by the fixed slot of the OCP network card is solved, and the flexible configuration and power-on and power-off control of the network card are realized. , which improves the flexibility and security of the system.
Patent Information
- Application Number
- CN202411356829.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-09-27
AI Technical Summary
In the existing server design, the fixed slot of the OCP network card leads to a small available space for configuration, which cannot meet the needs of customers in multiple application scenarios, and the BIOS adaptability is poor, so it is impossible to effectively control the power up and down of the network card.
By obtaining the configuration of the network card supported by the CPU, it automatically scans and adapts the network card access information, generates a structure that identifies the configuration of the network card currently inserted into the CPU, realizes flexible configuration of the network card, and controls the up and down of the network card according to the user's hot-swapping operation. electricity.
It improves the flexibility and scalability of the system, meets the configuration requirements in different application scenarios, and avoids the risk of damage to the network card and motherboard caused by abnormal power-on.
Smart Images

Figure CN118964263B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of servers, and in particular to a network card hot-plug configuration method, device, system and storage medium. Background Art
[0002] As server design matures, the compatibility of server components is becoming more and more important. The BIOS (Basic Input Output System) will capture PCIe (Peripheral Component Interconnect Express) device information through IO access mode, and then pass the corresponding information to the BMC and write it into the OS.
[0003] OCP network card (Open Compute Project Network Card) is a server network interface card launched by Open Compute Project. It is designed to meet the needs of data centers for high performance, high reliability and low power consumption, and the OCP network card supports "hot plugging".
[0004] In response to the hot-swap phenomenon, in the first generation of server CPU versions, only one OCP network card configuration was designed for the hardware. For example, only one X8 slot was reserved on the CPU side of the motherboard to connect the OCP network card. At this time, the configuration for BIOS and CPLD (Complex Programmable Logic Device) only needed to be hard-coded to adapt to this configuration. It only adapted to one configuration of OCP network cards, not other OCP network cards. As a result, the use space of hot-swap configuration OCP network cards in different application scenarios was greatly reduced, and the BIOS adaptability was poor and could not meet customer needs. Summary of the invention
[0005] In view of this, the present invention provides a network card hot-swap configuration method, device, system and storage medium to solve the problem of flexible BIOS adaptation in multiple application scenarios of server design platform OCP network cards.
[0006] In a first aspect, the present invention provides a network card hot-swap configuration method, which is applied to BIOS, wherein the BIOS is connected to a CPU via a simulator pin of a CPLD, and the method comprises:
[0007] Obtain a first structure of a network card configuration supported by the CPU, where the first structure is used to indicate a network card configuration supported by the CPU;
[0008] In the initialization phase, scanning and acquiring access information of at least one network card connected to the simulator pin of the CPLD, the access information including: the location of the CPU where the inserted network card is located and the cable expansion bandwidth;
[0009] Adapting the position of the CPU where the inserted network card is located and the cable extension bandwidth to the first structure to generate a second structure, where the second structure is used to identify the configuration and slot identification of the network card currently inserted into the CPU;
[0010] respectively configuring hot-swap properties for at least one network card managed by the CPU and the CPLD;
[0011] According to the identification function of the second structure and the configured hot-plug attribute, during the driver execution phase, based on the user's hot-plug operation on any one of the at least one network card, powering on and off the network card is controlled.
[0012] In combination with the first aspect, in a possible implementation manner, obtaining a first structure of a network card configuration supported by a CPU includes:
[0013] Obtaining system software and hardware interface documents, wherein the system software and hardware interface documents include interface configuration information supported by the motherboard;
[0014] Determine, according to the system hardware and software interface document, the relevant information of the slots of each interface of the CPU on the mainboard, wherein the relevant information of the slots includes: the number of channels and bandwidth capacity of the slots;
[0015] The first structure is generated according to the number of channels of the slot and the bandwidth capability, and is used to store one or more of the bandwidth, rate, start channel, end channel, slot location ID and CPU location of the current slot.
[0016] In combination with the first aspect, in another possible implementation, in the initialization stage, scanning and acquiring access information of at least one network card connected to the simulator pin of the CPLD includes:
[0017] In the initialization stage, the I2C link is used to scan the access information of at least one network card connected to the simulator pin in the CPLD;
[0018] Among them, the access information of at least one network card is simulated into a simulator pin after the CPLD identifies the location information of the currently connected network card, and is transmitted to the BIOS; the access information includes at least: a first field and a second field, the first field is used to indicate the location of the CPU where the inserted network card is located, and the second field is used to indicate whether the inserted network card has expanded bandwidth through a cable.
[0019] In combination with the first aspect, in another possible implementation, adapting the position of the CPU where the inserted network card is located and the cable extension bandwidth to the first structure to generate the second structure includes:
[0020] Dynamically determine the insertion status of at least one network card according to the first field and the second field, and determine whether the first field and the second field are both valid fields;
[0021] If they are all valid fields, the second structure is generated according to one or more of the first structure, the starting channel, the ending channel, the position ID of the slot and the position of the CPU in the first structure.
[0022] In combination with the first aspect, in yet another possible implementation, the configuring hot-swap properties for at least one network card managed by the CPU and the CPLD respectively includes:
[0023] The CPU is configured with a hot-plug type of the entire PCIe link and a first instruction is issued, wherein the hot-plug type includes two types: violent hot-plug and switch hot-plug; the first instruction is used to instruct the CPU to configure the current hot-plug type to the PCIe link one by one according to the position ID of the slot of the network card;
[0024] The hot-plug type and the I2C identifier corresponding to each network card, the location ID of the slot and the device address of the network card are configured for at least one network card managed by the CPLD.
[0025] In combination with the first aspect, in another possible implementation manner, after configuring the hot-swap attribute, the method further includes:
[0026] Matching according to the position of at least one network card inserted into the CPU and the hot-plug attribute configured for at least one network card managed by the CPLD;
[0027] Determine the connection mode of the target network card inserted into the slot according to the matching result;
[0028] The connection methods include: a connection method of a network card on the CPU side and a connection method of connecting two or more CPUs through a cable.
[0029] In combination with the first aspect, in another possible implementation, matching according to the position of at least one network card inserted into the CPU and the hot-swap attribute configured for at least one network card managed by the CPLD includes:
[0030] If at least one of the inserted network cards is the first network card and the second network card, and the first Slot ID corresponding to the first network card and the second Slot ID corresponding to the second network card are both the same as the two Slot IDs in the configured hot-swap properties, it is determined that the currently inserted first network card and the second network card are respectively connected to the two CPUs via cables.
[0031] In combination with the first aspect, in another possible implementation, during the driver execution phase, based on a hot plug operation of a user on any one of the at least one network card, controlling the power on and off of the network card includes:
[0032] When a target network card is detected to be inserted into the slot, the hot-plug property of the target network card is adapted according to the preset slot position ID in the DXE stage;
[0033] After the BIOS and the CPLD are adapted according to the agreed channels, the light on the target network card is automatically lit, and the OS system is entered, and the information of the inserted target network card is displayed under the OS system.
[0034] In combination with the first aspect, in another possible implementation, after entering the OS system, controlling powering on and powering off the network card includes:
[0035] Determine the switch Button hot-swap type selected by the user on the target network card;
[0036] In response to the hot-swap operation of the switch Button by the user, the indicator light flashes and then goes out, indicating that the target network card is to be unplugged, and controlling the target network card to complete power-off;
[0037] When the target network card is reinserted into the slot, in response to the user's hot-swap operation of the switch button, the indicator light flashes again and stays on, and then the target network card is controlled to power on.
[0038] In combination with the first aspect, in another possible implementation manner, configuring a hot-swap attribute for at least one network card managed by the CPLD includes:
[0039] The configuration information is transmitted to the CPLD through the I2C switch chip, and the hot-swap attribute is configured for at least one network card managed by the CPLD, wherein the configuration information includes the address information of the I2C switch chip.
[0040] In a second aspect, the present invention further provides a network card hot-swap configuration device, the device comprising:
[0041] An acquisition module, used for acquiring a first structure of a network card configuration supported by the CPU, wherein the first structure is used for indicating a network card configuration supported by the CPU;
[0042] The processing module is used to scan and obtain access information of at least one network card connected to the simulator pin of the CPLD during the initialization phase, wherein the access information includes: the location of the CPU where the inserted network card is located and the cable expansion bandwidth;
[0043] An adaption module, used for adapting the position of the CPU where the inserted network card is located and the cable extension bandwidth to the first structure to generate a second structure, wherein the second structure is used for identifying the configuration and slot identification of the network card currently inserted into the CPU;
[0044] A configuration module, used to configure hot-swap properties for at least one network card managed by the CPU and the CPLD respectively;
[0045] The execution module is used to control the power on and off of the network card based on the hot plug operation of any one of the at least one network card by the user during the driver execution phase according to the identification function of the second structure and the configured hot plug attribute.
[0046] In a third aspect, the present invention also provides a network card hot-swap configuration system, the system comprising: a mainboard and at least one network card, wherein the mainboard comprises: at least one CPU, a BIOS module, a CPLD and an I2C switching chip and at least one slot.
[0047] The at least one CPU is connected to the CPLD via the I2C switching chip; the CPLD includes an emulator pin, which is used to connect the BIOS module; the BIOS module is also connected to the I2C switching chip; the at least one slot is used to insert the at least one network card; the BIOS module is used to execute the network card hot-swap configuration method as described in the first aspect or any one of the embodiments of the first aspect when the at least one network card is inserted into the at least one slot.
[0048] Optionally, the at least one network card is an Open Compute Project (OCP) network card.
[0049] In a fourth 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 network card hot-plug configuration method of the first aspect or any corresponding embodiment thereof.
[0050] In addition, the present invention provides a computer program product, including computer instructions, which are used to enable a computer to execute the network card hot-plug configuration method in the above-mentioned first aspect or any corresponding embodiment thereof.
[0051] The network card hot-swap configuration method, device, system and storage medium provided in this embodiment can clearly know which network card configurations are feasible by obtaining the network card configuration status (first structure) supported by the CPU, which provides clear guidance for the subsequent selection and deployment of network cards. In the initialization phase, the network card access information is automatically scanned and adapted, including the network card position and the cable extension bandwidth, and the position of the CPU where the network card is located and the cable extension bandwidth are adapted to the first structure to generate a second structure, so as to achieve flexible configuration when different network cards are inserted, and solve the problem that the available space for configuration is small when the OCP network card is fixed in the slot, and the general needs of customers cannot be met. This method improves the flexibility and scalability of the system and can meet the configuration requirements in different application scenarios.
[0052] In addition, based on the recognition function of the second structure and the configuration of the hot-swap properties, the user can get immediate response and feedback when performing the network card hot-swap operation, and control the normal power on and off of the network card, which solves the problem that the violent hot-swap solution cannot effectively control the power on and off of the OCP network card. This method avoids the risk of damage to the network card and the motherboard due to abnormal power-on.
[0053] In addition, the method provided in this embodiment also implements the dynamic hot-swap function of the OCP Multi host configuration on the existing AMD platform, providing technical support for the development of corresponding functions in subsequent projects. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0055] Figure 1 is a structural schematic diagram of a server mainboard according to an embodiment of the present invention;
[0056] Figure 2 It is a flowchart of a method for configuring hot-swap network cards according to an embodiment of the present invention;
[0057] Figure 3 is a flow chart of another method for configuring hot-swap network cards according to an embodiment of the present invention;
[0058] Figure 4is a flow chart of another method for configuring hot-swappable network cards according to an embodiment of the present invention;
[0059] Figure 5 is a flow chart of another method for configuring hot-swappable network cards according to an embodiment of the present invention;
[0060] Figure 6 is a structural block diagram of a network card hot-swap configuration device according to an embodiment of the present invention;
[0061] Figure 7 It is a structural schematic diagram of a network card hot-swap configuration system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0062] 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.
[0063] The technical solution provided by the embodiment of the present invention can be applied to the field of server design technology, especially to the technical problems generated during the hot plugging of network cards. Firstly, the application scenarios and technical terms involved in the technical solution of the present invention are introduced.
[0064] The technical solution of the present invention can be applied to a server product, specifically, can be applied to all AMD X86 architecture server products, which are understood as: processor products produced by AMD (Advanced Micro Devices) and using X86 architecture.
[0065] Among them, AMD's SP architecture includes but is not limited to the SP5 architecture and the SP3 architecture. The new generation of server CPUs under the SP5 architecture is named Genoa (meaning the Italian city of Genoa), and the first generation of server CPUs under the SP3 architecture is named Milan (meaning the Italian city of Milan).
[0066] OCP, Open Compute Project, is a type of expansion card in computer hardware. OCP network cards are usually customized for data centers or large-scale computing environments. They emphasize modularity, replaceability, and high compatibility. OCP network cards usually do not follow traditional PCI standards, but use custom interfaces to optimize performance, power consumption, and heat dissipation design. OCP network cards are designed to meet the high performance, high reliability, and low power consumption requirements of data centers. OCP network cards have the characteristics of open standards, scalability, and high performance, making them an ideal choice for server network solutions.
[0067] The high performance advantages of OCP network cards are mainly reflected in the following aspects:
[0068] High bandwidth: can meet the data center's demand for data transmission and improve overall performance;
[0069] Low latency: It can provide faster data transmission speed, reduce delay and improve user experience;
[0070] High density: can meet the needs of large data centers and high-performance computing environments;
[0071] Energy saving and environmental protection: It helps to reduce operating costs and also helps to reduce the impact on the environment:
[0072] Support hot-swap: OCP network card supports hot-swap function, which is convenient for after-sales maintenance.
[0073] Users can easily replace or upgrade the network card without shutting down the server, which improves the reliability and maintainability of the system.
[0074] As for the support of hot-swap, most of the current server manufacturers require that this attribute be supported on NVME (Non-Volatile Memory Express) and SATA (Serial Advanced Technology Attachment). NVME and SATA are commonly used storage devices, generally used to install customer systems or store important data, and are essential equipment for the entire server. As for network cards, hot-swap is generally not supported. Currently, only OCP network cards support hot-swap, which makes OCP network cards stand out from many network cards and facilitates replacement and maintenance. Therefore, the configuration of hot-swap attributes of OCP network cards is crucial.
[0075] Hot Swap, or hot swap, means inserting or removing modules or boards into or out of a system without shutting down the system power supply, thereby improving the system's reliability, rapid maintainability, redundancy, and timely disaster recovery capabilities. For high-power modular power systems, hot swap technology can replace a faulty power module while maintaining the voltage of the entire power system, and ensure the normal operation of other power modules in the modular power system.
[0076] In the current server design, the compatibility of server components is receiving more and more attention. For conventional components, as long as the BIOS pairs the bandwidth, there will be no problem in identification. The BIOS system will capture the information of the PCIe device through the IO access mode, and then pass the corresponding information to the BMC and write it into the OS.
[0077] Currently, the OCP hot-swap solution on the Milan platform has the following disadvantages:
[0078] 1. During the surprise hot-plug process, there is a problem that the power on and off of the network card cannot be effectively controlled. If the network card is not ready or the hot-plug properties are not fully adapted, sudden hot-plugging may cause the machine to crash. In more serious cases, it may cause a short circuit in the network card circuit or damage to the motherboard. Since a network card and motherboard are expensive, violent hot-plugging causes great economic losses.
[0079] 2. On the Milan platform, the hardware only designs one OCP network card configuration. For example, only one X8 slot is reserved on the CPU0 side of the motherboard to connect the OCP network card. At this time, the BIOS and CPLD only need to be hard-coded to adapt to the current configuration. If there are other configurations, the OCP network card cannot be used. Because in the process of use by most customers, they will require OCP to be connected to different positions and support expansion through cables. However, the OCP network card on the Milan platform currently only supports connection to one position, and the bandwidth is fixed, which cannot meet the multi-scenario needs of customers and the product lacks competitiveness.
[0080] 3. Compared with the Milan platform, the Genoa platform has more configuration application scenarios and the number of OCP slots is more than one. The use of OCP is more flexible and changeable. The hard-coded configuration adaptation solution is no longer feasible. Therefore, for the configuration that still only designs one OCP network card, it is impossible to display the current accurate configuration. For example, when a x8 server port is plugged into a x16 or x4 PCIe device, its bandwidth will be displayed as x8. At this time, the customer sees that this is a performance of reduced bandwidth. It is necessary to modify the BIOS to increase the use of this configuration to display no abnormality, otherwise it will cause misunderstandings. Therefore, it is impossible to dynamically identify the OCP plug-in method in the application and configure resources for the current OCP network card plug-in method.
[0081] In addition, on the Milan platform, the OCP network card adaptation only supports Single host (single connection mode) and does not configure Multi host (multiple connection mode). On the Genoa platform, both OCP Multi host and OCP Single host configurations must be supported, and both configurations must support hot plugging, so the original solution is not applicable.
[0082] In summary, the technical solution provided by the embodiment of the method can solve the above-mentioned problems: the problem that violent hot plugging cannot accurately control the power on and off of the network card, the problem of flexible BIOS adaptation in multiple application scenarios of the Genoa platform OCP network card, and the problem of Mutli host and Single host identification and hot plug adaptation of the Genoa platform OCP network card.
[0083] In order to solve the above technical problems, the embodiments of the present invention provide a method, device and system for configuring hot-swap network cards. Figure 1 FIG. 1 is a schematic diagram of the structure of a server mainboard according to an embodiment of the present invention.
[0084] The motherboard includes: at least one central processing unit CPU, such as CPU 0, CPU 1, I2C switch chip, basic input and output system BIOS, complex programmable logic device CPLD and at least one network card interface. Figure 1 The mainboard or mainboard circuit in this embodiment may further include other more or fewer modules, units, and circuits, which are not limited in this embodiment.
[0085] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0086] In this embodiment, a network card hot-swap configuration method is provided, which can be used for the above-mentioned BIOS execution, such as Figure 1 As shown, the BIOS is connected to the CPU through the simulator pins of the CPLD. The BIOS can be composed of software, hardware, or a combination of software and hardware modules / units. Figure 2 is a flow chart of a method for configuring a network card hot-swap according to an embodiment of the present invention. Figure 2 As shown, the method includes:
[0087] Step S101, obtaining a first structure of a network card configuration supported by a CPU.
[0088] The first structure is used to indicate the network card configuration that the CPU can support. For example, there are several CPUs on the motherboard, the port number of each CPU, and the relevant information of the network card that can be connected. That is, it is understood as how many port connection methods (OCP network card) the current CPU has. For example, as shown in Table 1 below, it is the configuration of multi-channel connection (Multi host) or single-channel connection (Singlehost) on at least one CPU.
[0089] Specifically, a single-channel connection refers to an OCP (expansion card type) connection that only involves one side of the CPU, and does not occupy the resources of the other CPU. A multi-channel connection means that both CPUs need to provide part of the PCIe resources for OCP use through cables.
[0090] Table 1. Configuration table of single-channel connection and multi-channel connection of at least one OCP network card
[0091]
[0092] As shown in Table 1 above, there are 6 network card configurations on the server motherboard, including two multi-channel connection configurations and four single-channel connection configurations. Among them, the information that can be interpreted from the first multi-channel connection configuration information includes: two network cards are connected to two CPUs, connected to CPU1 and CPU0 respectively, connected by PCIe x8 slots, and the corresponding simulated network card is OCP0. The channel number of the transmission channel is CH2, and the access address is the I2C switch chip address 0xE0 and the simulator address 0x42.
[0093] Since the CPU and BIOS cannot communicate directly, it is necessary to simulate the simulator pins or other pin pins inside the CPLD to realize data transmission between the CPU and BIOS.
[0094] Optionally, in this example, the CPLD internally simulates the simulator pins as a PCA9555 chip circuit. The CPLD can pass the data from the CPU to the CPLD and pass the configuration information to the BIOS through the simulated PCA9555.
[0095] Furthermore, the PCA9555 chip circuit is a 16-bit general-purpose input / output (GPIO) expander with interrupts and weak pull-up resistors suitable for I2C bus or SMbus applications.
[0096] Step S102, in the initialization stage, scan and obtain access information of at least one network card connected to the simulator pin of the CPLD.
[0097] The PEI stage during booting refers to "Pre-EFI Initialization". This is an important stage in the UEFI (Unified Extensible Firmware Interface) boot process, which occurs after the SEC (Security Stage) and before the DXE (Driver Execution Environment) stage. Access information includes: the location of the CPU where the inserted network card is located and the cable expansion bandwidth.
[0098] Furthermore, the above step S102, in the initialization phase, scans and obtains access information of at least one network card connected to the simulator pin of the CPLD, specifically including:
[0099] In the initialization phase, the access information of at least one network card connected to the simulator pin in the CPLD is scanned using the I2C link. The access information of at least one network card is the location information of the currently connected network card that is simulated into the simulator pin after the CPLD identifies it, and is transmitted to the BIOS. The access information includes at least: a first field and a second field, the first field is used to indicate the location of the CPU where the inserted network card is located; the second field is used to indicate whether the inserted network card has extended bandwidth through a cable. Optionally, the first field is the OCP_CPU_ADDR field, and the second field is the OCP_CABLE_PRSNT field.
[0100] Furthermore, the BIOS will scan the configuration of PCA9555 through the I2C link to obtain the configuration information transmitted by the CPLD, and then dynamically identify the location of the current OCP, whether it is CPU0 or CPU1, the bandwidth is X8 or X16, and the configuration is Multi host or Single host based on the OCP_CPU_ADDR and OCP_CABLE_PRSNT in the data.
[0101] CPLD simulates the connected device according to the pin distribution of PCA9555 through the location information of the connected device. BIOS reads the pin information of PCA9555 bit by bit to obtain information such as OCP_CPU_ADDR and OCP_CABLE_PRSNT, and passes it to BIOS in the form of software and hardware interface documents. BIOS can adapt the unique bandwidth allocation according to different values.
[0102] Then, BIOS uses the lane distribution interval of the PCIe port and the uniqueness of the slotid to fill in the constructed structure, generating a second structure containing the bandwidth, rate, start channel, end channel, slot location ID, and CPU location of the current slot. The OCP on the machine is configured one by one through the initialization of the structure during the PEI phase of power-on.
[0103] Step S103: adapt the position of the CPU where the inserted network card is located and the cable extension bandwidth to the first structure to generate a second structure.
[0104] The second structure is used to identify the configuration and slot identification of the network card currently inserted into the CPU. Specifically, the BIOS determines the location of the CPU side where the OCP network card is located through the first field (OCP_CPU_ADDR). The BIOS determines whether the OCP network card has extended bandwidth through a cable through the second field (OCP_CABLE_PRSNT).
[0105] Step S104: configuring hot-swap properties for at least one network card managed by the CPU and the CPLD respectively.
[0106] For adapting the communication channel between CPU and CPLD, that is, configuring the hot-swap properties of OCP, it is necessary to clearly distinguish between the CPU side and the OCP side. For the CPU side, it is necessary to configure the hot-swap type of the entire PCIe link; for the OCP side, the BIOS needs to combine OCP_CPU_ADDR and OCP_CABLE_PRSNT to confirm the OCP network cards in different CPU positions, thereby realizing hot-swap of OCP network cards in different positions.
[0107] Among them, the hot plug attributes include: surprise hot plug and button hot plug. Surprise hot plug refers to unexpected and violent hot plug. Button hot plug means pressing the switch to power on. The switch can be set on the OCP network card.
[0108] The purpose of this step is to configure two types of plug-in recognition on both the CPU and CPLD ends, so as to identify the hot-plug type of the network card and control the power on and off in the subsequent hot-plug process.
[0109] Step S105 , according to the identification function of the second structure and the configured hot-plug attribute, during the driver program execution phase, based on the user's hot-plug operation on any one of the at least one network card, controlling the power on and off of the network card.
[0110] After the BIOS and CPLD are adapted according to the agreed channel, if it is based on the switch button hot-swap type, the indicator light will be automatically controlled to flash or go out during the driver execution (DXE) stage, thereby realizing the power-on and power-off control of the OCP network card, avoiding damage to the network card and motherboard due to abnormal power-on.
[0111] The network card hot-swap configuration method provided in this embodiment obtains the network card configuration status (first structure) supported by the CPU, so that the system can clearly know which network card configurations are feasible, which provides clear guidance for the subsequent selection and deployment of network cards. In the initialization phase, the network card access information (including the network card position and the cable extension bandwidth) is automatically scanned and adapted, and the position of the CPU where the network card is located and the cable extension bandwidth are adapted to the first structure to generate a second structure, so as to achieve flexible configuration when different network cards are inserted, and solve the problem that the available space for configuration is small when the OCP network card is fixed in the slot, and cannot meet the general needs of customers. The method improves the flexibility and scalability of the system and can meet the configuration requirements in different application scenarios.
[0112] In addition, based on the recognition function of the second structure and the configuration of the hot-swap properties, the user can get immediate response and feedback when performing the network card hot-swap operation, and control the normal power on and off of the network card, which solves the problem that the violent hot-swap solution cannot effectively control the power on and off of the OCP network card. This method avoids the risk of damage to the network card and the motherboard due to abnormal power-on.
[0113] In addition, the method provided in this embodiment also implements the dynamic hot-swap function of the OCP Multi host configuration on the existing AMD platform, providing technical support for the development of corresponding functions in subsequent projects.
[0114] In a possible implementation of this embodiment, as Figure 3 As shown, the above step S101: obtaining a first structure of a network card configuration supported by the CPU includes:
[0115] Step S101 - 1 , obtaining system software and hardware interface documents.
[0116] The system software and hardware interface document includes the interface configuration information supported by the motherboard, such as the PCIe port number supported by the CPU. Specifically, after the OCP network card is inserted and the computer is turned on, the BIOS will obtain a software and hardware interface document from the hardware when adapting the OCP network card configuration, which contains all the configuration information supported by the current model; specifically, the content of one configuration information can be seen in the aforementioned Table 1.
[0117] Step S101 - 2 , determining the relevant information of the slots of each interface of the CPU on the mainboard according to the system software and hardware interface document, the relevant information of the slots including: the number of channels and bandwidth capability of the slots.
[0118] The BIOS hardware will decompose the PCIe ports supported by the CPU into fixed bandwidth slots on the motherboard. Generally, different ports have different default bandwidths. For example, slot P0 is a x4 slot by default (i.e., it has 4 data lanes), slot P1 is a x16 slot by default (i.e., it has 16 data lanes), and slot P2 is a x8 slot by default (i.e., it has 8 data lanes, etc. You can adapt it in the code according to your needs.
[0119] There are pins reserved on each slot for sensing changes in the slot configuration on the current motherboard. The pins are connected to the CPLD, which will pass the configuration data by simulating the PCA9555 chip (such as the simulator pin). The BIOS can sense the configuration information through the I2C link.
[0120] Step S101 - 3 , generating a first structure according to the number of channels and bandwidth capability of the slot.
[0121] The first structure is used to store one or more of the bandwidth, rate, start channel, end channel, slot location ID and CPU location of the current slot.
[0122] In the PEI stage, the BIOS first builds a dynamic identification configuration structure based on the PCIe Controller supported by the CPU to store information such as the bandwidth, rate, start channel StartLane, end channel EndLane, Slotid, and the location of the CPU of the current slot. This structure can adapt to different configuration bandwidths and Slotids based on the differences in StartLane and EndLane.
[0123] Among them, PCIe Controller is used to define the protocols used within PCIe, etc. The slot location ID (such as Slotid) is used to identify the location of each PCIe slot on the motherboard to facilitate users to identify and install expansion cards. The starting channel StartLane is used to refer to the starting channel of the channel occupied by the PCIe device and the CPU communication channel; the ending channel EndLane is used to refer to the ending channel of the channel occupied by the PCIe device and the CPU communication channel.
[0124] In this embodiment, when hot plugging of the OCP network card / device is implemented, since the BIOS cannot control the power on and off of the network card, the hot plugging information can only be adapted through the BIOS, and the CPU transmits the data to the CPLD, and the power on and off of the network card is controlled by the CPLD.
[0125] In some possible implementations, the above step S103, adapting the position of the CPU where the inserted network card is located and the cable extension bandwidth to the first structure to generate the second structure, includes:
[0126] Dynamically determine the insertion status of at least one network card according to the first field and the second field, and judge whether the first field and the second field are both valid fields; if both are valid fields, generate a second structure according to one or more of the first structure, the starting channel, the ending channel, the slot position ID and the CPU position in the first structure.
[0127] Furthermore, the above step S104 configures hot-swap properties for at least one network card managed by the CPU and the CPLD, respectively, and specifically includes:
[0128] On the one hand, the BIOS configures the hot-plug type of the entire PCIe link for the CPU and issues a first instruction. The hot-plug type includes two types: violent hot-plug and switch hot-plug; the first instruction is used to instruct the CPU to configure the current hot-plug type to the PCIe link one by one according to the position ID of the slot of the network card.
[0129] Specifically, for the CPU side, it is necessary to configure the hot-plug type of the entire PCIe link. The CPU will configure the hot-plug type to the PCIe link one by one according to the Slotid of OCP. Different hot-plug types will have different performances. The hot-plug type will determine the selection of violent Surprise hot-plug and press the switch button hot-plug, the register selection of the lighting position, the lighting stage, etc. Because different hot-plug types will give different values to the registers in the code, each register has its own identification type. When selecting the hot-plug type, it needs to be configured in the CPU register according to the needs.
[0130] On the other hand, the BIOS configures the hot-plug type and the I2C identifier corresponding to each network card, the location ID of the slot, and the device address of the network card for at least one network card managed by the CPLD.
[0131] Since the address of the I2C switch chip circuit of PCA9545 needs to be clearly pointed out, the value is different when the network card is connected to CPU0 and CPU1. For the OCP side, BIOS needs to combine OCP_CPU_ADDR and OCP_CABLE_PRSNT to confirm the OCP network card in different CPU positions, and then implement hot plugging of OCP network cards in different positions. Because the CPU transmits data to CPLD through the I2C Switch PCA9545 chip, and there is more than one OCP network card on the motherboard, CPLD needs to split the data to simulate two PCA9555 chips to operate the hot plugging of OCP, so BIOS needs to pay special attention when configuring OCP hot plugging.
[0132] In this embodiment, the hot-plug type, I2CBusSegment (I2C BS), Slotid and SlaveAddress of the OCP end are used in a one-to-one correspondence with the CPU end, and only in this way can the OCP end correctly parse the hot-plug.
[0133] Furthermore, I2CBusSegment, for any PCA9545 device, needs to retain a value to identify the implementation of the I2CGPIO device. The Slave Address (device address) can be a byte, for example, the byte can be composed of a 7-bit address and a 1-bit R / W read / write bit, which is the address of the device.
[0134] Optionally, the specific process of the above-mentioned BIOS configuring hot-swap properties for at least one network card managed by the CPLD includes: the BIOS transmits configuration information to the CPLD through the I2C switching chip to configure the hot-swap properties for at least one network card managed by the CPLD, and the configuration information includes the address information of the I2C switching chip; such as the address information is the PCA9545 address 0xE0.
[0135] In addition, in another possible implementation of the present embodiment, after step S104: configuring the hot-plug properties, it also includes: matching according to the position of at least one network card inserted into the CPU and the hot-plug properties configured for at least one network card managed by the CPLD; and determining the connection mode of the target network card inserted into the slot according to the matching result.
[0136] The connection modes include: single host connection mode with a network card on the CPU side, and multi host connection mode with two or more CPUs connected via cables.
[0137] Optionally, in a specific implementation manner, the matching according to the position of at least one network card inserted into the CPU and the hot-swap attribute configured for at least one network card managed by the CPLD specifically includes:
[0138] If at least one of the inserted network cards is the first network card and the second network card, and the first Slot ID corresponding to the first network card and the second Slot ID corresponding to the second network card are both the same as the two Slot IDs in the configured hot-swap properties, it is determined that the currently inserted first network card and the second network card are connected to the two CPUs via cables respectively.
[0139] For example, for I2CBusSegment and SlaveAddress information, the BIOS needs to match the location of the OCP with the two PCA9555s simulated by the CPLD in the code, otherwise the light will not turn on. This matching means that the configuration information supported by the CPLD matches the information configured by the BIOS for the network card.
[0140] If OCP is configured as Single host, each OCP corresponds to a PCA9555 address; if OCP is configured as Multi host, BIOS and OS will identify it as two network cards of the same model but in different locations. In this case, BIOS only needs to treat it as one network card to configure I2CBusSegment. For Slotid, it needs to be strictly aligned with the Slotid of the previous bandwidth allocation (that is, the Slotid is determined to be the same). Hot plugging is achieved by finding devices through Slotid.
[0141] It should be noted that, in this embodiment, when configuring Multi host, the Slotids of the two OCP network cards identified need to be configured the same; the remaining OCP-side configuration parameters are no different from NVME hot-plug, and the configuration can be compared.
[0142] After matching the above information, the hot-swap process of the OCP network card can be judged according to the lighting of the OCPButton during the boot process. When the computer is powered on and the corresponding OCP slot is connected to an OCP network card, the BIOS will configure the hot-swap properties of the OCP network card one by one according to the Slotid in the DXE stage (driver execution environment).
[0143] Specifically, Figure 4As shown, in the DXE stage, based on the hot plug operation of any one of the at least one network card by the user, controlling the power on and off of the network card includes:
[0144] Step S105 - 1 , when it is detected that a target network card is inserted into the slot, the hot-plug property of the target network card is adapted according to the preset slot position ID in the DXE stage.
[0145] Step S105-2, after the BIOS and CPLD are adapted according to the agreed channel, the light on the target network card is automatically lit, and the OS system is entered, and the information of the inserted target network card is displayed under the OS system.
[0146] In addition, after entering the OS system, control the power on and off of the network card, including:
[0147] Step S105-3, determining the switch button hot plug type selected by the user on the target network card, which includes: violent hot plug and switch button hot plug.
[0148] Step S105-4, in response to the user's hot-swap operation of the switch Button, the indicator light flashes and then goes out, indicating that the target network card is to be unplugged, and the target network card is controlled to complete power-off.
[0149] Step S105-5, when the target network card is reinserted into the slot, in response to the user's switch button hot-swap type operation, the indicator light flashes again and stays on, and the target network card is controlled to complete power-on.
[0150] Specifically, if the light on the Button on the target network card automatically turns green during the DXE stage, the machine will not experience any abnormalities such as downtime until the machine enters the OS. The network card information can be seen by the lspci command under the OS. Then the user can short-press the Button, the green light will flash a few times and then go out. At this time, the OCP network card can be unplugged to complete the hot removal.
[0151] Then plug in the OCP network card and press the Button again. The green light will flash a few times and finally stay on. At this time, the hot insertion of the OCP network card is completed and the power-on is completed.
[0152] The above lspci is a command line tool widely used in Linux systems to list all PCI (Peripheral Component Interconnect) bus devices in the system and their detailed information.
[0153] The method provided in this embodiment is based on the requirements of multiple configurations of OCP network cards on the Genoa platform, and combines the OCP slots Single host and Multi host to develop an OCP network card dynamic identification solution and a dynamic configuration OCP network card Button hot plug solution, which solves the problem that the available space for the configuration of the fixed slot of the OCP network card is small and cannot meet the general needs of customers. In addition, this method also solves the problem that the violent hot plug solution cannot effectively control the power on and off of the OCP network card, avoiding damage to the network card and the motherboard caused by abnormal power-on.
[0154] In a specific embodiment, if Figure 5 As shown, the method provided in this embodiment includes:
[0155] Step S201, BIOS obtains software and hardware interface documents and starts adaptation preparation.
[0156] Step S202, BIOS constructs a first dynamic identification structure in the PEI stage. The specific process is as described in step S101 of the above embodiment, which will not be described in detail in this embodiment.
[0157] Step S203, using the I2C link to scan and obtain the access information of the CPLD. This step corresponds to step S102 of the above embodiment, and please refer to the description of the above step S102.
[0158] Step S204, BIOS dynamically configures the OCP network card according to the read OCP_CPU_ADDR (first field) and OCP_CABLE_PRSNT (second field).
[0159] Step S205, determining whether OCP_CPU_ADDR and OCP_CABLE_PRSNT are both valid.
[0160] Specifically, the validity of the two fields OCP_CPU_ADDR and OCP_CABLE_PRSNT can be indicated by an indication flag, such as "1" or "0". "1" or "0" is used to indicate that the field is valid. In this embodiment, it is assumed that the valid indication flag is "1". It can be pre-configured and generated by the system.
[0161] If all are "1" and valid, execute step S206; if one is "0" and invalid, end the process.
[0162] Step S206: If all are valid, then fill in the PCIe port Lane interval and Slotid to generate a second structure. The specific process is shown in step S103 of the above embodiment, which will not be repeated in this embodiment.
[0163] Step S207: dynamically identify the OCP network card using the second structure.
[0164] Step S208, configure the hot-plug type, I2CBusSegment, Slotid and SlaveAddress one by one according to the OCP network card position for adaptation.
[0165] Step S209: After the configuration is completed, the device is powered on and the Button lights are used to determine whether the adaptation is completed. Step S210 is then executed.
[0166] Step S210, determining whether the BIOS configuration is completed. If the configuration is completed, executing step S211; if not, returning to step S208.
[0167] Step S211, after the configuration is completed, the green light is on in the DXE stage until entering the OS, then short press the Button, the green light flashes a few times and then goes out.
[0168] Step S212, plug in the OCP network card, press the button again, the green light will flash a few times and finally stay on.
[0169] When the corresponding OCP slot is connected to an OCP network card, the BIOS will configure the hot-swap properties of the OCP network card one by one according to the Slotid in the DXE stage. After the BIOS and CPLD are adapted according to the agreed channel, the light on the Button will automatically light up green in the DXE stage, and the machine will not experience any abnormalities such as downtime until the machine enters the OS. Under the OS, lspci can clearly see the network card information, and then you can short-press the Button, the green light will flash a few times and then go out. At this time, you can pull out the OCP card to complete the hot removal. When the OCP network card is plugged in and the Button is pressed again, the green light will flash a few times and finally stay on. At this time, the hot insertion of the OCP network card is completed and the power-on is completed. For the above process, please refer to steps S105-1 to S105-5 of the aforementioned embodiment, which will not be described in detail in this embodiment.
[0170] The method provided in this embodiment dynamically configures the hot-swap properties of the OCP network card with the help of CPLD to realize dynamic configuration of information such as bandwidth and slotid, effectively distinguishes whether the connection mode of the OCP network card configuration belongs to single host or multi host, and realizes effective control of powering on and off the OCP network card in the case of Surprise violent hot-swap.
[0171] In this embodiment, a network card hot plug configuration device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of 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.
[0172] This embodiment provides a network card hot plug configuration device, such as Figure 6 As shown, the device comprises:
[0173] The acquisition module 610 is used to acquire a first structure of a network card configuration supported by the CPU, where the first structure is used to indicate the network card configuration supported by the CPU.
[0174] The processing module 620 is used to scan and obtain access information of at least one network card connected to the simulator pin of the CPLD during the initialization phase, wherein the access information includes: the location of the CPU where the inserted network card is located and the cable expansion bandwidth.
[0175] The adaption module 630 is used to adapt the position of the CPU where the inserted network card is located and the cable expansion bandwidth to the first structure to generate a second structure, and the second structure is used to identify the configuration and slot identification of the network card currently inserted into the CPU.
[0176] The configuration module 640 is used to configure hot-plug properties for at least one network card managed by the CPU and the CPLD respectively.
[0177] The execution module 650 is used to control the power on and off of the network card based on the hot plug operation of any one of the at least one network card by the user during the driver execution phase according to the identification function of the second structure and the configured hot plug attribute.
[0178] 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.
[0179] The network card hot-swap configuration 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, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0180] The embodiment of the present invention also provides a network card hot plug configuration system, having the above Figure 6 The network card hot-swap configuration device is shown.
[0181] See also Figure 7, is a structural diagram of a network card hot-swap configuration system according to an embodiment of the present invention. The system includes: a mainboard and at least one network card, wherein the mainboard includes: at least one CPU, a BIOS module, a CPLD, an I2C switch chip and at least one slot.
[0182] In addition, the mainboard may also include other modules such as a memory or storage unit, a transceiver module, etc., which is not limited in this embodiment.
[0183] At least one CPU is connected to the CPLD via an I2C switching chip; the CPLD includes simulator pins, and the simulator pins are used to connect to the BIOS module.
[0184] The BIOS module is also connected to the I2C switch chip; and at least one slot is used to insert at least one network card.
[0185] Among them, BIOS is a set of programs fixed on a ROM chip on the motherboard of the computer. It stores the most important basic input and output programs of the computer, the self-test program after power-on, and the system self-starting program. It can read and write specific information of system settings from CMOS. Its main function is to provide the most basic and direct hardware settings and control for the computer. In this embodiment, the BIOS module is used to execute the above-mentioned Figures 2 to 5 The network card hot-swap configuration method is shown.
[0186] Furthermore, the connection relationship between the modules or components on the mainboard can be as follows: Figure 1 The structure shown is the same. Figure 1 The connection relationship between each module, chip or unit will not be described in detail in this embodiment.
[0187] Optionally, the above-mentioned I2C switch chip can be an I2C Switch PCA9545 chip.
[0188] Optionally, the simulator pins in the above CPLD may be pins of a simulated PCA9555 chip.
[0189] Optionally, the at least one network card is an OCP network card.
[0190] It should be noted that the PCA9545 chip and the PCA9555 chip in this embodiment are examples, and may also be other types of PCA chip circuits or modules, which are not limited in this embodiment.
[0191] exist Figure 1In the motherboard structure shown, any processor can be a central processing unit (CPU), a network processor or a combination thereof. The CPU can further include a hardware chip. The hardware chip can be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device can be a complex programmable logic device, a field programmable logic gate array, a general array logic or any combination thereof.
[0192] In this embodiment, storage is taken as an example, and the memory stores instructions executable by at least one processor, so that the at least one processor executes the network card hot-plug configuration method shown in the above embodiment.
[0193] Further, the memory 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 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 may include a memory remotely arranged relative to the processor, 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.
[0194] The memory may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid state drive; the memory may also include a combination of the above types of memory.
[0195] The server motherboard also includes input and output devices. The processor, memory, and input and output devices can be connected via a bus or other means. Specifically, the input device can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, an indicator rod, one or more mouse buttons, a trackball, a joystick, etc. The output device may include a display device, an auxiliary lighting device (e.g., an LED), and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display, and a plasma display. In some optional embodiments, the display device may be a touch screen.
[0196] The server mainboard also includes at least one communication interface (generally referring to various interfaces, including but not limited to slots, sockets, etc.) for the mainboard to communicate with other devices or communication networks. Figure 7The server motherboard includes two slots, namely slot 1 and slot 2 for connecting external OCP network card 1 and OCP network card 2.
[0197] It should be understood that the server mainboard may further include more or fewer communication interfaces for connecting more or fewer OCP network cards.
[0198] An embodiment of the present invention also provides a computer-readable storage medium, and the above-mentioned 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 by downloading through a network and originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium, 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.
[0199] The storage medium may be a disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid state drive, etc.; further, the storage medium may also include a combination of the above-mentioned types of memories. It is 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 the computer, the processor or the hardware, the network card hot-swap configuration method shown in the above embodiment is implemented.
[0200] Embodiments of the present application may also provide a computer program product, including computer program instructions, which, when executed by a processor, cause the processor to perform the steps in the above method. Wherein, the computer program product may be written in any combination of one or more programming languages to perform program codes for performing the operations of the disclosed embodiments, wherein the programming languages include object-oriented programming languages, such as Java, C++, etc., and also include conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on a user computing device, partially on a user device, as an independent software package, partially on a user computing device, partially on a remote computing device, or entirely on a remote computing device or server.
[0201] The above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the embodiments of the present invention are described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A network card hot-swap configuration method, characterized in that: The method is applied to a basic input and output system BIOS, wherein the BIOS is connected to a CPU via an emulator pin of a CPLD, and the method comprises: Obtain a first structure of a network card configuration supported by the CPU, where the first structure is used to indicate a network card configuration supported by the CPU; In the initialization phase, scanning and acquiring access information of at least one network card connected to the simulator pin of the CPLD, the access information at least comprising: a first field and a second field, the first field being used to indicate the position of the CPU where the inserted network card is located, and the second field being used to indicate whether the inserted network card has bandwidth extended through a cable; Adapting the position of the CPU where the inserted network card is located and the cable extension bandwidth to the first structure to generate a second structure, where the second structure is used to identify the configuration and slot identification of the network card currently inserted into the CPU; respectively configuring hot-swap properties for at least one network card managed by the CPU and the CPLD; According to the identification function of the second structure and the configured hot-plug attribute, in the driver execution phase, based on the hot-plug operation of any one of the at least one network card by the user, controlling the power on and off of the network card; The step of adapting the position of the CPU where the inserted network card is located and the cable extension bandwidth to the first structure to generate the second structure includes: Dynamically determine the insertion status of at least one network card according to the first field and the second field, and determine whether the first field and the second field are both valid fields; If they are all valid fields, the second structure is generated according to one or more of the first structure, the starting channel, the ending channel, the position ID of the slot and the position of the CPU in the first structure.
2. The method according to claim 1, characterized in that The first structure of obtaining the network card configuration supported by the CPU includes: Obtaining system software and hardware interface documents, wherein the system software and hardware interface documents include interface configuration information supported by the motherboard; Determine, according to the system hardware and software interface document, the relevant information of the slots of each interface of the CPU on the mainboard, wherein the relevant information of the slots includes: the number of channels and bandwidth capability of the slots; The first structure is generated according to the number of channels of the slot and the bandwidth capability, and is used to store one or more of the bandwidth, rate, start channel, end channel, slot location ID and CPU location of the current slot.
3. The method according to claim 2, characterized in that In the initialization stage, scanning and acquiring access information of at least one network card connected to the simulator pin of the CPLD includes: In the initialization stage, the I2C link is used to scan the access information of at least one network card connected to the simulator pin in the CPLD; The access information of the at least one network card is simulated into a simulator pin after the CPLD identifies the location information of the currently connected network card, and is transmitted to the BIOS.
4. The method according to any one of claims 1 to 3, characterized in that: The configuring hot-swap properties for at least one network card managed by the CPU and the CPLD respectively includes: The CPU is configured with a hot-plug type of the entire PCIe link and a first instruction is issued, wherein the hot-plug type includes two types: violent hot-plug and switch hot-plug; the first instruction is used to instruct the CPU to configure the current hot-plug type to the PCIe link one by one according to the position ID of the slot of the network card; The hot-plug type and the I2C identifier corresponding to each network card, the location ID of the slot and the device address of the network card are configured for at least one network card managed by the CPLD.
5. The method according to claim 4, characterized in that After configuring the hot-swap properties, the following steps are also included: Matching according to the position of at least one network card inserted into the CPU and the hot-plug attribute configured for at least one network card managed by the CPLD; Determine the connection mode of the target network card inserted into the slot according to the matching result; The connection methods include: a connection method of a network card on the CPU side and a connection method of connecting two or more CPUs through a cable.
6. The method according to claim 5, characterized in that The matching according to the position of at least one network card inserted into the CPU and the hot-plug attribute configured for at least one network card managed by the CPLD includes: If at least one of the inserted network cards is the first network card and the second network card, and the first Slot ID corresponding to the first network card and the second Slot ID corresponding to the second network card are both the same as the two Slot IDs in the configured hot-swap properties, it is determined that the currently inserted first network card and the second network card are connected to two CPUs via cables respectively.
7. The method according to claim 4, characterized in that The method of controlling the power on and off of the network card based on the hot plug operation of any one of the at least one network card by the user during the driver program execution phase includes: When a target network card is detected to be inserted into the slot, the hot-plug property of the target network card is adapted according to the preset slot position ID in the DXE stage; After the BIOS and the CPLD are adapted according to the agreed channels, the light on the target network card is automatically lit, and the OS system is entered, and the information of the inserted target network card is displayed under the OS system.
8. The method according to claim 7, characterized in that After entering the OS system, controlling the power on and off of the network card includes: Determine the type of the switch Button hot-swap selected by the user on the target network card; In response to the hot-swap operation of the switch Button by the user, the indicator light flashes and then goes out, indicating that the target network card is to be unplugged, and controlling the target network card to complete power-off; When the target network card is reinserted into the slot, in response to the user's hot-swap operation of the switch button, the indicator light flashes again and stays on, and then the target network card is controlled to power on.
9. The method according to any one of claims 1 to 3, characterized in that: The configuring hot-plug properties for at least one network card managed by the CPLD includes: The configuration information is transmitted to the CPLD through the I2C switch chip, and the hot-swap attribute is configured for at least one network card managed by the CPLD, wherein the configuration information includes the address information of the I2C switch chip.
10. A network card hot-swap configuration device, characterized in that: The device comprises: An acquisition module, used for acquiring a first structure of a network card configuration supported by the CPU, wherein the first structure is used for indicating a network card configuration supported by the CPU; The processing module is used to scan and obtain access information of at least one network card connected to the simulator pin of the CPLD during the initialization phase, wherein the access information at least includes: a first field and a second field, wherein the first field is used to indicate the position of the CPU where the inserted network card is located, and the second field is used to indicate whether the inserted network card has bandwidth extended through a cable; An adaption module, used for adapting the position of the CPU where the inserted network card is located and the cable extension bandwidth to the first structure to generate a second structure, wherein the second structure is used for identifying the configuration and slot identification of the network card currently inserted into the CPU; A configuration module, used to configure hot-swap properties for at least one network card managed by the CPU and the CPLD respectively; an execution module, configured to control power on and off of the network card based on a user's hot plug operation on any one of the at least one network card during a driver execution phase according to the identification function of the second structure and the configured hot plug attribute; Among them, the adaptation module is specifically used to dynamically determine the insertion status of at least one network card according to the first field and the second field, and judge whether the first field and the second field are both valid fields; if both are valid fields, the second structure is generated according to one or more of the first structure, the starting channel, the ending channel, the slot location ID and the location of the CPU in the first structure.
11. A network card hot-swap configuration system, characterized in that: The system comprises: a mainboard and at least one network card, wherein the mainboard comprises: at least one CPU, a BIOS module, a CPLD, an I2C switch chip and at least one slot, The at least one CPU is connected to the CPLD via the I2C switching chip; The CPLD includes an emulator pin, and the emulator pin is used to connect to the BIOS module; The BIOS module is also connected to the I2C switch chip; The at least one slot is used to insert the at least one network card; The BIOS module is used to execute the network card hot-plug configuration method as described in any one of claims 1 to 9 when the at least one network card is inserted into the at least one slot.
12. The system according to claim 11, characterized in that The at least one network card is an Open Compute Project (OCP) network card.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the network card hot-plug configuration method according to any one of claims 1 to 9.
14. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to enable a computer to execute the network card hot-plug configuration method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Adaptation control method, device, equipment and system for OCP NIC network card
CN111901164A