[go: up one dir, main page]

CN119902907A - Method and device for switching network card devices based on bonding mode - Google Patents

Method and device for switching network card devices based on bonding mode Download PDF

Info

Publication number
CN119902907A
CN119902907A CN202411647543.2A CN202411647543A CN119902907A CN 119902907 A CN119902907 A CN 119902907A CN 202411647543 A CN202411647543 A CN 202411647543A CN 119902907 A CN119902907 A CN 119902907A
Authority
CN
China
Prior art keywords
network card
card device
switching operation
operation message
shared memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411647543.2A
Other languages
Chinese (zh)
Inventor
潘晓春
郭兴
黄明亮
张宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yusur Technology Co ltd
Original Assignee
Yusur Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yusur Technology Co ltd filed Critical Yusur Technology Co ltd
Priority to CN202411647543.2A priority Critical patent/CN119902907A/en
Publication of CN119902907A publication Critical patent/CN119902907A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer And Data Communications (AREA)

Abstract

本公开实施例提供了一种基于bonding模式下的网卡设备的切换方法及装置,涉及网卡设备技术领域。该方法包括:响应于基于bonding模式下的网卡设备的切换操作,生成切换操作消息,将切换操作消息传递至预设的回调接口;基于远程直接内存访问驱动模块从预设的回调接口中调取切换操作消息;基于远程直接内存访问驱动模块根据切换操作消息,将第一网卡设备的当前数据信息经由共享内存切换至第二网卡设备,并在第二网卡设备内执行当前数据信息。采用本技术方案,能够在一个网卡设备只有一个端口时,还能够与其他设备进行远程直接内存访问的通讯方式,进而提高数据传输的稳定性。

The disclosed embodiment provides a switching method and device based on a network card device in bonding mode, and relates to the technical field of network card devices. The method includes: in response to a switching operation of a network card device in bonding mode, generating a switching operation message, and passing the switching operation message to a preset callback interface; based on a remote direct memory access driver module, retrieving 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 shared memory according to the switching operation message, and executing the current data information in the second network card device. 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.

Description

Network card equipment switching method and device based on bonding mode
Technical Field
The embodiment of the disclosure relates to the technical field of network card equipment, in particular to a network card equipment switching method and device based on a bonding mode.
Background
The current remote direct memory access communication architecture based on the bonding master-slave mode is a bonding relationship established by two ports of the network card equipment, so that the communication mode of remote direct memory access with other equipment is realized.
However, when one network card device has one port, the communication mode of remote direct memory access with other devices cannot be performed.
Therefore, a switching method of a network card device based on a bonding mode is needed, and when one network card device has only one port, a communication mode of remote direct memory access can be performed with other devices, so that stability of data transmission is improved.
Disclosure of Invention
In order to solve the above technical problems or at least partially solve the above technical problems, an embodiment of the present disclosure provides a method and an apparatus for switching network card devices based on a bonding mode.
A first aspect of an embodiment of the present disclosure provides a method for switching network card devices in a bonding mode, where the method includes:
Responding to switching operation of network card equipment in a bonding mode, generating switching operation information, and transmitting the switching operation information to a preset callback interface, wherein the switching operation information is used for indicating switching of a first network card equipment into a second network card equipment;
The switching operation message is called from the preset callback interface based on a remote direct memory access driving module;
Based on the remote direct memory access driving module, switching the current data information of the first network card device to the second network card device through 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 driving module.
In one example, the switching, based on the remote direct memory access driving module, 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 includes:
transmitting the switching operation message to the first network card device and the second network card device based on a remote direct memory access driving module;
The first network card device stores the current data information into a shared memory according to the switching operation message, and after transmission is finished, the state identification of the shared memory is modified from a first identification to a second identification;
And when the second network card device detects that the state identifier of the shared memory is the second identifier, acquiring the current data information from the shared memory, and switching the first network card device to the second network card device.
In one example, before the first network card device stores the current data information into the shared memory according to the switching operation message, the method further includes:
And after the first network card equipment receives the switching operation message, suspending processing of the current data information.
In one example, the method further comprises:
And creating the shared memory based on the remote direct memory access driving module, and determining the shared memory state identifier as a first identifier.
In one example, the method further comprises:
and sending a notification message to the remote direct memory access driving module based on the second network card equipment, wherein the notification message is used for representing that the switching of the first network card equipment to the second network card equipment is completed.
A second aspect of an embodiment of the present disclosure provides a switching apparatus of a network card device in a bonding mode, where the apparatus includes:
The network interface device comprises a binding module, a preset callback interface, a first network interface device, a second network interface device, a first network interface device and a second network interface device, wherein the binding module is used for responding to switching operation of the network interface device in a binding mode, generating a switching operation message and transmitting the switching operation message to the preset callback interface;
the remote direct memory access driving module is used for calling the switching operation message from the preset callback interface;
The remote direct memory access driving module is used for switching the current data information of the first network card device to the second network card device through 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 driving module.
In one example, the remote direct memory access driving module is specifically configured 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 for storing the current data information into the shared memory according to the switching operation message, and modifying the state identifier of the shared memory from a first identifier to a second identifier after the transmission is finished;
And the second network card device is configured to acquire the current data information from the shared memory when detecting that the status identifier of the shared memory is the second identifier, and switch the first network card device to the second network card device.
In one example, the apparatus further comprises:
And the first network card device is used for suspending processing the current data information after receiving the switching operation message.
In one example, the apparatus further comprises:
The remote direct memory access driving module is further configured to create the shared memory, and determine the shared memory status identifier as a first identifier.
In one example, the apparatus further comprises:
The second network card device is further configured to send a notification message to the remote direct memory access driving module, where the notification message is used to characterize that the switching of the first network card device to the second network card device is completed.
A third aspect of the embodiments of the present disclosure provides a network card device based on a binding mode, including:
A processor and a memory, wherein the memory has stored therein a computer program which, when executed by the processor, performs the method of the first aspect.
A fourth aspect of the disclosed embodiments provides a computer readable storage medium having stored therein a computer program which, when executed by a processor, can implement the method of the first aspect described above.
The embodiment of the disclosure provides a switching method and device of network card equipment based on a bonding mode, wherein the method comprises the steps of responding to switching operation of the network card equipment based on the bonding mode, generating switching operation information, transmitting the switching operation information to a preset callback interface, wherein the switching operation information is used for indicating switching of a first network card equipment into a second network card equipment, the first network card equipment and the second network card equipment are based on the network card equipment in the bonding mode, calling the switching operation information from the preset callback interface based on a remote direct memory access driving module, switching current data information of the first network card equipment to the second network card equipment based on the remote direct memory access driving module according to the switching operation information, and executing the current data information in the second network card equipment, wherein the first network card equipment and the second network card equipment are provided with the same hardware structure, and the shared memory is pre-created by the remote direct memory access driving module. By adopting the technical scheme, when one network card device has only one port, the communication mode of remote direct memory access can be carried out with other devices, and the stability of data transmission is further improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, the drawings that are required for the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of a related art communication architecture for remote direct memory access;
FIG. 2 is a schematic diagram of a communication architecture for remote direct memory access according to an embodiment of the present disclosure;
fig. 3a is a flowchart of a switching method of a network card device in a binding mode according to an embodiment of the present disclosure;
FIG. 3b is a schematic diagram of managing resource IDs provided by embodiments of the present disclosure;
fig. 4a is a schematic flow chart of a switching method of a network card device in a binding mode according to an embodiment of the present disclosure;
Fig. 4b shows a schematic diagram of a memory structure according to an embodiment of the disclosure;
fig. 5 is a schematic structural diagram of a switching device of a network card device in a binding mode according to an embodiment of the present disclosure;
Fig. 6 is a schematic structural diagram of a network card device based on a binding mode in an embodiment of the disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced otherwise than as described herein, and it is apparent that the embodiments in the specification are only some, rather than all, of the embodiments of the present disclosure.
At present, a network card device based on a bonding mode in the related art establishes a bonding relationship between two ports of the same network card device, and further performs remote direct memory access with other devices. In particular, reference may be made to a schematic diagram of a related art remote direct memory access communication architecture shown in fig. 1.
For a clear description, reference may be made to the following explanation of the terms:
Remote direct memory access (Remote Direct Memory Access, RDMA for short) is one of the important support technologies to realize the potential of DPU schemes. The method is a computer network technology, which allows the direct access of the internal memories of two nodes on the network to complete the data communication without the participation of an operating system, thus having the advantages of low delay, high bandwidth, reduced system resource consumption and the like. From the perspective of system software design, RDMA can be directly regarded as a faster network, and current implementation of RDMA mainly includes InfiniBand, roCE (RDMA over Converged Ethernet) and iWARP (INTERNET WIDE AREA RDMA Protocol), wherein RoCE can implement high-performance data transmission on ethernet by encapsulating RDMA operations in an ethernet Protocol, and application is the widest.
The data processing unit (DataProcessingUnit, abbreviated as DPU) is a new generation of computing chip which uses data as a center, is I/O intensive, adopts a software defined technology route to support the virtualization of an infrastructure resource layer, and has the advantages of improving the efficiency of a computing system, reducing the total ownership cost of the whole system, improving the data processing efficiency and reducing the performance loss of other computing chips.
Linux binding drivers provide a network interface arrangement that bundles multiple network interface devices into a single network interface arrangement for use in network load balancing and network redundancy.
Memory Region (MR) is a block of contiguous Memory managed by RDMA, which controls access rights of Memory for remote access. Each memory has a set lkey and rkey of two 32-bit numbers representing the memory region. Lkey and rkey are needed for data transmission and reception.
RDMA doorbell mechanism (DB) is a technique used in RDMA communication that avoids the bottlenecks of CPU participation and data copying that are common in conventional network communication by directly communicating between a user state and a kernel state. The core advantage of this mechanism is that it can significantly reduce the delay of data transmission and improve the efficiency of data transmission.
The network configuration uses the Bonding technology to make redundancy of the network port hardware level, and single-point failure of single network port application is prevented.
For multiple physical network cards, one of the physical network cards is set as a Master (Master), the other network cards are Slave (Slave), the MAC address of the Bond network card is taken from the physical network card marked as the Master, and then the MAC address is copied to the other physical network cards.
It is common to use a master-slave mode in which only one slave is activated and the other slave interfaces are activated only when the interfaces of the active slave fail. A failover occurs in the primary and standby modes and one or more gratuitous ARP are sent on the newly activated slave interface. All VLAN interfaces on the master-slave device interfaces and on the interfaces where at least one IP address needs to be configured are sent gratuitous ARP. Gratuitous ARP sent on the VLAN interface will be attached with the appropriate VLAN id, so this mode provides fault tolerance.
As can be seen from fig. 1, the related art cannot realize switching among a plurality of network card devices, and has limitations. Fig. 2 is a schematic diagram of a communication architecture of remote direct memory access according to an embodiment of the disclosure.
Fig. 3a is a flowchart of a method for switching network card devices based on a binding mode according to an embodiment of the present disclosure, where the method may be performed by a network card device. As shown in fig. 3a, the method provided in this embodiment includes the following steps:
S301, generating a switching operation message in response to switching operation of the network card device in the bonding mode, and transmitting the switching operation message to a preset callback interface, wherein the switching operation message is used for indicating switching of the first network card device to the second network card device, and the first network card device and the second network card device are network card devices in the bonding mode.
In one example, the network card device in 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. In particular, reference may be made to a management diagram of resource IDs as shown in fig. 3 b. The advantage of this arrangement is that after the network card device is switched, it can be ensured that the network card device after switching can use the index information of the network card device before switching.
In one example, the first network card device characterizes a network card device before switching, and the second network card device characterizes a network card device after switching. Specifically, the switching operation may be triggered by a port abnormality in the first network card device. Further, the switching operation message may be a preset instruction message, a preset code file, or a preset identifier. The preset callback interface can be accessed by the remote direct memory access driving module in real time.
S302, a switching operation message is called from a preset callback interface based on the remote direct memory access driving module.
In one example, the remote direct memory access driver module invokes the handover operation message from the preset callback interface after querying that the handover operation message exists in the preset callback interface.
S303, switching the current data information of the first network card device to the second network card device through a shared memory based on the remote direct memory access driving 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 driving module.
In one example, the shared memory may be accessed by the first network card device or by the second network card device. The current data information is the data information being processed by the first network card device. After the remote direct memory access driving module acquires the switching operation message, the current data information of the first network card device is stored into the shared memory, then the first network card device is switched to the second network card device, and then the second network card device executes the current data information.
The embodiment of the disclosure provides a switching method of network card equipment based on a bonding mode, which comprises the steps of responding to switching operation of the network card equipment based on the bonding mode, generating switching operation information, transmitting the switching operation information to a preset callback interface, wherein the switching operation information is used for indicating that a first network card equipment is switched to a second network card equipment, the first network card equipment and the second network card equipment are based on the network card equipment in the bonding mode, calling the switching operation information from the preset callback interface based on a remote direct memory access driving module, switching current data information of the first network card equipment to the second network card equipment through a shared memory based on the remote direct memory access driving module according to the switching operation information, and executing the current data information in the second network card equipment, wherein the first network card equipment and the second network card equipment have the same hardware structure, and the shared memory is pre-created by the remote direct memory access driving module. By adopting the technical scheme, when one network card device has only one port, the communication mode of remote direct memory access can be carried out with other devices, and the stability of data transmission is further improved.
Fig. 4a is a flowchart illustrating a switching method of a network card device in a bonding mode according to an embodiment of the present disclosure. Embodiments of the present disclosure may be optimized based on the embodiments described above, and may be combined with various alternatives of one or more of the embodiments described above.
As shown in fig. 4a, the method for switching network card devices in the binding mode may include the following steps:
S401, responding to switching operation of network card equipment in a bonding mode, generating switching operation information, and transmitting the switching operation information to a preset callback interface, wherein the switching operation information is used for indicating switching of a first network card equipment into a second network card equipment, and the first network card equipment and the second network card equipment are based on the network card equipment in the bonding mode.
In one example, this step may be referred to the description of step S301.
S402, calling a switching operation message from a preset callback interface based on the remote direct memory access driving module.
In one example, this step may be referred to the description of step S302.
S403, the switching operation message is sent to the first network card device and the second network card device based on the remote direct memory access driving module.
In one example, after the remote direct memory access driving module receives the switching operation message, the switching operation message is sent to the first network card device and the second network card device, so that the first network card device performs a corresponding operation, and the second network card device also performs a corresponding operation.
S404, after the first network card device receives the switching operation message, the processing of the current data information is paused.
In one example, after the first network card device receives the switch operation message, the current data information is no longer processed in preparation for switching the second network card device.
S405, the first network card device stores the current data information into the shared memory according to the switching operation message, and after the transmission is finished, the state identification of the shared memory is modified from the first identification to the second identification.
In one example, the first network card device suspends processing the current data information and stores the current data information in the shared memory, and then modifies the state identifier of the shared memory after storing all the current data information is completed, and modifies the state identifier of the shared memory from the first identifier to the second identifier. The second identifier indicates that the shared memory completes the storage operation of all the current data information.
S406, when the second network card device detects that the state identifier of the shared memory is the second identifier, the current data information is acquired from the shared memory, and the first network card device is switched to the second network card device.
In one example, when the second network card device detects that the status identifier of the shared memory is the second identifier, it indicates that the second network card device knows that the shared memory completes the storing operation of all the current data information. And then acquiring current data information from the shared memory, and completing switching from the first network card device to the second network card device.
In one example, the current data information includes sq information, rq information, cq information, and the like.
In one example, the first network card device and the second network card device may access MR memory and shared memory. For a clearer illustration, reference may be made to a schematic memory structure shown in fig. 4 b. As can be seen from fig. 4b, the first network card device and the second network card device can each access the MR memory, the sq information, the rq information, the cq information, and the like.
S407, sending a notification message to the remote direct memory access driving module based on the second network card equipment, wherein the notification message is used for representing that the switching of the first network card equipment to the second network card equipment is completed.
In one example, the second network card device sends a notification message to the remote direct memory access driver module for notifying the remote direct memory access driver module that the switching of the first network card device to the second network card device is complete.
S408, executing 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 driving module.
In one example, the method further comprises:
and creating a shared memory based on the remote direct memory access driving module, and determining the shared memory state identifier as a first identifier.
In one example, the shared memory is a physical address and the first identifier characterizes the shared memory as available for use.
The embodiment of the disclosure provides a switching method of network card equipment based on a bonding mode, which comprises the following steps: the first network card device stores the current data information into the shared memory according to the switching operation message, and after the transmission is finished, the state identification of the shared memory is modified from the first identification to the second identification. When the second network card device detects that the state identifier of the shared memory is the second identifier, current data information is acquired from the shared memory, and the first network card device is switched to the second network card device. By adopting the technical scheme, the network card equipment can be switched in time through the identification of the shared memory, the data import and export are independently completed in the hardware, the drive is not perceived, and the switching is smoother.
Fig. 5 is a schematic structural diagram of a switching device of a network card device in a bonding mode according to an embodiment of the present disclosure, where the switching device of the network card device in the bonding mode may be understood as the network card device in the bonding mode or a part of functional modules in the network card device in the bonding mode. As shown in fig. 5, the switching device 50 of the network card device in the binding mode includes:
The bonding module 501 is configured to generate a switching operation message in response to a switching operation of the network card device in the bonding mode, and transmit the switching operation message to a preset callback interface, where the switching operation message is used to instruct to switch the first network card device to the second network card device;
the remote direct memory access driving module 502 is configured to invoke a switching operation message from a preset callback interface;
The remote direct memory access driving module 502 is configured to switch 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, where the first network card device and the second network card device have the same hardware structure, and the shared memory is created in advance by the remote direct memory access driving module.
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;
the first network card device 503 is configured to store current data information into the shared memory according to the switching operation message, and modify the status identifier of the shared memory from a first identifier to a second identifier after the transmission is completed;
And the second network card device 504 is configured to acquire current data information from the shared memory when detecting that the status identifier of the shared memory is the second identifier, and switch the first network card device to the second network card device.
In one example, the apparatus 50 further comprises:
The first network card device 503 is configured to suspend processing of the current data information after receiving the switching operation message.
In one example, the apparatus 50 further comprises:
the remote direct memory access driver module 502 is further configured to create a shared memory, and determine a shared memory status identifier as a first identifier.
In one example, the apparatus 50 further comprises:
The second network card device 504 is further configured to send a notification message to the remote direct memory access driving module, where the notification message is used to characterize that the switching of the first network card device to the second network card device is completed.
The device provided in this embodiment can execute the method of any one of the above embodiments, and the execution mode and the beneficial effects thereof are similar, and are not described herein again.
The embodiment of the disclosure also provides a network card device based on the bonding mode, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor is used for executing the computer program, and when the computer program is executed by the processor, the method of any embodiment can be realized.
Fig. 6 is a schematic structural diagram of a network card device in a binding mode according to an embodiment of the present disclosure. Referring now in particular to fig. 6, a schematic diagram of a bonding mode based network card device 1000 suitable for use in implementing embodiments of the present disclosure is shown. The network card device 1000 in the binding-based mode in the embodiments 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), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The network card device shown in fig. 6 in the binding-based mode is only one example, and should not impose any limitation on the functions and scope of use of the embodiments of the present disclosure.
As shown in fig. 6, the network card device 1000 in the bonding mode may include a processing means (e.g., a central processor, a graphic processor, etc.) 1001 which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 1002 or a program loaded from a storage means 1008 into a Random Access Memory (RAM) 1003. In the RAM1003, various programs and data required for the operation of the network card device 1000 in the bonding mode are also stored. The processing device 1001, the ROM 1002, and the RAM1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
In general, devices including input devices 1006 such as a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc., output devices 1007 including a Liquid Crystal Display (LCD), speaker, vibrator, etc., storage devices 1008 including, for example, magnetic tape, hard disk, etc., and communication devices 1009 may be connected to the I/O interface 1005. The communication means 1009 may allow the network card device 1000 in the bonding mode to communicate with other devices wirelessly or by wire to exchange data. Although fig. 6 illustrates the network card apparatus 1000 in a bonding mode with various devices, it should be understood that not all illustrated devices are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 1009, or installed from the storage device 1008, or installed from the ROM 1002. The above-described functions defined in the method of the embodiment of the present disclosure are performed when the computer program is executed by the processing device 1001.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of a computer-readable storage medium may include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to electrical wiring, fiber optic cable, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some embodiments, the clients, servers 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"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be included in the network card device in the bonding mode, or may exist alone without being incorporated in the network card device in the bonding mode.
The computer readable medium carries one or more programs, when the one or more programs are executed by the network card device in the bonding mode, the network card device in the bonding mode is caused to generate a switching operation message in response to switching operation of the network card device in the bonding mode, the switching operation message is transmitted to a preset callback interface, the switching operation message is used for indicating 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, the switching operation message is called from the preset callback interface based on a remote direct memory access driving module, the current data information of the first network card device is switched to the second network card device through a shared memory based on the remote direct memory access driving 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 driving module.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
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 that may be used include Field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems-on-a-chip (SOCs), complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The embodiments of the present disclosure further provide a computer readable storage medium, where a computer program is stored, where the computer program, when executed by a processor, may implement a method according to any one of the foregoing embodiments, and the implementation manner and beneficial effects of the method are similar, and are not described herein again.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The foregoing is merely a specific embodiment of the disclosure to enable one skilled in the art to understand or practice the disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown and described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1.一种基于bonding模式下的网卡设备的切换方法,其特征在于,包括:1. A method for switching a network card device in bonding mode, comprising: 响应于基于bonding模式下的网卡设备的切换操作,生成切换操作消息,将所述切换操作消息传递至预设的回调接口;其中,所述切换操作消息用于指示将第一网卡设备切换为第二网卡设备;所述第一网卡设备和所述第二网卡设备是基于bonding模式下的网卡设备;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.根据权利要求1所述的方法,其特征在于,所述基于所述远程直接内存访问驱动模块根据所述切换操作消息,将所述第一网卡设备的当前数据信息经由共享内存切换至所述第二网卡设备,包括:2. The method according to claim 1, characterized in that 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 according to the switching operation message, comprising: 基于远程直接内存访问驱动模块将所述切换操作消息发送至所述第一网卡设备和所述第二网卡设备;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.根据权利要求2所述的方法,其特征在于,所述第一网卡设备根据所述切换操作消息将当前数据信息存储至共享内存中之前,所述方法还包括: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 comprises: 所述第一网卡设备接收到所述切换操作消息之后,暂停处理所述当前数据信息。After receiving the switching operation message, the first network card device suspends processing the current data information. 4.根据权利要求1-2中任一项所述的方法,其特征在于,所述方法还包括: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.根据权利要求1-2中任一项所述的方法,其特征在于,所述方法还包括: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.一种基于bonding模式下的网卡设备的切换装置,其特征在于,包括:6. A switching device for a network card device in bonding mode, comprising: bonding模块,用于响应于基于bonding模式下的网卡设备的切换操作,生成切换操作消息,将所述切换操作消息传递至预设的回调接口;其中,所述切换操作消息用于指示将第一网卡设备切换为第二网卡设备;所述第一网卡设备和所述第二网卡设备是基于bonding模式下的网卡设备;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.根据权利要求6所述的装置,其特征在于,所述装置还包括:7. The device according to claim 6, characterized in that the device further comprises: 所述远程直接内存访问驱动模块,具体用于将所述切换操作消息发送至所述第一网卡设备和所述第二网卡设备;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.根据权利要求7所述的装置,其特征在于,所述装置还包括:8. The device according to claim 7, characterized in that the device further comprises: 所述第一网卡设备,用于接收到所述切换操作消息之后,暂停处理所述当前数据信息。The first network card device is used to suspend processing of the current data information after receiving the switching operation message. 9.一种基于bonding模式下的网卡设备,其特征在于,包括:9. A network card device based on bonding mode, characterized by comprising: 处理器和存储器,其中,所述存储器中存储有计算机程序,当所述计算机程序被所述处理器执行时,所述处理器执行权利要求1-5中任一项所述的方法。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.一种计算机可读存储介质,其特征在于,所述存储介质中存储有计算机程序,当所述计算机程序被处理器执行时,实现如权利要求1-5中任一项所述的方法。10. A computer-readable storage medium, characterized in that a computer program is stored in the storage medium, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
CN202411647543.2A 2024-11-18 2024-11-18 Method and device for switching network card devices based on bonding mode Pending CN119902907A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411647543.2A CN119902907A (en) 2024-11-18 2024-11-18 Method and device for switching network card devices based on bonding mode

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411647543.2A CN119902907A (en) 2024-11-18 2024-11-18 Method and device for switching network card devices based on bonding mode

Publications (1)

Publication Number Publication Date
CN119902907A true CN119902907A (en) 2025-04-29

Family

ID=95464152

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411647543.2A Pending CN119902907A (en) 2024-11-18 2024-11-18 Method and device for switching network card devices based on bonding mode

Country Status (1)

Country Link
CN (1) CN119902907A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120342852A (en) * 2025-06-19 2025-07-18 济南浪潮数据技术有限公司 Network card failure switching method, device, electronic equipment, storage medium and product
CN120743638A (en) * 2025-09-08 2025-10-03 麒麟软件有限公司 RDMA (remote direct memory Access) dual-network-card main/standby switching method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120342852A (en) * 2025-06-19 2025-07-18 济南浪潮数据技术有限公司 Network card failure switching method, device, electronic equipment, storage medium and product
CN120342852B (en) * 2025-06-19 2025-09-05 济南浪潮数据技术有限公司 Network card fault switching method and device, electronic equipment, storage medium and product
CN120743638A (en) * 2025-09-08 2025-10-03 麒麟软件有限公司 RDMA (remote direct memory Access) dual-network-card main/standby switching method and device
CN120743638B (en) * 2025-09-08 2025-11-21 麒麟软件有限公司 RDMA (remote direct memory Access) dual-network-card main/standby switching method and device

Similar Documents

Publication Publication Date Title
CN114201317B (en) Data transmission method and device, storage medium and electronic equipment
RU2637428C2 (en) Scalable direct data exchange between nodes via express type peripheral components interconnection bus (pcie)
CN119902907A (en) Method and device for switching network card devices based on bonding mode
US9253287B2 (en) Speculation based approach for reliable message communications
CN112118315A (en) Data processing system, method, apparatus, electronic device and storage medium
JP2015521779A (en) System and method for input / output virtualization
CN105472291A (en) Digital video recorder with multiprocessor cluster and realization method of digital video recorder
CN115904761B (en) System on chip, vehicle and video processing unit virtualization method
CN117215989A (en) Heterogeneous acceleration device, heterogeneous acceleration system, heterogeneous acceleration method, heterogeneous acceleration device and storage medium
CN115237589A (en) SR-IOV-based virtualization method, device and equipment
CN119597489A (en) P2P communication method and system between IO devices based on PCIe-NTB
CN117499318A (en) Cloud computing virtual network system, and use method, device, equipment and medium thereof
US8819242B2 (en) Method and system to transfer data utilizing cut-through sockets
CN116633827A (en) Link state detection method, device, device and computer-readable medium
CN113765801B (en) Message processing method and device applied to data center, electronic equipment and medium
WO2025196499A1 (en) Resource allocation methods and systems, and electronic device, storage medium and program product
CN109981778B (en) Method, device, equipment and storage medium for realizing service of content distribution network
WO2021147466A1 (en) Message processing method and apparatus, and electronic device
CN118524015A (en) Distributed gateway configuration method, device, equipment and medium based on DPU
TW201509158A (en) Integrated network device and its service integration method
CN119052074B (en) DPU-based network configuration method, working node, control node and device
CN114979128A (en) Cross-region communication method and device and electronic equipment
CN116450370B (en) Method and device for inter-process communication
CN119052135B (en) Network path detection method, working node, device and media based on DPU
CN109933432A (en) Method and apparatus for sending data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination