A virtual function device management method and device, server, storage medium and program product

By managing only one VF device in the vDPA software and using DPDK and target drivers for initialization, the problem of widespread VF device impact during vDPA software crashes and upgrades is solved, achieving independence and stability in device management.

CN122363871APending Publication Date: 2026-07-10JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
Filing Date
2025-01-08
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

The issue of a large number of Virtual Functional Devices (VF devices) being affected when the Virtual Data Path Acceleration (vDPA) software crashes and/or is upgraded.

Method used

By enabling the vDPA software to manage only one VF device, and using the Data Plane Development Kit (DPDK) and target drivers to initialize the VF device, independent management of device functions is achieved, avoiding the impact of crashes and upgrades on unmanaged VF devices.

Benefits of technology

When vDPA software crashes and/or is upgraded, only managed VF devices are affected, while unmanaged VF devices remain unaffected, reducing the scope of device failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122363871A_ABST
    Figure CN122363871A_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, server, storage medium, and program product for managing virtual functional devices. The method is applied to a virtual data path acceleration server, which runs on a server equipped with a data processor card. The data processor card provides physical functional devices, each corresponding to at least two virtual functional devices. A one-to-one correspondence exists between one of the virtual functional devices and the virtual data path acceleration server. The method includes: receiving a virtual functional device management request; and, in response to the virtual functional device management request, managing the virtual functional devices represented by the one-to-one correspondence. The technical solution of this invention ensures that only one virtual functional device is affected in the event of a crash or / or upgrade of the virtual data path acceleration server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a virtual functional device management method, apparatus, server, storage medium and program product. Background Technology

[0002] Virtual Data Path Acceleration (vDPA) is a technology used to accelerate the storage and network performance of Virtual Machines (VMs), and it is used in conjunction with Virtual Function (VF) devices.

[0003] In the process of realizing this invention, the inventors discovered the following technical problems in the prior art: when the vDPA software (i.e., the vDPA server or the vDPA program) crashes and / or is upgraded, a large number of VF devices will be affected, which urgently needs to be solved. Summary of the Invention

[0004] This invention provides a virtual function device management method, apparatus, server, storage medium, and program product, which solves the problem that a large number of VF devices are affected when vDPA software crashes and / or is upgraded.

[0005] According to one aspect of the present invention, a virtual functional device management method is provided, applied to a virtual data path acceleration server. The virtual data path acceleration server runs on a server, the server has a data processor card inserted, the data processor card provides physical functional devices, each physical functional device corresponds to at least two virtual functional devices, and there is a one-to-one correspondence between one of the virtual functional devices and the virtual data path acceleration server. The method may include:

[0006] Receive virtual function device management requests;

[0007] In response to virtual function device management requests, manage the virtual function devices represented by the one-to-one correspondence.

[0008] According to another aspect of the present invention, a virtual functional device management device is provided, configured on a virtual data path acceleration server. The virtual data path acceleration server runs on a server, and the server has a data processor card inserted. The data processor card provides physical functional devices, each physical functional device corresponding to at least two virtual functional devices. A one-to-one correspondence exists between one of the virtual functional devices and the virtual data path acceleration server. The device may include:

[0009] The request receiving module is used to receive virtual function device management requests;

[0010] The device management module is used to manage the virtual functional devices represented by the one-to-one correspondence in response to virtual functional device management requests.

[0011] According to another aspect of the present invention, a server is provided, wherein a data processor card is inserted into the server, the data processor card provides physical functional devices, each physical functional device corresponding to at least two virtual functional devices, and one of the virtual functional devices has a one-to-one correspondence with a virtual data path acceleration program. The server may include:

[0012] At least one processor; and

[0013] A memory that is communicatively connected to at least one processor; wherein,

[0014] The memory stores a virtual data path acceleration program that can be executed by at least one processor. The virtual data path acceleration program is executed by at least one processor to implement the virtual functional device management method provided in any embodiment of the present invention when executed by at least one processor.

[0015] According to another aspect of the present invention, a computer-readable storage medium is provided having computer instructions stored thereon for causing a processor to execute and implement the virtual functional device management method provided in any embodiment of the present invention.

[0016] According to another aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the virtual functional device management method provided in any embodiment of the present invention.

[0017] The technical solution of this invention is applied to vDPA software, which runs on a server. The server has a DPU card inserted, and the DPU card provides PF devices. Each PF device corresponds to at least two VF devices. There is a one-to-one correspondence between one VF device and the vDPA software; that is, the vDPA software is only responsible for managing the one VF device corresponding to it. Based on this, the vDPA software manages the VF device in response to received virtual function device management requests. Compared to managing multiple VF devices through vDPA software, the above technical solution, by having the vDPA software manage only one VF device, ensures that in the event of a vDPA software crash or / or upgrade, only the VF devices it manages are affected, while unmanaged VF devices remain unaffected, thus solving the problem of multiple VF devices being affected.

[0018] It should be understood that the description in this section is not intended to identify key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a schematic diagram of a virtual functional device management architecture provided by the relevant solution;

[0021] Figure 2 This is a schematic diagram of a virtual functional device management architecture provided according to an embodiment of the present invention;

[0022] Figure 3 This is a flowchart of a virtual functional device management method provided according to an embodiment of the present invention;

[0023] Figure 4 This is a schematic diagram of the technical architecture of vDPA software in a virtual functional device management method provided according to an embodiment of the present invention;

[0024] Figure 5 This is a flowchart of another virtual functional device management method provided according to an embodiment of the present invention;

[0025] Figure 6 This is a flowchart of another virtual functional device management method provided according to an embodiment of the present invention;

[0026] Figure 7 This is a flowchart of another virtual function device management method provided according to an embodiment of the present invention;

[0027] Figure 8 This is a structural block diagram of a virtual function device management device provided according to an embodiment of the present invention;

[0028] Figure 9 This is a schematic diagram of the structure of a server that implements the virtual functional device management method of this invention. Detailed Implementation

[0029] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. The same applies to "target," "original," etc., and will not be repeated here. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0031] Before introducing the embodiments of the present invention, the application scenarios of the embodiments of the present invention, the implementation process of the related virtual function device management scheme, and the reasons why the problem of a large number of VF devices being affected when the vDPA software crashes and / or is upgraded will be explained by way of example, so as to better understand the reasons why the virtual function device management scheme proposed in the embodiments of the present invention solves this problem.

[0032] vDPA is a technology that has emerged in recent years to accelerate the performance of virtual machine storage and networks. It can hardwareify the software data path of storage and network devices that are used to implement paravirtualization devices in virtual machine scenarios.

[0033] Specifically, the vDPA software runs on the server's operating system (OS) and can pass through the data paths of virtio storage and network devices on the data processing unit (DPU) to the virtual machine, thereby providing the virtual machine with virtio storage and network devices.

[0034] The DPU is a data processing chip used in data centers, installed on servers as a high-speed Peripheral Component Interconnect Express (PCIe) card. The DPU primarily provides storage and network devices. Storage devices can be virtio block devices (virtio-blk), and network devices can be virtio network interface cards (virtio-net). These can be provided to the server side as Physical Function (PF) devices, and the corresponding devices can be seen on the server OS using the command-line tool (lspci) to list Peripheral Component Interconnect (PCI) devices. In addition, PF devices are device entities on the PCIe bus. Through Single Root Input / Output Virtualization (SR-IOV) technology, the resources on a single PF device can be partitioned to create multiple Virtual Function (VF) devices, and each VF device can be placed in any virtual machine on the server.

[0035] See Figure 1 The proposed solution involves managing all VF devices associated with a single PF device within a single vDPA software. In other words, one vDPA software manages one PF device and all its associated VF devices. However, if the vDPA software crashes, all VF devices managed by it will become unavailable; similarly, if the vDPA software is upgraded, the data paths for all VF devices managed by it will be temporarily unavailable. Therefore, vDPA software crashes and / or upgrades can significantly impact the functionality of a large number of VF devices.

[0036] To address this, this invention proposes a scheme where vDPA software manages only one VF device. For example, see [link to example]. Figure 2 The vDPA software runs on a server, which has a DPU card. The DPU card provides PF devices, and each PF device is responsible for generating multiple VF devices. Each VF device is managed independently by a different vDPA software. Therefore, in the event of a vDPA software crash or / or upgrade, only the VF devices it manages are affected, while unmanaged VF devices remain unaffected, thus resolving the issue of a large number of VF devices being affected. This will be explained in detail below.

[0037] Figure 3This is a flowchart of a virtual function device management method provided in an embodiment of the present invention. This embodiment is applicable to situations where vDPA software is used to manage VF devices, and is particularly applicable to situations where vDPA software is used to manage a single VF device. The method is applied to the vDPA server (i.e., the vDPA software) and can be executed by the virtual function device management device provided in this embodiment. This device can be implemented in software and / or hardware and can be integrated into a server. The server has a data processor card (i.e., a DPU card) inserted, and the DPU card provides PF devices. Each PF device corresponds to at least two VF devices, and there is a one-to-one correspondence between one VF device and the vDPA software.

[0038] See Figure 3 The method of this invention specifically includes the following steps:

[0039] S110, Receive virtual function device management request.

[0040] The Virtual Function Device Management Request can be understood as a request to manage a specific VF device. This VF device can be understood as having a one-to-one correspondence with the aforementioned vDPA software, meaning it can be managed by the vDPA software. In this embodiment of the invention, optionally, to facilitate the distinction between different VF devices, the VF device that can be managed by the vDPA software will be referred to as VF device X in the following text.

[0041] In this embodiment of the invention, the vDPA software can receive virtual function device management requests. These requests may originate from sources such as VF device X, a virtual machine using VF device X, or other software on a server running the vDPA software. In this embodiment, the source of the virtual function device management request is not specifically limited.

[0042] S120. In response to a virtual function device management request, manage the virtual function devices represented by the one-to-one correspondence.

[0043] The vDPA software can manage VF device X in response to virtual function device management requests.

[0044] For example, when the virtual function device management request is a data path pass-through request, the vDPA software can pass-through the data path of VF device X to the virtual machine using VF device X; when the virtual function device management request is a device state live migration request, the vDPA software will live migrate (lm) the device state of VF device X to another server; when the virtual function device management request is a dirty page live migration request, the vDPA software will live migrate the dirty page corresponding to VF device X to another server; no specific limitations are made here.

[0045] The technical solution of this invention is applied to vDPA software, which runs on a server. The server has a DPU card inserted, and the DPU card provides PF devices. Each PF device corresponds to at least two VF devices. There is a one-to-one correspondence between one VF device and the vDPA software; that is, the vDPA software is only responsible for managing the one VF device corresponding to it. Based on this, the vDPA software manages the VF device in response to received virtual function device management requests. Compared to managing multiple VF devices through vDPA software, the above technical solution, by having the vDPA software manage only one VF device, ensures that in the event of a vDPA software crash or / or upgrade, only the VF devices it manages are affected, while unmanaged VF devices remain unaffected, thus solving the problem of multiple VF devices being affected.

[0046] An optional technical solution, a virtual functional device management method, further includes: in response to a virtual functional device creation request for a virtual functional device represented by a one-to-one correspondence, obtaining the device address of the virtual functional device to be created; initializing the virtual functional device represented by the device address using a data plane development kit, wherein a target driver is added to the data plane development kit; and initializing the device functions of the initialized virtual functional device using the target driver to create the virtual functional device.

[0047] The virtual function device creation request can be understood as a request instructing the vDPA software to create a VF device X. Optionally, the request can come from the virtual machine using the VF device X or other software on the server, etc., without specific limitations.

[0048] The device address can be understood as the address used to identify and access the VF device X to be created. Optionally, this address can be used to initialize the VF device X; it can also be specified in the startup parameters of the vDPA software so that the vDPA software can create the VF device X through this address.

[0049] In this embodiment of the invention, the vDPA software can obtain a device address in response to a virtual function device creation request. For example, when the virtual machine control plane creates a storage or network device, the vDPA software can be started, and the started vDPA software obtains the device address in response to the virtual function device creation request. Optionally, in this embodiment of the invention, the device address can be represented by a PCIe address.

[0050] The target driver can be understood as a pre-defined driver that initializes the device functions of the VF device X.

[0051] In this embodiment of the invention, the VF device X represented by the device address is initialized by using the Data Plane Development Kit (DPDK) that can initialize VF devices; for the initialized VF device X, the device functions of VF device X are initialized by using the target driver in DPDK to create VF device X.

[0052] Building upon this, for example, the VF device X can be initialized by using DPDK to call the Virtual Function I / O (vfio) interface. Here, vfio can be understood as a function of the kernel system (Linux kernel), and its purpose in a virtual machine scenario is to pass the VF device through the virtual machine.

[0053] For example, for the initialized VF device X, the VF device X can be created by using the target driver to initialize the basic device functions such as virtio-blk and / or virtio-net, and / or special device functions such as hot migration.

[0054] In light of the application scenarios that may be involved in the embodiments of the present invention, optionally, in order to adapt to the above-mentioned device functions, the vDPA software can be modified, for example, the vDPA framework and / or the virtio vDPA driver can be modified. Based on this, optionally, the modifications to the vDPA software can be mainly reflected in the virtio vDPA driver, while the vDPA framework can be adapted and modified according to the modifications to the virtio vDPA driver.

[0055] For example, see Figure 4You can add hot-migrating device functionality to the DPU card and modify vDPAFramework and virtio vDPAdriver to adapt to the device functionality. For details, see [link to documentation]. Figure 4 The technical architecture of vDPA software can specifically include hardware (HW), kernel space, and user space. Between the kernel space and user space are a data layer and a control plane. Further, the hardware can include a Data Processing Unit (DPU) and an I / O memory management unit (IOMMU). The DPU includes Power Filter (PF) devices and their corresponding Virtual Filter (VF) devices. The kernel space includes vfio and the IOMMU driver. Peripheral Component Interconnect (PCI) can be used between vfio and the DPU. User space includes the virtual machine emulation software process (Qemu process) and vDPA software. The virtual machine emulation software process can include applications, kernel drivers, Virtio drivers, and Virtio device models. The vDPA software includes a virtual host library (Vhost-library), a vDPA framework, and a virtio vDPA driver. The virtio vDPA driver can perform hot migrations with the DPU. The protocol standard device model of the paravirtualized device can interact with the virtual host library using an interaction protocol. IOMMU has two main functions: Direct Memory Access Address (DMA) address translation and interrupt remapping. The interaction protocol can be the interaction protocol between the open-source virtual machine emulation software (Quick EMUlator, qemu) and the vDPA software (vhost user).

[0056] In this embodiment of the invention, by using DPDK to initialize VF device X according to the device address, and by initializing the device functions of VF device X through the target driver, VF device X is created. This enables the creation process of VF device X using vDPA software, thereby facilitating the subsequent management of VF device X through vDPA software.

[0057] Figure 5This is a flowchart of another virtual function device management method provided in this embodiment of the invention. This embodiment is based on and optimized from the above-described technical solutions. In this embodiment, optionally, at least one virtual machine runs on the server, and the virtual function device represented by the one-to-one correspondence is used by one of the virtual machines. The explanations of terms that are the same as or corresponding to those in the above embodiments will not be repeated here.

[0058] See Figure 5 The method in this embodiment is applied to a virtual data path acceleration server, which runs on a server. The server has a data processor card that provides physical functional devices. Each physical functional device corresponds to at least two virtual functional devices. There is a one-to-one correspondence between one of the virtual functional devices and the virtual data path acceleration server. At least one virtual machine also runs on the server. The virtual functional device represented by the one-to-one correspondence is used by one of the virtual machines. The method may specifically include the following steps:

[0059] S210, Receive virtual function device management request.

[0060] S220. In response to a virtual function device management request, manage the virtual function devices represented by the one-to-one correspondence.

[0061] In this setup, at least one virtual machine runs on the server, and VF device X can be used by one of these virtual machines. Of course, it's optional whether this virtual machine uses other VF devices besides VF device X; no specific restrictions are imposed here.

[0062] The technical solution of this invention, because the vDPA software is only responsible for managing one VF device, ensures that in the event of a crash and / or upgrade of the vDPA software, only the virtual machines using the VF device are affected, while virtual machines not using the VF device are not affected, thereby reducing the number of virtual machines affected.

[0063] An optional technical solution is that the virtual functional device management request includes a data path pass-through request; managing the virtual functional devices represented by the one-to-one correspondence includes: for the virtual functional devices represented by the one-to-one correspondence, passing through the data path of the virtual functional devices to the virtual machines using the virtual functional devices, so that the virtual machines use the virtual functional devices based on the received data path.

[0064] In this context, a data path pass-through request can be understood as a request instructing the VF device X to perform a data path pass-through. Data path pass-through requests can originate from VF device X, virtual machines, or other software on the server, etc., without specific limitations here.

[0065] In this embodiment of the invention, the data path pass-through request can be generated when creating a virtual machine or adding storage or network devices to a virtual machine. For example, when creating a virtual machine or adding storage or network devices to a virtual machine, the relevant program will create the relevant VF underlying resources of VF device X on the DPU side. The vDPA software can send a request to create the device and initialize the created VF device X. After the VF device X is initialized, the data path pass-through request is generated.

[0066] In this embodiment of the invention, the vDPA software can receive data path pass-through requests.

[0067] A data path can be understood as a path that allows a VF device X to be allocated to a virtual machine for use.

[0068] In this embodiment of the invention, in response to a data path pass-through request, the vDPA software can pass through the data path of VF device X to the virtual machine using VF device X, so that the virtual machine can use VF device X through the data path. In this embodiment of the invention, no specific limitation is made on the method of passing through the data path of VF device X to the virtual machine using VF device X.

[0069] For example, the data path of VF device X can be passed through qemu to the virtual machine using VF device X.

[0070] In this embodiment of the invention, by passing the data path of VF device X to the virtual machine using VF device X, the virtual machine can use VF device X based on the received data path, thereby providing a basis for the virtual machine to use VF device X.

[0071] Figure 6 This is a flowchart of another virtual functional device management method provided in this embodiment of the invention. This embodiment is based on and optimized from the above-mentioned technical solutions. In this embodiment, optionally, the virtual functional device management request includes a device state hot migration request; managing the virtual functional devices represented by the one-to-one correspondence includes: for the virtual functional devices represented by the one-to-one correspondence, when the virtual machine using the virtual functional device is suspended, reading the device state from the virtual functional device; and, if it is determined that the device state migration process of the virtual functional device can be performed based on the device state, transmitting the device state to the target end. The explanations of terms that are the same as or corresponding to those in the above embodiments are not repeated here.

[0072] See Figure 6 The method in this embodiment is applied to a virtual data path acceleration server, which runs on a server. The server has a data processor card, which provides physical functional devices. Each physical functional device corresponds to at least two virtual functional devices. There is a one-to-one correspondence between one of the virtual functional devices and the virtual data path acceleration server. At least one virtual machine also runs on the server. The virtual functional device represented by the one-to-one correspondence is used by one of the virtual machines. Specifically, it may include the following steps:

[0073] S310. Receive a virtual function device management request, wherein the virtual function device management request includes a device state hot migration request.

[0074] In this context, a device state hot migration request can be understood as a request used to instruct the hot migration of the device state of a VF device. Device state hot migration requests can originate from VF device X, virtual machines, or other software on the server, etc., without specific limitations here.

[0075] In this embodiment of the invention, the vDPA software can receive device state hot migration requests.

[0076] The device status can be understood as the status of VF device X, specifically the status of VF device X in processing data, and further specifically the status of the functional parts of VF device X.

[0077] S320. In response to a device state hot migration request, for a virtual functional device represented by a one-to-one correspondence, when the virtual machine using the virtual functional device is suspended, read the device state from the virtual functional device.

[0078] In this embodiment of the invention, the vDPA software can respond to a device state hot migration request and, for VF device X, read the device state from VF device X when the virtual machine using VF device X is paused. This embodiment of the invention does not specifically limit the method of reading the device state from the VF device.

[0079] For example, the device status can be read from the register information of VF device X when the virtual machine using VF device X is paused, that is, when the virtual machine will not notify VF device X to process data temporarily.

[0080] S330. If, based on the device status, it is determined that a device status migration process for a virtual functional device can be performed, the device status is transmitted to the target end.

[0081] The target end can be understood as the end to which the device state needs to be hot-migrated. The target end can be other servers, etc., without being specifically limited here.

[0082] In this embodiment of the invention, since the device status can characterize whether VF device X has finished processing the data that the virtual machine needs to process, and / or whether the function of VF device X supports hot migration, etc., it can be determined whether the device status migration of VF device X can be performed based on the device status. If the device status migration process of VF device X can be performed, the device status is transmitted to the target end. In this embodiment of the invention, no specific limitation is made on the method of determining whether the device status migration process of VF device X can be performed based on the device status.

[0083] For example, if the data that the virtual machine needs to process from VF device X is determined based on the device status, and VF device X has already completed processing, it can be determined that a device state migration process for VF device X can be performed to transmit the device status to the target end.

[0084] Compared to solutions that cannot obtain device status from VF devices and can only obtain device status from PF devices, i.e., require the PF device to complete the hot migration of device status, the technical solution of this invention reads the device status directly from the VF device when the virtual machine is paused, enabling the VF device to independently hot migrate device status, thus completing the hot migration of device status without relying on the PF device.

[0085] An optional technical solution involves representing the device status using a first index, which indicates the last data that a suspended virtual machine notified the virtual functional device to process. If, based on the device status, it is determined that a device status migration process for the virtual functional device can be performed, the device status is transmitted to the target end. This includes: reading a second index from the virtual functional device and comparing the first index with the second index, wherein the second index indicates the last data processed by the virtual functional device; and, based on the comparison result, if it is determined that a device status migration process for the virtual functional device can be performed, transmitting the first index to the target end.

[0086] Specifically, the first index can be understood as representing the sequence number (which data number) of the data that the virtual machine notifies VF device X to process.

[0087] The second index can be understood as representing the sequence number of the data that has been processed so far, which is notified to the virtual machine.

[0088] The comparison result is the result of comparing the first index with the second index. The comparison result can, for example, characterize whether the first index and the second index are the same; the comparison result can further characterize, for example, the degree of similarity between the first index and the second index; and so on. In this embodiment of the invention, the meaning of the comparison result is not specifically limited.

[0089] In this embodiment of the invention, the vDPA software can read a second index from the VF device X and compare the first index with the second index. If, based on the comparison result, it is determined that a device state transition process for the VF device X can be performed, the first index is transmitted to the target end. In this embodiment of the invention, there are no specific limitations on the method of reading the second index from the VF device X and comparing the first index with the second index, or on the method of transmitting the first index to the target end if, based on the comparison result, it is determined that a device state transition process for the VF device X can be performed.

[0090] For example, hot migration support can be pre-added to the DPU card. Specifically, a new function named lm can be added to the PCI capability of the VF device. The register information included in the lm function is shown in Table 1 below. The PCI function is used in the PCI standard to represent the functions that a device has. When the virtual machine using the VF device X is paused, the first index last_avail_idx and the second index last_used_idx of the functional part (vring) of each data path can be read from the lm_ring_state_offset in the register information of the VF device X. The `t_used_idx` is compared. If the comparison results show that the first index `last_avail_idx` and the second index `last_used_idx` for each `vring` are equal, it means that the data that the virtual machine needs to process from VF device X has been processed by VF device X and can be migrated without any data loss. The device state migration process for VF device X is then determined, the first index `last_avail_idx` is recorded, and the first index `last_avail_idx` is hot-migrated to the target device. This allows subsequent processing to continue after the device resumes operation on the target device using the first index `last_avail_idx`. A `vring` can be understood as the functional part of the data path in virtio, used for efficient transmission of I / O requests.

[0091] Table 1 Register Information

[0092]

[0093]

[0094] The technical solution of this invention compares the first index with the second index, and then, based on the comparison result, determines that the device state migration process of VF device X can be performed, and transmits the first index to the target end. This avoids the situation where the first index is transmitted before VF device X has finished processing the data, resulting in data omission.

[0095] Figure 7 This is a flowchart of another virtual function device management method provided in this embodiment of the invention. This embodiment is based on and optimized from the above-described technical solutions. In this embodiment, optionally, the virtual function device management request includes a dirty page hot migration request; managing the virtual function devices represented by the one-to-one correspondence includes: for the virtual function devices represented by the one-to-one correspondence and the virtual machines using the virtual function devices, during the memory migration process of the virtual machines, enabling the recording function of the virtual function devices to record the dirty pages stored in the memory of the virtual machines, so as to transmit the recorded dirty pages to the target end, wherein the dirty pages are data that has been modified during the memory migration process and has not been transmitted to the target end. The explanations of terms that are the same as or corresponding to those in the above embodiments are not repeated here.

[0096] See Figure 7 The method in this embodiment is applied to a virtual data path acceleration server, which runs on a server. The server has a data processor card, which provides physical functional devices. Each physical functional device corresponds to at least two virtual functional devices. There is a one-to-one correspondence between one of the virtual functional devices and the virtual data path acceleration server. At least one virtual machine runs on the server, and the virtual functional device represented by the one-to-one correspondence is used by one of the virtual machines. The method may specifically include the following steps:

[0097] S410. Receive a virtual function device management request, wherein the virtual function device management request includes a dirty page hot migration request.

[0098] The dirty page hot migration request can be understood as a request to instruct the hot migration of dirty pages. This request can come from VF device X, virtual machine, or other software on the server, etc., without being specifically limited here.

[0099] In this embodiment of the invention, the vDPA software can receive dirty page hot migration requests.

[0100] S420. In response to a virtual function device management request, for the virtual function device represented by the one-to-one correspondence and the virtual machine using the virtual function device, during the memory migration process of the virtual machine, the recording function of the virtual function device is enabled so that the virtual function device records the dirty pages stored in the memory of the virtual machine, and the recorded dirty pages are transferred to the target end. The dirty pages are data that has been modified during the memory migration process and has not been transferred to the target end.

[0101] The memory migration process can be understood as the process of migrating the virtual machine's memory during the virtual machine's hot migration.

[0102] The logging function records dirty pages stored in the virtual machine's memory.

[0103] Understandably, since hot migration allows virtual machines to be migrated without interrupting their operation, during the virtual machine memory migration process, dirty pages that have been modified but not transferred to the target end may be generated because the virtual machine is still running. In this case, hot migration functionality can be added to VF device X in advance. By adding hot migration functionality, the recording function of VF device X can be enabled, thereby enabling VF device X to record the dirty pages stored in the virtual machine's memory and transfer the recorded dirty pages to the target end, thus realizing hot migration of dirty pages.

[0104] In this embodiment of the invention, the vDPA software can respond to a virtual function device management request and, for the VF device X and the virtual machine using the VF device X, enable the recording function of the VF device X during the virtual machine memory migration process, so that the VF device X records the dirty pages stored in the virtual machine's memory and transmits the recorded dirty pages to the target end.

[0105] Compared to solutions that cannot obtain dirty pages from the VF device and can only obtain them from the PF device, meaning that dirty page hot migration must be completed with the help of the PF device, the technical solution of this embodiment of the invention enables the VF device X to record the dirty pages stored in the virtual machine's memory by enabling the VF device X itself, and then transmits the recorded dirty pages to the target end. This allows the VF device to independently hot migrate dirty pages during hot migration, without relying on the PF device to complete the hot migration work.

[0106] An optional technical solution includes deploying virtual machine simulation software on a server and pre-allocating target memory for the virtual machine simulation software; managing the virtual functional devices represented by the one-to-one correspondence, further including: obtaining the memory address of the target memory and writing the memory address into the virtual functional device; enabling the virtual functional device to record dirty pages stored in the virtual machine's memory, so as to transfer the recorded dirty pages to the target end, including: enabling the virtual functional device to record the dirty pages stored in the virtual machine's memory into the target memory pointed to by the memory address, so as to transfer the dirty pages recorded in the target memory to the target end through the virtual machine simulation software.

[0107] Among them, QEMU is deployed on the server, and the server can pre-allocate target memory for QEMU. This target memory can be understood as memory used to record dirty pages.

[0108] A memory address can be understood as the address of the target memory.

[0109] In this embodiment of the invention, the vDPA software can obtain the memory address of the target memory and write the memory address to the VF device X. In this embodiment of the invention, the method of obtaining the memory address and writing the memory address to the VF device X is not specifically limited.

[0110] In this embodiment of the invention, VF device X can record dirty pages stored in the virtual machine's memory to the target memory pointed to by the memory address, so as to transfer the dirty pages recorded in the target memory to the target end via QEMU. In this embodiment of the invention, no specific limitation is made on the method by which VF device X records dirty pages stored in the virtual machine's memory to the target memory pointed to by the memory address, so as to transfer the dirty pages recorded in the target memory to the target end via QEMU.

[0111] Based on the above example of hot migration of device state, for instance, a QEMU is deployed on the server. A target memory for recording dirty pages can be pre-allocated to QEMU, where each bit represents 4KB of virtual machine memory space. The memory address of the shared target memory is obtained, and the log_base register information of the VF device X is initialized. The 64-bit user-mode start address of the memory address is written to the lm_base_addr register information of the VF device X, and the last 64-bit address is written to the lm_end_addr register information of the VF device X. During the virtual machine memory migration process, the lm_logging_ctrl register information of the VF device X is set to 1 to enable the recording function of the VF device X, i.e., to start the dirty page log. This allows the VF device X to record dirty pages stored in the virtual machine's memory to the target memory pointed to by the memory address in log_base, so that the dirty pages recorded in the target memory can be transferred to the target end via QEMU.

[0112] The technical solution of this invention enables the VF device to record dirty pages into the target memory during dirty page hot migration, thereby further enabling the VF device to independently hot migrate dirty pages and transfer dirty pages to the target end to complete the hot migration without relying on the PF device.

[0113] Figure 8 This is a structural block diagram of a virtual function device management device provided in an embodiment of the present invention. The device is configured on a virtual data path acceleration server, which runs on a server. The server has a data processor card inserted into it, and the data processor card provides physical function devices. Each physical function device corresponds to at least two virtual function devices. There is a one-to-one correspondence between one virtual function device and the virtual data path acceleration server. This device is used to execute the virtual function device management method provided in any of the above embodiments. This device and the virtual function device management methods of the above embodiments belong to the same inventive concept. Details not described in detail in the embodiments of the virtual function device management device can be found in the embodiments of the virtual function device management method described above. See also... Figure 8 Specifically, the device may include a request receiving module 510 and a device management module 520.

[0114] The request receiving module 510 is used to receive virtual function device management requests;

[0115] The device management module 520 is used to manage the virtual functional devices represented by the one-to-one correspondence in response to virtual functional device management requests.

[0116] Optionally, at least one virtual machine runs on the server, and the virtual functional device represented by the one-to-one correspondence is used by one of the virtual machines.

[0117] Optionally, based on the above-mentioned device, the virtual function device management request includes a device state hot migration request;

[0118] Device management module 520 includes:

[0119] The device status reading submodule is used to read the device status from the virtual functional device when the virtual machine using the virtual functional device is suspended, based on the one-to-one correspondence.

[0120] The device status transmission submodule is used to transmit the device status to the target end when the device status migration process for virtual functional devices is determined based on the device status.

[0121] Optionally, based on the above-mentioned device, the device status is represented by a first index, which is used to indicate the last data that the virtual function device notified of the suspended virtual machine to be processed.

[0122] The device status transmission submodule includes:

[0123] An index comparison unit is used to read a second index from a virtual function device and compare a first index with the second index, wherein the second index is used to indicate the last data processed by the virtual function device;

[0124] The first index transmission unit is used to transmit the first index to the target end when, based on the obtained comparison result, it is determined that a device state migration process for a virtual functional device can be performed.

[0125] Optionally, based on the above-mentioned device, the virtual function device management request includes a dirty page hot migration request;

[0126] Device management module 520 includes:

[0127] The dirty page transfer submodule is used to enable the recording function of the virtual function device during the memory migration process of the virtual machine, which is represented by the one-to-one correspondence and the virtual machine using the virtual function device. This allows the virtual function device to record the dirty pages stored in the memory of the virtual machine and transfer the recorded dirty pages to the target end. The dirty pages are data that has been modified during the memory migration process and has not been transferred to the target end.

[0128] Optionally, based on the above-mentioned device, virtual machine simulation software is deployed on the server, and target memory is pre-allocated for the virtual machine simulation software;

[0129] The device management module 520 also includes:

[0130] The memory address writing submodule is used to obtain the memory address of the target memory and write the memory address to the virtual function device;

[0131] The dirty page transport submodule includes:

[0132] The dirty page transfer unit is used to enable the virtual functional device to record dirty pages stored in the virtual machine's memory into the target memory pointed to by the memory address, so that the dirty pages recorded in the target memory can be transferred to the target end by the virtual machine emulation software.

[0133] Optionally, based on the above-mentioned device, the virtual function device management request includes a data path pass-through request;

[0134] Device management module 520 includes:

[0135] The data path pass-through submodule is used to pass through the data path of the virtual functional device represented by the one-to-one correspondence to the virtual machine using the virtual functional device, so that the virtual machine can use the virtual functional device based on the received data path.

[0136] Optionally, the device may also include:

[0137] The device address acquisition module is used to obtain the device address of the virtual functional device to be created in response to a virtual functional device creation request for a virtual functional device represented by a one-to-one correspondence relationship.

[0138] The virtual functional device initialization module is used to initialize the virtual functional device represented by the device address by utilizing the data plane development kit, wherein the target driver is added within the data plane development kit;

[0139] The virtual functional device creation module is used to initialize the device functions of the virtual functional device obtained from initialization by utilizing the target driver, so as to create the virtual functional device.

[0140] The Virtual Function Device (VF) management device provided in this embodiment of the invention is applied to vDPA software, which runs on a server. The server has a DPU card inserted, and the DPU card provides PF devices. Each PF device corresponds to at least two VF devices. There is a one-to-one correspondence between one VF device and the vDPA software; that is, the vDPA software is only responsible for managing the one VF device corresponding to it. Based on this, the vDPA software manages the VF device in response to received virtual function device management requests. Compared to managing multiple VF devices through vDPA software, the above device, by enabling the vDPA software to manage only one VF device, ensures that in the event of a vDPA software crash or / or upgrade, only the VF device it manages is affected, while unmanaged VF devices remain unaffected, thus solving the problem of multiple VF devices being affected.

[0141] The virtual functional device management device provided in the embodiments of the present invention can execute the virtual functional device management method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.

[0142] It is worth noting that in the embodiments of the virtual function device management device described above, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.

[0143] Figure 9 A schematic diagram of a server 10, which can be used to implement an embodiment of the present invention, is shown. The server has a data processor card that provides physical functional devices. Each physical functional device corresponds to at least two virtual functional devices. There is a one-to-one correspondence between one of the virtual functional devices and a virtual data path acceleration server. The server is intended to represent various forms of digital computers, such as laptops, desktop computers, workstations, personal digital assistants, blade servers, mainframes, and other suitable computers. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0144] like Figure 9As shown, server 10 includes at least one processor 11 and memory, such as read-only memory (ROM) 12 and random access memory (RAM) 13, communicatively connected to at least one processor 11. The memory stores a computer program executable by at least one processor, which is the vDPA program mentioned above. Processor 11 can perform various appropriate actions and processes based on the computer program stored in ROM 12 or loaded from storage unit 18 into RAM 13. RAM 13 can also store various programs and data required for the operation of server 10. Processor 11, ROM 12, and RAM 13 are interconnected via bus 14. Input / output (I / O) interface 15 is also connected to bus 14.

[0145] Multiple components in server 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of monitors, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows server 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0146] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as virtual function device management methods.

[0147] In some embodiments, the virtual functional device management method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on server 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the virtual functional device management method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the virtual functional device management method by any other suitable means (e.g., by means of firmware).

[0148] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0149] Computer programs used to implement the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a server.

[0150] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0151] To provide interaction with the user, the systems and techniques described herein can be implemented on a server having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the server. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0152] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0153] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0154] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0155] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for managing virtual functional devices, characterized in that, The method is applied to a virtual data path acceleration server, which runs on a server. The server has a data processor card inserted into it. The data processor card provides physical functional devices, each physical functional device corresponding to at least two virtual functional devices. There is a one-to-one correspondence between each of the virtual functional devices and the virtual data path acceleration server. Receive virtual function device management requests; In response to the virtual functional device management request, the virtual functional devices represented by the one-to-one correspondence are managed.

2. The method according to claim 1, characterized in that, At least one virtual machine runs on the server, and the virtual functional device represented by the one-to-one correspondence is used by one of the virtual machines.

3. The method according to claim 2, characterized in that, The virtual function device management request includes a device status hot migration request; The management of the virtual functional devices represented by the one-to-one correspondence includes: For the virtual functional device represented by the one-to-one correspondence, when the virtual machine using the virtual functional device is suspended, the device status is read from the virtual functional device; If, based on the device status, it is determined that the device status migration process for the virtual functional device can be performed, the device status is transmitted to the target end.

4. The method according to claim 3, characterized in that, The device status is represented by a first index, which is used to indicate the last data that the virtual function device notified of the paused virtual machine needs to process. The step of transmitting the device state to the target end when it is determined, based on the device state, that the device state migration process for the virtual functional device can be performed includes: A second index is read from the virtual function device, and the first index is compared with the second index, wherein the second index is used to indicate the last data processed by the virtual function device; If, based on the obtained comparison results, it is determined that the device state migration process of the virtual functional device can be performed, the first index is transmitted to the target end.

5. The method according to claim 2, characterized in that, The virtual functional device management request includes a dirty page hot migration request; The management of the virtual functional devices represented by the one-to-one correspondence includes: For the virtual functional device represented by the one-to-one correspondence and the virtual machine using the virtual functional device, during the memory migration process of the virtual machine, the recording function of the virtual functional device is enabled so that the virtual functional device records the dirty pages stored in the memory of the virtual machine, and the recorded dirty pages are transmitted to the target end. The dirty pages are data that has been modified during the memory migration process and has not been transmitted to the target end.

6. The method according to claim 5, characterized in that, The server is equipped with virtual machine simulation software, and target memory is pre-allocated to the virtual machine simulation software. The management of the virtual functional devices represented by the one-to-one correspondence also includes: Obtain the memory address of the target memory and write the memory address into the virtual function device; The step of having the virtual functional device record dirty pages stored in the memory of the virtual machine, and then transmitting the recorded dirty pages to the target end, includes: This allows the virtual functional device to record dirty pages stored in the virtual machine's memory into the target memory pointed to by the memory address, so that the dirty pages recorded in the target memory can be transferred to the target end by the virtual machine simulation software.

7. The method according to claim 2, characterized in that, The virtual function device management request includes a data path pass-through request; The management of the virtual functional devices represented by the one-to-one correspondence includes: For the virtual functional device represented by the one-to-one correspondence, the data path of the virtual functional device is transparently transmitted to the virtual machine using the virtual functional device, so that the virtual machine uses the virtual functional device based on the received data path.

8. The method according to claim 1, characterized in that, Also includes: In response to a virtual function device creation request for the virtual function device represented by the one-to-one correspondence, the device address of the virtual function device to be created is obtained; The virtual functional device represented by the device address is initialized by using the data plane development kit, wherein the target driver is added within the data plane development kit; For the virtual functional device obtained through initialization, the device functions of the virtual functional device are initialized using the target driver to create the virtual functional device.

9. A virtual functional device management device, characterized in that, The device is configured in a virtual data path acceleration server, which runs on a server. The server has a data processor card inserted into it. The data processor card provides physical functional devices, each physical functional device corresponding to at least two virtual functional devices. There is a one-to-one correspondence between each of the virtual functional devices and the virtual data path acceleration server. The device includes: The request receiving module is used to receive virtual function device management requests; The device management module is used to manage the virtual functional devices represented by the one-to-one correspondence in response to the virtual functional device management request.

10. A server, characterized in that, A data processor card is inserted into the server. The data processor card provides physical functional devices, each physical functional device corresponding to at least two virtual functional devices. There is a one-to-one correspondence between one of the virtual functional devices and a virtual data path acceleration program. The server includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores the virtual data path acceleration program, which can be executed by the at least one processor, to cause the at least one processor to perform the virtual functional device management method as described in any one of claims 1-8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the virtual function device management method as described in any one of claims 1-8.

12. A computer program product comprising a computer program that, when executed by a processor, implements the virtual functional device management method according to any one of claims 1-8.