Method, device and storage medium for port failover
By using the link information of the backup port for rapid switching when the primary port in the DPU device fails, the problem of data transmission interruption caused by port failure in the DPU device is solved, and the continuous availability of the data link and the continuity of business data are achieved.
Patent Information
- Application Number
- CN202410592929.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2043-12-29
AI Technical Summary
In a DPU device, when the primary port is located in multiple port binding groups on different DPUs, if the primary port fails, the backup port lacks link information, resulting in data transmission interruption. The existing technology requires a long time to reselect the link, affecting the continuity of data transmission.
By using the link information stored in the DPU to which the backup port belongs to perform rapid switching when the primary port fails, the continuous availability of the data link is ensured, including storing the link information of the primary port in the DPU to which the backup port belongs, and activating the backup port to continue communication when the primary port fails.
It achieves rapid recovery of data links in the event of port failure, ensures the continuity of business data transmission, avoids long-term interruptions, and improves network reliability.
Smart Images

Figure CN120238425B_ABST
Abstract
Description
[0001] This application is a divisional application, the original application number is 202311868251.7, the original application date is December 29, 2023, and the entire contents of the original application are incorporated herein by reference. TECHNICAL FIELD
[0002] The present disclosure relates to the field of computer technology, in particular to a port failure switching method, device and storage medium. BACKGROUND
[0003] Bonding technology is to establish multiple physical connections between a server and a switch (i.e., to connect multiple ports of the server to multiple ports of the switch one by one), and to cooperate with multiple optional working modes to achieve the purposes of expanding bandwidth through simultaneous multi-link transmission or improving network reliability through port failure switching.
[0004] In addition, data processing units (DPU) are widely used, and many DPUs can support transmission control protocol (TCP) offload engine (TOE) technology. The TOE technology transfers the protocol stack of the network layer and the transport layer to the DPU, which can effectively reduce the occupation of the central processing unit (CPU) and better liberate the processing resources of the CPU.
[0005] However, in a device using such a DPU, when multiple ports bound to each other are located on different DPUs, since the protocol stack of the network layer and the transport layer is on the DPU, when the master port establishes a data link with a peer device, the link information is maintained by the DPU to which the master port belongs. When the master port fails, the DPU to which the backup port belongs does not have corresponding link information, resulting in interruption of data transmission. SUMMARY
[0006] The present disclosure provides a port failure switching method, device and storage medium, which can ensure the continuous availability of data links and the continuity of data transmission in the case of port failure.
[0007] In a first aspect, a method for port failover is provided, which is applied to a first device including a first DPU and a second DPU, the first DPU including a first port and the second DPU including a second port. The method can include: the first DPU communicating with a second device through a data link using the first port, and then the first DPU notifying the second DPU of link information of the first port for storage, the first port and the second port belonging to a same port bonding group, the first port being a master port of the port bonding group and being in an active state, the second port being a backup port of the port bonding group and being in a silent state, and further, when the first port of the first DPU fails, the second DPU setting the second port to the active state and continuing to communicate with the second device through the data link using the second port based on the link information.
[0008] In the embodiments of the present disclosure, the first device establishes a data link with the second device through a master port (the first port) in a port bonding group for communication. Meanwhile, the first DPU to which the master port belongs notifies the second DPU to which the backup port (the second port) belongs of link information of the data link for storage. In this way, the DPU corresponding to the master port and the backup port in the port bonding group can maintain the link information of the data link at the same time. When the master port fails, the backup port can be activated, and the link information stored in the second DPU is configured to the backup port for use. In this way, the first device can continue to communicate with the second device through the data link using the backup port. In this way, the continuous availability of the data link can be ensured in the case of port failure. Moreover, because the link information has been stored in the second DPU, the process of configuring the link information to the backup port by the second DPU can be completed in a very short time. As long as the configuration is completed, the transmission of service data of the data link can be continued, and the continuity of the transmission of service data can be better ensured. In comparison, in the case of port failure, if a method for maintaining the data link cannot be provided, a data link needs to be reselected for corresponding transmission of service data. However, reselecting the data link needs a series of complex calculation and configuration processes, which takes a long time, and this can cause a long interruption of the transmission of service data.
[0009] In a possible implementation, the first device further includes a CPU, the CPU communicating with the first DPU and the second DPU through a computer bus. The process of notifying the link information can include: first, the first DPU sending the link information of the first port to the CPU, then the CPU storing the link information in a memory, and then the second DPU sending a read request to the CPU, and finally the CPU reading the link information in the memory and sending the link information to the second DPU for storage.
[0010] In this way, the second DPU can directly obtain the link information from the DPU memory of the second DPU, and configure the second port, thereby increasing the efficiency of activating the second port.
[0011] In a possible implementation, before the second DPU sends the read request to the CPU, the first DPU can send an indication message for reading the link information to the second DPU, where the indication message is a DOORBELL message.
[0012] The DOORBELL message is a message for direct communication between different expansion cards on the motherboard.
[0013] In this way, the indication message for reading the link information does not need to pass through the CPU, and has strong flexibility.
[0014] In a possible implementation, before the first DPU notifies the second DPU where the second port is located of the link information of the first port for storage, the CPU negotiates with the second device and establishes a data link, and the corresponding process flow is as follows: first, the CPU negotiates with the second device to obtain configuration information of the port binding group, the configuration information including first sub-information and second sub-information, the first sub-information being used to indicate that the first port is the master port of the port binding group, and the second sub-information being used to indicate that the second port is the standby port of the port binding group. Then, the CPU sends the first sub-information to the first DPU, and sends the second sub-information to the second DPU. Then, the first DPU sets the first port to an active state, establishes a data link between the first port and the second device, and generates the link information of the first port. Finally, the second DPU sets the second port to a silent state.
[0015] In this way, by determining the master port through negotiation, only the master port needs to perform the link establishment process and generate the link information for subsequent distribution, so that resource waste can be reduced.
[0016] In a possible implementation, the link information includes an Internet Protocol (IP) address, a Media Access Control (MAC) address of the first device, and an IP address and a MAC address of the second device. The link information can further include routing related information and service related information of a network layer and a transport layer.
[0017] In a possible implementation, when the port binding group includes a plurality of standby ports, the first DPU can notify the DPU where other standby ports except the second port are located of the link information of the first port for storage.
[0018] In this way, the link information is notified to the DPU where all the standby ports are located, so that more standby ports can be selected for switching when the first port fails, thereby improving network reliability, and if the port after switching also fails subsequently, other standby ports can be selected for continuous switching, so that the network reliability can also be well ensured.
[0019] In a possible implementation, the CPU can select the second port as the port to be activated from the multiple backup ports, and notify the second DPU of the second port.
[0020] In this way, because the ports of the port binding group are on different DPUs, the CPU can obtain the configuration information of the port binding group more conveniently relative to the DPU, and the DPU needs to perform inter-card data interaction to obtain the complete configuration information, so that the port selection by the CPU can improve the efficiency of port switching.
[0021] In a possible implementation, when the port binding group includes multiple master ports, the first DPU notifies the DPU where the other master ports are located of the link information of the first port, to configure the link information to the other master ports.
[0022] In this way, only one master port needs to perform the processing of establishing a link and generating link information, and then distribute the link information, which can reduce resource waste.
[0023] In a possible implementation, when the CPU receives the failure message of the first port sent by the first DPU, the CPU sends an activation notification of the second port to the second DPU, and then the second DPU sets the second port to an activated state and configures the stored link information to the second port.
[0024] The detection manner of the DPU for port failure can be directly detecting the level change of a specified pin, or can be detecting through a communication message.
[0025] In this way, the DPU detects the port failure more quickly, and the CPU implements the notification to the second DPU, so that the data transmission service can be switched to the second port in a short time.
[0026] In a possible implementation, when the first DPU fails, the CPU of the first device sends an activation notification of the second port to the second DPU, and then the second DPU sets the second port to an activated state and configures the stored link information to the second port.
[0027] In this way, when the first port is disabled due to the failure of the first DPU, the first device can continue to use the data link to communicate with the second device through the second port.
[0028] In a possible implementation, the first device includes a first DPU and a second DPU, and the first DPU and the second DPU are configured to implement the method provided in the first aspect and the possible implementation manners thereof.
[0029] In a third aspect, a computer-readable storage medium is provided, which stores computer program codes. When the computer program codes are executed by a computer device, the computer device performs the method provided by the first aspect and possible implementation manners thereof.
[0030] In a fourth aspect, a computer program product is provided, which includes computer program codes. When the computer program codes are executed by a computer device, the computer device performs the method provided by the first aspect and possible implementation manners thereof. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 is a structural schematic diagram of a computer device provided by an embodiment of the present disclosure;
[0032] Figure 2 is a method flow schematic diagram of port failure switching provided by an embodiment of the present disclosure;
[0033] Figure 3 is a method flow schematic diagram of establishing a data link provided by an embodiment of the present disclosure;
[0034] Figure 4 is a method flow schematic diagram of notifying link information provided by an embodiment of the present disclosure;
[0035] Figure 5 is a method flow schematic diagram of configuration before port failure provided by an embodiment of the present disclosure in combination with an application scenario;
[0036] Figure 6 is a method flow schematic diagram of port failure switching provided by an embodiment of the present disclosure in combination with an application scenario;
[0037] Figure 7 is a method flow schematic diagram of port failure switching provided by an embodiment of the present disclosure in combination with an application scenario;
[0038] Figure 8 is a method flow schematic diagram of link information distribution provided by an embodiment of the present disclosure in combination with an application scenario;
[0039] Figure 9 is a structural schematic diagram of a first device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0040] First, some terms related to the embodiments of the present disclosure are explained.
[0041] DPU
[0042] The DPU can share some complex processing work of the CPU, including network, virtualization, storage, security and other related work. In the embodiments of the present disclosure, the DPU is mainly responsible for network work and exists in the computer device as a network card. The DPU can be connected with the mainboard through the expansion slot such as the peripheral component interconnect express (PCIE) slot, and then realize the communication between the DPU and the CPU. The DPU card can be configured with exclusive memory, which can be referred to as DPU memory.
[0043] In the embodiments of the present disclosure, the DPU can support the offloading of stateful services, for example, support direct TCP offload engine (DTOE) technology, TOE technology, DTOE technology and TOE technology are to unload (or migrate) the protocol stack of network layer and transport layer from the operating system kernel to the DPU, so that the DPU can share a large amount of network packet processing work of the CPU, and help the CPU release a large amount of processing resources. The DPU can also support remote direct memory access (RDMA) technology, and RDMA over converged ethernet (ROCE) technology extended on the basis of the technology, and the cooperation of the two technologies can realize the direct access of devices to the memory through the Ethernet.
[0044] bonding unit
[0045] The bonding unit can also be referred to as a kernel bonding unit, and has a bonding component (which can be considered as a set of execution code) in the operating system kernel. Running the bonding component can create the bonding unit, and the bonding unit is used to execute the related processing of the bonding technology. In the bonding technology, multiple physical connections are established between two devices, that is, for one of the devices, there are multiple ports connected with another device, and through these connections, the bandwidth and network reliability between the devices can be improved.
[0046] Port bonding group
[0047] In the bonding technology, multiple ports of a device connected with the same peer device can be configured as a port binding group. The multiple ports in the port binding group can belong to different network cards of the device, or belong to the same network card of the device. Embodiments of the present disclosure are described in the case where the multiple ports belong to different network cards, and other cases are not described herein. The multiple ports in a port binding group correspond to a data link, and the data link generally refers to a logical link, that is, the device uses the data link to communicate with the peer device through any port in the multiple ports.
[0048] Through the bonding negotiation process between the device and the peer device, the primary port and the backup port can be determined in the multiple ports included in the port binding group. The device can use the primary port to communicate with the peer device through the data link, and when the primary port fails, the backup port can be used to continue to communicate with the peer device through the data link.
[0049] Configuration information of the port binding group
[0050] The configuration information can be used to record the port identifier of the primary port of the port binding group and the port identifier of the backup port of the port binding group.
[0051] Active state / silence state
[0052] In the port binding group, the currently used port is set to the active state, and the currently unused port is set to the silence state. For example, after the bonding negotiation process, the primary port can be set to the active state, and the backup port can be set to the silence state.
[0053] Link information
[0054] The link information includes basic information required for the device to perform Ethernet data transmission. The link information can include connection-related information, routing-related information, and service-related information. The connection-related information can include the internet protocol (IP) address and the media access control (MAC) address of the devices at both ends of the data link. The routing-related information can include a routing table, a label forwarding table, and other related information for message forwarding. The service-related information includes information about related services at the network layer and the transport layer, for example, information about an RDMA service in execution, which can specifically include a memory address for data reading and a destination device address for sending the read data. When the above information changes, the link information is updated.
[0055] The link information can be queue pair context (QPC) information.
[0056] Doorbell (DOORBELL) message
[0057] Messages that communicate directly between different expansion cards on the motherboard do not need to be transmitted through the CPU, have strong flexibility, and generally do not carry a large amount of data.
[0058] The present disclosure provides a method for port failover. This method can be applied to any computer device with network communication capabilities, such as a server, switch, or terminal. The computer device can be configured with multiple DPUs that support technologies such as TOE (or DTOE), ROCE, etc. The computer device is connected to a peer device via multiple ports. The server can be a database system server, a network service server, a cloud computing server, etc.
[0059] From a software perspective, the computer device may be installed with an operating system and a link management application. The operating system may have a bonding component (a set of executable code in the operating system that can establish a bonding unit when executed). The link management application can be a standalone application or a functional component attached to other applications. For example, it can be a functional component attached to a network card driver, which can establish a link management unit when running the link management application. In the embodiments of the present disclosure, the port fault switching method can be implemented by the link management unit and the bonding unit in combination, or the functions of the link management unit and the bonding unit can be integrated into a single execution unit to implement the method.
[0060] From the hardware point of view, Figure 1 As shown, the computer device may include a processor 110, a memory 120, and multiple DPUs 130. In the embodiment of the present disclosure, the port failover method can be implemented by the processor 110 in conjunction with the memory 120 and the DPU 130. These components are described in detail below:
[0061] Processor 110 may include any one or more processors such as a CPU, a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP). The processor may be used to negotiate with a peer device to obtain configuration information, obtain and send link information, receive and process fault messages sent by a DPU, and so on. The embodiments of this disclosure use a CPU as an example to provide a detailed description of the solution.
[0062] The memory 120 can include volatile memory, such as random access memory (RAM) for example. The memory can also include non-volatile memory, such as read-only memory (ROM), Flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), for example. The memory used by embodiments of the present disclosure can be a Double Data Rate Synchronous Dynamic RAM (DDR SDRAM) in RAM, which can also be referred to as DDR. The DDR can be used to store pre-stored data, intermediate data and result data related to a processing procedure, such as link information and the like.
[0063] The DPU 130 can be a network card used to implement communication between the computer device where the DPU is located and other devices or communication networks, and the DPU can also communicate with the processor through the bus. The DPU can also detect whether it is working normally through certain signals, and when a port failure of the network card is detected, a port failure message is notified to the CPU. And the like. The DPU can include a measurement processing unit (MPU) and a neural network processing unit (NPU), the MPU is responsible for related processing of the control plane, and the NPU is responsible for related processing of the data plane.
[0064] Embodiments of the present disclosure provide a port failure switching method, which is applied to a first device, and the first device has at least a first port and a second port, and the first port and the second port are both connected with a second device, that is, the first device and the second device have at least two physical connections. The ports connected with the second device are configured as a port binding group. The ports connected with the second device can respectively belong to different DPUs, or part or all of the ports can belong to the same DPU, and in embodiments of the present disclosure, the case that the ports respectively belong to different DPUs is taken as an example, and the scheme is described in detail, and other cases are not described again.
[0065] The processing flow of the port failure switching method provided by embodiments of the present disclosure can be as shown in Figure 2 The processing flow of the port failure switching method provided by embodiments of the present disclosure can be as shown in
[0066] 201, the first DPU uses the first port to communicate with the second device through a data link.
[0067] The first port is a master port of the port binding group and belongs to the first DPU.
[0068] After the first device is powered on, a bonding negotiation process is performed to determine the master port and the backup port in the port binding group. Then the master port (i.e., the first port) is set to an active state, the backup port is set to a silent state, a data link is established with the second device through the master port to generate link information, and the link information is configured to the first port. The related process is described in detail below.
[0069] At this time, the first device has configured the link information to the first port, and the first device can use the first port to communicate with the second device through the data link.
[0070] 202, the first DPU notifies the second DPU of the link information of the first port for storage.
[0071] The second port is a backup port of the port binding group and belongs to the second DPU. The link information is used for the first device to communicate with the second device through the data link using the first port.
[0072] There are many possible ways to notify, and the following describes several possible ways: way one, sending the link information of the first port of the first DPU to the second DPU through the CPU; way two, sending the link information of the first port of the first DPU to the second DPU through other components (such as some other chips) other than the CPU; way three, the first DPU directly sends the link information of the first port to the second DPU. This way will be further described in detail below.
[0073] After receiving the link information, the second DPU can store the link information in the DPU memory of the DPU, so that when the second port is in an active state, the link information can be quickly obtained.
[0074] Subsequently, after each link data update, the first DPU can use the same processing method to notify the second DPU of the updated link information.
[0075] 203, when it is determined that the first port of the first DPU is invalid, the second DPU sets the second port to an active state and configures the stored link information to the second port, and continues to communicate with the second device through the second port using the above data link based on the link information.
[0076] After the CPU determines that the first port is failed, the CPU sends a notification to the second DPU to set the second port to an active state. After the second DPU receives the notification, the second DPU sets the second port to the active state and configures the link information previously stored in the DPU memory of the second DPU to the second port. Specifically, the second DPU can modify the port identifier of the first port in some information included in the link information to the port identifier of the second port, including: for the routing table item including the port identifier of the first port, the port identifier of the first port is changed to the port identifier of the second port. At this time, the first device continues to communicate with the second device through the above-mentioned data link using the second port. The second port and the first port use the same link information, that is, they use the same data link, that is, although the port is switched, the data link is continuously available. In this way, the service data transmission can have good continuity during the port switching process.
[0077] When the first port is failed, if the first port is performing service data transmission (network layer, transport layer service, such as RDMA service), then at the time when the corresponding service starts, the link information will be updated once, and the updated link information will also be notified to the second DPU, that is, when the first port is failed, the link information stored in the second DPU has service related information of the service being performed by the first port (for example, the related information of the RDMA service being performed can include the memory address of the data read and the destination device address of the data read to the outside, etc.), using the service related information, the second DPU can continue to perform the service not completed by the first port.
[0078] Some methods for determining that the first port is failed are described below:
[0079] Method one, the first DPU performs fault detection on the first port.
[0080] The specified pin of the port can reflect the network cable connection state of the port. When the first port of the first DPU fails, for example, the network cable connected to the first port is damaged, broken or virtually connected, etc. The MPU in the first DPU can detect that the signal of the pin has an abnormal change (for example, the high level becomes low level), thereby determining that the first port has a connection failure. Then, the first DPU sends a failure message of the first port to the bonding unit. The failure message can carry the port identifier of the first port.
[0081] The bonding unit looks up the port identifier of the first port in the configuration information of each port binding group stored by the bonding unit. The port identifier of the first port is found in the configuration information of a certain port binding group. Then, the port identifier of the standby port recorded in the configuration information can be determined. If there is only one port identifier of a standby port in the configuration information, it is further determined that the standby port is in a silent state. Then, the port identifier of the standby port can be directly determined as the port identifier of the port to be activated. If there are multiple port identifiers of standby ports in the configuration information, a standby port in a silent state can be selected from the multiple standby ports based on a preset selection mechanism, as the port to be activated, to obtain the port identifier of the port to be activated. The selection mechanism can be selection according to priority, polling selection, random selection, etc. The port to be activated is the second port described above. Further, the bonding unit can send a notification of activating the second port to the link control unit. The notification can carry the port identifier of the second port.
[0082] After receiving the notification, the link control unit determines, based on the port identifier of the second port, that the DPU to which the second port belongs is the second DPU. Then, the link control unit sends a notification of activating the second port to the second DPU. At this time, the second DPU determines, based on the port identifier of the second port, the state of the second port recorded by the second DPU, and knows that the second port is currently in a silent state. Then, the silent state is switched to an active state. The stored link information is configured to the second port for use.
[0083] In mode two, the network card driver detects the failure of the first DPU.
[0084] The first DPU periodically sends a heartbeat message to the network card driver during operation. The network card driver can monitor the working state of the first DPU through the heartbeat message. When the first DPU stops working due to a failure, the network card driver cannot receive the heartbeat message sent by the first DPU within a certain time period, thereby determining that the first DPU has failed. Then, the network card driver sends a failure message of the first DPU to the bonding unit. The failure message can carry the identifier information of the first DPU.
[0085] The bonding unit determines the port identifiers of all ports in the first DPU, and then looks up these port identifiers in the configuration information of each port binding group stored by the bonding unit. The port identifier of the first port is found in the configuration information of a certain port binding group. The subsequent processing is similar to that in mode one, which will not be described here.
[0086] In the embodiments of the present disclosure, the first device establishes a data link with the second device through a master port (the first port) in the port binding group to communicate. Meanwhile, the first DPU to which the master port belongs informs the second DPU to which the backup port (the second port) belongs of the link information of the data link for storage. In this way, the DPU corresponding to the master port and the backup port in the port binding group can simultaneously maintain the link information of the data link. When the master port fails, the backup port can be activated, and the link information stored in the second DPU to which the backup port belongs is configured to the backup port for use, so that the first device can continue to use the data link to communicate with the second device through the backup port. In this way, the continuous availability of the data link can be ensured in the case of port failure. Moreover, because the link information has been stored in the second DPU, the process of configuring the link information to the backup port by the second DPU can be completed in a very short time, and as soon as the configuration is completed, the transmission of service data of the data link can continue, which can better ensure the continuity of the transmission of service data. In comparison, in the case of port failure, if a method for maintaining the data link cannot be provided, a data link needs to be reselected to transmit corresponding service data. However, reselecting the data link needs a series of complex calculation and configuration processes, which takes a long time, which will cause the service data transmission to be interrupted for a long time.
[0087] The embodiments of the present disclosure provide a pre-configuration processing flow for performing bonding configuration and generating link information, which can be executed before step 101. The corresponding processing flow can be as shown in Figure 3 The processing flow includes the following steps:
[0088] 301. The processor obtains configuration information of the port binding group by negotiating with the second device through the bonding unit.
[0089] The ports included in the port binding group can be pre-configured and recorded in the bonding unit, which can be manually configured or automatically configured by the device through a certain detection mechanism. The negotiation process can determine the master port and the backup port in each port included in the port binding group.
[0090] The first port and the second port belong to the same port bonding group. The configuration information negotiated for the port bonding group can be: the master port includes the first port of the first DPU, and the backup port includes the second port of the second DPU. The configuration information can be divided into first sub-information and second sub-information based on the DPU to which the port belongs. The first sub-information includes the port identifier of the first port (for example, the port identifier of the first port is A1) and the marking information used to indicate the master port (for example, the marking information can be 1), that is, the first sub-information is used to indicate that the first port is the master port of the port bonding group, in addition, the first sub-information can also include the identifier information of the first DPU. The second sub-information includes the port identifier of the second port (for example, the port identifier of the second port is B1) and the marking information used to indicate the backup port (for example, the marking information can be 0), that is, the second sub-information is used to indicate that the second port is the backup port of the port bonding group, in addition, the second sub-information can also include the identifier information of the second DPU. The bonding unit can store the configuration information corresponding to the group identifier (for example, the group identifier of the port bonding group is bond1) of the port bonding group in the configuration information table, as shown in Table 1.
[0091] Table 1
[0092] Group identification of port bonding group Configuration information bond1 Master port: port 1, backup port: port 3 bond2 Master port: port 2, backup port: port 4 …… ……
[0093] The bonding unit also runs and maintains a state information table of each port, and the state information table is used to record that each port of the port bonding group is in a silent state, an active state or a failure state.
[0094] 302, the processor sends the first sub-information to the first DPU and sends the second sub-information to the second DPU.
[0095] The bonding unit in the processor sends the configuration information and the group identifier of the port bonding group to the link control unit in the processor. The link control unit can store the configuration information and the group identifier correspondingly. For each sub-information in the configuration information, based on the DPU identifier information in the sub-information, different sub-information is sent to the corresponding DPU, that is, the link control unit sends the first sub-information to the first DPU and sends the second sub-information to the second DPU. At the same time, the link control unit can also notify the identifier information of all DPU corresponding to the port in the port bonding group to the DPU where the master port is located, that is, the link control unit can carry the first sub-information and the identifier information of the second DPU in the notification sent to the first DPU. In addition, the link control unit can also carry the group identifier in the notification sent to each DPU.
[0096] 303, the first DPU sets the first port to an active state, establishes a data link between the first port and the second device, and generates link information of the first port.
[0097] After the first DPU receives the first sub-message, the first port is set to an active state, and then a handshake process is performed between the first DPU and the second device through the first port to establish a data link, and link information of the first port is generated. The first DPU configures the link information to the first port, so that the first device uses the first port to communicate with the second device through the data link.
[0098] 304, the second DPU sets the second port to a silent state.
[0099] In terms of timing, there is no certain timing sequence between steps 303 and 304.
[0100] The embodiment of the present disclosure provides a processing method for a first DPU to inform a second DPU of link information. The corresponding process can be as shown in Figure 4 The method comprises the following steps:
[0101] 401, the first DPU sends the link information of the first port to the processor.
[0102] The first DPU first backs up the link information corresponding to the first port, and then sends the backed-up link information and the group identifier of the port binding group to which the first port belongs to the link control unit.
[0103] 402, the processor stores the link information in the memory.
[0104] The link control unit can apply for a certain memory space when starting, and when receiving the link information and the group identifier, it can store the link information and the group identifier in the memory space. The memory space can store the link information corresponding to all port binding groups.
[0105] 403, the first DPU sends an indication message for reading the link information to the second DPU.
[0106] The first DPU and the second DPU can be connected to the mainboard through the PCIE slot, and through the lines in the mainboard, the DOORBELL message, i.e. the indication message for reading the link information, can be transmitted. The DOORBELL message can carry the group identifier of the above-mentioned port binding group.
[0107] 404, the second DPU sends a read request to the processor.
[0108] The second DPU sends a read request for the link information to the link control unit in the processor, and the read request carries the group identifier of the port binding group.
[0109] 405, the processor reads the link information of the first port in the memory and sends the link information to the second DPU for storage.
[0110] The link control unit reads corresponding link information in the memory based on the group identifier, and sends the link information to the second DPU. After the second DPU receives the link information, the second DPU stores the link information in the DPU memory of the second DPU.
[0111] In the embodiments of the present disclosure, the port binding group can include more than one backup port, that is, not only one backup port for the second port, but also more than one master port, that is, not only one master port for the first port. The corresponding working mode can be initially setting all master ports to an active state, and all master ports perform data transmission. When any master port fails, a backup port is selected and set to an active state, and participates in data transmission.
[0112] Case one, the port binding group includes multiple backup ports.
[0113] The bonding unit in the processor negotiates with the opposite end to obtain configuration information, and divides the configuration information into a plurality of sub-information, each of which is used to indicate whether a port in the port binding group is a master port or a backup port. Then the bonding unit sends the configuration information and the group identifier of the port binding group to the link control unit, and the link control unit sends each sub-information to the corresponding DPU. For all DPU corresponding to the ports in the port binding group, the link control unit can determine the identifier information of the DPU other than the first DPU, and notify the identifier information of the other DPU to the first DPU (also referred to as the master DPU). In addition, the link control unit can also carry the group identifier in the notification sent to each DPU. The first DPU activates the first port, establishes a data link between the first port and the second device, and generates corresponding link information, and then configures the link information to the first port. The DPU (also referred to as the backup DPU) where each backup port is located sets the backup port to a silent state.
[0114] The first DPU notifies all backup DPU of the link information of the first port for storage. The specific processing mode is that the first DPU sends an indication message for reading link information to each backup DPU, and the indication message carries the group identifier of the port binding group. Each backup DPU sends a read request carrying the group identifier to the link control unit. The link control unit reads corresponding link information in the memory based on the group identifier, and sends the link information to each backup DPU. After each backup DPU receives the link information, the backup DPU stores the link information in the DPU memory of the backup DPU.
[0115] Case two, the port binding group includes multiple master ports.
[0116] The case of multiple primary ports is similar to the case of multiple backup ports. The first DPU activates the first port, establishes a data link between the first port and the second device, and generates corresponding link information, and then configures the link information to the first port. Through the same processing manner as case one, the link information is notified to all the DPU where the primary port is located. The DPU receiving the link information can configure the link information to the primary port in the DPU.
[0117] After each link data update, the first DPU can use the same processing manner as described above to notify the updated link information to the DPU where all the backup ports are located, and the DPU where the other primary ports except the first port are located.
[0118] The configuration process before the port failure will be described in detail below in combination with an application scenario example. As shown in FIG. 1, Figure 5 The first device includes a CPU, a first DPU, a second DPU and a memory, the CPU includes a bonding unit and a link control unit, the first DPU includes a port 3 and a port 4, and the second DPU includes a port 5 and a port 6. The port 4 is connected with the port 1 of the second device, and the port 5 is connected with the port 2 of the second device. The detailed processing procedure is as follows:
[0119] In the first step, the bonding unit negotiates with the second device to obtain configuration information, and the configuration information is that the port 4 and the port 5 belong to the same port binding group, the port 4 is the primary port, and the port 5 is the backup port.
[0120] In the second step, the bonding unit notifies the link control unit of the configuration information and the group identifier of the port binding group.
[0121] In the third step, the link control unit sends the information that the port 4 is the primary port to the first DPU, and sends the information that the port 5 is the backup port to the second DPU.
[0122] In the fourth step, the first DPU sets the port 4 to an active state, and the second DPU sets the port 5 to a silent state.
[0123] In the fifth step, the first DPU establishes a data link with the second device through the port 4, and generates link information. The first device communicates with the second device through the data link using the port 4.
[0124] In the sixth step, the first DPU backs up the link information, and then sends the backup link information and the group identifier of the port binding group to the link control unit.
[0125] In the seventh step, the link control unit stores the link information and the group identifier in the memory.
[0126] Step 8, the first DPU sends a DOORBELL message to the second DPU, notifying the second DPU to read the link information, and the DOORBELL message carries the group identifier.
[0127] Step 9, the second DPU sends a read request carrying the group identifier to the link control unit.
[0128] Step 10, the link control unit reads the link information in the memory based on the group identifier.
[0129] Step 11, the link control unit sends the link information to the second DPU for storage.
[0130] Next, the port failover process is described in detail using the above application scenario. As shown in Figure 6 and Figure 7 is a detailed processing flow. Figure 6 The corresponding fault detection method is that the first DPU detects the fault of the first port, Figure 7 The corresponding fault detection method is that the network card driver detects the fault of the DPU.
[0131] First, the processing flow shown in Figure 6 is described:
[0132] Step 1, the first DPU detects that port 4 has failed.
[0133] Step 2, the first DPU sends a fault message of port 4 to the bonding unit.
[0134] Step 3, the bonding unit determines that the backup port corresponding to port 4 is port 5 in the configuration information of the port binding group.
[0135] Step 4, the bonding unit sends a notification to activate port 5 to the link control unit.
[0136] Step 5, the link control unit notifies the second DPU to activate port 5.
[0137] Step 6, the second DPU switches the state of port 5 from the silent state to the active state.
[0138] Step 7, the second DPU configures the link information stored in the memory of the DPU itself to port 5. The first device uses port 5 to communicate with the second device through the data link.
[0139] Next, the processing flow shown in Figure 7 is described, which is different from the first to third steps of the processing flow shown in Figure 6 , which is described in detail as follows:
[0140] The first step, the network card driver detects that the first DPU has not sent a heartbeat message for a long time.
[0141] The second step, the network card driver sends a message to the bonding unit that the first DPU has failed.
[0142] The third step, the bonding unit finds the ports included in the first DPU in the configuration information of each port binding group, finds that port 4 is the master port of a port binding group, and further determines that the standby port corresponding to port 4 is port 5.
[0143] The fourth step, the bonding unit sends a notification to the link control unit to activate port 5.
[0144] The fifth step, the link control unit notifies the second DPU to activate port 5.
[0145] The sixth step, the second DPU switches the state of port 5 from the silent state to the active state.
[0146] The seventh step, the second DPU configures the link information stored in the memory of the DPU itself to port 5. The first device uses port 5 to communicate with the second device through the data link.
[0147] An application scenario in which a port binding group includes multiple master ports and multiple standby ports is given below, as shown in FIG. 8. Figure 8 As shown in the figure, in this scenario, the configuration information of the port binding group is that port 4, port 5, port 8 and port 9 belong to the same port binding group, the master ports are port 4 and port 8, and the standby ports are port 5 and port 9.
[0148] In this application scenario, in the configuration process before the failure, the processing flow of the first step to the fifth step is the same as the processing flow of the first step to the fifth step shown in FIG. 6, which will not be repeated here, and the process of distributing the link information will be described in detail from the sixth step: Figure 5
[0149] The sixth step, the first DPU backs up the link information, and then sends the backup link information and the group identifier of the port binding group to the link control unit.
[0150] The seventh step, the link control unit stores the link information and the group identifier in the memory.
[0151] The eighth step, the first DPU sends a DOORBELL message to the second DPU, the third DPU and the fourth DPU, notifying the second DPU, the third DPU and the fourth DPU to read the link information, and the DOORBELL message can carry the group identifier.
[0152] Step 9, the second DPU, the third DPU and the fourth DPU send a read request carrying the group identifier to the link control unit.
[0153] Step 10, the link control unit reads the link information in the memory based on the group identifier.
[0154] Step 11, the link control unit sends the link information to the second DPU, the third DPU and the fourth DPU for storage.
[0155] Based on the same technical concept, the embodiment of the disclosure provides a first device, as shown in the figure, the first device comprises a first DPU 910 and a second DPU 920, the first DPU 910 comprises a first port, and the second DPU 920 comprises a second port. Figure 9
[0156] The first DPU 910 is configured to:
[0157] communicate with a second device through a data link using the first port. Specifically, the processing function of step 201 and other implicit steps can be implemented.
[0158] inform the second DPU 920 of link information of the first port for storage, the first port and the second port belong to the same port binding group, the first port is the master port of the port binding group and is in an active state, and the second port is the standby port of the port binding group and is in a silent state. Specifically, the processing function of step 202 and other implicit steps can be implemented.
[0159] The second DPU 920 is configured to, when the first port of the first DPU 910 fails, set the second port to an active state, and continue to communicate with the second device through the data link using the second port based on the link information. Specifically, the processing function of step 203 and other implicit steps can be implemented.
[0160] In a possible implementation, the first device further comprises a CPU 930, and the CPU 930 communicates with the first DPU 910 and the second DPU 920 through a computer bus.
[0161] The first DPU 910 is configured to send the link information of the first port to the CPU 930. Specifically, the processing function of step 401 and other implicit steps can be implemented.
[0162] The CPU 930 is configured to store the link information into a memory. Specifically, the processing function of step 402 and other implicit steps can be implemented.
[0163] The second DPU 920 is configured to send a read request to the CPU 930. Specifically, the processing function of step 404 and other implicit steps can be implemented.
[0164] The CPU 930 is configured to read the link information in the memory, and send the link information to the second DPU 920 for storage. The CPU 930 can implement the processing function of step 405 and other implicit steps.
[0165] In a possible implementation, the first DPU 910 is further configured to send an indication message for reading the link information to the second DPU 920, where the indication message is a DOORBELL message. The first DPU 910 can implement the processing function of step 403 and other implicit steps.
[0166] In a possible implementation, the CPU 930 is configured to:
[0167] negotiate with the second device to obtain configuration information of the port binding group, the configuration information including first sub-information and second sub-information, the first sub-information being used to indicate that the first port is the master port of the port binding group, and the second sub-information being used to indicate that the second port is the backup port of the port binding group. The CPU 930 can implement the processing function of step 301 and other implicit steps.
[0168] The CPU 930 is further configured to send the first sub-information to the first DPU 910, and send the second sub-information to the second DPU 920. The CPU 930 can implement the processing function of step 302 and other implicit steps.
[0169] The first DPU 910 is further configured to set the first port to an active state, establish a data link between the first port and the second device, and generate link information of the first port. The first DPU 910 can implement the processing function of step 303 and other implicit steps.
[0170] The second DPU 920 is further configured to set the second port to a silent state. The second DPU 920 can implement the processing function of step 304 and other implicit steps.
[0171] In a possible implementation, the link information includes an Internet Protocol (IP) address, a Media Access Control (MAC) address of the first device, and an IP address and a MAC address of the second device.
[0172] In a possible implementation, the port binding group includes a plurality of backup ports.
[0173] The first DPU 910 is further configured to notify the link information of the first port to a DPU where other backup ports except the second port are located, for storage.
[0174] In a possible implementation, the CPU 930 is further configured to:
[0175] select the second port as the port to be activated from the plurality of backup ports.
[0176] The second DPU 920 is notified of the second port.
[0177] In a possible implementation, the port binding group includes a plurality of master ports.
[0178] The first DPU 910 is further configured to notify a DPU where a master port other than the first port is located of link information of the first port, so as to configure the link information to the master port.
[0179] In a possible implementation, the CPU 930 is configured to send an activation notification of the second port to the second DPU 920 when receiving the failure message of the first port sent by the first DPU 910. The processing function of step 203 and other implicit steps can be implemented.
[0180] The second DPU 920 is configured to set the second port to an active state and configure the stored link information to the second port. The processing function of step 203 and other implicit steps can be implemented.
[0181] In a possible implementation, the CPU 930 of the first device is configured to send an activation notification of the second port to the second DPU 920 when the first DPU 910 fails. The processing function of step 203 and other implicit steps can be implemented.
[0182] The second DPU 920 is configured to set the second port to an active state and configure the stored link information to the second port. The processing function of step 203 and other implicit steps can be implemented.
[0183] In the embodiments of the present disclosure, the first device establishes a data link with the second device through a master port (the first port) in the port binding group to communicate. Meanwhile, the first DPU to which the master port belongs notifies the second DPU to which the backup port (the second port) belongs of the link information of the data link for storage. In this way, the DPU corresponding to the master port and the backup port in the port binding group can maintain the link information of the data link at the same time. When the master port fails, the backup port can be activated, and the link information stored in the second DPU to which the backup port belongs is configured to the backup port for use. In this way, the first device can continue to use the data link to communicate with the second device through the backup port. In this way, the continuous availability of the data link can be ensured in the case of port failure. Moreover, because the link information has been stored in the second DPU, the process of configuring the link information to the backup port by the second DPU can be completed in a very short time. As long as the configuration is completed, the transmission of service data of the data link can continue, and the continuity of the transmission of service data can be better ensured. In comparison, in the case of port failure, if a method for maintaining the data link cannot be provided, a data link needs to be reselected to transmit corresponding service data. However, reselecting the data link needs a series of complex calculation and configuration processes, which takes a long time, and this can cause the service data transmission to be interrupted for a long time.
[0184] The embodiments of the present disclosure also provide a computer readable storage medium. The computer readable storage medium can be any available medium or data storage device including one or more available media that is / are accessible by a computing device. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a digital video disk (DVD)), or a semiconductor medium (for example, a solid state disk), etc. The computer readable storage medium includes instructions indicating the computing device to execute the method for service processing, or indicating the computing device to execute the method for service processing.
[0185] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present disclosure, but not limit them; although the present disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand: the technical solutions recorded in the foregoing embodiments can still be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the protection scope of the technical solutions of the embodiments of the present disclosure.
Claims
1. A method for port fault switching, characterized in that: The first device includes a first data processor (DPU) and a second DPU, the first DPU is configured with a first port, and the second DPU is configured with a second port, and the method includes: The first DPU communicates with the second device via a data link using the first port; The first DPU notifies the second DPU of link information of the first port for storage, the first port and the second port belong to the same port binding group, the first port is the master port of the port binding group and is in an active state, and the second port is the backup port of the port binding group and is in a silent state; When the first port of the first DPU fails, the second DPU sets the second port to an active state and continues to communicate with the second device through the second port using the data link based on the link information.
2. The method according to claim 1, characterized in that The first device further includes a central processing unit (CPU), which communicates with the first DPU and the second DPU via a computer bus. The first DPU notifies the second DPU where the second port is located of the link information of the first port for storage, including: The first DPU sends link information of the first port to the CPU; The CPU stores the link information in a memory; The second DPU sends a read request to the CPU; The CPU reads the link information from the memory and sends the link information to the second DPU for storage.
3. The method according to claim 2, characterized in that Before the second DPU sends a read request to the CPU, the method further includes: The first DPU sends an instruction message for reading the link information to the second DPU, wherein the instruction message is a doorbell DOORBELL message.
4. The method according to any one of claims 1 to 3, characterized in that Before the first DPU notifies the second DPU where the second port is located of the link information of the first port for storage, the method further includes: The CPU of the first device negotiates with the second device to obtain configuration information of the port binding group, where the configuration information includes first sub-information and second sub-information, the first sub-information being used to indicate that the first port is a primary port of the port binding group, and the second sub-information being used to indicate that the second port is a backup port of the port binding group; The CPU sends the first sub-information to the first DPU, and sends the second sub-information to the second DPU; The first DPU sets the first port to an activated state, establishes a data link between the first port and the second device, and generates link information of the first port; The second DPU sets the second port to a silent state.
5. The method according to any one of claims 1 to 4, characterized in that The link information includes an Internet Protocol (IP) address and a Media Access Control (MAC) address of the first device and an IP address and a MAC address of the second device.
6. The method according to any one of claims 1 to 5, characterized in that The port binding group includes multiple backup ports; The method further comprises: The first DPU notifies the DPUs where other backup ports except the second port are located of the link information of the first port for storage.
7. The method according to claim 6, characterized in that Before the second DPU sets the second port to an activated state and configures the stored link information to the second port, the method further includes: The CPU of the first device selects the second port from the multiple standby ports as the port to be activated; The CPU notifies the second DPU of the second port.
8. The method according to any one of claims 1 to 7, characterized in that The port binding group includes multiple primary ports; The method further comprises: The first DPU notifies the DPUs where other primary ports other than the first port are located of the link information of the first port, so that the link information is configured for the other primary ports.
9. The method according to any one of claims 1 to 8, characterized in that When it is determined that the first port of the first DPU is invalid, the second DPU sets the second port to an activated state and configures the stored link information to the second port, including: When the CPU of the first device receives the fault message of the first port sent by the first DPU, it sends an activation notification of the second port to the second DPU; The second DPU sets the second port to an active state and configures the stored link information to the second port.
10. The method according to any one of claims 1 to 8, characterized in that When it is determined that the first port of the first DPU is invalid, the second DPU sets the second port to an activated state and configures the stored link information to the second port, including: When the first DPU fails, the CPU of the first device sends an activation notification of the second port to the second DPU; The second DPU sets the second port to an active state and configures the stored link information to the second port.
11. A first device for port failure switching, characterized in that: The first device includes a first DPU and a second DPU, the first DPU is configured with a first port, and the second DPU is configured with a second port; wherein: The first DPU is configured to communicate with the second device via a data link using the first port; and notify the second DPU of link information for storage, wherein the first port and the second port belong to the same port binding group, the first port is a primary port of the port binding group and is in an active state, and the second port is a backup port of the port binding group and is in a silent state. The second DPU is configured to set the second port to an active state when the first port of the first DPU fails, and continue to communicate with the second device through the second port using the data link based on the link information.
12. The first device according to claim 11, characterized in that The first device further includes a central processing unit (CPU), and the CPU communicates with the first DPU and the second DPU via a computer bus; The first DPU is configured to send link information of the first port to the CPU; The CPU is configured to store the link information in a memory; The second DPU is configured to send a read request to the CPU; The CPU is further configured to read the link information from the memory and send the link information to the second DPU for storage.
13. The first device according to claim 12, characterized in that The first DPU is further configured to send an instruction message for reading the link information to the second DPU, wherein the instruction message is a doorbell DOORBELL message.
14. The first device according to any one of claims 11 to 13, characterized in that: The CPU of the first device is configured to negotiate with the second device to obtain configuration information of the port binding group, the configuration information including first sub-information and second sub-information, the first sub-information being used to indicate that the first port is a primary port of the port binding group, and the second sub-information being used to indicate that the second port is a backup port of the port binding group; send the first sub-information to the first DPU, and send the second sub-information to the second DPU; The first DPU is further configured to set the first port to an activated state, establish a data link between the first port and the second device, and generate link information of the first port; The second DPU is further configured to set the second port to a silent state.
15. The first device according to any one of claims 11 to 14, characterized in that: The link information includes an Internet Protocol (IP) address and a Media Access Control (MAC) address of the first device and an IP address and a MAC address of the second device.
16. The first device according to any one of claims 11 to 15, characterized in that: The port binding group includes multiple backup ports; The first DPU is further configured to notify the DPUs where other backup ports, other than the second port, are located of the link information of the first port for storage.
17. The first device according to claim 16, characterized in that The CPU of the first device is further configured to: Selecting the second port from the multiple standby ports as the port to be activated; The second DPU is notified of the second port.
18. The first device according to any one of claims 11 to 17, characterized in that: The port binding group includes multiple primary ports; The first DPU is further configured to notify the DPUs where other primary ports other than the first port are located of the link information of the first port, so as to configure the link information to the other primary ports.
19. The first device according to any one of claims 11 to 18, characterized in that The CPU of the first device is configured to send an activation notification of the second port to the second DPU when receiving a fault message of the first port sent by the first DPU; The second DPU is configured to set the second port to an activated state and configure the stored link information to the second port.
20. The first device according to any one of claims 11 to 18, characterized in that The CPU of the first device is configured to send an activation notification of the second port to the second DPU when the first DPU fails; The second DPU is configured to set the second port to an activated state and configure the stored link information to the second port.
21. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer program code. When the computer program code is executed by a computer device, the computer device executes the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Port failover method and device, and storage medium
CN120238423A