A network card configuration method, device, equipment and storage medium
By assigning target virtual machines to the target virtual machine, enabling them to transmit data with the Internet, the scope and efficiency of low-latency network card solutions in virtual machine environments is solved, and a wider and more efficient network acceleration is achieved.
Patent Information
- Application Number
- CN202111623979.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2041-12-28
AI Technical Summary
The low-latency network acceleration solutions implemented by existing low-latency network cards are mainly limited to physical machines or host environments, with a small range of use and low efficiency.
By obtaining the target configuration file of the target virtual machine, and assigning the target virtual machine based on the file, the target virtual machine can achieve data transmission with the Internet through the target virtual physical function.
The scope of use of low-latency network card solutions has been expanded, and the efficiency of use has been improved, so that the low-latency network acceleration solutions can be effectively applied in virtual machine environments.
Smart Images

Figure CN114416287B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud communication technologies, and in particular, to a network card configuration method, apparatus, device, and storage medium. Background Art
[0002] With the rapid development of network communication technologies, the requirement for network latency is getting higher and higher. How to effectively reduce data transmission latency has become the primary problem to be solved currently. At present, in order to reduce data transmission latency and obtain a network performance with ultra-low latency, a low-latency network acceleration solution has been proposed to be implemented by using a low-latency network card such as a Solarflare network card.
[0003] However, the low-latency network acceleration solution implemented by using a low-latency network card is currently only limited to the application environment of a physical machine or a host machine, resulting in a relatively small usage range and low usage efficiency of the low-latency network acceleration solution implemented by using a low-latency network card.
[0004] Content of the Application
[0005] In view of this, embodiments of this application are expected to provide a network card configuration method, apparatus, device, and storage medium, which solve the problem of the relatively small usage range of the low-latency network acceleration solution implemented by using a low-latency network card such as a Solarflare network card, expand the usage range of the low-latency network acceleration solution implemented by using a low-latency network card such as a Solarflare network card, and improve the usage efficiency of the low-latency network acceleration solution implemented by using a low-latency network card such as a Solarflare network card.
[0006] To achieve the above object, the technical solution of this application is implemented as follows:
[0007] In a first aspect, a network card configuration method, the method includes:
[0008] Obtain a target configuration file corresponding to a target virtual machine; wherein, the target configuration file is configured with configuration parameters for providing a target virtual physical function for the target virtual machine, and the target virtual physical function is obtained by slicing a reference physical function of a target network card in advance;
[0009] Based on the target configuration file, allocate the target virtual physical function to the target virtual machine, so that the target virtual machine can achieve data transmission with the Internet through the target virtual physical function.
[0010] Optionally, the allocating the target virtual physical function to the target virtual machine based on the target configuration file includes:
[0011] Based on the target configuration file, determine the local area network MAC address of the target virtual physical function;
[0012] Determine that the MAC address of the target virtual machine is the MAC address of the target virtual physical function.
[0013] Optionally, after determining that the MAC address of the target virtual machine is the LAN MAC address of the target virtual physical function, the method further includes:
[0014] Perform a locking operation on the MAC address of the target virtual physical function, so that the MAC address of the target virtual physical function only provides network communication services for the target virtual machine.
[0015] Optionally, before obtaining the target configuration file corresponding to the target virtual machine, the method further includes:
[0016] Obtain physical function configuration parameters;
[0017] Determine the reference physical function of the target network card that needs to be physically function split and virtualized from the physical function configuration parameters;
[0018] Based on the reference physical function, split out a preset number of reference virtual physical functions; wherein, the preset number is included in the physical function configuration parameters, and the preset number of reference virtual physical functions includes the target virtual physical function.
[0019] Optionally, after splitting out a preset number of reference virtual physical functions based on the reference physical function, the method further includes:
[0020] Determine the historical network port sorting order;
[0021] Name the preset number of reference virtual physical functions according to a preset network port naming rule to obtain the preset number of reference network port names;
[0022] Sort the preset number of reference network port names starting from the last sorting object in the historical network port sorting order according to a preset sorting rule to obtain the target network port sorting order.
[0023] Optionally, the method further includes:
[0024] Hide the preset number of reference network port names.
[0025] Optionally, the method further includes:
[0026] Send the target network port sorting order to the target virtual machine; wherein, the target network port sorting order is used for display in the target virtual machine for the user to perform a selection operation.
[0027] Optionally, the method further includes:
[0028] Establishing an association relationship between the reference physical function and the preset number of reference virtual physical functions;
[0029] Counting the allocation information of the preset number of reference virtual physical functions;
[0030] Storing the association relationship and the allocation information.
[0031] In a second aspect, a network card configuration device includes an acquisition unit and an allocation unit; wherein:
[0032] The acquisition unit is configured to acquire a target configuration file corresponding to a target virtual machine; wherein, the target configuration file is configured with configuration parameters for providing target virtual physical functions for the target virtual machine, and the target virtual physical functions are obtained by slicing a reference physical function of a target network card in advance;
[0033] The allocation unit is configured to allocate the target virtual physical functions to the target virtual machine based on the target configuration file, so that the target virtual machine can implement data transmission with the Internet through the target virtual physical functions.
[0034] In a third aspect, a network card configuration device includes a target network card, a memory, a processor, and a communication bus; wherein:
[0035] The target network card is configured to provide a network interface for a running virtual machine to implement Internet communication;
[0036] The memory is configured to store executable instructions;
[0037] The communication bus is configured to implement a communication connection between the processor and the memory;
[0038] The processor is configured to execute a network card configuration program stored in the memory to implement the steps of the network card configuration method as described in any one of the above.
[0039] In a fourth aspect, a storage medium stores a network card configuration program, and when the network card configuration program is executed by a processor, the steps of the network card configuration method as described in any one of the above are implemented.
[0040] The network card configuration method, device, equipment, and storage medium provided by the embodiments of the present application obtain a target configuration file corresponding to a target virtual machine, and based on the target configuration file, allocate a target virtual physical function to the target virtual machine, so as to enable the target virtual machine to realize data transmission with the Internet through the target virtual physical function. In this way, by allocating a target virtual physical function to the target virtual machine to realize data transmission between the target virtual machine and the Internet, the problem that the usage range of low-latency network acceleration solutions implemented by current low-latency network cards such as Solarflare network cards is small is solved, the usage range of low-latency network acceleration solutions implemented by low-latency network cards such as Solarflare network cards is expanded, and the usage efficiency of low-latency network acceleration solutions implemented by low-latency network cards such as Solarflare network cards is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a schematic flowchart of a network card configuration method provided by an embodiment of the present application;
[0042] Figure 2 It is a schematic flowchart of another network card configuration method provided by an embodiment of the present application;
[0043] Figure 3 It is a schematic flowchart of yet another network card configuration method provided by an embodiment of the present application;
[0044] Figure 4 It is a schematic flowchart of a network card configuration method provided by another embodiment of the present application;
[0045] Figure 5 It is a schematic flowchart of another network card configuration method provided by another embodiment of the present application;
[0046] Figure 6 It is a schematic flowchart of yet another network card configuration method provided by another embodiment of the present application;
[0047] Figure 7 It is a schematic flowchart of a network card configuration method provided by yet another embodiment of the present application;
[0048] Figure 8 It is a schematic flowchart of another network card configuration method provided by yet another embodiment of the present application;
[0049] Figure 9 It is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0050] Figure 10 It is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0051] Figure 11A schematic diagram of a page for setting virtual partitioning configuration parameters provided by an embodiment of the present application;
[0052] Figure 12 A schematic diagram of an application interface on the virtual machine side provided by an embodiment of the present application;
[0053] Figure 13 A schematic diagram of the structure of a network card configuration device provided by an embodiment of the present application;
[0054] Figure 14 A schematic diagram of the structure of a network card configuration device provided by an embodiment of the present application. Detailed implementation manners
[0055] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] An embodiment of the present application provides a network card configuration method, which is applied to a network card configuration device. Referring to Figure 1 as shown, the method includes the following steps:
[0057] Step 101, obtain a target configuration file corresponding to a target virtual machine.
[0058] Among them, the target configuration file is configured with configuration parameters for providing a target virtual physical function for the target virtual machine, and the target virtual physical function is obtained by splitting the reference physical function of the target network card in advance.
[0059] In the embodiment of the present application, the network card configuration device is a device that can install the target network card and provide cloud computing services. For example, it can be a computer device, a server, etc. with high computing power. The network card configuration device can run a virtual machine. The target network card is a low-latency network card, such as a Solarflare network card. The target configuration file can be a file obtained by a user configuring parameters for the login process of the target virtual machine when logging in to the target virtual machine. The target configuration file is configured with the target virtual physical function configured by the user for the target virtual machine. The virtual physical function (Physical Function, PF) can also be called a virtual network interface. The virtual physical function is obtained by splitting the reference physical function of the target network card, and the reference physical function is a physical function of the target network card, that is, a physical network interface of the target network card.
[0060] Step 102, allocate the target virtual physical function to the target virtual machine based on the target configuration file.
[0061] Among them, based on the target configuration file, the target virtual physical function is allocated to the target virtual machine, so that the target virtual machine can realize data transmission with the Internet through the target virtual physical function.
[0062] In an embodiment of the present application, after the network card configuration device obtains the target configuration file for the target virtual machine, it allocates the target virtual physical function to the target virtual machine according to the configuration parameters in the target configuration file. Among them, the network card configuration device can analyze the configuration parameters in the target configuration file to determine whether the target virtual physical function has been allocated to other virtual machines. If the target virtual physical function has been allocated to other virtual machines, a prompt message can be generated to prompt the user that the target virtual physical function has been used. In this way, the user can reconfigure the target virtual machine. However, in some application scenarios, when the user configures the target configuration file, the network card configuration device can only display the virtual physical functions that are not currently allocated, so that the user can select the target virtual physical function from the unallocated virtual physical functions. The target virtual physical function includes at least one virtual physical function.
[0063] The network card configuration method provided by the embodiment of the present application obtains the target configuration file corresponding to the target virtual machine, and based on the target configuration file, allocates the target virtual physical function to the target virtual machine, so as to enable the target virtual machine to realize data transmission with the Internet through the target virtual physical function. In this way, by allocating the target virtual physical function to the target virtual machine to realize data transmission between the target virtual machine and the Internet, the problem that the use range of the low-latency network acceleration scheme implemented by current low-latency network cards such as Solarflare network cards is small is solved, the use range of the low-latency network acceleration scheme implemented by low-latency network cards such as Solarflare network cards is expanded, and the use efficiency of the low-latency network acceleration scheme implemented by low-latency network cards such as Solarflare network cards is improved.
[0064] Based on the foregoing embodiment, an embodiment of the present application provides a network card configuration method. Refer to Figure 2 As shown, this method is applied to a network card configuration device, and this method includes the following steps:
[0065] Step 201, obtain the target configuration file corresponding to the target virtual machine.
[0066] Among them, the target configuration file is configured with configuration parameters for providing the target virtual physical function for the target virtual machine, and the target virtual physical function is obtained by slicing the reference physical function of the target network card in advance.
[0067] In an embodiment of the present application, the user sets configuration parameters for the target virtual machine to obtain the target configuration file. In this way, the network card configuration device can obtain the target configuration file corresponding to the target virtual machine.
[0068] Step 202, based on the target configuration file, determine the LAN MAC address of the target virtual physical function.
[0069] In the embodiment of the present application, the network interface name of the target virtual physical function is configured in the target configuration file. In this way, the network interface configuration device can determine the network interface name of the target virtual physical function from the target configuration file, and then determine the MAC address of the target virtual physical function according to the network interface name of the target virtual physical function.
[0070] Step 203: Determine that the MAC address of the target virtual machine is the MAC address of the target virtual physical function.
[0071] In the embodiment of the present application, on the premise that the MAC address of the target virtual physical function is not currently allocated, the MAC address of the target virtual machine is set as the MAC address of the target virtual physical function. In this way, it is realized that the target virtual machine performs data transmission through the target virtual physical function.
[0072] Based on the foregoing embodiments, in other embodiments of the present application, as shown in Figure 3 After the network card configuration device executes step 203, it is further used to execute step 204:
[0073] Step 204: Perform a locking operation on the MAC address of the target virtual physical function.
[0074] Among them, performing a locking operation on the MAC address of the target virtual physical function enables the MAC address of the target virtual physical function to provide network communication services only for the target virtual machine.
[0075] In the embodiment of the present application, a locking operation is performed on the MAC address of the target virtual physical function to prevent the MAC address of the target virtual function from being re-allocated to other virtual machines or devices, resulting in a conflict in the use of physical functions.
[0076] Based on the foregoing embodiments, in other embodiments of the present application, as shown in Figure 4 Before the network card configuration device executes step 201, it is further used to execute steps 205 to 207:
[0077] Step 205: Obtain physical function configuration parameters.
[0078] In the embodiment of the present application, the physical function configuration parameters are configured with a reference physical function that needs to perform physical function slicing virtualization, and a preset number of virtual physical functions that need to be sliced out, that is, the user needs to set which physical function of the target network card to perform physical function slicing virtualization operations, and the number of slices required.
[0079] Step 206: Determine the reference physical function of the target network card that needs to perform physical function slicing virtualization from the physical function configuration parameters.
[0080] In an embodiment of the present application, the network card configuration device analyzes the physical function configuration parameters to determine the reference physical function of the target network card that needs to perform physical function slicing and virtualization. Exemplarily, the target network card is a Solarflare network card, and the reference physical function of the target network card specified in the corresponding physical function configuration parameters that needs to perform physical function slicing and virtualization is Network Interface 1 of the Solarflare network card.
[0081] Step 207: Based on the reference physical function, slice out a preset number of reference virtual physical functions.
[0082] Among them, the physical function configuration parameters include a preset number, and the preset number of reference virtual physical functions include the target virtual physical function.
[0083] In an embodiment of the present application, the preset number is a number greater than or equal to 1 set by the user according to actual needs. Exemplarily, if the preset number is 3, then for the reference physical function, 3 reference virtual physical functions are sliced out, including Reference Virtual Physical Function 1, Reference Virtual Physical Function 2, and Reference Virtual Physical Function 3.
[0084] Based on the foregoing embodiments, in other embodiments of the present application, as shown in Figure 5 After the network card configuration device executes step 207, it is further used to execute steps 208 to 210:
[0085] Step 208: Determine the historical network interface sorting order.
[0086] In an embodiment of the present application, the historical network interface sorting order can be recorded in the network card rule file. In this way, the network card rule file recording the historical network interface sorting order can be determined.
[0087] Step 209: Name the preset number of reference virtual physical functions according to the preset network interface naming rule to obtain the preset number of reference network interface names.
[0088] In an embodiment of the present application, the preset network interface naming rule is used to specify the rule for naming virtual physical functions. For example, it can be named according to the naming of the corresponding physical function, so as to indicate the relationship between the virtual physical function and the corresponding physical function. Exemplarily, assuming that the naming of Network Interface 1 is eth3, the naming of the corresponding 3 reference virtual physical functions is eth31, eth32, and eth33.
[0089] Step 210: Sort the preset number of reference network interface names starting from the last sorting object in the historical network interface sorting order according to the preset sorting rule to obtain the target network interface sorting order.
[0090] In the embodiment of the present application, the preset sorting rule is from bottom to top, from left to right, with optical ports first and then electrical ports. In this way, according to the preset sorting rule, a preset number of reference network port names are sorted to the end of the historical network port sorting order to obtain the target network port sorting order. Exemplarily, if the historical network port sorting order is eth1, eth2, eth3, eth4, eth5, then eth31, eth32, and eth33 are sorted after eth5, and the target network port sorting order obtained is eth1, eth2, eth3, eth4, eth5, eth32, eth31, eth33.
[0091] Based on the foregoing embodiments, in other embodiments of the present application, referring to Figure 6 as shown, after the network card configuration device executes step 209, it is further configured to execute step 211:
[0092] Step 211: Hide a preset number of reference network port names.
[0093] In the embodiment of the present application, in the network card configuration device, the preset number of reference network port names obtained by splitting are subjected to a hiding process, reducing the confusion caused by users seeing these reference network port names and improving the user experience effect. Specifically, the virtual function input / output (VFIO) technology can be used to transfer the virtual physical function from the kernel state to the user state, thereby implementing the hiding operation. It should be noted that step 211 can be executed before step 210, after step 210, or simultaneously with step 210, and the specific execution order can be determined according to the actual situation.
[0094] Based on the foregoing embodiments, in other embodiments of the present application, referring to Figure 7 as shown, after the network card configuration device executes step 210, it is further configured to execute step 212:
[0095] Step 212: Send the target network port sorting order to the target virtual machine.
[0096] Among them, the target network port sorting order is used for display in the target virtual machine to enable the user to perform a selection operation.
[0097] In the embodiment of the present application, the network card configuration device sends the determined target network port sorting order to the target virtual machine. In this way, when the user operates on the target virtual machine, the corresponding network port names can be seen. The target virtual machine can also distinguish the physical function and the virtual physical function according to the network port names in the received target network port sorting order.
[0098] Based on the foregoing embodiments, in other embodiments of the present application, referring to Figure 8As shown, after the network card configuration device executes step 212, it is further used to execute steps 213 to 215:
[0099] Step 213, establish an association relationship between the reference physical function and a preset number of reference virtual physical functions.
[0100] In the embodiment of the present application, the association relationship between the reference physical function and a preset number of reference virtual physical functions may be a correspondence relationship between the reference physical function and a preset number of reference virtual physical functions.
[0101] Step 214, count the allocation information of a preset number of reference virtual physical functions.
[0102] In the embodiment of the present application, the allocation information of a preset number of reference virtual physical functions refers to the usage status of a preset number of reference virtual physical functions being allocated for use. The allocation information at least includes information about the virtual machines used and the identification information of the reference virtual physical functions being used. The information about the virtual machines includes virtual machine identification information, and the identification information of the reference virtual physical functions includes at least one of the following information: the corresponding Peripheral Component Interconnect (PCI) address, MAC address, etc.
[0103] Step 215, store the association relationship and the allocation information.
[0104] In the embodiment of the present application, the association relationship and the allocation information are stored correspondingly, so as to determine the number of reference virtual physical functions being used, which virtual machines are using the corresponding reference virtual physical functions, and the reference virtual physical functions that have not been used yet.
[0105] Based on the foregoing embodiments, the embodiment of the present application provides an implementation logic structure diagram of a network card configuration device. Refer to Figure 9 As shown, it includes: a Solarflare network card, virtual machine 1, and virtual machine 2. Among them, the slicing virtualization technology of the Solarflare network card is used to slice the Solarflare network card into n virtual physical functions, denoted as PF1, PF2,..., PFn. Among them, PF1 is passed through to virtual machine 1 for use, and PFn is passed through to virtual machine 2 for use. The application programs in virtual machine 1 and virtual machine 2 can both be transformed by using acceleration suites of the Solarflare network card, such as Onload, Transmission Control Protocol Direct (TCPDirect), TCPDirect, EF_VI, etc.
[0106] Among them, to implement Figure 9The implementation process between virtual machine 1 and PF1, virtual machine 2 and PF2 in the network card configuration device shown can refer to Figure 10 As shown, the network card configuration device includes a physical function management module and a virtual machine associated physical function module; wherein:
[0107] The physical function management module is used to implement the following processes:
[0108] Step 301: The physical function management module backs up the network card rule file of the network card included in the network card configuration device.
[0109] The network card rule file includes the sorting order of the current network cards of the network card configuration device.
[0110] Step 302: The physical function management module performs network card segmentation virtualization through the Solarflare network card's own tool.
[0111] The physical function management module uses the Solarflare network card's built-in tool to perform a network card virtualization operation on a physical PF of the Solarflare network card, and divides a specified number of virtual PFs. Figure 11 Configure the parameters on the page shown, set the eth10 physical PF of the Solarflare network card to perform network card switching virtualization operation, and split out 7 virtual PFs.
[0112] Step 303: The physical function management module controls the network card configuration device to restart.
[0113] Step 304: After the network card configuration device is restarted, the physical function management module enters the PF network card sequence preservation process.
[0114] Among them, since there is no obvious difference between virtual PF and physical PF, it is easy for virtual PF to occupy the PCI address space of physical PF and squeeze out the names and sorting order of other types of network cards. Therefore, the physical function management module needs to enter the PF network card order preservation process: control the driver of the Solarflare network card, that is, the virtual PF of the Solarflare network card to start last, so as not to squeeze out the PCI address space and network card name order of other types of network cards; or, sort the split virtual PF into the sorting order included in the network card rule file, and use the naming requirements of the virtual PF to name the corresponding network card, thereby solving the crowding problem of the same type of network cards.
[0115] Step 305: The physical function management module executes the hidden function of the virtual PF.
[0116] Among them, since there is no difference between the virtual PF and the physical PF, if multiple generated virtual PFs exist in the network subsystem, there will be problems in management and maintenance. For example, users will see multiple network interface names, causing confusion and resulting in a poor user experience. Therefore, the VFIO technology can be used to transfer the virtual PF driver from the kernel mode to the user mode, so as to achieve the purpose of hiding.
[0117] Step 306: The physical function management module maintains the mapping relationship table of the physical PF and the virtual PF and writes it into a file.
[0118] Among them, the file records the usage situation of the virtual PF, including how many virtual PFs are used, which virtual machine each virtual PF is used by, and how many virtual PFs are left available. In addition, it also includes the configuration information related to each virtual PF, such as its corresponding PCI address, MAC address, device identifier, etc.
[0119] The virtual machine associated physical function module is mainly used to implement the following processes:
[0120] Step 401: The virtual machine associated physical function module controls the startup of the virtual machine.
[0121] Step 402: The virtual machine associated physical function module selects a virtual PF.
[0122] Step 403: The virtual machine associated physical function module determines the MAC address of the selected virtual PF from the file of the physical function management module.
[0123] Step 404: The virtual machine associated physical function module assigns the determined MAC address to the virtual machine.
[0124] Step 405: The virtual machine associated physical function module updates the virtual machine to which the virtual PF used this time has been assigned into the file.
[0125] Among them, a locking operation is performed on the MAC address of the virtual PF assigned to the virtual machine to ensure that there will be no conflict when multiple virtual machines call the same virtual PF. Exemplarily, the interface for the virtual machine to select the network card can be as Figure 12 shown. First step: Configure the network interface that the virtual machine needs to connect at area A1. Second step: Select the network card model at area A2. For example, the split virtual network card model can adopt the "SR direct pass-through network card". At this time, the SR direct pass-through network card can be selected. Third step: Area A3 is the network interface list. The network interface list shows the available idle direct pass-through network interfaces. If the SR direct pass-through network card function is selected, two options displayed at area A4 need to be selected simultaneously for configuration.
[0126] It should be noted that for the explanations of the same steps or concepts in this embodiment and other embodiments, reference can be made to the descriptions in other embodiments, and details will not be elaborated here.
[0127] The network card configuration method provided by the embodiments of the present application obtains a target configuration file corresponding to a target virtual machine, and based on the target configuration file, allocates a target virtual physical function to the target virtual machine, so as to enable the target virtual machine to achieve data transmission with the Internet through the target virtual physical function. In this way, by allocating a target virtual physical function to the target virtual machine to achieve data transmission between the target virtual machine and the Internet, the problem that the usage range of low-latency network acceleration solutions implemented by current low-latency network cards such as Solarflare network cards is relatively small is solved, the usage range of low-latency network acceleration solutions implemented by low-latency network cards such as Solarflare network cards is expanded, and the usage efficiency of low-latency network acceleration solutions implemented by low-latency network cards such as Solarflare network cards is improved.
[0128] Based on the foregoing embodiments, an embodiment of the present application provides a network card configuration device 5, which can be applied to Figures 1 - 8 In the corresponding embodiment, refer to Figure 13 As shown, the network card configuration device 5 includes: an acquisition unit 51 and an allocation unit 52; where:
[0129] The acquisition unit 51 is used to acquire a target configuration file corresponding to a target virtual machine; where the target configuration file is configured with configuration parameters for providing a target virtual physical function for the target virtual machine, and the target virtual physical function is obtained by splitting in advance based on the reference physical function of the target network card;
[0130] The allocation unit 52 is used to allocate a target virtual physical function to the target virtual machine based on the target configuration file, so that the target virtual machine can achieve data transmission with the Internet through the target virtual physical function.
[0131] In other embodiments of the present application, the allocation unit 52 includes: a first determination module and a second determination module; where:
[0132] The first determination module is used to determine the LAN MAC address of the target virtual physical function based on the target configuration file;
[0133] The second determination module is used to determine that the MAC address of the target virtual machine is the MAC address of the target virtual physical function.
[0134] In other embodiments of the present application, after the second determination module, the allocation unit 52 further includes: a locking module; where:
[0135] A locking module, which is used to lock the MAC address of the target virtual physical function, so that the MAC address of the target virtual physical function provides network communication services only for the target virtual machine.
[0136] In other embodiments of the present application, the network card configuration device further includes: a determination unit and a segmentation unit; wherein:
[0137] The acquisition unit is further used to acquire physical function configuration parameters;
[0138] The determination unit is used to determine the reference physical function of the target network card that needs to be physically function-segmented and virtualized from the physical function configuration parameters;
[0139] The segmentation unit is used to segment a preset number of reference virtual physical functions based on the reference physical function; wherein, the physical function configuration parameters include the preset number, and the preset number of reference virtual physical functions include the target virtual physical function.
[0140] In other embodiments of the present application, after the segmentation unit, the network card configuration device further includes: a naming unit and a sorting unit; wherein:
[0141] The determination unit is further used to determine the historical network port sorting order;
[0142] The naming unit is used to name the preset number of reference virtual physical functions according to a preset network port naming rule to obtain a preset number of reference network port names;
[0143] The sorting unit is used to sort the preset number of reference network port names starting from the last sorting object in the historical network port sorting order according to a preset sorting rule to obtain the target network port sorting order.
[0144] In other embodiments of the present application, the network card configuration device further includes: a hiding unit; wherein:
[0145] The hiding unit is used to hide the preset number of reference network port names.
[0146] In other embodiments of the present application, the network card configuration device further includes: a sending unit; wherein:
[0147] The sending unit is used to send the target network port sorting order to the target virtual machine; wherein, the target network port sorting order is used to be displayed in the target virtual machine for the user to perform a selection operation.
[0148] In other embodiments of the present application, the network card configuration device further includes: a establishing unit, a statistical unit and a storage unit; wherein:
[0149] The establishing unit is used to establish an association relationship between the reference physical function and the preset number of reference virtual physical functions;
[0150] A statistical unit for statistically analyzing the allocation information of a preset number of reference virtual physical functions;
[0151] A storage unit for storing the association relationship and the allocation information.
[0152] It should be noted that the information interaction process between the units and modules in this embodiment can refer to the information interaction process described in the foregoing method embodiment, and will not be elaborated here.
[0153] The network card configuration device provided by the embodiment of the present application obtains a target configuration file corresponding to a target virtual machine, and based on the target configuration file, allocates a target virtual physical function to the target virtual machine, so as to enable the target virtual machine to perform data transmission with the Internet through the target virtual physical function. In this way, by allocating the target virtual physical function to the target virtual machine to realize data transmission between the target virtual machine and the Internet, the problem that the usage range of the low-latency network acceleration solution implemented by currently available low-latency network cards such as Solarflare network cards is relatively small is solved, the usage range of the low-latency network acceleration solution implemented by low-latency network cards such as Solarflare network cards is expanded, and the usage efficiency of the low-latency network acceleration solution implemented by low-latency network cards such as Solarflare network cards is improved.
[0154] Based on the foregoing embodiments, an embodiment of the present application provides a network card configuration device 6, which can be applied to Figures 1 - 8 In the corresponding embodiment, refer to Figure 12 As shown, the network card configuration device 6 includes: a target network card 61, a memory 62, a processor 63, and a communication bus 64; where:
[0155] The target network card 61 is used to provide a network interface for the running virtual machine to implement Internet communication;
[0156] The memory 62 is used to store executable instructions;
[0157] The communication bus 64 is used to implement the communication connection between the processor 63 and the memory 62;
[0158] The processor 63 is used to execute the network card configuration program stored in the memory to implement the interaction process in the corresponding method embodiment, which will not be elaborated here. Figures 1 - 8 Based on the foregoing embodiments, an embodiment of the present application provides a computer-readable storage medium, simply referred to as a storage medium. The computer-readable storage medium stores one or more network card configuration programs, and the one or more network card configuration programs can be executed by one or more processors to implement as
[0159] Figures 1 - 8 The network card configuration method provided by the corresponding embodiment will not be elaborated here.
[0160] It should be noted that in this article, the terms "including", "comprising", or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article, or device including that element.
[0161] The serial numbers of the embodiments of the present application above are only for description and do not represent the superiority or inferiority of the embodiments.
[0162] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which can be a mobile phone, computer,..., air conditioner, or network communication link device, etc.) to execute the methods described in various embodiments of the present application.
[0163] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the specified functions in Figure One one process or multiple processes and / or blocks Figure One one block or multiple blocks.
[0164] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the specified functions in Figure One one process or multiple processes and / or blocks Figure One one block or multiple blocks.
[0165] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable apparatus to generate a computer-implemented process, thereby providing instructions for implementing the steps of the function specified in one process or a plurality of processes and / or blocks Figure One One process or a plurality of processes and / or blocks Figure One in one block or a plurality of blocks.
[0166] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.
Claims
1. A network card configuration method, characterized in that, The method includes: Obtaining physical function configuration parameters; Determining, from the physical function configuration parameters, a reference physical function of a target network card that needs to perform physical function slicing and virtualization; wherein, the reference physical function is a physical function of the target network card, that is, the reference physical function is a physical network port of the target network card; Based on the reference physical function, slicing out a preset number of reference virtual physical functions; wherein, the preset number is included in the physical function configuration parameters, and the preset number of reference virtual physical functions includes a target virtual physical function; Obtaining a target configuration file corresponding to a target virtual machine; wherein, the target configuration file is configured with configuration parameters for providing the target virtual physical function for the target virtual machine; Based on the target configuration file, allocating the target virtual physical function to the target virtual machine, so that the target virtual machine can achieve data transmission with the Internet through the target virtual physical function.
2. The method according to claim 1, characterized in that, The allocating the target virtual physical function to the target virtual machine based on the target configuration file includes: Based on the target configuration file, determining the LAN MAC address of the target virtual physical function; Determining that the MAC address of the target virtual machine is the MAC address of the target virtual physical function.
3. The method according to claim 2, characterized in that, After determining that the MAC address of the target virtual machine is the MAC address of the target virtual physical function, the method further includes: Performing a locking operation on the MAC address of the target virtual physical function, so that the MAC address of the target virtual physical function only provides network communication services for the target virtual machine.
4. The method according to claim 1, characterized in that, After slicing out a preset number of reference virtual physical functions based on the reference physical function, the method further includes: Determining the historical network port sorting order; Naming the preset number of reference virtual physical functions according to a preset network port naming rule to obtain the preset number of reference network port names; Sorting the preset number of reference network port names starting from the last sorting object in the historical network port sorting order according to a preset sorting rule to obtain a target network port sorting order.
5. The method according to claim 4, characterized in that, The method further includes: Hiding the preset number of reference network port names.
6. The method according to claim 4, characterized in that, The method further includes: Sending the target network port sorting order to the target virtual machine; wherein, the target network port sorting order is used for display in the target virtual machine to enable a user to perform a selection operation.
7. The method according to any one of claims 3 to 6, characterized in that, The method further includes: Establishing an association relationship between the reference physical function and the preset number of reference virtual physical functions; Counting the allocation information of the preset number of reference virtual physical functions; Storing the association relationship and the allocation information.
8. A network card configuration device, characterized in that, The apparatus includes: an obtaining unit, an allocating unit, a determining unit, and a slicing unit; wherein: The obtaining unit is used to obtain physical function configuration parameters; The determining unit is used to determine, from the physical function configuration parameters, a reference physical function of a target network card that needs to perform physical function slicing and virtualization; wherein, the reference physical function is a physical function of the target network card, that is, a physical network port of the target network card; The slicing unit is configured to slice a preset number of reference virtual physical functions based on the reference physical function; wherein, the physical function configuration parameters include the preset number, and the preset number of reference virtual physical functions include the target virtual physical function; The obtaining unit is further configured to obtain a target configuration file corresponding to the target virtual machine; wherein, the target configuration file is configured with configuration parameters for providing the target virtual physical function for the target virtual machine; The allocation unit is configured to allocate the target virtual physical function to the target virtual machine based on the target configuration file, so that the target virtual machine can realize data transmission with the Internet through the target virtual physical function.
9. An electronic device, characterized in that, The device includes: a target network card, a memory, a processor, and a communication bus; wherein: The target network card is configured to provide a network interface for realizing Internet communication for the running virtual machine; The memory is configured to store executable instructions; The communication bus is configured to realize the communication connection between the processor and the memory; The processor is configured to execute the network card configuration program stored in the memory to implement the steps of the network card configuration method according to any one of claims 1 to 7.
10. A storage medium, characterized in that, A network card configuration program is stored on the storage medium, and when the network card configuration program is executed by the processor, the steps of the network card configuration method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method and device for configuring network card for virtual machine
CN106789363A
Method for managing a virtual machine and a related device
CN108958884A
Method and Apparatus for Managing Physical Network Interface Card, and Physical Host
US20150207678A1