Port failover method and device, and storage medium
By configuring the link information of the backup port to the backup port when the main port fails in the DPU device, the data transmission interruption caused by port failure in the prior art is solved, and the continuity and network reliability of the data link are quickly restored.
Patent Information
- Application Number
- CN202311868251.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-01
AI Technical Summary
In DPU devices, when the main port is located in multiple port binding groups on different DPUs, when the main port fails, the lack of link information on the backup port causes data transmission to be interrupted. The prior art requires a long and complex computing and configuration process to reselect the data link.
When the main port fails, the link information stored in the second DPU to which the backup port belongs is configured to the backup port, and the link information is maintained at the same time by using the main port in the port binding group and the DPU corresponding to the backup port, ensuring that the port is quickly switched to the backup port to continue communication when the port fails.
It realizes the rapid recovery of data links when the port fails, ensures the continuity of service data transmission, avoids long-term interruptions, and improves the reliability and efficiency of the network.
Smart Images

Figure CN120238423A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and particularly to a method, device, and storage medium for port failure switching. Background Art
[0002] The bonding technology is to establish multiple physical connections between a server and a switch (that is, to connect multiple ports of the server to multiple ports of the switch one by one), and cooperate with various optional working modes to achieve the purposes of simultaneous multi-link transmission to expand bandwidth, or port failure switching to improve network reliability.
[0003] In addition, data processing units (DPUs) are widely used, and many DPUs can support the transmission control protocol (TCP) offload engine (TOE) technology. The TOE technology transfers the protocol stacks of the network layer and the transport layer to the DPU, which can effectively reduce the occupancy of the central processing unit (CPU) and better liberate the processing resources of the CPU.
[0004] However, in a device using such a DPU, for the case where multiple mutually-bonded ports are located on different DPUs, since the protocol stacks of the network layer and the transport layer are on the DPU, when the main port establishes a data link with the peer device, the link information is maintained by the DPU to which the main port belongs. When the main port fails, the DPU to which the standby port belongs does not have the corresponding link information, resulting in data transmission interruption. Summary of the Invention
[0005] The present disclosure provides a method, device, and storage medium for port failure switching, which can ensure the continuous availability of the data link and the continuity of data transmission in the case of port failure.
[0006] In a first aspect, a method for port failover is provided, which is applied to a first device. The first device includes a first DPU and a second DPU. The first DPU includes a first port, and the second DPU includes a second port. The processing procedure of this method may include: The first Data Processor Unit (DPU) uses the first port to communicate with a second device through a data link, and then the first DPU notifies the second DPU of the 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 primary 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. Further, when the first port of the first DPU fails, the second DPU sets the second port to the active state and continues to communicate with the second device through the second port based on the link information.
[0007] In the embodiments of the present disclosure, the first device establishes a data link with the second device through the primary port (the first port) in the port binding group for communication. At the same time, the first DPU to which the primary port belongs notifies the second DPU to which the standby port (the second port) belongs of the link information of this data link for storage. In this way, the DPUs corresponding to the primary port and the standby port in the port binding group can maintain the link information of this data link simultaneously. When the primary port fails, the standby port can be activated, and the link information stored in the second DPU where the standby port is located is configured for the standby port to use. In this way, the first device can continue to use this data link to communicate with the second device through this standby 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 the second DPU configuring the link information for the standby port can be completed in a very short time. As long as the configuration is completed, the business data transmission of this data link can continue, which can better ensure the continuity of business data transmission. In contrast, in the case of port failure, if a method for maintaining the data link cannot be provided, then a new data link needs to be selected to perform the corresponding business data transmission. However, selecting a new data link requires a series of complex calculation and configuration processes, which takes a long time and will cause the business data transmission to be interrupted for a long time.
[0008] In a possible implementation manner, the first device further includes a CPU. The CPU communicates with the first DPU and the second DPU through a computer bus. The processing of notifying the link information may include: First, the first DPU sends the link information of the first port to the CPU, then the CPU stores the link information in the memory, then the second DPU sends a read request to the CPU, and finally the CPU reads the link information in the memory and sends the link information to the second DPU for storage.
[0009] In this way, the second DPU can directly obtain the link information from its own DPU memory and configure it for the second port, improving the efficiency of activating the second port.
[0010] In a possible implementation, before the second DPU sends a 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.
[0011] The doorbell message is a message for direct communication between different expansion cards on the motherboard.
[0012] In this way, the indication message for reading the link information does not need to be transmitted through the CPU, which has strong flexibility.
[0013] In a possible implementation, before the first DPU notifies the second DPU where the second port is located to store the link information of the first port, the CPU negotiates with the second device and establishes a data link. The corresponding processing flow is as follows: First, the CPU negotiates with the second device to obtain the configuration information of the port binding group, which includes the first sub-information and the second sub-information. The first sub-information is used to indicate that the first port is the master port of the port binding group, and the second sub-information is 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 the 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 the silent state.
[0014] In this way, by negotiating to determine the master port, only the master port needs to perform the link establishment process and generate the link information for subsequent distribution, which can reduce resource waste.
[0015] In a possible implementation, the link information includes the network protocol IP address, media access control MAC address of the first device, and the IP address and MAC address of the second device. The link information may also include routing-related information and service-related information of the network layer and transport layer.
[0016] In a possible implementation, when the port binding group includes multiple standby ports, the first DPU can notify the DPU where the other standby ports except the second port are located to store the link information of the first port.
[0017] In this way, notifying the DPU where all standby ports are located can provide more standby ports for selection and switching when the first port fails, improving network reliability. Moreover, if the switched port also fails subsequently, other standby ports can be selected for continuous switching, which can also well ensure network reliability.
[0018] In a possible implementation, the CPU can select a second port as the port to be activated from multiple standby ports and notify the second DPU of the second port.
[0019] In this way, since the ports of the port binding group are on different DPUs, the CPU can more conveniently obtain the configuration information of the port binding group relative to the DPU, while the DPU needs to perform less efficient inter-card data interaction to obtain the complete configuration information. Therefore, the CPU selecting the port can improve the efficiency of port switching.
[0020] In a possible implementation, when the port binding group includes multiple primary ports, the first DPU notifies the DPU where the other primary ports except 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.
[0021] In this way, only one primary port needs to establish a link, generate link information, and then distribute the link information, which can reduce resource waste.
[0022] In a possible implementation, when the CPU receives a fault message of the first port sent by the first DPU, it sends an activation notification of the second port to the second DPU, and then the second DPU sets the second port to the active state and configures the stored link information to the second port.
[0023] The DPU can detect the port fault by directly detecting the level change of the specified pin, or it can also detect through communication messages.
[0024] In this way, the DPU can detect the port fault relatively quickly, and the CPU can notify the second DPU, so that the data transmission service can be switched to the second port in a short time.
[0025] 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 the active state and configures the stored link information to the second port.
[0026] In this way, when the first port fails due to the failure of the first DPU, the first device can continue to communicate with the second device through the second port using this data link.
[0027] In a second aspect, a first device is provided, which includes a first DPU and a second DPU, and the first DPU and the second DPU are used to implement the method provided in the first aspect and its possible implementations.
[0028] In a third aspect, a computer-readable storage medium is provided. 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 provided by the first aspect and its possible implementations.
[0029] In a fourth aspect, a computer program product is provided. The computer program product includes computer program code. When the computer program code is executed by a computer device, the computer device executes the method provided by the first aspect and its possible implementations. Description of the Drawings
[0030] Figure 1 is a schematic structural diagram of a computer device provided by an embodiment of the present disclosure;
[0031] Figure 2 is a schematic flowchart of a method for port failure switching provided by an embodiment of the present disclosure;
[0032] Figure 3 is a schematic flowchart of a method for establishing a data link provided by an embodiment of the present disclosure;
[0033] Figure 4 is a schematic flowchart of a method for notifying link information provided by an embodiment of the present disclosure;
[0034] Figure 5 is a schematic flowchart of a method for configuration before port failure in combination with an application scenario provided by an embodiment of the present disclosure;
[0035] Figure 6 is a schematic flowchart of a method for port failure switching in combination with an application scenario provided by an embodiment of the present disclosure;
[0036] Figure 7 is a schematic flowchart of a method for port failure switching in combination with an application scenario provided by an embodiment of the present disclosure;
[0037] Figure 8 is a schematic flowchart of a method for link information distribution in combination with an application scenario provided by an embodiment of the present disclosure;
[0038] Figure 9 is a schematic structural diagram of a first device provided by an embodiment of the present disclosure. Detailed Embodiments
[0039] First, some terms related to the embodiments of the present disclosure are explained.
[0040] DPU
[0041] The DPU can share some complex processing tasks for the CPU, including tasks related to networking, virtualization, storage, security, etc. In the embodiments of the present disclosure, the DPU is mainly responsible for networking tasks and exists as a network card in a computer device. The DPU can be connected to the motherboard through expansion slots such as peripheral component interconnect express (PCIE) slots, thereby enabling communication with the CPU. The DPU card can be configured with exclusive memory, which can be referred to as DPU memory.
[0042] In the embodiments of the present disclosure, the DPU can support the offloading of stateful services. For example, it supports direct tcp offload egine (DTOE) technology and TOE technology. The DTOE technology and TOE technology offload (or migrate) the protocol stacks of the network layer and transport layer from the operating system kernel to the DPU. In this way, the DPU can share a large amount of network packet processing tasks for the CPU, helping the CPU release a large amount of processing resources. The DPU can also support remote direct memory access (RDMA) technology and the RDMA over converged ethernet (ROCE) technology extended based on this technology. The combined use of the two technologies can enable direct memory access between devices through Ethernet.
[0043] bonding unit
[0044] The bonding unit can also be referred to as the kernel bonding unit. It has a bonding component (which can be considered a set of executable codes) in the operating system kernel. Running the bonding component can create a bonding unit, which is used to perform related processing of bonding technology. In bonding technology, multiple physical connections are established between two devices. That is to say, for one of the devices, there are multiple ports connected to the other device. Through these connections, the bandwidth and network reliability between devices can be improved.
[0045] port bonding group
[0046] In the bonding technology, multiple ports of a device connected to the same peer device can be configured into a port bonding group. The multiple ports in the port bonding group can belong to different network cards of the device or the same network card of the device. In the embodiments of the present disclosure, the case where multiple ports belong to different network cards is described, and other cases will not be elaborated. The multiple ports in a port bonding group correspond to a data link. Generally, the so-called data link actually refers to a logical link, that is, no matter which port among these multiple ports the device uses to communicate with the peer, the same data link is used.
[0047] Through the bonding negotiation process between the device and the peer device, the primary port and the standby port can be determined among the multiple ports included in the port bonding group. The device can first use the primary port to communicate with the peer device through the data link. When the primary port fails, the standby port can be used to continue communicating with the peer device through this data link.
[0048] configuration information of port bonding group
[0049] The configuration information can be used to record the port identifier of the primary port of the port bonding group and the port identifier of the standby port of the port bonding group.
[0050] activation status / silent status
[0051] In the port bonding group, the currently used port is set to the active state, and the currently unused port is set to the silent state. For example, after the bonding negotiation process, the primary port can be set to the active state, and the standby port can be set to the silent state.
[0052] link information
[0053] The link information includes the basic information required for Ethernet data transmission between devices. The link information can include connection-related information, routing-related information, service-related information, etc. The connection-related information can include the network protocol (Internet Protocol, IP) addresses and media access control (MAC) addresses of the devices at both ends of the data link. The routing-related information can include routing tables, label forwarding tables, and other related information for packet forwarding. The service-related information includes information about related services at the network layer and transport layer. For example, the related information of the running RDMA service can specifically include the memory address for data reading and the destination device address for sending the read data externally. When these above-mentioned information changes, the link information will be updated.
[0054] The link information can be information such as queue pair context (QPC).
[0055] doorbell message
[0056] A message for direct communication between different expansion cards on the main board, which does not need to be transmitted through the CPU, has strong flexibility, and generally has a relatively small data volume.
[0057] The embodiments of the present disclosure provide a method for port failover, which can be applied to computer devices, such as servers, switches, terminals, and other arbitrary computer devices with network communication functions. The computer device can be configured with several DPUs, and the DPU supports technologies such as TOE (or DTOE) and ROCE. The computer device is connected to the peer device through multiple ports. The above server can be a database system server, a network service server, a cloud computing server, etc.
[0058] From a software perspective, an operating system and a link management application can be installed in the computer device. The operating system can have a bonding component (a set of execution codes in the operating system that can establish a bonding unit when executed). The link management application can be an independent application program or a functional component attached to other application programs. For example, it can be a functional component attached to the network card driver. When the link management application runs, it can establish a link management unit. In the embodiments of the present disclosure, the method for port failover can be implemented by the cooperation of the link management unit and the bonding unit, or the functions of the link management unit and the bonding unit can be integrated by an execution unit to implement this method.
[0059] From a hardware perspective, as Figure 1 shown, the computer device can include a processor 110, a memory 120, multiple DPUs 130, etc. In the embodiments of the present disclosure, the method for port failover can be implemented by the cooperation of the processor 110 with the memory 120 and the DPU 130. The following will specifically introduce these components:
[0060] The processor 110 can include any one or more of processors such as a CPU, a graphics processing unit (GPU), a micro processor (MP), or a digital signal processor (DSP). The processor can be used to negotiate configuration information with the peer device, obtain and send link information, receive and process fault messages sent by the DPU, etc. In the embodiments of the present disclosure, the processor is taken as an example of a CPU for a detailed description of the solution.
[0061] The memory 120 may include a volatile memory, such as a random access memory (RAM). The memory may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD). The memory used in the embodiments of the present disclosure may be a Double Data Rate Synchronous Dynamic RAM (DDR SDRAM) in the RAM, which may also be referred to as DDR. The DDR may be used to store pre-stored data, intermediate data, and result data related to the processing process, such as link information, etc.
[0062] The DPU 130 may be a network card for implementing communication between the computer device where the DPU is located and other devices or a communication network. At the same time, the DPU may also communicate with the processor through a bus. The DPU may also detect whether it is working properly through certain signals. When a port failure of this network card is detected, a port failure message is notified to the CPU. And so on. The DPU may include a measurement processing unit (MPU) and a neural network processing unit (NPU). The MPU is responsible for the relevant processing of the control plane, and the NPU is responsible for the relevant processing of the data plane.
[0063] The embodiments of the present disclosure provide a method for port failure switching. This method is applied to a first device. There are at least a first port and a second port on the first device. Both the first port and the second port are connected to a second device. That is to say, there are at least two physical connections between the first device and the second device. These ports connected to the second device are configured as a port binding group. These ports connected to the second device may belong to different DPUs respectively, or there may be some or all of the ports belonging to the same DPU. In the embodiments of the present disclosure, the case where these ports belong to different DPUs respectively is taken as an example to elaborate the solution in detail, and other cases will not be elaborated.
[0064] The processing flow of the method for port failure switching provided by the embodiments of the present disclosure may be as Figure 2 shown and includes the following steps:
[0065] 201, The first DPU uses the first port to communicate with the second device through a data link.
[0066] Among them, the first port is the primary port of the port bonding group and belongs to the first DPU.
[0067] After the first device is powered on, bonding negotiation processing will be performed to determine the primary port and standby port in the port bonding group. Then, the primary port (i.e., the first port) is set to the active state, and the standby port is set to the silent state. A data link is established with the second device through the primary port to generate link information, and the link information is configured to the first port. The relevant processing procedures will be introduced in detail in the following content.
[0068] 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.
[0069] 202, the first DPU notifies the second DPU where the second port is located to store the link information of the first port.
[0070] Among them, the second port is the standby port of the port bonding group and belongs to the second DPU. The link information is used for the first device to communicate with the second device through the first port via the data link.
[0071] There can be various possible ways of notification. The following are several feasible ways: Way 1, send the link information of the first port of the first DPU to the second DPU through the CPU; Way 2, send the link information of the first port of the first DPU to the second DPU through other components outside the CPU (such as another chip); Way 3, the first DPU directly sends the link information of the first port to the second DPU. This way will be further introduced in detail in the following content.
[0072] After the second DPU receives the link information, it can store the link information in the DPU memory of this DPU so that when the second port is in the active state, the link information can be quickly obtained.
[0073] Subsequently, after each link data update, the first DPU can use the same processing method to notify the updated link information to the second DPU.
[0074] 203, when it is determined that the first port of the first DPU fails, the second DPU sets the second port to the active state and configures the stored link information to the second port, and continues to communicate with the second device through the second port based on the link information using the above data link.
[0075] After the CPU determines that the first port fails, it sends a notification to the second DPU to set the second port to the active state. After receiving the notification, the second DPU sets the second port to the active state and configures the link information pre-stored in its DPU memory for the second port. Specifically, it can modify the port identifier of the first port in some of the information included in the link information to the port identifier of the second port, including: for the routing table entry containing the port identifier of the first port, changing the port identifier of the first port to the port identifier of the second port. At this time, the first device continues to communicate with the second device through the above 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 to say, although the port has been switched, the data link is continuously available. In this way, good continuity of service data transmission can be ensured during the port switching process.
[0076] When the first port fails, if the first port is in the process of transmitting service data (network layer and transport layer services, such as RDMA services), then at the start of the corresponding service, the link information will be updated once, and the updated link information will also be notified to the second DPU. That is to say, when the first port fails, the link information stored in the second DPU contains the service-related information of the service being carried out by the first port (for example, the relevant information of the executing RDMA service may include the memory address for data reading and the destination device address for sending the read data externally, etc.). Using this service-related information, the second DPU can continue to execute the service that the first port has not completed.
[0077] The following introduces some methods for determining the failure of the first port:
[0078] Method 1: The first DPU performs a fault detection on the first port.
[0079] The specified pin of the port can reflect the network cable connection status of the port. When a fault occurs in the first port of the first DPU, for example, a fault such as a broken, severed, or loose connection of the network cable connected to the first port, the MPU in the first DPU can detect an abnormal change in the signal of this pin (for example, a high level becomes a low level), thereby determining that a connection fault has occurred in the first port. Then, the first DPU sends a fault message of the first port to the bonding unit. The fault message may carry the port identifier of the first port.
[0080] The bonding unit looks up the port identifier of the first port in the configuration information of each port bonding group it stores. If it finds that the configuration information of a certain port bonding group includes the port identifier of the first port, it can further determine the port identifier of the standby port recorded in this configuration information. If there is only one port identifier of the standby port in this configuration information, and it is further determined that this standby port is in the silent state, then the port identifier can be directly determined as the port identifier of the port to be activated. If there are multiple port identifiers of the standby ports in this configuration information, a standby port in the silent state can be selected from the multiple standby ports based on a preset selection mechanism as the port to be activated, and the port identifier of the port to be activated is obtained. The selection mechanism can be selection according to priority, polling selection, random selection, etc. This port to be activated is the above-mentioned second port. Further, the bonding unit can send a notification to activate the second port to the link control unit, and the notification can carry the port identifier of the second port.
[0081] After receiving the notification, the link control unit determines that the DPU to which the second port belongs is the second DPU based on the port identifier of the second port, and then sends a notification to activate the second port to the second DPU. At this time, the second DPU looks up the status of the second port recorded by it based on the port identifier of the second port, and learns that the second port is currently in the silent state, and then switches this silent state to the active state. The above-mentioned stored link information is configured for the second port to use.
[0082] Method 2: The network card driver detects the failure of the first DPU.
[0083] The first DPU periodically sends heartbeat messages to the network card driver during its operation. The network card driver can monitor the working state of the first DPU through the heartbeat information. When the first DPU fails and stops working, the network card driver does not receive the heartbeat information sent by the first DPU within a certain period of time, so it determines that the first DPU has failed. Then, the network card driver sends the failure message of the first DPU to the bonding unit. The failure message can carry the identification information of the first DPU.
[0084] 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 bonding group it stores. If it finds that the configuration information of a certain port bonding group includes the port identifier of the first port. The subsequent processing is similar to that in Method 1 and will not be elaborated here.
[0085] In the embodiments of the present disclosure, the first device establishes a data link with the second device through the primary port (the first port) in the port bonding group for communication. At the same time, the first DPU to which the primary port belongs notifies the link information of the data link to the second DPU to which the standby port (the second port) belongs for storage. In this way, the DPUs corresponding to the primary port and the standby port in the port bonding group can maintain the link information of the data link at the same time. When the primary port fails, the standby port can be activated, and the link information stored in the second DPU where the standby port is located is configured for the standby port to use. In this way, the first device can continue to use the data link to communicate with the second device through the standby port. In this way, the continuous availability of the data link can be ensured in the case of port failure. Moreover, since the link information has been stored in the second DPU, the process of the second DPU configuring the link information for the standby port can be completed in a very short time. As long as the configuration is completed, the service data transmission of the data link can continue, which can better ensure the continuity of the service data transmission. In contrast, in the case of port failure, if a method for maintaining the data link cannot be provided, then a new data link needs to be selected to perform the corresponding service data transmission. However, selecting a new data link requires a series of complex calculation and configuration processes, which takes a long time and will cause the service data transmission to be interrupted for a long time.
[0086] The embodiments of the present disclosure provide a processing flow for pre-configuration, which is used to perform bonding configuration and generate link information. It can be executed before step 101, and the corresponding processing flow can be as Figure 3 shown, including the following steps:
[0087] 301. The processor negotiates with the second device through the bonding unit to obtain the configuration information of the port bonding group.
[0088] Among them, which ports are included in the port bonding 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 primary port and the standby port among the ports included in the port bonding group.
[0089] The first port and the second port belong to the same port bonding group. The configuration information negotiated for this port bonding group can be as follows: the primary port includes the first port of the first DPU, and the standby port includes the second port of the second DPU. Based on the DPU to which the port belongs, the configuration information can be divided into first sub-information and second sub-information. 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 for indicating the primary 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 primary 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 for indicating the standby 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 standby 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 of the port bonding group (for example, the group identifier of this port bonding group is bond1) in the configuration information table, as shown in Table 1.
[0090] Table 1
[0091] group identifier of port bonding group configuration information bond1 Primary port: Port 1, Secondary port: Port 3 bond2 Primary port: Port 2, Secondary port: Port 4 …… ……
[0092] The bonding unit also runs and maintains the status information table of each port. The status information table is used to record whether each port of the port bonding group is in a silent state, an active state, or a failure state.
[0093] 302. The processor sends the first sub-information to the first DPU and sends the second sub-information to the second DPU.
[0094] 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 in correspondence. For each sub-information in the configuration information, based on the DPU identifier information in the sub-information, different sub-informations are 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 DPU where the primary port is located of the identifier information of all the DPUs corresponding to the ports in the port bonding group. That is, the notification sent by the link control unit to the first DPU can carry the first sub-information and the identifier information of the second DPU. In addition, the notification sent by the link control unit to each DPU can also carry the group identifier.
[0095] 303. The first DPU sets the first port to the active state, establishes a data link between the first port and the second device, and generates the link information of the first port.
[0096] After the first DPU receives the first sub-message, it sets the first port to the active state, and then performs a handshake process with the second device through the first port to establish a data link, and generates link information of the first port. The first DPU configures the link information for the first port so that the first device can use the first port to communicate with the second device through the data link.
[0097] 304. The second DPU sets the second port to the silent state.
[0098] In terms of timing, there is no necessary chronological relationship between steps 303 and 304.
[0099] An embodiment of the present disclosure provides a processing method for a first DPU to notify link information to a second DPU. The corresponding process can be as Figure 4 shown, including the following steps:
[0100] 401. The first DPU sends the link information of the first port to the processor.
[0101] 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.
[0102] 402. The processor stores the link information in the memory.
[0103] When starting up, the link control unit can apply for a certain amount of memory space. When receiving the link information and the group identifier, it can store the link information and the group identifier correspondingly in this memory space. All the link information corresponding to the port binding groups can be stored in this memory space.
[0104] 403. The first DPU sends an indication message for reading the link information to the second DPU.
[0105] The first DPU and the second DPU can be connected to the motherboard through the PCIE slot. Through the lines in the motherboard, the DOORBELL message, that is, the indication message for reading the link information, can be transmitted. The DOORBELL message can carry the group identifier of the above port binding group.
[0106] 404. The second DPU sends a read request to the processor.
[0107] The second DPU sends a read request for the link information to the link control unit in the processor. The read request carries the group identifier of the port binding group.
[0108] 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.
[0109] The link control unit reads the corresponding link information from the memory based on the group identifier and sends the link information to the second DPU. After receiving the link information, the second DPU stores the link information in its own DPU memory.
[0110] In the embodiments of the present disclosure, the port binding group may include more than one standby port, that is, not only the second port is a standby port, but also may include more than one primary port, that is, not only the first port is a primary port. The corresponding working mode may be to initially set all primary ports to the active state, and all primary ports perform data transmission. When any primary port fails, a standby port is selected and set to the active state to also participate in data transmission.
[0111] Case 1: The port binding group includes multiple standby ports.
[0112] The bonding unit in the processor negotiates with the peer to obtain configuration information, and divides the configuration information into several sub-information, and each sub-information is used to indicate whether a port in the port binding group is a primary port or a standby port. Then the bonding unit sends the configuration information and the group identifier of the port binding group to the link control unit, and then the link control unit sends each sub-information to the corresponding DPU. For all the DPUs corresponding to the ports in the port binding group, the link control unit can determine the identification information of the other DPUs except the first DPU among these DPUs, and notify the identification information of the other DPUs to the first DPU (which can also be called the primary DPU). In addition, the notification sent by the link control unit to each DPU may also carry the group identifier. The first DPU activates the first port, establishes a data link between the first port and the second device, generates the corresponding link information, and then configures the link information to the first port. All the DPUs where the standby ports are located (which can also be called standby DPUs) set their respective standby ports to the silent state.
[0113] The first DPU notifies all the standby DPUs to store the link information of the first port. The specific processing method is as follows: The first DPU sends an indication message for reading the link information to each standby DPU respectively. The indication message carries the group identifier of the port binding group. Each standby DPU sends a read request carrying the group identifier to the link control unit. The link control unit reads the corresponding link information from the memory based on the group identifier and sends the link information to each standby DPU. After receiving the link information, each standby DPU stores the link information in its own DPU memory.
[0114] Case 2: The port binding group includes multiple primary ports.
[0115] The case of multiple primary ports is handled in a similar manner to the case of multiple standby ports. The first DPU activates the first port, establishes a data link between the first port and the second device, generates corresponding link information, and then configures this link information for the first port. Through the same processing method as in Case 1, this link information is notified to all the DPUs where the primary ports are located. The DPUs that receive the link information can configure the link information for the primary ports in the DPU.
[0116] After each update of the link data, the first DPU can use the same processing method as above to notify the updated link information to all the DPUs where the standby ports are located, as well as the DPUs where the other primary ports except the first port are located.
[0117] The following details the configuration process before a port failure in combination with an application scenario example. As Figure 5 shown, the first device includes a CPU, a first DPU, a second DPU, and memory. The CPU includes a bonding unit and a link control unit. The first DPU includes port 3 and port 4, and the second DPU includes port 5 and port 6. Port 4 is connected to port 1 of the second device, and port 5 is connected to port 2 of the second device. The detailed processing flow is as follows:
[0118] First step, the bonding unit negotiates with the second device to obtain configuration information. The configuration information is that port 4 and port 5 belong to the same port bonding group, port 4 is the primary port, and port 5 is the standby port.
[0119] Second step, the bonding unit notifies the configuration information and the group identifier of the port bonding group to the link control unit.
[0120] Third step, the link control unit sends the information that port 4 is the primary port to the first DPU, and sends the information that port 5 is the standby port to the second DPU.
[0121] Fourth step, the first DPU sets port 4 to the active state, and the second DPU sets port 5 to the silent state.
[0122] Fifth step, the first DPU establishes a data link with the second device through port 4 and generates link information. The first device uses port 4 to communicate with the second device through the data link.
[0123] Sixth step, the first DPU backs up the link information, and then sends the backed-up link information and the group identifier of the port bonding group to the link control unit.
[0124] Seventh step, the link control unit stores the link information and the group identifier correspondingly in the memory.
[0125] In the eighth step, the first DPU sends a DOORBELL message to the second DPU to notify the second DPU to read the link information, and the group identifier is carried in the DOORBELL message.
[0126] In the ninth step, the second DPU sends a read request carrying the group identifier to the link control unit.
[0127] In the tenth step, the link control unit reads the link information from the memory based on the group identifier.
[0128] In the eleventh step, the link control unit sends the link information to the second DPU for storage.
[0129] Next, continue to use the above application scenario to elaborate on the port failover process. As Figure 6 and Figure 7 shown is the detailed processing flow. Figure 6 The corresponding method for detecting a fault is that the first DPU detects a fault in the first port, Figure 7 and the corresponding fault detection method is that the network card driver detects a fault in the DPU.
[0130] First, introduce Figure 6 the processing flow shown:
[0131] In the first step, the first DPU detects a fault in port 4.
[0132] In the second step, the first DPU sends a fault message of port 4 to the bonding unit.
[0133] In the third step, the bonding unit determines that the standby port corresponding to port 4 in the port binding group configuration information is port 5.
[0134] In the fourth step, the bonding unit sends a notification to activate port 5 to the link control unit.
[0135] In the fifth step, the link control unit notifies the second DPU to activate port 5.
[0136] In the sixth step, the second DPU switches the status of port 5 from the silent state to the active state.
[0137] In the seventh step, the second DPU configures the link information stored in its own DPU memory for port 5. The first device uses port 5 to communicate with the second device through the data link.
[0138] Next, introduce Figure 7 the processing flow shown. The first three steps of this processing flow are different from those of the processing flow shown in Figure 6 and are introduced in detail below:
[0139] In the first step, the network card driver detects that the first DPU has not received a heartbeat message for a long time.
[0140] In the second step, the network card driver sends a message indicating the failure of the first DPU to the bonding unit.
[0141] In the third step, the bonding unit searches for each port included in the first DPU in the configuration information of each port binding group, and finds that port 4 is the primary port of a port binding group, and then determines that the backup port corresponding to port 4 is port 5.
[0142] In the fourth step, the bonding unit sends a notification to activate port 5 to the link control unit.
[0143] In the fifth step, the link control unit notifies the second DPU to activate port 5.
[0144] In the sixth step, the second DPU switches the status of port 5 from the silent state to the active state.
[0145] In the seventh step, the second DPU configures the link information stored in its own DPU memory for port 5. The first device communicates with the second device through port 5 via the data link.
[0146] The following presents an application scenario where a port binding group includes multiple primary ports and multiple backup ports. For example, Figure 8 As shown, 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 primary ports are port 4 and port 8, and the backup ports are port 5 and port 9.
[0147] In this application scenario, during the configuration process before the failure, the processing flow of the first step to the fifth step is the same as that of the first step to the fifth step Figure 5 shown, and no repeated introduction will be made here. Starting directly from the sixth step, the process of link information distribution will be described in detail:
[0148] In the sixth step, the first DPU backs up the link information, and then sends the backed-up link information and the group identifier of the port binding group to the link control unit;
[0149] In the seventh step, the link control unit stores the link information and the group identifier correspondingly in the memory.
[0150] In the eighth step, the first DPU sends DOORBELL messages to the second DPU, the third DPU, and the fourth DPU respectively, notifying the second DPU, the third DPU, and the fourth DPU to read the link information. The DOORBELL message can carry the group identifier.
[0151] Step 9: The second DPU, the third DPU, and the fourth DPU send a read request carrying a group identifier to the link control unit.
[0152] Step 10: The link control unit reads link information from the memory based on the group identifier.
[0153] Step 11: The link control unit sends the link information to the second DPU, the third DPU, and the fourth DPU for storage.
[0154] Based on the same technical concept, an embodiment of the present disclosure provides a first device. As Figure 9 shown, the first device includes a first DPU 910 and a second DPU 920. The first DPU 910 includes a first port, and the second DPU 920 includes a second port.
[0155] The first DPU 910 is configured to:
[0156] Communicate with a second device through a data link using the first port. Specifically, it can implement the processing functions of step 201 above, as well as other implicit steps.
[0157] Notify the second DPU 920 of the 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 primary 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, it can implement the processing functions of step 202 above, as well as other implicit steps.
[0158] 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 second port based on the link information. Specifically, it can implement the processing functions of step 203 above, as well as other implicit steps.
[0159] In a possible implementation, the first device further includes a CPU 930. The CPU 930 communicates with the first DPU 910 and the second DPU 920 through a computer bus.
[0160] The first DPU 910 is configured to send the link information of the first port to the CPU 930. Specifically, it can implement the processing functions of step 401 above, as well as other implicit steps.
[0161] The CPU 930 is configured to store the link information in the memory. Specifically, it can implement the processing functions of step 402 above, as well as other implicit steps.
[0162] The second DPU 920 is configured to send a read request to the CPU 930. Specifically, it can implement the processing functions of step 404 above, as well as other implicit steps.
[0163] The CPU 930 is used to read link information in the memory and send the link information to the second DPU 920 for storage. Specifically, it can implement the processing functions of step 405 above and other implicit steps.
[0164] In a possible implementation, the first DPU 910 is further used to send an indication message for reading link information to the second DPU 920, where the indication message is a DOORBELL message. Specifically, it can implement the processing functions of step 403 above and other implicit steps.
[0165] In a possible implementation, the CPU 930 is used to:
[0166] Negotiate with a second device to obtain configuration information of a port binding group. The configuration information includes a first sub - information and a second sub - information. The first sub - information is used to indicate that the first port is the primary port of the port binding group, and the second sub - information is used to indicate that the second port is the standby port of the port binding group. Specifically, it can implement the processing functions of step 301 above and other implicit steps.
[0167] Send the first sub - information to the first DPU 910 and send the second sub - information to the second DPU 920. Specifically, it can implement the processing functions of step 302 above and other implicit steps.
[0168] The first DPU 910 is further used 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. Specifically, it can implement the processing functions of step 303 above and other implicit steps.
[0169] The second DPU 920 is further used to set the second port to a silent state. Specifically, it can implement the processing functions of step 304 above and other implicit steps.
[0170] In a possible implementation, the link information includes the network protocol IP address and media access control MAC address of a first device, and the IP address and MAC address of a second device.
[0171] In a possible implementation, the port binding group includes multiple standby ports.
[0172] The first DPU 910 is further used to notify the DPU where other standby ports except the second port are located to store the link information of the first port.
[0173] In a possible implementation, the CPU 930 is further used to:
[0174] Select the second port as the port to be activated from multiple standby ports.
[0175] Notify the second port to the second DPU 920.
[0176] In a possible implementation, the port binding group includes multiple primary ports;
[0177] The first DPU 910 is further configured to notify the link information of the first port to the DPU where other primary ports except the first port are located, so as to configure the link information to other primary ports.
[0178] 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 receiving a fault message of the first port sent by the first DPU 910. Specifically, it can implement the processing function of step 203 above, as well as other implicit steps.
[0179] 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. Specifically, it can implement the processing function of step 203 above, as well as other implicit steps.
[0180] 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. Specifically, it can implement the processing function of step 203 above, as well as other implicit steps.
[0181] 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. Specifically, it can implement the processing function of step 203 above, as well as other implicit steps.
[0182] In an embodiment of the present disclosure, a first device establishes a data link with a second device through a primary port (the first port) in a port binding group for communication. At the same time, a first DPU to which the primary port belongs notifies link information of the data link to a second DPU to which a standby port (the second port) belongs for storage. In this way, the DPUs corresponding to the primary port and the standby port in the port binding group can maintain the link information of the data link simultaneously. When the primary port fails, the standby port can be activated, and the link information stored in the second DPU where the standby port is located is configured for the standby port to use. In this way, the first device can continue to use the data link to communicate with the second device through the standby port. In this way, the continuous availability of the data link can be ensured in the case of port failure. Moreover, since the link information has been stored in the second DPU, the process of the second DPU configuring the link information for the standby port can be completed in a very short time. As long as the configuration is completed, the business data transmission of the data link can continue, which can better ensure the continuity of business data transmission. In contrast, in the case of port failure, if a method for maintaining the data link cannot be provided, then a new data link needs to be selected for corresponding business data transmission. However, selecting a new data link requires a series of complex calculation and configuration processes, which takes a long time and will cause the business data transmission to be interrupted for a long time.
[0183] An embodiment of the present disclosure also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store or a data storage device such as a data center that includes one or more available media. 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 drive), etc. The computer-readable storage medium includes instructions that instruct the computing device to execute a method for business processing, or instruct the computing device to execute a method for business processing.
[0184] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, and are not intended to limit them; although the present disclosure has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present disclosure.
Claims
1. A method for port failover, characterized in that The method is applied to a first device, which includes a first data processor DPU and a second DPU. The first DPU includes a first port, and the second DPU includes a second port. The method includes: the first DPU communicates with a second device through a data link using the first port; The first DPU notifies the second DPU of the 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 primary 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; 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 based on the link information using the data link.
2. The method according to claim 1, 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 through a computer bus. Among them, the first DPU notifying the second DPU where the second port is located of the link information of the first port for storage includes: The first DPU sends the link information of the first port to the CPU; The CPU stores the link information in the memory; The second DPU sends a read request to the CPU; The CPU reads the link information in the memory and sends the link information to the second DPU for storage.
3. The method according to claim 2, wherein Before the second DPU sends a read request to the CPU, the method further includes: The first DPU sends an indication message for reading the link information to the second DPU, where the indication 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 the configuration information of the port binding group. The configuration information includes a first sub-information and a second sub-information. The first sub-information is used to indicate that the first port is the primary port of the port binding group, and the second sub-information is used to indicate that the second port is the standby 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 active state, establishes a data link between the first port and the second device, and generates the 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 the network protocol IP address of the first device, the media access control MAC address, and the IP address and MAC address of the second device.
6. The method according to any one of claims 1-5, characterized in that, The port binding group includes multiple standby ports; The method further includes: The first DPU notifies the DPU where other standby ports except the second port are located of the link information of the first port for storage.
7. The method according to claim 6, wherein Before the second DPU sets the second port to the active 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 as the port to be activated from the multiple standby ports; The CPU notifies the second DPU of the second port.
8. The method according to any one of claims 1-7, characterized in that, The port binding group includes multiple primary ports; The method further includes: The first DPU notifies the link information of the first port to the DPU where the other primary ports except the first port are located, so as to configure the link information to the other primary ports.
9. The method according to any one of claims 1-8, characterized in that, When it is determined that the first port of the first DPU fails, the second DPU sets the second port to the active 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 the active state and configures the stored link information to the second port.
10. The method according to any one of claims 1-8, characterized in that, When it is determined that the first port of the first DPU fails, the second DPU sets the second port to the active 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 the active state and configures the stored link information to the second port.
11. A first device for port failover, characterized in that, The first device includes a first DPU and a second DPU. The first DPU includes a first port, and the second DPU includes a second port; The first DPU is used to communicate with the second device through the data link using the first port; Notify the link information of the first port to the second DPU for storage. The first port and the second port belong to the same port binding group. The first port is the primary port of the port binding group and is in the active state, and the second port is the standby port of the port binding group and is in the silent state; The second DPU is used to, when the first port of the first DPU fails, set the second port to the active state, and continue to communicate with the second device through the second port 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 through a computer bus; The first DPU is used to send the link information of the first port to the CPU; The CPU is used to store the link information in the memory; The second DPU is used to send a read request to the CPU; The CPU is further used to read the link information in the memory and send the link information to the second DPU for storage.
13. The first device according to claim 12, wherein The first DPU is further used to send an indication message for reading the link information to the second DPU, where the indication message is a doorbell DOORBELL message.
14. The first device according to any one of claims 11-13, characterized in that, The CPU of the first device is used to negotiate with the second device to obtain the configuration information of the port binding group. The configuration information includes first sub-information and second sub-information. The first sub-information is used to indicate that the first port is the primary port of the port binding group, and the second sub-information is used to indicate that the second port is the standby 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 used 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 second DPU is further used to set the second port to a silent state.
15. The first device according to any one of claims 11-14, characterized in that, The link information includes the network protocol IP address of the first device, the media access control MAC address, and the IP address and MAC address of the second device.
16. The first device according to any one of claims 11-15, characterized in that, The port binding group includes multiple standby ports; The first DPU is further used to notify the DPU where other standby ports except the second port are located to store the link information of the first port.
17. The first device according to claim 16, characterized in that, The CPU of the first device is further used to: Select the second port as the port to be activated from the multiple standby ports; Notify the second DPU of the second port.
18. The first device according to any one of claims 11-17, characterized in that, The port binding group includes multiple primary ports; The first DPU is further used to notify the DPU where other primary ports except 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-18, characterized in that, The CPU of the first device is used to send an activation notification of the second port to the second DPU when receiving the fault message of the first port sent by the first DPU; The second DPU is used to set the second port to an active state and configure the stored link information to the second port.
20. The first device according to any one of claims 11-18, characterized in that, The CPU of the first device is used to send an activation notification of the second port to the second DPU when the first DPU fails; The second DPU is used to set the second port to an active 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-10 above.
Citation Information
Cited By
Port failover method and device, and storage medium
CN120238425A
Method, device and storage medium for port failover
CN120238425B
Port fault switching method, device, and storage medium
WO2025139833A1