A virtual machine network acceleration method, system, electronic device and storage medium

By adding intelligent network cards to the source host side of the virtual machine and configuring network acceleration components, the problem of slow communication speed of virtual machines in different physical nodes is solved, fast communication between the virtual machine and the destination side is achieved, the performance and business efficiency of the virtual machine are improved, and the performance and business efficiency of the virtual machine are optimized. Use physical server resources.

CN118473935BActive Publication Date: 2024-11-12JINAN INSPUR DATA TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410911107.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-09
Publication Date
2024-11-12
Estimated Expiration
2044-07-09

AI Technical Summary

Technical Problem

Virtual machines on different physical nodes cannot achieve fast communication, resulting in poor service response efficiency and performance of virtual machines, which are affected by hardware bottlenecks in physical nodes.

Method used

Add an intelligent network card to the source host side of the virtual machine to deploy it, and configure network acceleration components inside the intelligent network card. Create a virtual port through preset port configuration information, and offload the data to be transmitted by the virtual machine to the intelligent network card. Use the intelligent network card to use the intelligent network card to build a virtual port based on Network acceleration components and network card resources are forwarded in user mode to achieve rapid data transmission.

Benefits of technology

By adding intelligent network cards and network acceleration components to the source host, fast communication between the virtual machine and the destination side can be achieved, business efficiency and performance of virtual machine are improved, and the use of physical server resources is optimized, configuration changes are simplified, and maintenance costs are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118473935B_ABST
    Figure CN118473935B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer technology, and discloses a virtual machine network acceleration method, system, electronic device and storage medium, the method comprising: adding a smart network card on a source host end where a virtual machine is deployed, and configuring a network acceleration component inside the smart network card; creating a virtual port between the smart network card and the source host end according to preset port configuration information, so that the source host end unloads the data to be transmitted sent by the virtual machine to the smart network card through the virtual port; using the smart network card, based on the network acceleration component and network card resources, the data to be transmitted is forwarded in user mode, and the data to be transmitted is forwarded to the destination end. By adding a smart network card on the source host end, and using the network card resources and network acceleration component of the smart network card, the user mode forwarding of the data to be transmitted is realized on the smart network card, so that the virtual machine on the source host end can achieve fast communication with the destination end, laying a foundation for improving the business efficiency and other performance of the virtual machine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a virtual machine network acceleration method, system, electronic device and storage medium. Background Art

[0002] Currently, VMware, as the largest virtualization vendor, has achieved software-defined applications and all the resources they require, including servers, storage, networks, and security functions, which will be virtualized, and then all elements will be combined to create a software-defined data center that spans the boundaries of physical subnets.

[0003] In related technologies, different virtual machines often need to communicate with each other. The network performance of communication between virtual machines on the same physical node is not affected by hardware bottlenecks, and fast communication can be achieved. However, communication between virtual machines on different physical nodes is affected by the hardware bottleneck of the physical node, resulting in the inability of virtual machines on different physical nodes to communicate quickly, which is not conducive to ensuring the performance of virtual machines such as business response efficiency. Summary of the invention

[0004] The present application provides a virtual machine network acceleration method, system, electronic device and storage medium to solve the defects in the related art that virtual machines located at different physical nodes cannot achieve fast communication.

[0005] The first aspect of the present application provides a virtual machine network acceleration method, comprising:

[0006] Adding a smart network card to the source host side where the virtual machine is deployed, and configuring a network acceleration component inside the smart network card;

[0007] According to the preset port configuration information, a virtual port is created between the smart network card and the source host end, so that the source host end unloads the data to be transmitted sent by the virtual machine to the smart network card through the virtual port;

[0008] The intelligent network card is used to perform user-mode forwarding on the data to be transmitted based on the network acceleration component and network card resources, and the data to be transmitted is forwarded to the destination.

[0009] In an optional implementation, before configuring the network acceleration component inside the smart network card, the method further includes:

[0010] Starting the smart network card, and checking the startup items of the smart network card during the startup process to obtain a startup item checking result;

[0011] According to the startup item check result, determining whether the smart network card meets the preset network acceleration component configuration conditions;

[0012] When it is determined that the smart network card meets the preset network acceleration component configuration condition, the step of configuring the network acceleration component inside the smart network card is performed.

[0013] In an optional implementation, judging whether the smart network card meets a preset network acceleration component configuration condition according to the startup item checking result includes:

[0014] According to the startup item check result, determining whether the smart network card has enabled the ideal memory page configuration;

[0015] In the case of determining that the smart network card enables the ideal memory page configuration, determining whether the smart network card enables the virtualization configuration;

[0016] When it is determined that the smart network card has virtualization configuration enabled, determining whether the smart network card is bound to a target network card resource;

[0017] When it is determined that the smart network card is bound to the target network card resource, it is determined that the smart network card meets a preset network acceleration component configuration condition.

[0018] In an optional embodiment, the method further includes:

[0019] When it is determined that the smart network card does not enable the ideal memory page configuration, does not enable the virtualization configuration, or does not bind the target network card resources, it is determined that the smart network card does not meet the preset network acceleration component configuration conditions, and configuration error prompt information of the smart network card is generated.

[0020] In an optional implementation, configuring a network acceleration component inside the smart network card includes:

[0021] According to the preset network acceleration component configuration information, an acceleration bridge and a physical port connected to the acceleration bridge are configured inside the smart network card;

[0022] Wherein, the network acceleration component includes the acceleration bridge and the physical port.

[0023] In an optional implementation manner, creating a virtual port between the smart network card and the source host according to the preset port configuration information includes:

[0024] Generate port encapsulation commands according to preset port configuration information;

[0025] Sending the port encapsulation command to the smart network card to create a virtual port on the smart network card;

[0026] The virtual port is transparently transmitted to the source host, so that the source host unloads traffic to the smart network card through the virtual port.

[0027] In an optional embodiment, the method further includes:

[0028] Acquire port encapsulation command response information fed back by the smart network card during the process of creating the virtual port;

[0029] According to the port encapsulation command response information, verify whether the virtual port is successfully created on the smart network card.

[0030] In an optional implementation manner, after transparently transmitting the virtual port to the source host, the method further includes:

[0031] Obtaining virtual port information of the smart network card and network card port information of the source host;

[0032] According to the number of virtual ports represented by the virtual port information of the smart network card and the number of network card ports represented by the network card port information of the source host, it is determined whether the virtual port between the smart network card and the source host is successfully created.

[0033] In an optional implementation, judging whether the virtual port between the smart network card and the source host end is successfully created according to the number of virtual ports represented by the virtual port information of the smart network card and the number of network card ports represented by the network card port information of the source host end includes:

[0034] Determine whether the number of virtual ports of the smart network card and the network card port of the source host meet the preset creation quantity;

[0035] When it is determined that the number of virtual ports of the smart network card and the network card port of the source host both meet the preset creation quantity, it is determined that the virtual port between the smart network card and the source host is successfully created.

[0036] In an optional implementation, the using the smart network card to perform user-mode forwarding on the data to be transmitted based on the network acceleration component and the network card resources, and forwarding the data to be transmitted to the destination end, includes:

[0037] Based on the smart network card, in user mode, the data to be transmitted received through the virtual port is sent to the acceleration bridge in a network acceleration mode;

[0038] Transmitting the data to be transmitted to the physical port in user mode through the acceleration bridge;

[0039] Forwarding the data to be transmitted to a destination end through the physical port;

[0040] The network acceleration component includes the acceleration bridge and the physical port, and the operation of the network acceleration component only consumes the network card resources of the smart network card, and the network card resources include at least memory.

[0041] In an optional embodiment, the method further includes:

[0042] The virtual port configuration is added to the acceleration bridge of the intelligent network card, so that the data to be transmitted is transmitted between the virtual port and the acceleration bridge in the network acceleration mode.

[0043] A second aspect of the present application provides a virtual machine network acceleration system, comprising: a source host terminal and a smart network card deployed with a virtual machine;

[0044] The source host is used to offload the data to be transmitted sent by the virtual machine to the smart network card through the virtual port between the source host and the smart network card;

[0045] The smart network card is used to receive the data to be transmitted, perform user-mode forwarding on the data to be transmitted based on the network acceleration component and the network card resources, and forward the data to be transmitted to the destination.

[0046] The third aspect of the present application provides a virtual machine network acceleration device, including:

[0047] A configuration module, used to add a smart network card on the source host side where the virtual machine is deployed, and configure a network acceleration component inside the smart network card;

[0048] A port creation module, used to create a virtual port between the smart network card and the source host end according to preset port configuration information, so that the source host end unloads the data to be transmitted sent by the virtual machine to the smart network card through the virtual port;

[0049] The acceleration module is used to utilize the intelligent network card to perform user-mode forwarding on the data to be transmitted based on the network acceleration component and network card resources, and forward the data to be transmitted to the destination.

[0050] A fourth aspect of the present application provides an electronic device, comprising: at least one processor and a memory;

[0051] The memory stores computer-executable instructions;

[0052] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method described in the first aspect and various possible designs of the first aspect.

[0053] A fifth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method described in the first aspect and various possible designs of the first aspect are implemented.

[0054] The sixth aspect of the present application provides a computer program product, including computer instructions, which are used to enable a computer to execute the method described in the first aspect and various possible designs of the first aspect.

[0055] The technical solution of this application has the following advantages:

[0056] The present application provides a virtual machine network acceleration method, system, electronic device and storage medium, the method comprising: adding a smart network card to a source host end where a virtual machine is deployed, and configuring a network acceleration component inside the smart network card; creating a virtual port between the smart network card and the source host end according to preset port configuration information, so that the source host end can unload the data to be transmitted sent by the virtual machine to the smart network card through the virtual port; using the smart network card, based on the network acceleration component and the network card resources, the data to be transmitted is forwarded in user mode, and the data to be transmitted is forwarded to the destination end. The method provided by the above scheme realizes user-mode forwarding of the data to be transmitted on the smart network card by adding a smart network card to the source host end, and utilizing the network card resources and network acceleration components of the smart network card, so that the virtual machine on the source host end can achieve rapid communication with the destination end, laying a foundation for improving the business efficiency and other performance of the virtual machine. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the following is a brief introduction to the drawings required for use in the embodiments or the related technical descriptions. Obviously, the drawings described below are some embodiments of the present application, and a person skilled in the art can also obtain other drawings based on these drawings.

[0058] Figure 1 A schematic diagram of the structure of the network system based on the embodiments of the present application;

[0059] Figure 2 A flowchart of a virtual machine network acceleration method provided in an embodiment of the present application;

[0060] Figure 3 A schematic diagram of a check flow for smart network card startup items provided in an embodiment of the present application;

[0061] Figure 4 A schematic diagram of the structure of an exemplary virtual machine network acceleration system provided in an embodiment of the present application;

[0062] Figure 5A schematic diagram of the structure of a virtual machine network acceleration method test model provided in an embodiment of the present application;

[0063] Figure 6 A schematic diagram of the structure of a virtual machine network acceleration system provided in an embodiment of the present application;

[0064] Figure 7 A schematic diagram of the structure of a virtual machine network acceleration device provided in an embodiment of the present application;

[0065] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0066] The above drawings have shown clear embodiments of the present application, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0067] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0068] In addition, the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. In the description of the following embodiments, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.

[0069] In related technologies, most virtualized networks use openvswitch to implement network virtualization. The current acceleration solution for ovs (openvswitch) can use ovs-dpdk to bypass the kernel protocol stack, and use technologies such as large memory pages and CPU isolation to forward messages only in user mode, which can greatly improve the network forwarding performance between nodes.

[0070] However, although using dpdk on a physical host can optimize the network performance of virtual machines, it is inevitable that dpdk will occupy a certain amount of CPU and memory resources on the host. In other words, although this solution can speed up message forwarding, it is achieved at the expense of certain server resources. If the server-related resources are tight, it will affect other services of the server. In addition, most physical servers have a common problem when using dpdk, that is, when adjusting the dpdk configuration (such as the number of large page memory pages, etc.), the power must be turned off. Therefore, if dpdk is used on a physical server, when the network topology needs to be adjusted, if the previous configuration is improper, it may increase the difficulty of operation.

[0071] In response to the above problems, the embodiments of the present application provide a virtual machine network acceleration method, system, electronic device and storage medium, the method comprising: adding a smart network card to the source host end where the virtual machine is deployed, and configuring a network acceleration component inside the smart network card; creating a virtual port between the smart network card and the source host end according to the preset port configuration information, so that the source host end can unload the data to be transmitted sent by the virtual machine to the smart network card through the virtual port; using the smart network card, based on the network acceleration component and the network card resources, the data to be transmitted is forwarded in user mode, and the data to be transmitted is forwarded to the destination end. The method provided by the above scheme realizes user-mode forwarding of the data to be transmitted on the smart network card by adding a smart network card to the source host end, and utilizing the network card resources and network acceleration components of the smart network card, so that the virtual machine on the source host end can achieve rapid communication with the destination end, laying a foundation for improving the business efficiency and other performance of the virtual machine.

[0072] The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.

[0073] First, the structure of the network system on which this application is based is described:

[0074] The virtual machine network acceleration method, system, electronic device and storage medium provided in the embodiments of the present application are suitable for forwarding and processing the data to be transmitted sent by the virtual machine at the source host end. Figure 1 As shown, it is a schematic diagram of the structure of the network system based on the embodiment of the present application, which mainly includes a source host end and a destination host end. Both the source host end and the destination host end are provided with virtual machines. The source host end is provided with a smart network card. The present application configures the smart network card so that the source host end forwards data through the smart network card, so that the data to be transmitted can be quickly forwarded to the destination host end.

[0075] The embodiment of the present application provides a virtual machine network acceleration method for quickly forwarding data to be transmitted sent by a virtual machine on a host. The execution subject of the embodiment of the present application is an electronic device, such as a server, a desktop computer, a laptop computer, a tablet computer, and other electronic devices that can be used to deploy virtual machines and smart network cards and forward data to be transmitted sent by the virtual machine.

[0076] like Figure 2 FIG. 1 is a flow chart of a virtual machine network acceleration method provided in an embodiment of the present application, the method comprising:

[0077] Step 201: Add a smart network card to a source host on which a virtual machine is deployed, and configure a network acceleration component inside the smart network card.

[0078] Among them, network acceleration components specifically refer to components that run data plane development tool (Data Plane DevelopmentKit, referred to as: dpdk) related services, such as virtual switches, libraries and tool sets for fast packet processing, OVS-DPDK kernel modules, DPDK drivers and user space applications.

[0079] It should be noted that the smart network card used in the embodiment of the present application has sufficient network card resources such as CPU and memory. The smart network card can basically use its own sufficient network card resources to implement the dbdk function, thereby avoiding the impact of the smart network card's internal kernel protocol stack on the network card performance.

[0080] Specifically, in one embodiment, an acceleration bridge and a physical port connected to the acceleration bridge may be configured inside the smart network card according to preset network acceleration component configuration information.

[0081] Wherein, the network acceleration component includes the acceleration bridge and the physical port.

[0082] Specifically, when the smart network card deploys multiple related service components to implement the DPDK function, in order to make the data forwarding method of the smart network card match these service components, an acceleration bridge and a physical port connected to the acceleration bridge can be configured inside the smart network card according to the preset network acceleration component configuration information (the DPDK function configuration information of the smart network card) to perform corresponding data forwarding based on the acceleration bridge and the physical port connected to the acceleration bridge.

[0083] Step 202: Create a virtual port between the smart network card and the source host according to the preset port configuration information, so that the source host can offload the data to be transmitted sent by the virtual machine to the smart network card through the virtual port.

[0084] Specifically, a virtual port can be directly created based on the functions provided by the smart network card itself, and then the created virtual port can be transparently transmitted to the source host end that carries the smart network card according to the preset port configuration information represented by the attribute characteristics of the smart network card, so that the source host end can perceive the addition of the network card, and then the source host end can offload the data to be transmitted sent by the virtual machine to the smart network card through the virtual port.

[0085] Step 203: using the smart network card, based on the network acceleration component and the network card resources, forwarding the data to be transmitted in user mode, and forwarding the data to be transmitted to the destination.

[0086] Specifically, the dpdk function is implemented on the smart network card based on its configured network acceleration components and network card resources, so that the data to be transmitted is forwarded in user mode on the smart network card, and then transmitted to the destination through the smart network card. The destination specifically refers to the virtual machine deployed on the target physical node. Since the method provided in the embodiment of the present application is to offload the dpdk function to the smart network card, the processing and forwarding of the data to be transmitted by the smart network card do not consume the resources of the physical server (source host end), so that the physical server uses dpdk without perception, and when the dpdk configuration needs to be modified, only the smart network card needs to be restarted, which does not affect other services of the physical server, facilitates subsequent maintenance, and also reduces subsequent maintenance costs.

[0087] On the basis of the above embodiments, since the dpdk function implementation has configuration requirements for the device, in order to ensure that the smart network card can normally implement the dpdk function, as an implementable method, in one embodiment, before configuring the network acceleration component inside the smart network card, the method also includes:

[0088] Step 301, starting the smart network card, and checking the startup items of the smart network card during the startup process to obtain a startup item checking result;

[0089] Step 302: judging whether the smart network card meets the preset network acceleration component configuration condition according to the startup item check result;

[0090] Step 303: When it is determined that the smart network card meets the preset network acceleration component configuration condition, the step of configuring the network acceleration component inside the smart network card is executed.

[0091] It should be noted that the smart network card has multiple startup items, which can be configured before the network card is started. During the startup process of the smart network card, the startup items are aligned and checked to determine whether the startup items enabled by the smart network card meet the preset network acceleration component configuration conditions to avoid the situation where the smart network card does not support the dpdk function.

[0092] Specifically, in one embodiment, based on the startup item check result, it is determined whether the smart network card has enabled the ideal memory page configuration; if it is determined that the smart network card has enabled the ideal memory page configuration, it is determined whether the smart network card has enabled the virtualization configuration; if it is determined that the smart network card has enabled the virtualization configuration, it is determined whether the smart network card is bound to the target network card resources; if it is determined that the smart network card is bound to the target network card resources, it is determined that the smart network card meets the preset network acceleration component configuration conditions.

[0093] It should be noted that the application of dpdk technology requires the configuration of large page memory (ideal memory page configuration) to avoid cache paging table fragmentation and improve memory access efficiency. Since the embodiment of the present application actually adopts ovs-dpdk technology, that is, the smart network card needs to deploy Open vSwitch (ovs) components, the smart network card needs to support network virtualization functions, that is, turn on virtualization configuration. Since the application of dpdk technology requires CPU core binding to ensure that data forwarding tasks are executed on dedicated CPU cores, avoid interference, and significantly improve the data packet forwarding speed, the smart network card needs to bind the target network card resources, that is, bind the CPU core.

[0094] For example, Figure 3 As shown, it is a schematic diagram of the inspection process of the smart network card startup items provided in the embodiment of the present application. First, it is checked whether the ideal memory page configuration is enabled for the smart network card, and then it is determined whether the virtualization configuration is enabled, and finally it is determined whether the target network card resources are bound. If all the checks pass, it is determined that the smart network card meets the preset network acceleration component configuration conditions, that is, the inspection result is successful. If any item is found to be unqualified during the inspection process, subsequent inspections are stopped and the inspection result is determined to be a failure.

[0095] Furthermore, in one embodiment, when it is determined that the smart network card does not have an ideal memory page configuration enabled, does not have a virtualization configuration enabled, or does not bind the target network card resources, it is determined that the smart network card does not meet the preset network acceleration component configuration conditions, and a configuration error prompt message of the smart network card is generated.

[0096] Specifically, when the check result is failure, in order to enable the user to make corresponding configuration corrections to the smart network card, when it is determined that the smart network card does not meet the preset network acceleration component configuration conditions, a configuration error prompt message of the smart network card can be generated to remind the user to enable the corresponding startup item configuration.

[0097] Based on the above embodiment, as an implementable manner, in one embodiment, creating a virtual port between the smart network card and the source host according to the preset port configuration information includes:

[0098] Step 2021, generating a port encapsulation command according to preset port configuration information;

[0099] Step 2022: Send the port encapsulation command to the smart network card to create a virtual port on the smart network card;

[0100] Step 2023: transparently transmit the virtual port to the source host, so that the source host unloads traffic to the smart network card through the virtual port.

[0101] Specifically, by creating a virtual port between the smart network card and the source host, the message forwarding and flow control related work originally carried by the physical server (source host) can be offloaded to the smart network card hardware for processing through the tc-flower protocol conversion logic, without being affected by the kernel protocol stack of the physical host.

[0102] Specifically, the relevant commands for creating the network port inside the smart NIC can be encapsulated to integrate the system commands needed to create the network port into a customized command that is easy for users to understand and use, so as to obtain the port encapsulation command. For example, the port encapsulation command is smartnic create-port, and the actual instructions are as follows:

[0103] virtio_net_controller -i <network card device name>

[0104] create virtio-net dev <network port id> <mac> <mtu><queue>

[0105] Among them, the network card device name is the name of the smart network card, the network port id indicates the ID of the virtual port, the mac indicates the mac address of the virtual port, the mtu indicates the maximum value of the received data message (data to be transmitted). If the size of the received data message exceeds the maximum value, the data message is split, and the queue indicates the concurrent number of data sent and received by the smart network card.

[0106] Among them, Figure 4 As shown, it is a structural diagram of an exemplary virtual machine network acceleration system provided by an embodiment of the present application. The smart network card is connected to the source host side (bare metal server) through PCIE (a high-speed bus connecting the internal components of the server). The smart network card is provided with a virtual switch and a network acceleration component for providing dpdk functions. The virtual switch communicates with these network acceleration components (OVS / DPDK) through a specified protocol (TC Flower / Rte flow). The virtual machine is provided with multiple virtual ports, each of which is transparently transmitted to the source host side through PCIE. The virtual ports on the source host side are represented by PF and VF, and the virtual ports on the smart network card are represented by PF rep and VF rep. The virtual ports created by the smart network card include two types of creation: virtio and sr-iov. The SR-IOV protocol is configured for the virtual port on the source host side to virtualize a smart network card connected to the source host side through multiple virtual ports into multiple network cards. The Smart NIC is equipped with a controller (virtual controller) for the network interface in the virtualized environment. The source host is equipped with several virtual NIC drivers accordingly. These virtual NIC drivers are connected to the driver port (SF rep) on the Smart NIC. The source host sets the static mode and dynamic mode (hot plug) configuration of the Smart NIC based on the virtual NIC driver.

[0107] Specifically, in one embodiment, during the process of creating the virtual port, the port encapsulation command response information fed back by the smart network card during the process of creating the virtual port is obtained; and according to the port encapsulation command response information, it is verified whether the virtual port is successfully created in the smart network card.

[0108] The port encapsulation command response information includes the Linux command return value (ret), the console print value output, and the command failure error message.

[0109] Specifically, first, a port encapsulation command is issued to the smart network card. The smart network card uses the Linux system. The code uses relevant modules to encapsulate the relevant interfaces of the Linux system commands, so that the smart network card returns the port encapsulation command response information in the process of responding to the port encapsulation command. When the smart network card successfully creates a virtual port in response to the port encapsulation command, the returned encapsulation command response information is as follows: ret=0; output=#cmd result#; message=null. When the smart network card fails to create a virtual port in response to the port encapsulation command, the returned encapsulation command response information is as follows: ret=-1; output=null; message=# message info#. Among them, ret: Linux command fails to return -1, and successfully returns 0; output: returns the console print value of the Linux command; message: If the Linux command fails and reports an error, the error message is returned, otherwise it is empty. The console print value represents the name of the port encapsulation command response action of the smart network card.

[0110] Specifically, in one embodiment, in order to ensure the reliability of the virtual port creation result and to ensure that the smart network card can operate normally and stably, after the virtual port is transparently transmitted to the source host, the virtual port information of the smart network card and the network card port information of the source host can be obtained; based on the number of virtual ports represented by the virtual port information of the smart network card and the number of network card ports represented by the network card port information of the source host, it is determined whether the virtual port between the smart network card and the source host is successfully created.

[0111] Specifically, after the smart network card completes the creation of the virtual port, the corresponding virtual port information can be found inside the smart network card. After completing the transparent transmission of the virtual port, the corresponding network card port information can be found on the source host side. Therefore, by analyzing the virtual port information and the network card port information, it can be determined whether the virtual port between the smart network card and the source host side is successfully created.

[0112] Specifically, in one embodiment, it is determined whether the number of virtual ports of the smart network card and the network card port of the source host meet the preset creation quantity; when it is determined that the number of virtual ports of the smart network card and the network card port of the source host both meet the preset creation quantity, it is determined that the virtual port between the smart network card and the source host is successfully created.

[0113] Exemplarily, assuming that the preset creation number is 8, when the number of virtual ports represented by the virtual port information of the smart network card is less than 8, or the number of network card ports represented by the network card port information is less than 8, it is determined that the virtual port creation between the smart network card and the source host end fails; if the number of virtual ports and the number of network card ports are both 8, it is determined that the virtual port creation between the smart network card and the source host end is successful.

[0114] Based on the above embodiment, as an implementable manner, in one embodiment, the method of using the smart network card to forward the data to be transmitted in user mode based on the network acceleration component and the network card resources, and forwarding the data to be transmitted to the destination end includes:

[0115] Step 2031: Based on the smart network card, in user mode, the data to be transmitted received through the virtual port is sent to the acceleration bridge in a network acceleration mode;

[0116] Step 2032, transmitting the data to be transmitted to the physical port in user mode through the acceleration bridge;

[0117] Step 2033: forward the data to be transmitted to the destination end through the physical port.

[0118] Among them, the network acceleration component includes the acceleration bridge and the physical port, the physical port is directly connected to the data receiving end of the destination end through a network cable, and the operation of the network acceleration component only consumes the network card resources of the smart network card, and the network card resources include at least memory.

[0119] Specifically, in one embodiment, the virtual port configuration is added to the acceleration bridge of the smart network card, so that the data to be transmitted is transmitted between the virtual port and the acceleration bridge in the network acceleration mode.

[0120] It should be noted that the use of dpdk needs to be closely integrated with the openVSwith component, that is, the actual use is the dpdk solution based on the ovs virtual switch. The principle is that the message received from a network port connected to OVS does not need to be processed in the openvswitch.ko kernel state, and the message directly reaches the user state ovs-vswitchd through the DPDK PMD driver.

[0121] Among them, the encapsulation command for the virtual port configuration of the acceleration bridge is as follows:

[0122] ovs-vsctl add-br <acceleration bridge> –- set bridge <bridge> datapath_type=netdev

[0123] The meaning of this encapsulation command is to create an accelerated bridge and set its data path type to netdev. Setting the data path type of the bridge to `netdev` means that OVS will use the data path provided by the kernel to process packets. This mode (network acceleration mode) has lower overhead than the default traditional mode and is suitable for high-performance packet processing scenarios.

[0124] Accordingly, the encapsulation commands for configuring the physical port are as follows:

[0125] ovs-vsctl add-port <accelerated bridge> <physical port> -- set Interface <physical port> type=dpdk options: dpdk-devargs=<physical port mac>

[0126] The meaning of this encapsulation command is to add a physical port to the Open vSwitch bridge (accelerated bridge), set its type to dpdk, and specify the DPDK device parameter as the MAC address of the physical port. In this way, DPDK can be used in OVS to improve network data processing performance.

[0127] Accordingly, the encapsulation command for configuring the virtual port is as follows:

[0128] ovs-vsctl add-port <accelerated bridge> <virtual port> -- set Interface <virtual port> type = dpdk options: dpdk-devargs = <virtual port mac>, representative = <rep port id corresponding to the virtual port>

[0129] The meaning of this encapsulation command is to add a virtual port to the acceleration bridge and configure it to use DPDK for data processing. At the same time, the MAC address of the virtual port and the corresponding port ID are specified so that the data packet forwarding between the virtual port and the acceleration bridge adopts the network acceleration mode (DPDK mode).

[0130] Specifically, after the smart network card completes the response to the above three encapsulation commands, it indicates that the smart network card configuration network port dpdk has been executed. At this time, the smart network card can use dpdk technology to implement user-mode forwarding of data packets. During the command response process, if an abnormality occurs, the smart network card will capture the abnormal information and prompt the user. Among them, the inspection script and related commands provided in the embodiment of the present application are encapsulated and made into an rpm package and incorporated into the mirrored ISO of the smart network card for execution by the smart network card.

[0131] Specifically, after the configuration is completed, the traffic forwarding logic of the smart network card is that the traffic unloaded from the physical server network port first uses the above-mentioned <virtual port> as the entrance, and is forwarded to the <physical port> inside the smart network card through the bridge in dpdk mode, that is, the physical port directly connected to the network cable in the actual sense, and then sent to the external destination through this port. In actual applications, you can also modify the virtual machine xml file on the physical server, and pass the network port created by the smart network card to the virtual machine through pci. The message (data to be transmitted) sent by the virtual machine can be forwarded through dpdk to improve the data communication efficiency of the virtual machine.

[0132] For example, to facilitate those skilled in the art to more clearly understand the method provided in the embodiments of the present application, Figure 5 As shown, it is a structural schematic diagram of the virtual machine network acceleration method test model provided by an embodiment of the present application, wherein eth0 (Vid: 159) is the virtual port (pf1) created by the smart network card, and the network card port generated by PCI transparent transmission to the physical server side is transparently transmitted to the virtual machine for use. BSC refers to a type of smart network card, which is represented by the smart network card in the figure. 100.7.38.155 and 100.7.38.156 are the management IPs of the physical server (source host side) and the smart network card, respectively. br0 is the bridge name, and pf2 is the configuration port of the smart network card, which is used to receive the configuration information input by the user, corresponding to eth0 of the physical server side. P1 (Vid: 102) is the physical port, and the physical server with the management IP of 100.7.38.151 can be called the external environment, that is, the destination host side. In order to make the test model as simple as possible, the physical switch is not used during the test process, and the test is directly carried out by direct connection of the network cable. If the two network ports eth0 and enp94s0f0 need to communicate, the traffic forwarding path is the virtual machine on the source host-eth0-pf1-br0-P1-enp94s0f0, and the traffic forwarding mode is dpdk mode. It can be found that from the operating system level of the physical host 100.7.38.155, eth0 is just an ordinary network port provided to the virtual machine. The physical server itself does not have any dpdk configuration, but in fact the traffic is forwarded through dpdk.

[0133] Furthermore, in one embodiment, since the virtual machines deployed on the physical server often need to obtain host information from the physical server during operation, such as hardware resource information, network information, storage information, and system performance indicator information, in order to facilitate the virtual machine to obtain this host information, the host information of the physical server (source host side) can be pre-stored in the smart network card, so that the virtual machine can read its pre-stored host information through the smart network card, thereby improving the efficiency of the virtual machine in obtaining the host information and reducing the data acquisition delay.

[0134] The virtual machine network acceleration method provided by the embodiment of the present application is to add a smart network card to the source host end where the virtual machine is deployed, and configure a network acceleration component inside the smart network card; create a virtual port between the smart network card and the source host end according to the preset port configuration information, so that the source host end can unload the data to be transmitted sent by the virtual machine to the smart network card through the virtual port; use the smart network card, based on the network acceleration component and the network card resources, to forward the data to be transmitted in user mode, and forward the data to be transmitted to the destination end. The method provided by the above scheme, by adding a smart network card to the source host end, and using the network card resources and network acceleration components of the smart network card, realizes the user-mode forwarding of the data to be transmitted on the smart network card, so that the virtual machine on the source host end can communicate quickly with the destination end, laying the foundation for improving the business efficiency and other performance of the virtual machine. In addition, the smart network card is used to release the CPU and memory resources of the physical server, optimize the performance of the physical server while accelerating network forwarding, simplify the relevant configuration on the physical server, reduce the difficulty of configuration changes, and only operate inside the smart network card, so that the physical server can use dpdk without perception. In addition, through self-packaged commands, operation and maintenance personnel who do not know much about dpdk and smart network cards can also easily operate it. The operation workload is small, it can be installed and obtained, and it is user-friendly.

[0135] An embodiment of the present application provides a virtual machine network acceleration system, which is used to execute the virtual machine network acceleration method provided in the above embodiment.

[0136] like Figure 6 FIG. 1 is a schematic diagram of a virtual machine network acceleration system according to an embodiment of the present application. The virtual machine network acceleration system includes: a source host terminal on which a virtual machine is deployed and a smart network card.

[0137] Among them, the source host end is used to unload the data to be transmitted sent by the virtual machine to the smart network card through the virtual port between the source host end and the smart network card; the smart network card is used to receive the data to be transmitted, and based on the network acceleration component and the network card resources, perform user-mode forwarding on the data to be transmitted, and forward the data to be transmitted to the destination end.

[0138] Regarding the virtual machine network acceleration system in this embodiment, its specific implementation method has been described in detail in the embodiment of the method, and will not be elaborated here.

[0139] The virtual machine network acceleration system provided in the embodiment of the present application is used to execute the virtual machine network acceleration method provided in the above embodiment. Its implementation method and principle are the same and will not be repeated here.

[0140] An embodiment of the present application provides a virtual machine network acceleration device, which is used to execute the virtual machine network acceleration method provided in the above embodiment.

[0141] like Figure 7 , which is a schematic diagram of the structure of a virtual machine network acceleration device provided in an embodiment of the present application. The virtual machine network acceleration device 70 comprises: a configuration module 701 , a port creation module 702 and an acceleration module 703 .

[0142] Among them, the configuration module is used to add a smart network card on the source host side where the virtual machine is deployed, and configure a network acceleration component inside the smart network card; the port creation module is used to create a virtual port between the smart network card and the source host side according to the preset port configuration information, so that the source host side can unload the data to be transmitted sent by the virtual machine to the smart network card through the virtual port; the acceleration module is used to use the smart network card to perform user-state forwarding on the data to be transmitted based on the network acceleration component and network card resources, and forward the data to be transmitted to the destination side.

[0143] Regarding the virtual machine network acceleration device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0144] The virtual machine network acceleration device provided in the embodiment of the present application is used to execute the virtual machine network acceleration method provided in the above embodiment. Its implementation method and principle are the same and will not be repeated here.

[0145] An embodiment of the present application provides an electronic device for executing the virtual machine network acceleration method provided in the above embodiment.

[0146] like Figure 8 FIG. 8 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 80 includes: at least one processor 81 and a memory 82.

[0147] The memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the virtual machine network acceleration method provided in the above embodiment.

[0148] The electronic device provided in the embodiment of the present application is used to execute the virtual machine network acceleration method provided in the above embodiment. Its implementation method and principle are the same and will not be repeated here.

[0149] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, a virtual machine network acceleration method provided in any of the above embodiments is implemented.

[0150] The storage medium containing computer executable instructions provided in the embodiments of the present application can be used to store computer executable instructions of the virtual machine network acceleration method provided in the aforementioned embodiments. The implementation method and principle are the same and will not be repeated here.

[0151] An embodiment of the present application provides a computer program product, including computer instructions, which are used to enable a computer to execute the virtual machine network acceleration method provided in the above embodiment.

[0152] The embodiments of the present application provide a computer program product that can be used to execute computer instructions of the virtual machine network acceleration method provided in the aforementioned embodiments. The implementation method and principle are the same and will not be repeated here.

[0153] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0154] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0155] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0156] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.

[0157] A part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0158] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0159] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.< / mtu> < / mac>

Claims

1. A virtual machine network acceleration method, characterized in that: include: Adding a smart network card to the source host where the virtual machine is deployed, and configuring a network acceleration component inside the smart network card; According to the preset port configuration information, a virtual port is created between the smart network card and the source host end, so that the source host end unloads the data to be transmitted sent by the virtual machine to the smart network card through the virtual port; Using the smart network card, based on the network acceleration component and the network card resources, the data to be transmitted is forwarded in user mode, and the data to be transmitted is forwarded to the destination end; The method of using the smart network card to forward the data to be transmitted in user mode based on the network acceleration component and the network card resources, and forwarding the data to be transmitted to the destination end, includes: Based on the smart network card, in user mode, the data to be transmitted received through the virtual port is sent to the acceleration bridge in a network acceleration mode; Transmitting the data to be transmitted to the physical port in user mode through the acceleration bridge; Forwarding the data to be transmitted to a destination end through the physical port; Add the virtual port configuration in the acceleration bridge of the smart network card, so that the data to be transmitted is transmitted between the virtual port and the acceleration bridge in the network acceleration mode; The network acceleration component includes the acceleration bridge and the physical port, the operation of the network acceleration component only consumes the network card resources of the smart network card, the network card resources include at least memory, and the network acceleration mode includes the DPDK mode; the destination end refers to a virtual machine deployed on the target physical node; Before configuring the network acceleration component inside the smart network card, the method further includes: Starting the smart network card, and checking the startup items of the smart network card during the startup process to obtain a startup item checking result; According to the startup item check result, determining whether the smart network card meets the preset network acceleration component configuration conditions; When it is determined that the smart network card meets the preset network acceleration component configuration condition, executing the step of configuring the network acceleration component inside the smart network card; The step of judging whether the smart network card meets a preset network acceleration component configuration condition according to the startup item checking result includes: According to the startup item check result, determining whether the smart network card has enabled the ideal memory page configuration; In the case of determining that the smart network card enables the ideal memory page configuration, determining whether the smart network card enables the virtualization configuration; When it is determined that the smart network card has virtualization configuration enabled, determining whether the smart network card is bound to a target network card resource; In the case of determining that the smart network card is bound to the target network card resource, determining that the smart network card meets the preset network acceleration component configuration condition; The target network card resources include CPU cores.

2. The method according to claim 1, characterized in that The method further comprises: When it is determined that the smart network card does not enable the ideal memory page configuration, does not enable the virtualization configuration, or does not bind the target network card resources, it is determined that the smart network card does not meet the preset network acceleration component configuration conditions, and configuration error prompt information of the smart network card is generated.

3. The method according to claim 1, characterized in that The configuring of a network acceleration component inside the smart network card includes: According to the preset network acceleration component configuration information, an acceleration bridge and a physical port connected to the acceleration bridge are configured inside the smart network card; Wherein, the network acceleration component includes the acceleration bridge and the physical port.

4. The method according to claim 1, characterized in that: The step of creating a virtual port between the smart network card and the source host according to the preset port configuration information includes: Generate port encapsulation commands according to preset port configuration information; Sending the port encapsulation command to the smart network card to create a virtual port on the smart network card; The virtual port is transparently transmitted to the source host, so that the source host unloads traffic to the smart network card through the virtual port.

5. The method according to claim 4, characterized in that The method further comprises: Acquire port encapsulation command response information fed back by the smart network card during the process of creating the virtual port; According to the port encapsulation command response information, verify whether the virtual port is successfully created on the smart network card.

6. The method according to claim 4, characterized in that After transparently transmitting the virtual port to the source host, the method further includes: Obtaining virtual port information of the smart network card and network card port information of the source host; According to the number of virtual ports represented by the virtual port information of the smart network card and the number of network card ports represented by the network card port information of the source host, it is determined whether the virtual port between the smart network card and the source host is successfully created.

7. The method according to claim 6, characterized in that The determining, based on the number of virtual ports represented by the virtual port information of the smart network card and the number of network card ports represented by the network card port information of the source host, whether the virtual port between the smart network card and the source host is successfully created includes: Determine whether the number of virtual ports of the smart network card and the network card port of the source host meet the preset creation quantity; When it is determined that the number of virtual ports of the smart network card and the network card port of the source host both meet the preset creation quantity, it is determined that the virtual port between the smart network card and the source host is successfully created.

8. A virtual machine network acceleration system, characterized in that: include: Deploy the source host with virtual machines and smart network cards; The source host is used to offload the data to be transmitted sent by the virtual machine to the smart network card through the virtual port between the source host and the smart network card; The smart network card is used to receive the data to be transmitted, perform user-mode forwarding on the data to be transmitted based on the network acceleration component and the network card resources, and forward the data to be transmitted to the destination end; The smart network card is used to send the data to be transmitted received through the virtual port to the acceleration bridge in the network acceleration mode in the user state; and transmit the data to be transmitted to the physical port through the acceleration bridge in the user state; Forwarding the data to be transmitted to the destination end through the physical port; adding the virtual port configuration in the acceleration bridge of the smart network card so that the data to be transmitted is transmitted between the virtual port and the acceleration bridge in the network acceleration mode; The network acceleration component includes the acceleration bridge and the physical port, the operation of the network acceleration component only consumes the network card resources of the smart network card, the network card resources include at least memory, and the network acceleration mode includes the DPDK mode; the destination end refers to a virtual machine deployed on the target physical node; The configuration process of the smart network card is as follows: Starting the smart network card, and checking the startup items of the smart network card during the startup process to obtain a startup item checking result; According to the startup item check result, determining whether the smart network card meets the preset network acceleration component configuration conditions; When it is determined that the smart network card meets the preset network acceleration component configuration condition, configure the network acceleration component inside the smart network card; The step of judging whether the smart network card meets a preset network acceleration component configuration condition according to the startup item checking result includes: According to the startup item check result, determining whether the smart network card has enabled the ideal memory page configuration; In the case of determining that the smart network card enables the ideal memory page configuration, determining whether the smart network card enables the virtualization configuration; When it is determined that the smart network card has virtualization configuration enabled, determining whether the smart network card is bound to a target network card resource; In the case of determining that the smart network card is bound to the target network card resource, determining that the smart network card meets the preset network acceleration component configuration condition; The target network card resources include CPU cores.

9. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1 to 7 is implemented.

11. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method for enabling forwarding device to forward data, control device, storage medium and system

    CN110912836A

  • Production test method, system and device of intelligent network card and readable storage medium

    CN113608940A

  • Data processing method, programmable network card equipment, physical server and storage medium

    CN113821310A

  • Deployment method, device and equipment of virtual machine Ceph cluster and medium

    CN117827375A

  • Method for Accessing Remote Acceleration Device by Virtual Machine, and System

    US20200356401A1