Network card switching method and device

CN121567543BActive Publication Date: 2026-10-09INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511787127.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-10-09
Estimated Expiration
2045-11-28

AI Technical Summary

Technical Problem

例如,主备网卡或多网卡之间难以实时同步链路状态、配置参数及业务流量信息,导致切换时易出现配置不一致、流量中断等问题,无法保障通信的连续性

Benefits of technology

[0033]In a ninth aspect, this application proposes a program product comprising at least one of a program and instructions, wherein when the program and instructions are executed by an electronic device, they implement the steps of the method described in the first aspect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121567543B_ABST
    Figure CN121567543B_ABST
Patent Text Reader

Abstract

The application provides a network card switching method and device. The method applied to a processing device comprises the following steps: in response to an abnormal running state of a first network card, controlling a first disconnecting switch and a second disconnecting switch, so as to deactivate a first NCSI link corresponding to the first network card, and activate a second NCSI link as an active NCSI link; based on a communication link connection state between the processing device and the first network card, sending instruction information matched with the communication link connection state to the second network card, so as to instruct the second network card to acquire network connection state information of the first network card based on a virtual NTB link or direct memory access (DMA), and enable the second network card to replace the first network card to perform communication based on the network connection state information. Through the technical scheme, the continuity of out-of-band management and communication during network card switching can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer network technology, and in particular to a network card switching method, apparatus, device and storage medium. Background Technology

[0002] In related technologies, network interface card (NIC) redundancy switching schemes have shortcomings in terms of lack of state synchronization and cross-plane coordination mechanisms. For example, it is difficult to synchronize link status, configuration parameters, and service traffic information in real time between primary and backup NICs or multiple NICs, which can easily lead to problems such as configuration inconsistencies and traffic interruptions during switching, thus failing to guarantee the continuity of communication. Summary of the Invention

[0003] This application aims to at least partially address one of the technical problems in the related art.

[0004] In a first aspect, this application proposes a network interface card (NIC) switching method. The NIC includes a first NIC and a second NIC, which are connected to the same PCIe switch via a Virtual Non-Transparent Bridge (NTB) link within the PCIe switch. A first NCSI link of the first NIC is controlled by a first isolating switch, and a second NCSI link of the second NIC is controlled by a second isolating switch. The method is applied to a processing device and includes: responding to an abnormal operating state of the first NIC, controlling the first and second isolating switches to deactivate the first NCSI link corresponding to the first NIC and activate the second NCSI link as the active NCSI link; and sending instruction information matching the communication link connection state to the second NIC based on the communication link connection state between the processing device and the first NIC. The instruction information instructs the second NIC to obtain the network connection state information of the first NIC based on the virtual NTB link or Direct Memory Access (DMA), so that the second NIC can take over communication from the first NIC based on the network connection state information.

[0005] In one implementation, sending instruction information matching the communication link connection status to the second network card based on the communication link connection status between the processing device and the first network card includes: when the communication link connection status is that the communication link is not disconnected, sending first instruction information to the second network card, wherein the first instruction information is used to instruct the second network card to obtain the network connection status information of the first network card through the virtual NTB link.

[0006] In an optional implementation, after sending the first instruction information to the second network card, the method further includes: obtaining response information returned by the first network card, the response information being information returned by the second network card after failing to obtain the network connection status information based on the virtual NTB link; and sending a second instruction information to the second network card, the second instruction information being used to authorize the second network card to obtain the network connection status information of the first network card through DMA.

[0007] In one implementation, sending instruction information matching the communication link connection status to the second network card based on the communication link connection status between the processing device and the first network card includes: when the communication link connection status is a communication link disconnection, sending second instruction information to the second network card, wherein the second instruction information is used to authorize the second network card to obtain the network connection status information of the first network card through DMA.

[0008] In one implementation, the first network interface card (NIC) is powered by a first power supply link, and the second NIC is powered by a second power supply link. The method further includes: determining that the operating state of the first NIC is abnormal when an abnormality is detected in the electrical parameters of the first power supply link.

[0009] In one alternative implementation, the memory module of the first network card is powered by a third power supply link, which is a different power supply link from the first power supply link.

[0010] In one implementation, the virtual NTB link is established based on a non-transparent port of a PCIe switch. The virtual NTB link connects a first communication port in the first network interface card (NIC) and a second communication port in the second NIC. The first and second communication ports are communication ports corresponding to virtual functions partitioned using single-root I / O virtualization technology.

[0011] In one implementation, the method further includes: determining that the first network interface card (NIC) is in an abnormal operating state when the channel transmission quality index value of the first NCSI link is detected to be less than that of the channel transmission quality index value of the second NCSI link.

[0012] Secondly, this application proposes a method for switching network interface cards (NICs). The NICs include a first NIC and a second NIC, which are connected to the same PCIe switch and are connected via a virtual non-transparent bridge (NTB) link within the PCIe switch. The first NIC's first NCSI link is controlled by a first isolating switch, and the second NIC's second NCSI link is controlled by a second isolating switch. The method is applied to the second NIC and includes: receiving instruction information from a processing device that matches the communication link connection status of the first NIC; the instruction information being sent by the processing device after determining that the first NIC's operating status is abnormal; wherein, in the case of the first NIC's abnormal operating status, the processor further controls the first and second isolating switches to deactivate the first NCSI link of the first NIC and activate the second NCSI link of the second NIC as the active NCSI link; according to the instruction information, obtaining the network connection status information of the first NIC via the virtual NTB link or direct memory access (DMA); and taking over communication from the first NIC based on the network connection status information.

[0013] In one implementation, obtaining the network connection status information of the first network card through the virtual NTB link or direct memory access DMA according to the instruction information includes: in response to receiving the first instruction information, obtaining the network connection status information of the first network card based on the virtual NTB link, wherein the first instruction information is information sent by the processing device when it determines that the communication link with the first network card is not disconnected.

[0014] In one alternative implementation, in response to the failure to obtain the network connection status information through the virtual NTB link, a response message is returned to the processing device. The response message is used by the processing device to send a second instruction message to the second network card. The second instruction message is information sent by the processing device when it determines that the communication link with the first network card is disconnected.

[0015] In one implementation, the step of obtaining the network connection status information of the first network card through the virtual NTB link or direct memory access DMA according to the instruction information includes: in response to receiving the second instruction information, obtaining the network connection status information of the first network card based on DMA, wherein the second instruction information is information sent by the processing device when it determines that the communication link with the first network card is disconnected.

[0016] In one implementation, the method further includes: sending a reset command to the first network interface card (NIC). (Virtual NTB link) In a third aspect, this application proposes a network interface card (NIC) switching device. The NIC includes a first NIC and a second NIC, which are connected to the same PCIe switch via a virtual non-transparent bridge (NTB) link within the PCIe switch. A first NCSI link of the first NIC is controlled by a first isolating switch, and a second NCSI link of the second NIC is controlled by a second isolating switch. The device is applied to a processing device and includes a first processing module for responding to the operation of the first NIC. If the connection status is abnormal, the first isolation switch and the second isolation switch are controlled to deactivate the first NCSI link corresponding to the first network card and activate the second NCSI link as the active NCSI link. The second processing module is used to send instruction information matching the communication link connection status to the second network card based on the communication link connection status between the processing device and the first network card. The instruction information is used to instruct the second network card to obtain the network connection status information of the first network card based on the virtual NTB link or direct memory access DMA, so that the second network card can take over the communication from the first network card based on the network connection status information.

[0017] In one implementation, the second processing module can be used to: send a first instruction message to the second network card when the communication link connection status is that the communication link is not disconnected, wherein the first instruction message is used to instruct the second network card to obtain the network connection status information of the first network card through the virtual NTB link.

[0018] In an optional implementation, the second processing module may further be used to: obtain response information returned by the first network card, the response information being the information returned by the second network card after failing to obtain the network connection status information based on the virtual NTB link; and send a second instruction to the second network card, the second instruction being used to authorize the second network card to obtain the network connection status information of the first network card through DMA.

[0019] In one implementation, the second processing module can also be used to: send a second instruction message to the second network card when the communication link connection status is disconnected, wherein the second instruction message is used to authorize the second network card to obtain the network connection status information of the first network card through DMA.

[0020] In one implementation, the first network card is powered by a first power supply link, and the second network card is powered by a second power supply link. The first processing module can be used to: determine that the operating state of the first network card is abnormal when an abnormality is detected in the electrical parameters of the first power supply link.

[0021] In one alternative implementation, the memory module of the first network card is powered by a third power supply link, which is a different power supply link from the first power supply link.

[0022] In one implementation, the virtual NTB link is established based on a non-transparent port of a PCIe switch. The virtual NTB link connects a first communication port in the first network interface card (NIC) and a second communication port in the second NIC. The first and second communication ports are communication ports corresponding to virtual functions partitioned using single-root I / O virtualization technology.

[0023] In one implementation, the first processing module can be used to: determine a virtual NTB link with an abnormal operating status of the first network interface card when the channel transmission quality index value of the first NCSI link is detected to be less than the channel transmission quality index value of the second NCSI link.

[0024] Fourthly, this application proposes a network interface card (NIC) switching device. The NIC includes a first NIC and a second NIC, which are connected to the same PCIe switch via a virtual non-transparent bridge (NTB) link within the PCIe switch. The first NIC's first NCSI link is controlled by a first isolating switch, and the second NIC's second NCSI link is controlled by a second isolating switch. The method is applied to the second NIC. The device includes: a transceiver module for receiving instruction information sent by a processing device that matches the communication link connection status of the first NIC. The instruction information is sent by the processing device after determining that the first NIC's operating status is abnormal. In the case of the first NIC's abnormal operating status, the processor also controls the first and second isolating switches to deactivate the first NCSI link of the first NIC and activate the second NCSI link of the second NIC as the active NCSI link; a first processing module for obtaining the network connection status information of the first NIC through the virtual NTB link or direct memory access (DMA) according to the instruction information; and a second processing module for taking over communication from the first NIC based on the network connection status information.

[0025] In one implementation, the first processing module can be used to: in response to receiving a first instruction message, obtain network connection status information of the first network card based on the virtual NTB link, wherein the first instruction message is information sent by the processing device when it determines that the communication link with the first network card has not been disconnected.

[0026] In an optional implementation, the transceiver module can also be used to: return response information to the processing device in response to failure to obtain the network connection status information through the virtual NTB link, the response information being used by the processing device to send second instruction information to the second network card, the second instruction information being information sent by the processing device when it determines that the communication link with the first network card is disconnected.

[0027] In one implementation, the first processing module can be used to: in response to receiving a second instruction message, acquire network connection status information of the first network card based on DMA, wherein the second instruction message is information sent by the processing device when it determines that the communication link with the first network card is disconnected.

[0028] In one implementation, the transceiver module can also be used to send a reset command to the first network card.

[0029] In a fifth aspect, this application proposes an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the network interface card switching method as described in the first aspect.

[0030] In a sixth aspect, this application provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the network interface card switching method as described in the second aspect.

[0031] In a seventh aspect, this application provides a storage medium storing instructions that, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect.

[0032] Eighthly, this application provides a storage medium storing instructions that, when executed on an electronic device, cause the electronic device to perform the method described in the second aspect.

[0033] In a ninth aspect, this application proposes a program product comprising at least one of a program and instructions, wherein when the program and instructions are executed by an electronic device, they implement the steps of the method described in the first aspect.

[0034] In a tenth aspect, this application provides a storage medium storing instructions that, when executed on an electronic device, cause the electronic device to perform the method described in the second aspect.

[0035] The network interface card (NIC) switching method, apparatus, device, and storage medium provided in this application allow the processing device to switch the active NCSI link from the first NCSI link corresponding to the first NIC to the second NCSI link corresponding to the second NIC when the first NIC fails. It also sends an instruction to the second NIC, enabling the second NIC to obtain the network connection status information of the first NIC based on the virtual NTB link or DMA between the second and first NICs, and to take over communication from the first NIC based on the network connection status information. This improves the continuity of out-of-band management and communication during NIC switching.

[0036] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0037] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a flowchart illustrating a network card switching method provided in an embodiment of this application; Figure 2 This is a schematic diagram of a hardware topology for a redundant design of an NCSI out-of-band management module provided in an embodiment of this application; Figure 3 This is a schematic diagram of the interaction process for NCSI link switching provided in an embodiment of this application; Figure 4 This is a schematic diagram of a PCIe link hardware topology provided in an embodiment of this application; Figure 5 This is a flowchart illustrating another network card switching method provided in an embodiment of this application; Figure 6 This is a schematic diagram of a network card switching interaction process provided in an embodiment of this application; Figure 7 This is a flowchart illustrating another network card switching method provided in an embodiment of this application; Figure 8 This is a schematic diagram of another network card switching interaction process provided in an embodiment of this application; Figure 9This is a schematic diagram of a power supply redundancy design hardware topology provided in an embodiment of this application; Figure 10 This is a flowchart illustrating another network card switching method provided in an embodiment of this application; Figure 11 This is a schematic diagram of the structure of a network card switching device provided in an embodiment of this application; Figure 12 This is a schematic diagram of another network card switching device provided in an embodiment of this application; Figure 13 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0038] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0039] The network interface card (NIC) switching method and apparatus of this application are described below with reference to the accompanying drawings.

[0040] It should be noted that the network card switching method provided in this application embodiment can be used for switching between a first network card and a second network card. The first network card and the second network card are connected to the same PCIe switch, and the first network card and the second network card are connected through a virtual non-transparent bridge (NTB) link within the PCIe switch. The first NCSI (Network Controller Sideband Interface) link of the first network card is controlled by a first isolating switch, and the second NCSI link of the second network card is controlled by a second isolating switch. For example, the first network card may be a network card that is currently in an active running state, undertaking device network communication tasks and processing data transmission and reception; the second network card may be a network card that is currently in a standby state, only starting up and taking over the device network communication tasks and processing data transmission and reception when the first network card's operating state is abnormal.

[0041] Figure 1 This is a flowchart illustrating a network interface card (NIC) switching method provided in an embodiment of this application. This method can be applied to processing devices. For example... Figure 1 As shown, the method may include, but is not limited to, the following steps: S101: In response to an abnormal operating state of the first network card, control the first isolation switch and the second isolation switch to deactivate the first NCSI link corresponding to the first network card and activate the second NCSI link as the active NCSI link.

[0042] It should be noted that, in the embodiments of this application, the processing device may include at least one of the following: CPU (Central Processing Unit), CPLD (Complex Programmable Logic Device), and BMC (Baseboard Management Controller).

[0043] As an example, taking a processing device including a CPU, CPLD, and BMC as an example, the network card switching method executed by the processing device provided in this application embodiment can be executed collaboratively by the CPU, CPLD, and BMC included in the processing device.

[0044] As an example, please see Figure 2 , Figure 2 This is a schematic diagram of a hardware topology for a redundant design of an NCSI out-of-band management module provided in an embodiment of this application. Figure 2 As shown, the BMC outputs NCSI signals through the MAC (Media Access Control) port to two ISOSwitch (Isolator Switch) chips. The selection of the chips is controlled by the CPLD. The first and second network cards are output by different switch chips. When the BMC detects an abnormal operating state of the first network card, the CPLD first sets the control signal NCSI_BMC_SEL0 to an inactive state, causing the first ISOSwitch to disconnect from NCSIHeader0 (network controller sideband 0 interface); at the same time, it sets NCSI_BMC_SEL1 to an active state, driving the SEL terminal of the second ISOSwitch to switch the NCSI signal of port A to port C. Finally, the NCSI signal of the BMC is transmitted through the link corresponding to the second network card, completing the switching of the active NCSI link from the first NCSI link of the first network card to the NCSI link of the second network card.

[0045] In some embodiments, the processing device (e.g., BMC) may send a heartbeat signal to the first NCSI link corresponding to the first network card. If no response information is received from the first network card after multiple consecutive transmissions (e.g., 3 times), it is determined that the operating status of the first network card is abnormal.

[0046] As an example, please see Figure 3 , Figure 3 This is a schematic diagram of the interaction process for NCSI link switching provided in an embodiment of this application. Figure 3As shown, the BMC can send heartbeat signals to the NCSI link where the first network card is located in real time. When there is no response for three consecutive times, it determines that the first network card is in an abnormal operating state, switches the active NCSI link from the first NCSI link corresponding to the first network card to the second NCSI link corresponding to the second network card, and alerts the network card management service that the first network card management is lost.

[0047] S102: Based on the communication link connection status between the processing device and the first network card, send instruction information matching the communication link connection status to the second network card. The instruction information is used to instruct the second network card to obtain the network connection status information of the first network card based on the virtual NTB link or direct memory access DMA, so that the second network card can take over the communication from the first network card based on the network connection status information.

[0048] In the embodiments of this application, the aforementioned network connection status information includes at least one of the following: TCP sequence number, RDMA (Remote Direct Memory Access) queue pair context, TLS (Transport Layer Security) session key, and OVS (Open vSwitch) flow table rules.

[0049] As an example, when the physical layer index of the communication link of the first network card is greater than or equal to a preset index threshold, the processing device (e.g., CPLD) sends corresponding instruction information to the second network card to instruct the second network card to obtain the network connection status information in the memory of the main network card through the virtual NTB link between the second and the first network card. Thus, the second network card can load and use the network connection status information of the first network card and take over the communication from the first network card.

[0050] As another example, when the physical layer index of the communication link of the first network card is less than a preset index threshold, the processing device (e.g., CPLD) sends corresponding instruction information to the second network card so that the second network card can directly read the network connection status information in the memory of the first network card through DMA memory read. Thus, the second network card can load and use the network connection status information of the first network card and take over the communication from the first network card.

[0051] In one implementation, the virtual NTB link is established based on the non-transparent port of the PCIe switch. The virtual NTB link connects the first communication port in the first network interface card and the second communication port in the second network interface card. The first and second communication ports are communication ports corresponding to virtual functions partitioned using single-root I / O virtualization technology.

[0052] For example, please see Figure 4 , Figure 4 This is a schematic diagram of a PCIe link hardware topology provided in an embodiment of this application. For example... Figure 4 As shown, the PCIe signal is issued by the CPU and transmitted to the first network card and the second network card via the PCIe Switch. The PCIe Switch integrates a virtual NTB function to establish a virtual NTB link between the first network card and the second network card, which serves as a bridge connecting the two independent smart network cards for address mapping and information transmission.

[0053] It should be noted that in some embodiments of this application, S101 and S102 can be performed in an interchangeable order or individually.

[0054] By implementing the embodiments of this application, the processing device can control a first disconnect switch and a second disconnect switch when the first network interface card (NIC) fails, switching the active NCSI link from the first NCSI link corresponding to the first NIC to the second NCSI link corresponding to the second NIC. Based on the communication link connection status between the processing device and the first NIC, the processing device sends corresponding indication information to the second NIC, enabling the second NIC to obtain the network connection status information of the first NIC based on the virtual NTB link or DMA between them. This allows the second NIC to take over communication from the first NIC based on the network connection status information. This improves the continuity of out-of-band management and communication during NIC switching.

[0055] In some embodiments, the processing device can send a first instruction message to the first network interface card (NIC) when it is able to communicate with the NIC even if the NIC fails. As an example, please refer to [link to example]. Figure 5 , Figure 5 This is a flowchart illustrating another network interface card (NIC) switching method provided in an embodiment of this application. This method can be applied to processing devices. For example... Figure 5 As shown, the method may include, but is not limited to, the following steps: S501: In response to an abnormal operating state of the first network card, control the first isolation switch and the second isolation switch to deactivate the first NCSI link corresponding to the first network card and activate the second NCSI link as the active NCSI link.

[0056] In the embodiments of this application, step S501 can be implemented in any of the embodiments of this application. The embodiments of this application do not limit this and will not be described in detail.

[0057] S502: When the communication link connection status with the first network card is not disconnected, send a first instruction message to the second network card. The first instruction message is used to instruct the second network card to obtain the network connection status information of the first network card through the virtual NTB link.

[0058] As an example, please see Figure 6 , Figure 6 This is a schematic diagram of a network card switching interaction process provided in an embodiment of this application. Figure 6 As shown, when the CPU detects an abnormal operating status of the first network card, but the communication link between the CPU and the first network card is not disconnected, the training process of the second network card is triggered. After the second network card is successfully trained, the second network card requests network connection status information from the first network card through the virtual NTB link between the second network card and the first network card. The first network card will return the network connection status information to the second network card, so that the second network card can take over the PCIe link and resume transmission based on the network connection status information.

[0059] In an optional implementation, the above method may further include the following steps: obtaining response information returned by the first network card, the response information being the information returned by the second network card after failing to obtain network connection status information based on the virtual NTB link; sending a second instruction to the second network card, the second instruction being used to authorize the second network card to obtain the network connection status information of the first network card through DMA.

[0060] For example, after the second network card fails to obtain the connection status information of the first network card through the virtual NTB link between the second and first network cards, it can return response information to the processing device. Thus, after receiving the response information returned by the first network card, the processing device can send a second instruction to the second network card to authorize the second network card to obtain the network connection status information of the first network card through DMA.

[0061] In some embodiments, the processing device may obtain memory control permissions for the first network card before sending the second instruction information to the second network card.

[0062] For example, a processing device (e.g., a CPLD) can read and write the memory registers of the first network card via I2C (Inter-Integrated Circuit) to take over control of the memory of the first network card.

[0063] By implementing the embodiments of this application, the processing device can send a first indication message to the second network card when the communication link with the first network card is not disconnected. This enables the second network card to obtain the network connection status information of the first network card based on the virtual NTB link between the second and first network cards, and to take over communication from the first network card based on the network connection status information. This allows the second network card to quickly obtain network connection status information via the NTB link even when a network card malfunctions but communication is still possible, improving network card switching efficiency and ensuring communication continuity during network card switching. In some embodiments, if the first network interface card (NIC) loses communication with the processing device after a failure, a second instruction message can be sent to the second NIC to enable the second NIC to obtain the network connection status information of the first NIC via DMA. As an example, please refer to [link to example]. Figure 7 , Figure 7 This is a flowchart illustrating another network interface card (NIC) switching method provided in an embodiment of this application. This method can be applied to processing devices. For example... Figure 7 As shown, the method may include, but is not limited to, the following steps: S701: In response to an abnormal operating state of the first network interface card (NIC), control the first isolation switch and the second isolation switch to deactivate the first NCSI link corresponding to the first NIC and activate the second NCSI link as the active NCSI link.

[0064] In the embodiments of this application, step S701 can be implemented in any of the embodiments of this application. The embodiments of this application do not limit this and will not be described in detail.

[0065] S702: When the communication link connection with the first network card is disconnected, send a second instruction message to the second network card. The second instruction message is used to authorize the second network card to obtain the network connection status information of the first network card through DMA.

[0066] As an example, please see Figure 8 , Figure 8 This is a schematic diagram of another network card switching interaction process provided in an embodiment of this application. For example... Figure 8 As shown, when the first network card is physically damaged or the communication link with the processing device (e.g., CPU) is completely disconnected, the first network card cannot synchronize the network connection status information to the second network card through NTB. In this case, the first network card can be switched to slave mode and authorized to perform DMA access to the second network card. Thus, the second network card can read the network connection status information in the memory of the first network card through DMA and take over the communication based on the network connection status information.

[0067] By implementing the embodiments of this application, when the first network card disconnects from the processing device, a second instruction message can be sent to the second network card to authorize the second network card to read the network connection status information in the memory of the first network card via DMA, so as to take over communication from the first network card based on the network connection status information. This can improve the communication recovery capability when the first network card fails and ensure the continuity of communication.

[0068] In some embodiments, the first network interface card (NIC) is powered by a first power supply link, and the second NIC is powered by a second power supply link. The method further includes: determining that the operating state of the first NIC is abnormal when an abnormality is detected in the electrical parameters of the first power supply link.

[0069] In the embodiments of this application, the above power supply parameters include at least one of the following: power supply voltage, operating current, ripple voltage, noise voltage, and overvoltage or undervoltage trigger state.

[0070] As an example, taking the operating current as an electrical parameter, when the processing device detects that the operating current of the first power supply link of the first network card is greater than the preset current threshold, it determines that the operating status of the first network card is abnormal.

[0071] In one alternative implementation, the memory module of the first network card is powered by a third power supply link, which is different from the first power supply link.

[0072] For example, a dedicated power supply link can be configured for the memory module of the first network card, thereby maintaining the integrity of the data in the memory of the first network card after physical damage occurs, and further improving the communication status recovery capability. In some embodiments, the method further includes: in response to receiving an interruption message from the second network card, cutting off the power supply to the first power supply link.

[0073] For example, after the second network card takes over communication from the first network card, it can return terminal information to the processing device. After receiving the terminal information, the processing device can cut off the power supply to the first power supply link to avoid the abnormality of the first network card from affecting the motherboard or the second network card.

[0074] As an example, please see Figure 9 , Figure 9 This is a schematic diagram of a power supply redundancy design hardware topology provided in an embodiment of this application. For example... Figure 9 As shown, the first and second network cards are powered independently. The CPLD controls the on / off state of the efuse. When the first network card malfunctions or the current is too high, the BMC will notify the CPLD through GPIO. The CPLD will cut off the power supply to the efuse in a very short time and switch to the backup flash.

[0075] In some embodiments, the method further includes: determining that the first network interface card (NIC) is in an abnormal operating state when the channel transmission quality index value of the first NCSI link is detected to be less than that of the channel transmission quality index value of the second NCSI link.

[0076] For example, the processing device (e.g., BMC) can compare the channel transmission quality index values ​​of the first NCSI link and the second NCSI link in real time, and determine that the first network card is in an abnormal operating state if it detects that the channel transmission quality index value of the first NCSI link is less than the channel transmission quality index value of the second NCSI link.

[0077] In the embodiments of this application, the channel transmission quality index values ​​mentioned above include at least one of the following: signal-to-noise ratio and bit error rate.

[0078] The above embodiments of this application describe the network interface card (NIC) switching method provided by this application from the perspective of a processing device. The following will further describe the NIC switching method provided by this application from the perspective of a second NIC.

[0079] As an example, please see Figure 10 , Figure 10 This is a flowchart illustrating another network interface card (NIC) switching method provided in an embodiment of this application. This method can be applied to a second NIC. For example... Figure 10 As shown, the method may include, but is not limited to, the following steps: S1001: Received instruction information from the processing device that matches the communication link connection status of the first network card.

[0080] In the embodiments of this application, the above-mentioned instruction information is information sent by the processing device after determining that the operating status of the first network card is abnormal.

[0081] In one embodiment of this application, when the operating state of the first network card is abnormal, the processor is further configured to control the first isolation switch and the second isolation switch to deactivate the first NCSI link of the first network card and activate the second NCSI link of the second network card as the active NCSI link.

[0082] S1002: Based on the instruction information, obtain the network connection status information of the first network card through the virtual NTB link or DMA.

[0083] As an example, in response to receiving instruction information sent by the processing device, the second network card obtains the network connection status information of the first network card based on the virtual NTB link between the second and first network cards.

[0084] As another example, the second network card, in response to receiving instruction information sent by the processing device, obtains the network connection status information of the first network card through DMA.

[0085] In one implementation, according to instruction information, the network connection status information of the first network card is obtained through a virtual NTB link or direct memory access (DMA), including: in response to receiving the first instruction information, obtaining the network connection status information of the first network card based on the virtual NTB link, wherein the first instruction information is the virtual NTB link of information sent by the processing device when it determines that the communication link with the first network card is not disconnected.

[0086] For example, in response to receiving the first instruction information sent by the processing device, the second network card sends a request information to the first network card based on the non-transparent bridge NTB link between the second and third network cards. The request information is used to enable the first network card to return its own network connection status information to the second network card through the NTB link.

[0087] In an optional implementation, the method further includes: returning response information to the processing device in response to the failure to obtain network connection status information of the first network card based on the virtual NTB link between the first network card and the first network card; and reading the status data of the first network card based on DMA in response to obtaining the second instruction information sent by the processing device, wherein the second instruction information is sent by the processing device after obtaining the response information.

[0088] For example, if the second network interface card (NIC) does not receive network connection status information from the first NIC within a preset time period after sending a request message to the first NIC, it returns a response message to the processing device to inform the processing device that it has not obtained the network connection status information of the first NIC. After receiving the response message, the processing device can return a second instruction message to the second NIC to authorize the second NIC to obtain the network connection status information of the first NIC through DMA. In one implementation, the above-mentioned acquisition of the network connection status information of the first network card through a virtual NTB link or direct memory access DMA based on the instruction information includes: in response to receiving the second instruction information, acquiring the network connection status information of the first network card based on DMA, wherein the second instruction information is information sent by the processing device when it determines that the communication link with the first network card is disconnected.

[0089] For example, in response to receiving a second instruction message sent by the processing device, the second network card obtains the network connection status information of the first network card through DMA. The second instruction message is used to enable the second network card to perform DMA read memory.

[0090] S1003: Takes over communication from the first network card based on network connection status information.

[0091] In some embodiments, the second network interface card (NIC) may also report the handover event to the processing device (e.g., BMC) via the second NCSI link.

[0092] In some embodiments, the second network card can also send a reset command to the first network card when preset conditions are met.

[0093] In the embodiments of this application, the above-mentioned preset conditions include at least one of the following: the second NCSI link is activated, the network connection status information of the first network card has been obtained, and training (link training) is successful.

[0094] By implementing the embodiments of this application, the second network interface card (NIC) can, upon receiving instruction information from the processing device, obtain the network connection status information of the first NIC based on the non-transparent bridge (NTB) link or direct memory access (DMA) between itself and the first NIC, and then take over communication from the first NIC based on the network connection status information. This improves the continuity of communication during NIC switching.

[0095] Please see Figure 11 , Figure 11 This is a schematic diagram of a network card switching device provided in an embodiment of this application. The network cards include a first network card and a second network card, which are connected to the same PCIe switch. The first and second network cards are connected via a virtual non-transparent bridge (NTB) link within the PCIe switch. The first NCSI link of the first network card is controlled by a first isolating switch, and the second NCSI link of the second network card is controlled by a second isolating switch. Figure 11 As shown, the device 1100 can be applied to a processing device. The device 1100 includes: a first processing module 1101, used to control a first isolation switch and a second isolation switch in response to an abnormal operating state of the first network card, used to deactivate the first NCSI link corresponding to the first network card, and activate the second NCSI link as the active NCSI link; and a second processing module 1102, used to send instruction information matching the communication link connection state to the second network card based on the communication link connection state between the processing device and the first network card, the instruction information being used to instruct the second network card to obtain the network connection state information of the first network card based on a virtual NTB link or direct memory access DMA, so that the second network card can take over communication from the first network card based on the network connection state information.

[0096] In one implementation, the second processing module 1102 can be used to: send a first instruction message to the second network card when the communication link connection status is that the communication link is not disconnected. The first instruction message is used to instruct the second network card to obtain the network connection status information of the first network card through the virtual NTB link.

[0097] In an optional implementation, the second processing module 1102 may also be used to: obtain the response information returned by the first network card, the response information being the information returned by the second network card after failing to obtain network connection status information based on the virtual NTB link; and send a second instruction to the second network card, the second instruction being used to authorize the second network card to obtain the network connection status information of the first network card through DMA.

[0098] In one implementation, the second processing module 1102 can also be used to: send a second instruction message to the second network card when the communication link connection status is disconnected, the second instruction message being used to authorize the second network card to obtain the network connection status information of the first network card through DMA.

[0099] In one implementation, the first network card is powered by a first power supply link, and the second network card is powered by a second power supply link. The first processing module 1101 can be used to: determine that the operating state of the first network card is abnormal when an abnormality is detected in the electrical parameters of the first power supply link.

[0100] In one alternative implementation, the memory module of the first network card is powered by a third power supply link, which is a different power supply link from the first power supply link.

[0101] In one implementation, the virtual NTB link is established based on the non-transparent port of the PCIe switch. The virtual NTB link connects the first communication port in the first network card and the second communication port in the second network card. The first and second communication ports are communication ports corresponding to virtual functions partitioned using single root I / O virtualization technology.

[0102] In one implementation, the first processing module 1101 can be used to: determine that the operating status of the first network card is abnormal when the channel transmission quality index value of the first NCSI link is detected to be less than that of the channel transmission quality index value of the second NCSI link.

[0103] Please see Figure 12 , Figure 12 This is a schematic diagram of another network card switching device provided in an embodiment of this application. The network cards include a first network card and a second network card. The first and second network cards are connected to the same PCIe switch, and are connected via a virtual non-transparent bridge (NTB) link within the PCIe switch. The first NCSI link of the first network card is controlled by a first isolating switch, and the second NCSI link of the second network card is controlled by a second isolating switch. Figure 12 As shown, the device 1200 can be applied to a second network interface card (NIC). The device 1200 includes: a transceiver module 1201, used to receive instruction information sent by a processing device that matches the communication link connection status of the first NIC. The instruction information is sent by the processing device after determining that the operating status of the first NIC is abnormal. In the case of abnormal operating status of the first NIC, the processor also controls a first isolation switch and a second isolation switch to deactivate the first NCSI link of the first NIC and activate the second NCSI link of the second NIC as the active NCSI link; a first processing module 1202, used to obtain the network connection status information of the first NIC through a virtual NTB link or direct memory access (DMA) according to the instruction information; and a second processing module 1203, used to take over communication from the first NIC based on the network connection status information.

[0104] In one implementation, the first processing module 1202 can be used to: in response to receiving a first instruction information, obtain network connection status information of the first network card based on the virtual NTB link, wherein the first instruction information is information sent by the processing device when it determines that the communication link with the first network card has not been disconnected.

[0105] In an alternative implementation, the transceiver module 1201 can also be used to: return response information to the processing device in response to failure to obtain network connection status information through the virtual NTB link. The response information is used by the processing device to send second instruction information to the second network card. The second instruction information is information sent by the processing device when it determines that the communication link with the first network card is disconnected.

[0106] In one implementation, the first processing module 1202 can be used to: in response to receiving the second instruction information, obtain the network connection status information of the first network card based on DMA, wherein the second instruction information is information sent by the processing device when it determines that the communication link with the first network card is disconnected.

[0107] In one implementation, the transceiver module 1201 can also be used to: send a reset command to the first network card via a virtual NTB link.

[0108] With the apparatus of this application embodiment, the second network interface card (NIC) can, upon receiving instruction information from the processing device, obtain the network connection status information of the first NIC based on the non-transparent bridge (NTB) link or direct memory access (DMA) between itself and the first NIC, and then take over communication from the first NIC based on the network connection status information. This improves the continuity of communication during NIC switching.

[0109] It should be noted that the foregoing explanation of the network card switching method embodiment also applies to the network card switching device of this embodiment, and will not be repeated here.

[0110] To implement the above embodiments, this application also proposes an electronic device. Please see [link to relevant documentation]. Figure 13 , Figure 13 This is a schematic diagram of the structure of the electronic device provided in an embodiment of this application. For example... Figure 13 As shown, the electronic device 1300 includes: a processor 1301 and a memory 1302 communicatively connected to the processor 1301; the memory 1302 stores computer execution instructions; the processor 1301 executes the computer execution instructions stored in the memory to implement the method provided in the foregoing embodiments.

[0111] To implement the above embodiments, this application also proposes a storage medium storing instructions that, when executed on an electronic device, cause the electronic device to perform the methods provided in the foregoing embodiments.

[0112] To implement the above embodiments, this application also proposes a program product, including at least one of a program and instructions, wherein when the program and instructions are executed by an electronic device, they implement the steps of the method provided in the foregoing embodiments.

[0113] It should be noted that the acquisition, transmission, storage, use, and processing of data in this application comply with the relevant provisions of national laws and regulations and do not violate public order and good morals.

[0114] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0115] It is worth noting that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, they do not mean that the applicant has used or necessarily used the solution.

[0116] In the description of this application, unless otherwise stated, " / " means "or", for example, A / B can mean A or B; "and / or" in this document is merely a description of the relationship between related objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone.

[0117] In the foregoing descriptions of the embodiments, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0118] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0119] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0120] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0121] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0122] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0123] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0124] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.

Claims

1. A method for switching network interface cards (NICs), characterized in that, The network interface card (NIC) includes a first NIC and a second NIC. The first NIC and the second NIC are connected to the same PCIe switch, and are connected via a virtual non-transparent bridge (NTB) link within the PCIe switch. The first NIC's first NCSI link is controlled by a first isolating switch, and the second NIC's second NCSI link is controlled by a second isolating switch. The method is applied to a processing device, and the method includes: In response to an abnormal operating state of the first network interface card (NIC), the first isolation switch and the second isolation switch are controlled to deactivate the first NCSI link corresponding to the first NIC and activate the second NCSI link as the active NCSI link. Based on the communication link connection status between the processing device and the first network card, the device sends instruction information matching the communication link connection status to the second network card. The instruction information is used to instruct the second network card to obtain the network connection status information of the first network card based on the virtual NTB link or direct memory access DMA, so that the second network card can take over the communication from the first network card based on the network connection status information. The step of sending instruction information matching the communication link connection status to the second network card based on the communication link connection status between the processing device and the first network card includes: When the communication link connection status is that the communication link is not disconnected, a first instruction message is sent to the second network card. The first instruction message is used to instruct the second network card to obtain the network connection status information of the first network card through the virtual NTB link.

2. The method according to claim 1, characterized in that, After sending the first instruction information to the second network card, the method further includes: The response information returned by the first network card is obtained. The response information is the information returned by the second network card after it fails to obtain the network connection status information based on the virtual NTB link. Send a second instruction message to the second network card. The second instruction message is used to authorize the second network card to obtain the network connection status information of the first network card through DMA.

3. The method according to claim 1, characterized in that, The step of sending instruction information matching the communication link connection status to the second network card based on the communication link connection status between the processing device and the first network card includes: When the communication link connection status is disconnected, a second instruction message is sent to the second network card. The second instruction message is used to authorize the second network card to obtain the network connection status information of the first network card through DMA.

4. The method according to claim 1, characterized in that, The first network interface card (NIC) is powered by a first power supply link, and the second NIC is powered by a second power supply link. The method further includes: If an abnormality is detected in the electrical parameters of the first power supply link, it is determined that the operating status of the first network card is abnormal.

5. The method according to claim 4, characterized in that, The memory module of the first network card is powered by a third power supply link, which is a different power supply link from the first power supply link.

6. The method according to claim 1, characterized in that, The virtual NTB link is established based on the non-transparent port of the PCIe switch. The virtual NTB link connects the first communication port in the first network card and the second communication port in the second network card. The first communication port and the second communication port are communication ports corresponding to virtual functions divided using single root I / O virtualization technology.

7. The method according to claim 1, characterized in that, The method further includes: If the channel transmission quality index value of the first NCSI link is detected to be lower than that of the channel transmission quality index value of the second NCSI link, it is determined that the operating status of the first network card is abnormal.

8. A method for switching network interface cards (NICs), wherein the NICs include a first NIC and a second NIC, the first NIC and the second NIC are connected to the same PCIe switch, and the first NIC and the second NIC are connected via a virtual non-transparent bridge (NTB) link within the PCIe switch, a first NCSI link of the first NIC is controlled by a first isolating switch, and a second NCSI link of the second NIC is controlled by a second isolating switch, the method being applied to the second NIC, the method comprising: The processing device receives an instruction message that matches the communication link connection status of the first network card. The instruction message is sent by the processing device after determining that the operating status of the first network card is abnormal. In the case of abnormal operating status of the first network card, the processing device also controls the first isolation switch and the second isolation switch to deactivate the first NCSI link of the first network card and activate the second NCSI link of the second network card as the active NCSI link. According to the instruction information, the network connection status information of the first network card is obtained through the virtual NTB link or direct memory access DMA; Based on the network connection status information, it takes over communication from the first network card; The received instruction information from the processing device that matches the communication link connection status of the first network card includes: The processing device receives a first instruction message sent by the processing device when the communication link connection status is that the communication link is not disconnected. The first instruction message is used to instruct the second network card to obtain the network connection status information of the first network card through the virtual NTB link.

9. An electronic device, characterized in that, include: A processing device, and a memory communicatively connected to the processing device; The memory stores computer-executed instructions; The processing device executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 7 and 8.

Citation Information

Patent Citations

  • Circuit supporting automatic switching of NCSI signal management function and server

    CN108259246A

  • Network card power-on method and system, storage medium and equipment

    CN113645049A