CN112351089B - Data transmission method, system and device between virtual machine and accelerator - Google Patents

Data transmission method, system and device between virtual machine and accelerator Download PDF

Info

Publication number
CN112351089B
CN112351089B CN202011181692.6A CN202011181692A CN112351089B CN 112351089 B CN112351089 B CN 112351089B CN 202011181692 A CN202011181692 A CN 202011181692A CN 112351089 B CN112351089 B CN 112351089B
Authority
CN
China
Prior art keywords
virtual machine
accelerator
application
transmission path
transmission
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.)
Active
Application number
CN202011181692.6A
Other languages
Chinese (zh)
Other versions
CN112351089A (en
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202011181692.6A priority Critical patent/CN112351089B/en
Publication of CN112351089A publication Critical patent/CN112351089A/en
Application granted granted Critical
Publication of CN112351089B publication Critical patent/CN112351089B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols

Abstract

The invention discloses a method, a system and a device for data transmission between a virtual machine and an accelerator.A high-speed transmission path for realizing a high-speed transmission protocol by means of physical network card hardware is established between an application in the virtual machine and the accelerator; the other is a low-speed transmission path for realizing a low-speed transmission protocol by means of a network card device simulated by software. When the virtual machine does not receive the migration command, controlling the application in the virtual machine to communicate with the accelerator by using the high-speed transmission path. After the virtual machine receives the migration command, the application in the virtual machine is controlled to be switched to a low-speed transmission path to communicate with the accelerator, the low-speed transmission protocol depends on a network card device simulated by software, the migration process of the low-speed transmission protocol is similar to that of a CPU (central processing unit), and simple data transmission and copying are also realized, so that the application running in the virtual machine can be ensured not to be interrupted, namely the accelerator resource pooling scheme adopting the high-speed transmission protocol and the low-speed transmission protocol supports the migration of the virtual machine.

Description

Data transmission method, system and device between virtual machine and accelerator
Technical Field
The present invention relates to the field of servers, and in particular, to a method, a system, and an apparatus for data transmission between a virtual machine and an accelerator.
Background
To improve the computing power of the cloud, more and more accelerator resources are added to cloud data centers, such as accelerators having FPGA (Field Programmable Gate Array) processing units. Initially, the FPGA accelerator is plugged into a PCIe (peripheral component interconnect express) slot of the server, only serves applications on the server, and cannot be accessed by other servers, which results in a waste of the FPGA accelerator to some extent. In order to improve the utilization rate of FPGA accelerator resources, a server network card is used to realize that a local FPGA accelerator can be accessed by a remote server through a network, all FPGA accelerators logically form an accelerator resource pool together, and a resource manager allocates accelerator resources according to requirements, so that the utilization rate of the FPGA accelerator resources is improved. Meanwhile, in order to reduce the acceleration performance loss caused by the transmission delay between the Remote server and the FPGA accelerator, a high-speed data transmission protocol, such as an RDMA (Remote Direct Memory Access) protocol, is generally used as the network transmission protocol of the Remote server and the FPGA accelerator.
At present, the application of the server is usually deployed in a virtual machine created on the server. In order to ensure the operation and maintenance effect of the cloud data center, it is generally set that the virtual machine has a live migration function, that is, the virtual machine running on one physical machine can be migrated to another physical machine, and it is required that a user does not feel that an application in the virtual machine is interrupted during the migration process. If the application running in the virtual machine does not need to access the external device, the migration is only the copy of the state data of the CPU (central processing unit) and the Memory, and the virtual machine migration is easier to realize. If the application running in the virtual machine needs to access the external device through the network, problems sometimes exist, for example, the application running in the virtual machine needs to access the FPGA accelerator through the network, and the two devices communicate through the RDMA protocol, but the RDMA protocol implementation mechanism requires to store some states into the network card hardware, that is, the RDMA protocol depends on the network card hardware, and the high-speed data transmission can be guaranteed only by the function of the network card hardware, and the application running in the virtual machine is interrupted in the migration process due to the limitation of the network card hardware, that is, the existing FPGA accelerator resource pooling scheme adopting the RMDA protocol does not support the virtual machine migration.
Therefore, how to provide a solution to the above technical problem is a problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a method, a system and a device for data transmission between a virtual machine and an accelerator, which can ensure that an application running in the virtual machine is not interrupted, namely, the accelerator resource pooling scheme adopting a high-speed transmission protocol and a low-speed transmission protocol supports virtual machine migration.
In order to solve the above technical problem, the present invention provides a method for transmitting data between a virtual machine and an accelerator, comprising:
establishing a first transmission path supporting a first transmission protocol and a second transmission path supporting a second transmission protocol between an application in the virtual machine and an accelerator to be communicated; the first transmission protocol is a high-speed transmission protocol realized by means of physical network card hardware; the second transmission protocol is a low-speed transmission protocol realized by means of network card equipment simulated by software;
when the application in the virtual machine enters operation, controlling the application in the virtual machine to preferentially use the first transmission path to communicate with the accelerator;
and after the virtual machine receives a migration command, controlling the application in the virtual machine to be switched to the second transmission path to communicate with the accelerator.
Preferably, the process of establishing a first transmission path supporting a first transmission protocol and a second transmission path supporting a second transmission protocol between an application in the virtual machine and an accelerator to be communicated includes:
the method comprises the steps that a software stack used for supporting pooling of accelerator resources and supporting connection of different transmission protocols between an application in a virtual machine and an accelerator to be communicated based on the same physical network link is arranged on the virtual machine in advance; wherein the different transport protocols include the first transport protocol and the second transport protocol;
and calling an interface which is provided by the software stack and is connected with the accelerator at the application initialization stage in the virtual machine so that the software stack establishes a first transmission path and a second transmission path which are required by communication between the application in the virtual machine and the accelerator.
Preferably, after the virtual machine receives the migration command, the process of controlling the application in the virtual machine to switch to the second transmission path to communicate with the accelerator includes:
after the virtual machine receives a migration command, closing the first transmission path, and marking the first transmission path as unavailable;
when the application in the virtual machine uses an interface connected with the accelerator for communication, if the first transmission path is detected to be unavailable, the application in the virtual machine is automatically switched to the second transmission path to complete the communication between the application in the virtual machine and the accelerator.
Preferably, the method for data transmission between the virtual machine and the accelerator further includes:
after the migration of the virtual machine is completed, reestablishing the first transmission path between the application in the virtual machine and the accelerator, and marking the first transmission path as available;
when the application in the virtual machine uses an interface connected with the accelerator for communication, if the first transmission path is detected to be available, the first transmission path is preferentially used for completing the communication between the application in the virtual machine and the accelerator.
Preferably, the first transport protocol is specifically an RDMA protocol; the second transport protocol is specifically a TCP protocol.
Preferably, the method for data transmission between the virtual machine and the accelerator further includes:
setting an indicating device used for indicating a specific transmission path adopted by an application in a virtual machine running on a server in advance on the server;
and controlling the indicating device to perform corresponding indicating operation according to a specific transmission path used by the application in the virtual machine during running.
In order to solve the above technical problem, the present invention further provides a data transmission system between a virtual machine and an accelerator, including:
the link establishing module is used for establishing a first transmission path supporting a first transmission protocol and a second transmission path supporting a second transmission protocol between the application in the virtual machine and the accelerator to be communicated; the first transmission protocol is a high-speed transmission protocol realized by means of physical network card hardware; the second transmission protocol is a low-speed transmission protocol realized by means of network card equipment simulated by software;
the high-speed transmission module is used for controlling the application in the virtual machine to preferentially use the first transmission path to communicate with the accelerator when the application in the virtual machine enters operation;
and the low-speed transmission module is used for controlling the application in the virtual machine to be switched to the second transmission path to communicate with the accelerator after the virtual machine receives the migration command.
Preferably, the link establishing module is specifically configured to:
the method comprises the steps that a software stack used for supporting pooling of accelerator resources and supporting connection of different transmission protocols between an application in a virtual machine and an accelerator to be communicated based on the same physical network link is arranged on the virtual machine in advance; wherein the different transport protocols include the first transport protocol and the second transport protocol;
and calling an interface which is provided by the software stack and is connected with the accelerator at the application initialization stage in the virtual machine so that the software stack establishes a first transmission path and a second transmission path which are required by communication between the application in the virtual machine and the accelerator.
Preferably, the low-speed transmission module is specifically configured to:
after the virtual machine receives a migration command, closing the first transmission path, and marking the first transmission path as unavailable;
when the application in the virtual machine uses an interface connected with the accelerator for communication, if the first transmission path is detected to be unavailable, the application in the virtual machine is automatically switched to the second transmission path to complete the communication between the application in the virtual machine and the accelerator.
In order to solve the above technical problem, the present invention further provides a data transmission device between a virtual machine and an accelerator, including:
a memory for storing a computer program;
and the processor is used for realizing the steps of any one of the above data transmission methods between the virtual machine and the accelerator when executing the computer program.
The invention provides a data transmission method between a virtual machine and an accelerator, wherein two different and independent data transmission paths are established between an application in the virtual machine and the accelerator, and one is a high-speed transmission path for realizing a high-speed transmission protocol by means of physical network card hardware; the other is a low-speed transmission path for realizing a low-speed transmission protocol by means of a network card device simulated by software. When the virtual machine does not receive the migration command, the application in the virtual machine is controlled to preferentially use the high-speed transmission path to communicate with the accelerator, namely, the data transmission with high bandwidth and low delay is carried out. After the virtual machine receives the migration command, the application in the virtual machine is controlled to be switched to a low-speed transmission path to communicate with the accelerator, the low-speed transmission protocol depends on a network card device simulated by software, the migration process of the low-speed transmission protocol is similar to that of a CPU (central processing unit), and simple data transmission and copying are also realized, so that the running application in the virtual machine can be ensured not to be interrupted, namely, the accelerator resource pooling scheme adopting the high-speed transmission protocol and the low-speed transmission protocol supports the migration of the virtual machine.
The invention also provides a system and a device for data transmission between the virtual machine and the accelerator, and the system and the device have the same beneficial effects as the migration method.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed in the prior art and the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a flowchart of a data transmission method between a virtual machine and an accelerator according to an embodiment of the present invention;
fig. 2 is a schematic diagram of data transmission between a virtual machine and an accelerator according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data transmission system between a virtual machine and an accelerator according to an embodiment of the present invention.
Detailed Description
The core of the invention is to provide a method, a system and a device for data transmission between a virtual machine and an accelerator, which can ensure that the application running in the virtual machine is not interrupted, namely, the accelerator resource pooling scheme adopting a high-speed transmission protocol and a low-speed transmission protocol supports virtual machine migration.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating a data transmission method between a virtual machine and an accelerator according to an embodiment of the present invention.
The data transmission method between the virtual machine and the accelerator comprises the following steps:
step S1: establishing a first transmission path supporting a first transmission protocol and a second transmission path supporting a second transmission protocol between an application in the virtual machine and an accelerator to be communicated; the first transmission protocol is a high-speed transmission protocol realized by means of physical network card hardware; the second transmission protocol is a low-speed transmission protocol realized by means of a network card device simulated by software.
Specifically, two different and independent data transmission paths are established between an application in a virtual machine and an accelerator to be communicated, wherein the two different and independent data transmission paths are respectively called as a first transmission path and a second transmission path, the first transmission path supports a high-speed transmission protocol realized by means of physical network card hardware, and namely the first transmission path is a high-speed transmission path; the second transmission path supports a low-speed transmission protocol realized by means of a network card device simulated by software, namely the second transmission path is a low-speed transmission path.
The reason why the high-speed transmission path and the low-speed transmission path are established between the application in the virtual machine and the accelerator to be communicated is because: if a high-speed transmission path is adopted between the application in the virtual machine and the accelerator for data transmission, high-bandwidth and low-delay data transmission can be realized, so that the acceleration performance loss caused by the transmission delay between a remote server and the accelerator is reduced; if the application in the virtual machine and the accelerator adopt a low-speed transmission path for data transmission, the application running in the virtual machine accesses the accelerator by means of the network card device simulated by the software, and because the state of the network card device simulated by the software is not stored in network card hardware, the migration of the virtual machine is supported, so that a foundation is provided for realizing the pooling of accelerator resources which can adopt a high-speed transmission protocol and can ensure the real-time migration of the virtual machine.
Step S2: and when the application in the virtual machine enters the operation, controlling the application in the virtual machine to preferentially use the first transmission path to communicate with the accelerator.
Specifically, when the application in the virtual machine runs, the application in the virtual machine is controlled to preferentially use the first transmission path to communicate with the accelerator, that is, when the virtual machine does not receive a migration command issued by the virtual machine management software, the application in the virtual machine preferentially uses the high-speed transmission path to communicate with the accelerator, so that high-bandwidth and low-delay data transmission is realized.
Step S3: and after the virtual machine receives the migration command, controlling the application in the virtual machine to be switched to a second transmission path to communicate with the accelerator.
Specifically, after the virtual machine receives a migration command issued by the virtual machine management software, the application in the virtual machine is controlled to be switched to the second transmission path to communicate with the accelerator, that is, in the migration process of the virtual machine, the application in the virtual machine uses the low-speed transmission path to communicate with the accelerator, and the migration of the virtual machine can be successfully completed.
The invention provides a data transmission method between a virtual machine and an accelerator, wherein two different and independent data transmission paths are established between an application in the virtual machine and the accelerator, and one is a high-speed transmission path for realizing a high-speed transmission protocol by means of physical network card hardware; the other is a low-speed transmission path for realizing a low-speed transmission protocol by means of a network card device simulated by software. When the virtual machine does not receive the migration command, the application in the virtual machine is controlled to preferentially use the high-speed transmission path to communicate with the accelerator, namely, the data transmission with high bandwidth and low delay is carried out. After the virtual machine receives the migration command, the application in the virtual machine is controlled to be switched to a low-speed transmission path to communicate with the accelerator, the low-speed transmission protocol depends on a network card device simulated by software, the migration process of the low-speed transmission protocol is similar to that of a CPU (central processing unit), and simple data transmission and copying are also realized, so that the running application in the virtual machine can be ensured not to be interrupted, namely, the accelerator resource pooling scheme adopting the high-speed transmission protocol and the low-speed transmission protocol supports the migration of the virtual machine.
On the basis of the above-described embodiment:
referring to fig. 2, fig. 2 is a schematic diagram of data transmission between a virtual machine and an accelerator according to an embodiment of the present invention.
As an alternative embodiment, the process of establishing a first transmission path supporting a first transmission protocol and a second transmission path supporting a second transmission protocol between an application in a virtual machine and an accelerator to be communicated includes:
the method comprises the steps that a software stack used for supporting pooling of accelerator resources and supporting connection of different transmission protocols between an application in a virtual machine and an accelerator to be communicated based on the same physical network link is arranged on the virtual machine in advance; wherein the different transport protocols comprise a first transport protocol and a second transport protocol;
in the application initialization stage in the virtual machine, an interface provided by the software stack and connected with the accelerator is called, so that the software stack establishes a first transmission path and a second transmission path required by communication between the application in the virtual machine and the accelerator.
Specifically, the specific way for establishing the transmission path between the application in the virtual machine and the accelerator to be communicated is as follows:
the method and the device for realizing the virtual machine resource pooling have the advantages that the software stack is arranged on the virtual machine in advance, the resource pooling of the accelerator is supported, and the connection of different transmission protocols between the application in the virtual machine and the accelerator to be communicated is realized based on the same physical network link. It should be noted that each transport protocol is implemented in the form of a plug-in, that is, an application in the virtual machine simply calls an interface provided by the software stack and connected to the accelerator, and the protocol that can be used by the interface is determined by the supported plug-in. Meanwhile, the software stack has the capability of protocol switching, and when the protocol (high-speed transmission protocol) with the first priority is unavailable, the protocol (low-speed transmission protocol) with the second priority can be immediately switched, so that the two connected parties can be ensured to continue to communicate.
In the application initialization stage of the virtual machine, the interface provided by the software stack and connected with the accelerator is called, and at the moment, the software stack can establish a high-speed transmission path and a low-speed transmission path required by communication between the application in the virtual machine and the accelerator.
As an alternative embodiment, after the virtual machine receives the migration command, a process of controlling the application in the virtual machine to switch to the second transmission path to communicate with the accelerator includes:
after the virtual machine receives the migration command, closing the first transmission path, and marking the first transmission path as unavailable;
when the application in the virtual machine uses an interface connected with the accelerator for communication, if the first transmission path is detected to be unavailable, the application in the virtual machine is automatically switched to the second transmission path to complete the communication between the application in the virtual machine and the accelerator.
Specifically, according to the method and the device, after the virtual machine receives the migration command issued by the virtual machine management software, the high-speed transmission path is closed first, and the high-speed transmission path is marked as unavailable. When the application in the virtual machine uses an interface connected with an accelerator for communication, and a software stack detects that a high-speed transmission path is unavailable, the software stack automatically switches to a low-speed transmission path to complete the communication between the application in the virtual machine and the accelerator, so that the application in the virtual machine uses the low-speed transmission path to communicate with the accelerator in the migration process of the virtual machine.
As an optional embodiment, the method for data transmission between the virtual machine and the accelerator further includes:
after the migration of the virtual machine is completed, reestablishing a first transmission path between the application in the virtual machine and the accelerator, and marking the first transmission path as available;
when the application in the virtual machine communicates by using the interface connected with the accelerator, if the first transmission path is detected to be available, the first transmission path is preferentially used for completing the communication between the application in the virtual machine and the accelerator.
Further, after the migration of the virtual machine is completed, the management software of the virtual machine sends a high-speed transmission path reconstruction command. After a high-speed transmission path reestablishment command sent by virtual machine management software is received, a high-speed transmission path is reestablished between an application in a virtual machine and an accelerator, and the high-speed transmission path is marked as available. When the application in the virtual machine uses an interface connected with an accelerator for communication, if the software stack detects that a high-speed transmission path is available, the software stack preferentially uses the high-speed transmission path to complete the communication between the application in the virtual machine and the accelerator, so that the application in the virtual machine resumes using the high-speed transmission path to communicate with the accelerator after the migration of the virtual machine is completed.
As an alternative embodiment, the first transport protocol is specifically an RDMA protocol; the second transport protocol is in particular the TCP protocol.
Specifically, the high-speed transport Protocol may be an RDMA Protocol, and the low-speed transport Protocol may be a TCP (Transmission Control Protocol), which is not particularly limited herein.
As an optional embodiment, the method for data transmission between the virtual machine and the accelerator further includes:
setting an indicating device used for indicating a specific transmission path adopted by an application in a virtual machine running on a server in advance on the server;
and controlling the indicating device to perform corresponding indicating operation according to a specific transmission path used by the application in the virtual machine during operation.
Further, the application can also set an indicating device on the server in advance, and the indicating device is used for indicating a specific transmission path adopted by an application in a virtual machine running on the server. Based on this, the application can control the indicating device to perform corresponding indicating operation according to the specific transmission path used by the application in the virtual machine during operation, so that the user can know the specific transmission path currently adopted by the application in the virtual machine operating on the server.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a data transmission system between a virtual machine and an accelerator according to an embodiment of the present invention.
The data transmission system between the virtual machine and the accelerator comprises:
a link establishing module 1, configured to establish a first transmission path supporting a first transmission protocol and a second transmission path supporting a second transmission protocol between an application in a virtual machine and an accelerator to be communicated; the first transmission protocol is a high-speed transmission protocol realized by means of physical network card hardware; the second transmission protocol is a low-speed transmission protocol realized by means of network card equipment simulated by software;
the high-speed transmission module 2 is used for controlling the application in the virtual machine to preferentially use the first transmission path to communicate with the accelerator when the application in the virtual machine runs;
and the low-speed transmission module 3 is used for controlling the application in the virtual machine to be switched to a second transmission path to communicate with the accelerator after the virtual machine receives the migration command.
As an optional embodiment, the link establishing module 1 is specifically configured to:
the method comprises the steps that a software stack used for supporting pooling of accelerator resources and supporting connection of different transmission protocols between an application in a virtual machine and an accelerator to be communicated based on the same physical network link is arranged on the virtual machine in advance; wherein the different transport protocols comprise a first transport protocol and a second transport protocol;
in the application initialization stage in the virtual machine, an interface provided by the software stack and connected with the accelerator is called, so that the software stack establishes a first transmission path and a second transmission path required by communication between the application in the virtual machine and the accelerator.
As an optional embodiment, the low-speed transmission module 3 is specifically configured to:
after the virtual machine receives the migration command, closing the first transmission path, and marking the first transmission path as unavailable;
when the application in the virtual machine uses an interface connected with the accelerator for communication, if the first transmission path is detected to be unavailable, the application in the virtual machine is automatically switched to the second transmission path to complete the communication between the application in the virtual machine and the accelerator.
For introduction of the data transmission system provided in the present application, reference is made to the above-mentioned embodiments of the data transmission method, and details of the data transmission system are not described herein again.
The present application further provides a data transmission device between a virtual machine and an accelerator, including:
a memory for storing a computer program;
and the processor is used for realizing the steps of any one of the above data transmission methods between the virtual machine and the accelerator when executing the computer program.
For introduction of the data transmission apparatus provided in the present application, reference is made to the above embodiments of the data transmission method, and details of the data transmission apparatus are not repeated herein.
It is further noted that, in the present specification, 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. Also, 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 an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. 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 invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for data transmission between a virtual machine and an accelerator is characterized by comprising the following steps:
establishing a first transmission path supporting a first transmission protocol and a second transmission path supporting a second transmission protocol between an application in the virtual machine and an accelerator to be communicated; the first transmission protocol is a high-speed transmission protocol realized by means of physical network card hardware; the second transmission protocol is a low-speed transmission protocol realized by means of network card equipment simulated by software;
when the application in the virtual machine enters operation, controlling the application in the virtual machine to preferentially use the first transmission path to communicate with the accelerator;
and after the virtual machine receives a migration command, controlling the application in the virtual machine to be switched to the second transmission path to communicate with the accelerator.
2. The method for data transmission between a virtual machine and an accelerator according to claim 1, wherein the process of establishing a first transmission path supporting a first transmission protocol and a second transmission path supporting a second transmission protocol between an application in the virtual machine and the accelerator to be communicated comprises:
the method comprises the steps that a software stack used for supporting pooling of accelerator resources and supporting connection of different transmission protocols between an application in a virtual machine and an accelerator to be communicated based on the same physical network link is arranged on the virtual machine in advance; wherein the different transport protocols include the first transport protocol and the second transport protocol;
and calling an interface which is provided by the software stack and is connected with the accelerator at the application initialization stage in the virtual machine so that the software stack establishes a first transmission path and a second transmission path which are required by communication between the application in the virtual machine and the accelerator.
3. The method for data transmission between a virtual machine and an accelerator according to claim 2, wherein after the virtual machine receives a migration command, controlling a process of switching an application in the virtual machine to the second transmission path to communicate with the accelerator includes:
after the virtual machine receives a migration command, closing the first transmission path, and marking the first transmission path as unavailable;
when the application in the virtual machine uses an interface connected with the accelerator for communication, if the first transmission path is detected to be unavailable, the application in the virtual machine is automatically switched to the second transmission path to complete the communication between the application in the virtual machine and the accelerator.
4. The method for data transmission between a virtual machine and an accelerator according to claim 3, wherein the method for data transmission between a virtual machine and an accelerator further comprises:
after the virtual machine is migrated, reestablishing the first transmission path between the application in the virtual machine and the accelerator, and marking the first transmission path as available;
when the application in the virtual machine uses an interface connected with the accelerator for communication, if the first transmission path is detected to be available, the first transmission path is preferentially used for completing the communication between the application in the virtual machine and the accelerator.
5. The method of data transfer between a virtual machine and an accelerator according to claim 1, wherein the first transfer protocol is specifically an RDMA protocol; the second transport protocol is specifically a TCP protocol.
6. The method for data transmission between a virtual machine and an accelerator according to claim 1, wherein the method for data transmission between a virtual machine and an accelerator further comprises:
setting an indicating device used for indicating a specific transmission path adopted by an application in a virtual machine running on a server in advance on the server;
and controlling the indicating device to perform corresponding indicating operation according to a specific transmission path used by the application in the virtual machine during running.
7. A system for data transfer between a virtual machine and an accelerator, comprising:
the link establishing module is used for establishing a first transmission path supporting a first transmission protocol and a second transmission path supporting a second transmission protocol between the application in the virtual machine and the accelerator to be communicated; the first transmission protocol is a high-speed transmission protocol realized by means of physical network card hardware; the second transmission protocol is a low-speed transmission protocol realized by means of network card equipment simulated by software;
the high-speed transmission module is used for controlling the application in the virtual machine to preferentially use the first transmission path to communicate with the accelerator when the application in the virtual machine enters operation;
and the low-speed transmission module is used for controlling the application in the virtual machine to be switched to the second transmission path to communicate with the accelerator after the virtual machine receives the migration command.
8. The system for data transfer between a virtual machine and an accelerator according to claim 7, wherein the link establishment module is specifically configured to:
the method comprises the steps that a software stack used for supporting pooling of accelerator resources and supporting connection of different transmission protocols between an application in a virtual machine and an accelerator to be communicated based on the same physical network link is arranged on the virtual machine in advance; wherein the different transport protocols include the first transport protocol and the second transport protocol;
and calling an interface which is provided by the software stack and is connected with the accelerator at the application initialization stage in the virtual machine so that the software stack establishes a first transmission path and a second transmission path which are required by communication between the application in the virtual machine and the accelerator.
9. The system for data transfer between a virtual machine and an accelerator according to claim 8, wherein the low-speed transfer module is specifically configured to:
after the virtual machine receives a migration command, closing the first transmission path, and marking the first transmission path as unavailable;
when the application in the virtual machine uses an interface connected with the accelerator for communication, if the first transmission path is detected to be unavailable, the application in the virtual machine is automatically switched to the second transmission path to complete the communication between the application in the virtual machine and the accelerator.
10. An apparatus for data transmission between a virtual machine and an accelerator, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method for data transfer between a virtual machine and an accelerator according to any one of claims 1 to 6 when executing said computer program.
CN202011181692.6A 2020-10-29 2020-10-29 Data transmission method, system and device between virtual machine and accelerator Active CN112351089B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011181692.6A CN112351089B (en) 2020-10-29 2020-10-29 Data transmission method, system and device between virtual machine and accelerator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011181692.6A CN112351089B (en) 2020-10-29 2020-10-29 Data transmission method, system and device between virtual machine and accelerator

Publications (2)

Publication Number Publication Date
CN112351089A CN112351089A (en) 2021-02-09
CN112351089B true CN112351089B (en) 2022-05-13

Family

ID=74355318

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011181692.6A Active CN112351089B (en) 2020-10-29 2020-10-29 Data transmission method, system and device between virtual machine and accelerator

Country Status (1)

Country Link
CN (1) CN112351089B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117336639B (en) * 2023-11-29 2024-02-27 苏州元脑智能科技有限公司 Signal transmission method and device, storage medium and electronic device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101540764B (en) * 2009-04-27 2013-02-06 曙光信息产业(北京)有限公司 Data transmitting and routing method facing to virtual machine based on FPGA
CN101859263B (en) * 2010-06-12 2012-07-25 中国人民解放军国防科学技术大学 Quick communication method between virtual machines supporting online migration
CN105022658B (en) * 2014-04-30 2019-03-05 中国移动通信集团公司 A kind of virtual machine migration method, system and relevant apparatus
CN111698164B (en) * 2020-06-11 2021-11-19 北京金山云网络技术有限公司 Network routing method and device of virtual machine and management server

Also Published As

Publication number Publication date
CN112351089A (en) 2021-02-09

Similar Documents

Publication Publication Date Title
US10698717B2 (en) Accelerator virtualization method and apparatus, and centralized resource manager
CN106161537B (en) Method, device and system for processing remote procedure call and electronic equipment
US10609125B2 (en) Method and system for transmitting communication data
CN110830574B (en) Method for realizing intranet load balance based on docker container
US20210311800A1 (en) Connecting accelerator resources using a switch
US20140068165A1 (en) Splitting a real-time thread between the user and kernel space
CN110535811B (en) Remote memory management method and system, server, client and storage medium
CN107688502A (en) Inter-process communication methods and device
CN107682460A (en) A kind of distributed storage trunked data communication method and system
CN112351089B (en) Data transmission method, system and device between virtual machine and accelerator
CN106131162B (en) A method of network service agent is realized based on IOCP mechanism
WO2024067529A1 (en) Rdma-based link establishment method and apparatus, and device and storage medium
WO2024061308A1 (en) Notification processing method, and terminal device, server side and computer storage medium
CN106970844A (en) A kind of MTP management methods of pair of android system
CN103678163A (en) Method, device and system for switching of data stream
CN113254160B (en) IO resource request method and device
JP5317185B2 (en) Hot standby system and hot standby method
WO2021022947A1 (en) Method for deploying virtual machine and related device
CN105763640B (en) A kind of virtual machine managing and control system under cloud computing environment
CN111857964A (en) Method and equipment for transmitting data of virtual machine CAN port to physical machine CAN port equipment
JP2004515993A5 (en)
CN117041147B (en) Intelligent network card equipment, host equipment, method and system
WO2023035777A1 (en) Network configuration method, proxy component, controller, electronic device and storage medium
CN113132145B (en) Distributed training network system with separated management and training networks and communication method
CN110351319B (en) Request message transmission method, device and transmission equipment

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
GR01 Patent grant
GR01 Patent grant