Network card equipment switching method and device based on bonding mode
By establishing bonding relationships between network card devices and using remote direct memory access driver module for data switching, the problem that single-port network card devices cannot perform remote direct memory access is solved, and the stability of data transmission is improved.
Patent Information
- Application Number
- CN202411647543.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-04-29
AI Technical Summary
When a network card device has only one port, it cannot communicate with other devices in a remote direct memory access, resulting in limited data transmission stability.
By establishing bonding relationships between network card devices, using the remote direct memory access driver module to generate a switching operation message, the current data information of the first network card device is switched to the second network card device through shared memory, and the current data information is executed in the second network card device.
It realizes a communication method that can still access remotely directly memory with other devices when a network card device has only one port, improving the stability of data transmission.
Smart Images

Figure CN119902907A_ABST
Abstract
Description
Technical Field
[0001] The disclosed embodiments relate to the technical field of network card devices, and more particularly to a switching method and apparatus for network card devices in bonding mode. Background Art
[0002] The current remote direct memory access communication architecture based on the bonding master-slave mode is a communication method for remote direct memory access with other devices by establishing a bonding relationship between two ports of the same network card device.
[0003] However, this method cannot communicate with other devices through remote direct memory access when a network card device has only one port.
[0004] Therefore, there is an urgent need for a switching method for network card devices based on bonding mode, which can communicate with other devices in a remote direct memory access manner when a network card device has only one port, thereby improving the stability of data transmission. Summary of the invention
[0005] In order to solve the above technical problem or at least partially solve the above technical problem, the embodiments of the present disclosure provide a switching method and apparatus based on a network card device in bonding mode.
[0006] A first aspect of an embodiment of the present disclosure provides a switching method for a network card device in a bonding mode, the method comprising:
[0007] In response to a switching operation of a network card device in bonding mode, a switching operation message is generated, and the switching operation message is transmitted to a preset callback interface; wherein the switching operation message is used to indicate that the first network card device is switched to the second network card device; the first network card device and the second network card device are network card devices in bonding mode;
[0008] Retrieving the switching operation message from the preset callback interface based on the remote direct memory access driver module;
[0009] Based on the remote direct memory access driver module, according to the switching operation message, the current data information of the first network card device is switched to the second network card device via the shared memory, and the current data information is executed in the second network card device; wherein, the first network card device and the second network card device have the same hardware structure; and the shared memory is pre-created by the remote direct memory access driver module.
[0010] In one example, the switching operation message based on the remote direct memory access driver module switches the current data information of the first network card device to the second network card device via the shared memory, including:
[0011] Sending the switching operation message to the first network card device and the second network card device based on the remote direct memory access driver module;
[0012] The first network card device stores the current data information in the shared memory according to the switching operation message, and changes the state identifier of the shared memory from the first identifier to the second identifier after the transmission is completed;
[0013] When the second network card device detects that the state identifier of the shared memory is the second identifier, the current data information is obtained from the shared memory, and the first network card device is switched to the second network card device.
[0014] In one example, before the first network card device stores the current data information in the shared memory according to the switching operation message, the method further includes:
[0015] After receiving the switching operation message, the first network card device suspends processing the current data information.
[0016] In one example, the method further includes:
[0017] The shared memory is created based on the remote direct memory access driver module, and the shared memory state identifier is determined as a first identifier.
[0018] In one example, the method further includes:
[0019] A notification message is sent to the remote direct memory access driver module based on the second network card device; wherein the notification message is used to indicate that the switching from the first network card device to the second network card device is completed.
[0020] A second aspect of an embodiment of the present disclosure provides a switching device based on a network card device in bonding mode, the device comprising:
[0021] The bonding module is used to generate a switching operation message in response to a switching operation of a network card device in a bonding mode, and transmit the switching operation message to a preset callback interface; wherein the switching operation message is used to indicate that the first network card device is switched to the second network card device; the first network card device and the second network card device are network card devices in the bonding mode;
[0022] A remote direct memory access driver module, used for retrieving the switching operation message from the preset callback interface;
[0023] The remote direct memory access driver module is used to switch the current data information of the first network card device to the second network card device via the shared memory according to the switching operation message, and execute the current data information in the second network card device; wherein, the first network card device and the second network card device have the same hardware structure; and the shared memory is pre-created by the remote direct memory access driver module.
[0024] In one example, the remote direct memory access driver module is specifically used to send the switching operation message to the first network card device and the second network card device;
[0025] The first network card device is used to store the current data information in the shared memory according to the switching operation message, and change the state identifier of the shared memory from the first identifier to the second identifier after the transmission is completed;
[0026] The second network card device is used to obtain the current data information from the shared memory and switch the first network card device to the second network card device when detecting that the state identifier of the shared memory is the second identifier.
[0027] In one example, the apparatus further comprises:
[0028] The first network card device is used to suspend processing of the current data information after receiving the switching operation message.
[0029] In one example, the apparatus further comprises:
[0030] The remote direct memory access driver module is further used to create the shared memory and determine the shared memory state identifier as the first identifier.
[0031] In one example, the apparatus further comprises:
[0032] The second network card device is further used to send a notification message to the remote direct memory access driver module; wherein the notification message is used to indicate that the switching from the first network card device to the second network card device is completed.
[0033] A third aspect of the embodiments of the present disclosure provides a network card device based on a bonding mode, including:
[0034] A processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the method described in the first aspect.
[0035] A fourth aspect of an embodiment of the present disclosure provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method of the first aspect described above can be implemented.
[0036] The disclosed embodiment provides a switching method and device based on a network card device in bonding mode, the method comprising: generating a switching operation message in response to a switching operation of a network card device in bonding mode, and transmitting the switching operation message to a preset callback interface; wherein the switching operation message is used to indicate that a first network card device is switched to a second network card device; the first network card device and the second network card device are network card devices in bonding mode; calling the switching operation message from the preset callback interface based on a remote direct memory access driver module; based on the remote direct memory access driver module, switching the current data information of the first network card device to the second network card device via a shared memory according to the switching operation message, and executing the current data information in the second network card device; wherein the first network card device and the second network card device have the same hardware structure; and the shared memory is pre-created by the remote direct memory access driver module. By adopting this technical solution, when a network card device has only one port, it can also communicate with other devices in a remote direct memory access manner, thereby improving the stability of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0039] Figure 1 A schematic diagram of a communication architecture of remote direct memory access of a related technology is shown;
[0040] Figure 2 is a schematic diagram of a communication architecture for remote direct memory access provided by an embodiment of the present disclosure;
[0041] Figure 3a It is a flowchart of a switching method of a network card device based on a bonding mode provided by an embodiment of the present disclosure;
[0042] Figure 3bIt is a schematic diagram of resource ID management provided by an embodiment of the present disclosure;
[0043] Figure 4a A schematic diagram of a process flow of a switching method of a network card device based on a bonding mode provided by an embodiment of the present disclosure is shown;
[0044] Figure 4b A schematic diagram of a memory structure provided by an embodiment of the present disclosure is shown;
[0045] Figure 5 It is a structural schematic diagram of a switching device based on a network card device in bonding mode provided by an embodiment of the present disclosure;
[0046] Figure 6 It is a structural diagram of a network card device based on bonding mode in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0047] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0048] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0049] At present, in the related art, the network card device based on the bonding mode establishes a bonding relationship between two ports of the same network card device, and then performs remote direct memory access with other devices. For details, please refer to Figure 1 A schematic diagram of a communication architecture of remote direct memory access of a related technology is shown.
[0050] For a clearer explanation, please refer to the following glossary:
[0051] Remote Direct Memory Access (RDMA) is one of the important supporting technologies for realizing the potential of DPU solutions. It is a computer network technology that allows two nodes on the network to directly access each other's memory and complete data communication without the involvement of the operating system. Therefore, it has the advantages of low latency, high bandwidth, and reduced system resource consumption. From the perspective of system software design, RDMA can be directly regarded as a faster network. The current implementations of RDMA mainly include InfiniBand, RoCE (RDMA over Converged Ethernet) and iWARP (Internet Wide Area RDMA Protocol). Among them, RoCE can achieve high-performance data transmission on Ethernet by encapsulating RDMA operations in the Ethernet protocol and is the most widely used.
[0052] The Data Processing Unit (DPU) is a new generation of computing chip that is data-centric, I / O intensive, and uses software-defined technology to support infrastructure resource layer virtualization. It has the capabilities of improving computing system efficiency, reducing the total cost of ownership of the overall system, improving data processing performance, and reducing performance losses of other computing chips.
[0053] Linux bonding: The Linux bonding driver provides a way to bundle multiple network interface devices into a single network interface setting for use in network load balancing and network redundancy.
[0054] A memory region (MR) is a continuous memory managed by RDMA. RDMA controls the access rights of the memory for remote access. Each memory has a set of lkey and rkey, which are two 32-bit numbers used to represent the memory region. lkey and rkey are required when sending and receiving data.
[0055] The RDMA doorbell mechanism (DB for short) is a technology used in RDMA communication. It directly communicates between user state and kernel state, thus avoiding the bottleneck of CPU participation and data copying commonly seen in traditional network communication. The core advantage of this mechanism is that it can significantly reduce the latency of data transmission and improve the efficiency of data transmission.
[0056] Multiple network cards are virtualized into one to achieve redundancy; multiple network cards appear as one card with the same IP address; the network configuration uses Bonding technology to provide redundancy at the network port hardware level to prevent single point failure of a single network port application.
[0057] For multiple physical network cards, one of the physical network cards will be set as the Master, and the other network cards are Slaves. The MAC address of the Bond network card is taken from the physical network card marked as the Master, and then this MAC address is copied to the other physical network cards.
[0058] The active-standby mode is commonly used in daily life. In this mode, only one slave device is activated. Only when the interface of the working slave device fails, the other slave device interface will be activated. When a failover occurs in the active-standby mode, one or more gratuitous ARPs will be sent on the newly activated slave device interface. Gratuitous ARPs will be sent on the master and slave device interfaces and all VLAN interfaces configured on the interface. At least one IP address needs to be configured on these interfaces. The gratuitous ARPs sent on the VLAN interface will be attached with the appropriate VLAN id, so this mode provides fault tolerance.
[0059] from Figure 1 It can be seen that the related technology cannot realize the switching between multiple network card devices and has limitations. Figure 2 A schematic diagram of a communication architecture for remote direct memory access provided by an embodiment of the present disclosure is shown.
[0060] Figure 3a 1 is a flow chart of a switching method of a network card device in bonding mode provided by an embodiment of the present disclosure, and the method can be executed by a network card device. Figure 3a As shown, the method provided in this embodiment includes the following steps:
[0061] S301. In response to a switching operation of a network card device in bonding mode, a switching operation message is generated, and the switching operation message is passed to a preset callback interface; wherein the switching operation message is used to indicate switching a first network card device to a second network card device; the first network card device and the second network card device are network card devices in bonding mode.
[0062] In one example, the network card device based on the bonding mode includes a first network card device and a second network card device. The first network card device and the second network card device have the same hardware structure and the same resource ID. For details, see Figure 3b A schematic diagram of resource ID management is shown. The advantage of such a setting is that after the network card device is switched, it can be ensured that the network card device after the switch can use the index information of the network card device before the switch.
[0063] In one example, the first network card device represents the network card device before switching, and the second network card device represents the network card device after switching. Specifically, the switching operation can be triggered by a port exception in the first network card device. Further, the switching operation message can be a preset instruction message, a preset code file, or a preset identifier. The preset callback interface can be accessed in real time by the remote direct memory access driver module.
[0064] S302: Retrieve a switching operation message from a preset callback interface based on the remote direct memory access driver module.
[0065] In one example, after the remote direct memory access driver module finds that the switching operation message exists in the preset callback interface, it retrieves the switching operation message from the preset callback interface.
[0066] S303. Based on the remote direct memory access driver module, according to the switching operation message, the current data information of the first network card device is switched to the second network card device via the shared memory, and the current data information is executed in the second network card device; wherein the first network card device and the second network card device have the same hardware structure; and the shared memory is pre-created by the remote direct memory access driver module.
[0067] In one example, the shared memory can be accessed by the first network card device and can also be accessed by the second network card device. The current data information is the data information being processed by the first network card device. After obtaining the switching operation message, the remote direct memory access driver module first stores the current data information of the first network card device in the shared memory, then switches the first network card device to the second network card device, and then the second network card device executes the current data information.
[0068] The disclosed embodiment provides a switching method for a network card device in bonding mode, the method comprising: generating a switching operation message in response to a switching operation of the network card device in bonding mode, and transmitting the switching operation message to a preset callback interface; wherein the switching operation message is used to indicate that the first network card device is switched to the second network card device; the first network card device and the second network card device are network card devices in bonding mode; calling the switching operation message from the preset callback interface based on the remote direct memory access driver module; switching the current data information of the first network card device to the second network card device via the shared memory based on the remote direct memory access driver module according to the switching operation message, and executing the current data information in the second network card device; wherein the first network card device and the second network card device have the same hardware structure; and the shared memory is pre-created by the remote direct memory access driver module. By adopting this technical solution, when a network card device has only one port, it can also communicate with other devices in a remote direct memory access manner, thereby improving the stability of data transmission.
[0069] Figure 4a The flowchart of a method for switching a network card device in bonding mode provided by an embodiment of the present disclosure is shown. The embodiment of the present disclosure is optimized based on the above embodiment, and the embodiment of the present disclosure can be combined with various optional solutions in one or more of the above embodiments.
[0070] like Figure 4a As shown, the switching method of the network card device based on the bonding mode may include the following steps:
[0071] S401. In response to a switching operation of a network card device in bonding mode, a switching operation message is generated, and the switching operation message is passed to a preset callback interface; wherein the switching operation message is used to indicate switching a first network card device to a second network card device; the first network card device and the second network card device are network card devices in bonding mode.
[0072] In an example, this step may refer to the description of step S301.
[0073] S402: Retrieve a switching operation message from a preset callback interface based on the remote direct memory access driver module.
[0074] In an example, this step may refer to the description of step S302.
[0075] S403: Send a switching operation message to the first network card device and the second network card device based on the remote direct memory access driver module.
[0076] In one example, after receiving the switching operation message, the remote direct memory access driver module sends the switching operation message to the first network card device and the second network card device, thereby causing the first network card device to perform the corresponding operation and the second network card device to also perform the corresponding operation.
[0077] S404: After receiving the switching operation message, the first network card device suspends processing of current data information.
[0078] In one example, after receiving the switching operation message, the first network card device no longer processes the current data information and prepares for switching to the second network card device.
[0079] S405: The first network card device stores the current data information in the shared memory according to the switching operation message, and changes the state identifier of the shared memory from the first identifier to the second identifier after the transmission is completed.
[0080] In one example, the first network card device suspends processing of current data information and stores the current data information in a shared memory, and then after completing the storage of all current data information, modifies the state flag of the shared memory from a first flag to a second flag, wherein the second flag indicates that the shared memory completes the storage operation of all current data information.
[0081] S406: When the second network card device detects that the state identifier of the shared memory is the second identifier, it obtains current data information from the shared memory and switches the first network card device to the second network card device.
[0082] In one example, when the second network card device detects that the state identifier of the shared memory is the second identifier, it means that the second network card device knows that the shared memory has completed the storage operation of all current data information. Then the current data information is obtained from the shared memory, and the first network card device is switched to the second network card device.
[0083] In one example, the current data information includes sq information, rq information, cq information, etc.
[0084] In one example, the first network card device and the second network card device can access the MR memory and the shared memory. For a clearer description, see Figure 4b A schematic diagram of a memory structure is shown in FIG. Figure 4b It can be seen that both the first network card device and the second network card device can access MR memory, sq information, rq information, cq information, etc.
[0085] S407: Send a notification message to the remote direct memory access driver module based on the second network card device; wherein the notification message is used to indicate that the switching from the first network card device to the second network card device is completed.
[0086] In an example, the second network card device sends a notification message to the remote direct memory access driver module to notify the remote direct memory access driver module that the switching from the first network card device to the second network card device is completed.
[0087] S408, executing the current data information in the second network card device; wherein the first network card device and the second network card device have the same hardware structure; and the shared memory is pre-created by the remote direct memory access driver module.
[0088] In one example, the method further includes:
[0089] A shared memory is created based on the remote direct memory access driver module, and the shared memory state identifier is determined as the first identifier.
[0090] In an example, the shared memory is a physical address, and the first identifier indicates that the shared memory can be used.
[0091] The disclosed embodiment provides a switching method for a network card device in a bonding mode, the method comprising: the first network card device stores the current data information in a shared memory according to a switching operation message, and changes the state identifier of the shared memory from the first identifier to the second identifier after the transmission is completed. When the second network card device detects that the state identifier of the shared memory is the second identifier, it obtains the current data information from the shared memory and switches the first network card device to the second network card device. By adopting this technical solution, the network card device can be switched in time through the identifier of the shared memory, and the data import and export can be completed autonomously within the hardware, the driver is not aware of it, and the switching is smoother.
[0092] Figure 5 1 is a schematic diagram of a switching device based on a network card device in bonding mode provided by an embodiment of the present disclosure. The switching device based on a network card device in bonding mode can be understood as the network card device based on bonding mode or some functional modules in the network card device based on bonding mode. Figure 5 As shown, the switching device 50 based on the network card device in bonding mode includes:
[0093] The bonding module 501 is used to generate a switching operation message in response to a switching operation of a network card device in a bonding mode, and transmit the switching operation message to a preset callback interface; wherein the switching operation message is used to indicate that the first network card device is switched to the second network card device; the first network card device and the second network card device are network card devices in a bonding mode;
[0094] A remote direct memory access driver module 502 is used to retrieve a switching operation message from a preset callback interface;
[0095] The remote direct memory access driver module 502 is used to switch the current data information of the first network card device to the second network card device via the shared memory according to the switching operation message, and execute the current data information in the second network card device; wherein the first network card device and the second network card device have the same hardware structure; the shared memory is pre-created by the remote direct memory access driver module.
[0096] In one example, the remote direct memory access driver module 502 is specifically configured to send a switching operation message to the first network card device and the second network card device;
[0097] The first network card device 503 is used to store the current data information in the shared memory according to the switching operation message, and change the state identifier of the shared memory from the first identifier to the second identifier after the transmission is completed;
[0098] The second network card device 504 is used to obtain current data information from the shared memory and switch the first network card device to the second network card device when detecting that the state identifier of the shared memory is the second identifier.
[0099] In one example, the apparatus 50 further includes:
[0100] The first network card device 503 is configured to suspend processing of current data information after receiving the switching operation message.
[0101] In one example, the apparatus 50 further includes:
[0102] The remote direct memory access driver module 502 is further configured to create a shared memory and determine the shared memory state identifier as the first identifier.
[0103] In one example, the apparatus 50 further includes:
[0104] The second network card device 504 is further used to send a notification message to the remote direct memory access driver module; wherein the notification message is used to indicate that the switching from the first network card device to the second network card device is completed.
[0105] The device provided in this embodiment can execute the method of any of the above embodiments, and its execution method and beneficial effects are similar, which will not be repeated here.
[0106] The embodiment of the present disclosure also provides a network card device based on bonding mode, which includes: a memory, in which a computer program is stored; a processor, for executing the computer program, and when the computer program is executed by the processor, the method of any of the above embodiments can be implemented.
[0107] For example, Figure 6 This is a schematic diagram of the structure of a network card device based on the bonding mode in the embodiment of the present disclosure. Figure 6 , which shows a schematic diagram of the structure of the network card device 1000 based on the bonding mode in the embodiment of the present disclosure. The network card device 1000 based on the bonding mode in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The network card device based on the bonding mode is shown as an example only and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0108] like Figure 6 As shown, the network card device 1000 based on the bonding mode may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1002 or the program loaded from the storage device 1008 to the random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the network card device 1000 based on the bonding mode are also stored. The processing device 1001, the ROM 1002 and the RAM 1003 are connected to each other through a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0109] Typically, the following devices may be connected to the I / O interface 1005: input devices 1006 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1008 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 may allow the network card device 1000 in bonding mode to communicate with other devices wirelessly or by wire to exchange data. Figure 6 The network card device 1000 based on the bonding mode with various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown, and more or fewer devices may be implemented or possessed alternatively.
[0110] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 1009, or installed from a storage device 1008, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0111] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0112] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0113] The computer-readable medium may be included in the network card device based on the bonding mode; or may exist independently without being assembled into the network card device based on the bonding mode.
[0114] The computer-readable medium carries one or more programs. When the one or more programs are executed by the network card device based on the bonding mode, the network card device based on the bonding mode: generates a switching operation message in response to a switching operation of the network card device based on the bonding mode, and transmits the switching operation message to a preset callback interface; wherein the switching operation message is used to indicate that the first network card device is switched to the second network card device; the first network card device and the second network card device are network card devices based on the bonding mode; the switching operation message is retrieved from the preset callback interface based on the remote direct memory access driver module; the current data information of the first network card device is switched to the second network card device via a shared memory based on the remote direct memory access driver module according to the switching operation message, and the current data information is executed in the second network card device; wherein the first network card device and the second network card device have the same hardware structure; and the shared memory is pre-created by the remote direct memory access driver module.
[0115] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0116] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0117] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0118] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0119] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0120] The embodiments of the present disclosure further provide a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method of any of the above embodiments can be implemented. The execution method and beneficial effects are similar and will not be repeated here.
[0121] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0122] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for switching a network card device based on a bonding mode, characterized in that: include: In response to a switching operation of a network card device in bonding mode, a switching operation message is generated, and the switching operation message is transmitted to a preset callback interface; wherein the switching operation message is used to indicate that the first network card device is switched to the second network card device; the first network card device and the second network card device are network card devices in bonding mode; Retrieving the switching operation message from the preset callback interface based on the remote direct memory access driver module; Based on the remote direct memory access driver module, according to the switching operation message, the current data information of the first network card device is switched to the second network card device via the shared memory, and the current data information is executed in the second network card device; wherein, the first network card device and the second network card device have the same hardware structure; and the shared memory is pre-created by the remote direct memory access driver module.
2. The method according to claim 1, characterized in that The method of switching the current data information of the first network card device to the second network card device via the shared memory based on the remote direct memory access driver module according to the switching operation message includes: Sending the switching operation message to the first network card device and the second network card device based on the remote direct memory access driver module; The first network card device stores the current data information in the shared memory according to the switching operation message, and changes the state identifier of the shared memory from the first identifier to the second identifier after the transmission is completed; When the second network card device detects that the state identifier of the shared memory is the second identifier, the current data information is obtained from the shared memory, and the first network card device is switched to the second network card device.
3. The method according to claim 2, characterized in that Before the first network card device stores the current data information in the shared memory according to the switching operation message, the method further includes: After receiving the switching operation message, the first network card device suspends processing the current data information.
4. The method according to any one of claims 1 to 2, characterized in that The method further comprises: The shared memory is created based on the remote direct memory access driver module, and the shared memory state identifier is determined as a first identifier.
5. The method according to any one of claims 1 to 2, characterized in that: The method further comprises: A notification message is sent to the remote direct memory access driver module based on the second network card device; wherein the notification message is used to indicate that the switching from the first network card device to the second network card device is completed.
6. A switching device for a network card device in bonding mode, characterized in that: include: The bonding module is used to generate a switching operation message in response to a switching operation of a network card device in a bonding mode, and transmit the switching operation message to a preset callback interface; wherein the switching operation message is used to indicate that the first network card device is switched to the second network card device; the first network card device and the second network card device are network card devices in the bonding mode; A remote direct memory access driver module, used for retrieving the switching operation message from the preset callback interface; The remote direct memory access driver module is used to switch the current data information of the first network card device to the second network card device via the shared memory according to the switching operation message, and execute the current data information in the second network card device; wherein, the first network card device and the second network card device have the same hardware structure; and the shared memory is pre-created by the remote direct memory access driver module.
7. The device according to claim 6, characterized in that The device also includes: The remote direct memory access driver module is specifically used to send the switching operation message to the first network card device and the second network card device; The first network card device is used to store the current data information in the shared memory according to the switching operation message, and change the state identifier of the shared memory from the first identifier to the second identifier after the transmission is completed; The second network card device is used to obtain the current data information from the shared memory and switch the first network card device to the second network card device when detecting that the state identifier of the shared memory is the second identifier.
8. The device according to claim 7, characterized in that The device also includes: The first network card device is used to suspend processing of the current data information after receiving the switching operation message.
9. A network card device based on bonding mode, characterized in that: include: A processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the method according to any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Cited By
Network card fault switching method and device, electronic equipment, storage medium and product
CN120342852A
Network card fault switching method, device, electronic device, storage medium and product
CN120342852B
RDMA dual-network-card main-standby switching method and equipment
CN120743638A
A method and device for RDMA dual network card active-standby switching
CN120743638B
Network card switching method of PBX (Private Branch Exchange) equipment and PBX equipment
CN121098719A