A data access method and device for an NVMe-oF user state client
Through the data access method of NVMe-oF user mode client, the high overhead problem of Guest I/O submission in the virtualized environment is solved, and pure user mode data access is realized, which reduces latency and overhead, and supports multiplexing and high availability functions.
Patent Information
- Application Number
- CN202111627192.5
- 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
In a virtualized environment, Guest I/O submission needs to be processed through the kernel, resulting in high overhead such as data copying and context switching, which affects storage performance.
It provides a data access method and device for NVMe-oF user state client. By receiving data access request messages sent by virtual host vhost devices, analyzing request messages, selecting a ring queue based on server identification, and writing access operation instructions to the control instruction area of NVMe-oF server, realizing pure user state data access.
This approach reduces CPU context switching and data copying overhead, provides lower latency and overhead, supports multiplexing and high availability capabilities, and is compatible with standard storage devices and remote access storage nodes.
Smart Images

Figure CN114417373B_ABST
Abstract
Description
Technical Field
[0001] This application relates to, but is not limited to, the field of computer technology, and in particular, to a data access method and apparatus for an NVMe-oF user-mode client. Background Art
[0002] Virtio is a currently widely accepted abstract device interface for input / output (I / O) virtualization. By defining virtual queues (virtqueue) and virtual ring queues (vring), it realizes the support for different Peripheral Component Interconnect (PCI) devices. Offloading virtio to the host is called virtual host (vhost), which can be implemented in the kernel mode. The implementation in the kernel mode is mainly realized in the Linux kernel.
[0003] The vhostuser solution of the Storage Performance Development Kit (SPDK) is the latest evolution solution. Through the polling mode driver in the user mode, a full user-mode, end-to-end I / O stack can be realized. In virtualization, the virtual machine exit (VM_EXIT) is a relatively large overhead. The vhost user solution can eliminate the VM_EXIT overhead when the guest I / O is submitted, and reduce the central processing unit (CPU) context switching through the I / O polling in the user mode. However, in the implementation of the backend storage, when the guest I / O is submitted, it needs to pass through the kernel, resulting in overheads such as data copying and context switching, thus having a large overhead. Summary of the Invention
[0004] Embodiments of this application are expected to provide a data access method and apparatus for an NVMe-oF user-mode client.
[0005] The technical solution of this application is implemented as follows:
[0006] In a first aspect, a data access method for an NVMe-oF user-mode client provided by an embodiment of this application includes:
[0007] Receiving a data access request message sent by a virtual host vhost device;
[0008] Parsing the data access request message to obtain a first server identifier and an access operation instruction;
[0009] Select a first circular queue based on the first server identifier, and write the access operation instruction into the control instruction area of the first NVMe-oF server through the first circular queue; wherein, the first circular queue is a queue between the vhost device and the first NVMe-oF server.
[0010] In a second aspect, a data access device for an NVMe-oF user space client provided by an embodiment of the present application includes:
[0011] A receiving module, configured to receive a data access request message sent by a virtual host vhost device;
[0012] A processing module, configured to parse the data access request message to obtain a first server identifier and an access operation instruction;
[0013] The processing module is further configured to select a first circular queue based on the first server identifier;
[0014] The processing module is configured to write the access operation instruction into the control instruction area of the first NVMe-oF server through the first circular queue; wherein, the first circular queue is a queue between the vhost device and the first NVMe-oF server.
[0015] In a third aspect, a data access device provided by an embodiment of the present application includes: a processor, a memory, and a communication bus;
[0016] The communication bus is used to implement a communication connection between the processor and the memory.
[0017] The processor is configured to execute a data access program for an NVMe-oF user space client stored in the memory to implement the steps of the first aspect.
[0018] In a fourth aspect, a computer-readable storage medium storing executable instructions is provided by an embodiment of the present application. The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the data access method for an NVMe-oF user space client as described above.
[0019] The embodiments of the present application provide a data access method and device for an NVMe-oF user-mode client. The data access method includes: receiving a data access request message sent by a virtual host vhost device; parsing the data access request message to obtain a first server identifier and an access operation instruction; selecting a first circular queue based on the first server identifier, and writing the access operation instruction into the control instruction area of the first NVMe-oF server through the first circular queue; wherein, the first circular queue is a queue between the vhost device and the first NVMe-oF server; that is to say, the data access method provided by the present application not only is compatible with standard storage devices, i.e., remote access storage nodes such as NVMe-oF servers, but also can provide multiplexing high-availability functions. On this premise, the pure user-mode NVMe-oF client and the circular queue docking technology are applied, and the pure user-mode and CPU offloading methods are used to provide vhost backend devices, providing lower overhead and latency. Description of the Drawings
[0020] Figure 1 FIG. is an optional flowchart of the data access method for the NVMe-oF user-mode client provided by the embodiment of the present application;
[0021] Figure 2 FIG. is a schematic diagram of the architecture comparison between the related art and the data access of the present application;
[0022] Figure 3 FIG. is an optional flowchart of the data access method for the NVMe-oF user-mode client provided by the embodiment of the present application;
[0023] Figure 4 FIG. is a schematic diagram of the architecture of the data access device provided by the embodiment of the present application;
[0024] Figure 5 FIG. is a schematic structural diagram of the data access device for the NVMe-oF user-mode client provided by the embodiment of the present application;
[0025] Figure 6 FIG. is a schematic structural diagram of the data access device provided by the embodiment of the present application. Detailed Embodiments
[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0027] In the description, claims, and above-mentioned drawings of this application, terms such as "first" and "second" are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprise" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, method, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products, or devices.
[0028] Reference to "embodiment" herein means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of this application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0029] An embodiment of this application provides a data access method for an NVMe-oF user-space client. The data access method for the NVMe-oF user-space client is applied to a data access device. Referring to Figure 1 as shown, the method includes the following steps:
[0030] Step 101, receive a data access request message sent by a virtual host vhost device.
[0031] The data access device provided by the embodiment of this application can be implemented as any terminal with a screen display function such as a laptop, a tablet computer, a desktop computer, a mobile device (such as a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable game device), a smart robot, etc., or can also be implemented as a server.
[0032] The Non-Volatile Memory Express (NVMe) is a high-performance and highly scalable storage protocol used to connect a host and a memory subsystem. With the continuous promotion of the NVMe over Fabric (NVMe-oF) protocol on the architecture of the Non-Volatile Memory Host Controller Interface Specification in the storage industry, the large overhead in the data access process has attracted more and more attention. Currently, in the NVMe-oF storage system, the access permission of the host to each namespace is controlled by the mapping between the host NVMe Qualified Name (nqn) and the NVM subsystem nqn.
[0033] In some embodiments of the present application, the management and control virtual machine deployed on the host side communicates with the user virtual machine through the front-end and back-end driver vhost method, which can be implemented in the following way: deploy the front-end driver on the user virtual machine side and the back-end driver on the management and control virtual machine side. Specifically, in implementation, the front-end driver can be implemented by a guest machine such as a user virtual machine, and the back-end driver can be implemented by a virtual operating system simulator (Quick EMUlator, QEMU), QEMU, kernel vhost, or vhost user in user space.
[0034] In an embodiment of the present application, the NVMe-oF user-space client communicates with an external device through the NVMe-oF protocol, obtains a data access request message sent by the vhost device of the virtual host; parses the data access request message to obtain a first server identifier and an access operation instruction, selects a first circular queue based on the first server identifier, and writes the access operation instruction into the control instruction area of the first NVMe-oF server through the first circular queue.
[0035] The NVMe interface is an interface in the NVMe-oF user-space client for plugging in an NVMe hard disk, and it is connected to the NVMe-oF server through a Peripheral Component Interconnect express (PCIe) bus.
[0036] The NVMe hard disk of the NVMe-oF server refers to a storage medium that conforms to the NVMe standard. Optionally, the NVMe hard disk includes an NVMe solid state disk (SSD).
[0037] Step 102: Parse the data access request message to obtain a first server identifier and an access operation instruction.
[0038] In an embodiment of the present application, the data access request message carries a namespace such as a first server identifier. The namespace is used to identify the target storage medium of the access operation instruction. The access operation instruction is an instruction of the NVMe protocol.
[0039] In some embodiments, when an external device needs to store data in the storage medium of the NVMe-oF server connected to the NVMe-oF user-space client, or when the external device accesses the storage medium of the NVMe-oF server connected to the NVMe-oF user-space client to read data, a data access request message is generated, and the namespace corresponding to the target storage medium such as the server identifier is added to the data access request message, and the data access request message can be sent to the NVMe-oF user-space client through the NVMeoF protocol in a high-speed optical fiber network.
[0040] Step 103: Select a first circular queue based on the first server identifier, and write the access operation instruction into the control instruction area of the first NVMe-oF server through the first circular queue.
[0041] Wherein, the first circular queue is a queue between the vhost device and the first NVMe-oF server.
[0042] An embodiment of the present application provides a data access method for an NVMe-oF user-mode client. The data access method includes: receiving a data access request message sent by a virtual host vhost device; parsing the data access request message to obtain a first server identifier and an access operation instruction; selecting a first circular queue based on the first server identifier, and writing the access operation instruction into the control instruction area of the first NVMe-oF server through the first circular queue; wherein, the first circular queue is a queue between the vhost device and the first NVMe-oF server; that is to say, the data access method provided by the present application not only is compatible with standard storage devices, i.e., remote access storage nodes such as NVMe-oF servers, but also can provide a vhost backend device in a pure user-mode, CPU offloading manner with lower overhead and latency on the premise of being able to provide a multiplexing high-availability function by applying the docking technology of a pure user-mode NVMe-oF client and a circular queue.
[0043] In an implementable scenario, combined with Figure 2 as shown in the schematic diagram of the architecture comparison of data access between the related art and the present application, the user-mode data access device for implementing the above data access method provided by the present application is not only compatible with standard storage devices, i.e., remote access storage nodes such as NVMe-oF servers such as Figure 2 the NVMe-oF1 server and the NVMe-oF2 server in, but also can provide a vhost backend device in a pure user-mode, CPU offloading manner with lower overhead and latency on the premise of being able to provide a multiplexing high-availability function by applying the docking technology of a pure user-mode NVMe-oF client and a circular queue.
[0044] An embodiment of the present application provides a data access method for an NVMe-oF user-mode client. The data access method for the NVMe-oF user-mode client is applied to a data access device. Referring to Figure 3 as shown, the method includes the following steps:
[0045] Step 301: Receive a data access request message sent by a virtual host vhost device.
[0046] Step 302: Parse the data access request message to obtain a first server identifier and an access operation instruction.
[0047] Step 303: Obtain the first queue connection information, and based on the first queue connection information, connect the data stream circular queue of the vhost device to the circular queue of the first NVMe-oF server to establish the first circular queue.
[0048] Step 304: Select the first circular queue based on the first server identifier, and write the access operation instruction into the control instruction area of the first NVMe-oF server through the first circular queue.
[0049] Wherein, the first circular queue is the queue between the vhost device and the first NVMe-oF server.
[0050] In other embodiments of the present application, after selecting the first circular queue based on the first server identifier in step 304, the following steps may also be executed:
[0051] First, in the scenario where the first NVMe-oF server is inaccessible, switch to the second NVMe-oF server connected by the user-mode client of NVMe-oF.
[0052] Second, write the access operation instruction into the control instruction area of the second NVMe-oF server through the second circular queue.
[0053] Wherein, the second circular queue is the queue between the vhost device and the second NVMe-oF server.
[0054] That is to say, in the embodiments of the present application, in the scenario where the first NVMe-oF server is inaccessible, it can be quickly switched to the second NVMe-oF server connected by the user-mode client of NVMe-oF, realizing fast virtual machine live migration while being compatible with standard storage devices. In this way, in the edge computing scenario, with two storages providing the standard NVMe-oF protocol, the live migration and high availability of virtual machines can be achieved. In addition, the above live migration solution has higher scalability, faster migration speed, and does not require the mechanisms (such as master selection, arbitration, etc.) of the storage node itself.
[0055] Here, before writing the access operation instruction into the control instruction area of the second NVMe-oF server through the second circular queue, the second queue connection information may also be obtained, and based on the second queue connection information, the data stream circular queue of the vhost device is connected to the circular queue of the second NVMe-oF server to establish the second circular queue.
[0056] In other embodiments of the present application, the scenario where the first NVMe-oF server is inaccessible includes at least one of the following:
[0057] The network connection between the user-mode client of NVMe-oF and the first NVMe-oF server is disconnected;
[0058] The first NVMe-oF server crashes;
[0059] The input / output communication between the user-mode client of NVMe-oF and the first NVMe-oF server times out;
[0060] An instruction to switch from the first NVMe-oF server to the second NVMe-oF server is received.
[0061] In other embodiments of the present application, in the above scenario, receiving an instruction to switch from the first NVMe-oF server to the second NVMe-oF server includes: receiving an instruction sent by the upper management system of the NVMe-oF user-mode client; or, receiving an instruction input by the user in the NVMe-oF user-mode client.
[0062] In other embodiments of the present application, the data access device can also manage the server identifiers and queue connection information of multiple NVMe-oF servers to generate a management list; wherein, the management list includes the first server identifier and the first queue connection information corresponding to the first NVMe-oF server, and the second server identifier and the second queue connection information corresponding to the second NVMe-oF server.
[0063] In other embodiments of the present application, in the scenario where the first NVMe-oF server is inaccessible, switching to the second NVMe-oF server connected by the NVMe-oF user-mode client includes:
[0064] In the scenario where the first NVMe-oF server is inaccessible, select the second server identifier from the management list;
[0065] Based on the second server identifier, switch the connection object of the NVMe-oF user-mode client from the first NVMe-oF server to the second NVMe-oF server.
[0066] As can be seen from the above, the data access device of the present application connects to a remote NVMe-oF server (NVMe-oF Target) through an NVMe-oF user-mode client and creates a local vhost user backend device. The backend devices used include vhost-blk devices, vhost-scsi devices, and vhost-NVMe devices. To achieve remote access to vhost devices, when a storage node, such as the first NVMe-oF server, cannot be accessed, it can be switched to another storage node, such as the second NVMe-oF server. Among them, the vhost-blk device means that the vhost device uses the block protocol, the vhost-scsi device means that the vhost device uses the Small Computer System Interface (SCSI) protocol, and the vhost-NVMe device means that the vhost device uses the NVMe protocol.
[0067] In other embodiments of the present application, after step 101 receives a data access request message sent by a virtual host vhost device, the following steps may also be performed: If the received data access request message is a message using the vhost-block protocol or a message using the vhost-scsi protocol, convert the data access request message into a message using the NVMe protocol.
[0068] In other embodiments of the present application, the data access device may also manage the use of host resources by the vhost device; among them, the host resources include at least one of the following: storage resources, computing resources, and network resources.
[0069] In some embodiments, the host refers to the host of a computing node. Multiple vhosts can run on the host, and the vhost can flexibly use the host resources. The host resources can include computing resources, storage resources, network resources, etc.
[0070] Combined Figure 2 and Figure 4 To further illustrate the architecture of the data access device in the data access architecture of the present application, see Figure 4 As shown, on the host side, it includes: virtual machine monitors such as KVM, QEMU, etc. The virtual machine monitor is used to manage the virtualization simulation of the virtual machine and the user virtual machine, such as device simulation, CPU simulation, memory simulation, etc.
[0071] The management and control virtual machine deployed on the host side can communicate with the user virtual machine through the vhost method of front-end and back-end drivers; the management and control virtual machine deployed on the host side can use customized hardware resources to communicate with the above virtual machine monitors such as KVM and QEMU through the direct vifo method. Vhost is a back-end implementation solution of virtio. Virtio is a semi-virtualization implementation solution that requires both the virtual machine side and the host side to provide drivers to complete communication. Usually, the driver on the virtio host side is implemented in QEMU in the user space, while vhost is implemented in the kernel and is a kernel module vhost_net.ko. Specifically, when implemented, the management and control virtual machine deployed on the host side can also communicate with the user virtual machine through the virtio method.
[0072] Furthermore, the steps of the data access method implemented by the data access device are corresponded to each functional module and described as follows: The NVMe-oF user-mode client connects to the remote NVMe-oF target as needed and abstracts it into a block device in this module, providing block device-related interfaces. The protocol conversion module is in the following situations: converting between the vhost-block protocol and the NVMe protocol; converting between the vhost-scsi protocol and the NVMe protocol, and connecting vhost-NVMe and the NVMe protocol. The Vhost master control module creates a vhost virtual device by the user, and this device is provided to the QEMU virtual machine. The connection module is used to receive the control instructions of the vhost module, connect the circular queue of the vhost data stream with the circular queue of the NVMe-oF transport, so as to achieve zero-copy of data. When receiving a vhost read / write request, write the corresponding control instructions into the control instruction area of the NVMe-oF transport. The control instructions include read / write, etc., and the virtual address of the data buffer. The NVMe-oF target management module is used to manage multiple NVMe-oF target nqns and connection information input by the user, and persist them locally or on the network. When the failover module performs a switch, select another NVMe-oF target from the management list, establish a connection, and re-dock the circular queue. The failover module switches to another NVMe-oF target when the current NVMe-oF target is inaccessible, and completes the connection operation with the new NVMe-oF target. Inaccessibility includes detecting a disconnection of the network connection with the NVMe-oF target, server downtime, or I / O communication timeout, and also includes manual switching by the user or through the upper-layer management system, such as during live migration.
[0073] It should be noted that the descriptions of the same steps and the same content in this embodiment and other embodiments can be referred to the descriptions in other embodiments, and will not be repeated here.
[0074] An embodiment of the present application provides a data access device for an NVMe-oF user-mode client. This data access device for an NVMe-oF user-mode client can be applied to Figure 1 a data access method for an NVMe-oF user-mode client provided in the corresponding embodiment. Refer to Figure 5 As shown, the data access device 5 for an NVMe-oF user-mode client includes:
[0075] A receiving module 501, configured to receive a data access request message sent by a virtual host vhost device;
[0076] A processing module 502, configured to parse the data access request message to obtain a first server identifier and an access operation instruction; select a first circular queue based on the first server identifier; and write the access operation instruction into the control instruction area of the first NVMe-oF server through the first circular queue; wherein, the first circular queue is a queue between the vhost device and the first NVMe-oF server.
[0077] In other embodiments of the present application, the processing module 502 is configured to obtain first queue connection information, and connect the data stream circular queue of the vhost device with the circular queue of the first NVMe-oF server based on the first queue connection information to establish a first circular queue.
[0078] In other embodiments of the present application, the processing module 502 is configured to switch to a second NVMe-oF server connected to the user-mode client of NVMe-oF in a scenario where the first NVMe-oF server is inaccessible; and write the access operation instruction into the control instruction area of the second NVMe-oF server through a second circular queue; wherein, the second circular queue is a queue between the vhost device and the second NVMe-oF server.
[0079] In other embodiments of the present application, the scenario where the first NVMe-oF server is inaccessible includes at least one of the following: the network connection between the user-mode client of NVMe-oF and the first NVMe-oF server is disconnected; the first NVMe-oF server crashes; the input / output communication between the user-mode client of NVMe-oF and the first NVMe-oF server times out; an instruction to switch from the first NVMe-oF server to the second NVMe-oF server is received.
[0080] In other embodiments of the present application, the receiving module 501 is configured to receive an instruction sent by an upper-layer management system of the NVMe-oF user-mode client; or receive an instruction input by a user in the NVMe-oF user-mode client.
[0081] In other embodiments of the present application, the processing module 502 is configured to manage the server identifiers and queue connection information of multiple NVMe-oF servers, and generate a management list; wherein the management list includes a first server identifier and first queue connection information corresponding to a first NVMe-oF server, and a second server identifier and second queue connection information corresponding to a second NVMe-oF server.
[0082] In other embodiments of the present application, the processing module 502 is configured to select a second server identifier from the management list in a scenario where the first NVMe-oF server is inaccessible; based on the second server identifier, switch the connection object of the NVMe-oF user-mode client from the first NVMe-oF server to the second NVMe-oF server.
[0083] In other embodiments of the present application, the processing module 502 is configured to convert a data access request message into a message using the NVMe protocol if the received data access request message is a message using the vhost-block protocol or a message using the vhost-small computer system interface (SCSI) protocol.
[0084] In other embodiments of the present application, the processing module 502 is configured to manage the use of host resources by a vhost device; wherein the host resources include at least one of the following: storage resources, computing resources, and network resources.
[0085] An embodiment of the present application provides a data access device for an NVMe-oF user-mode client, which receives a data access request message sent by a virtual host (vhost) device; parses the data access request message to obtain a first server identifier and an access operation instruction; selects a first circular queue based on the first server identifier, and writes the access operation instruction into the control instruction area of a first NVMe-oF server through the first circular queue; wherein the first circular queue is a queue between the vhost device and the first NVMe-oF server; that is to say, the data access method provided by the present application not only is compatible with standard storage devices, i.e., remote access storage nodes such as NVMe-oF servers, but also can provide a multiplexing high-availability function. On this premise, it applies a pure user-mode NVMe-oF client and circular queue docking technology, adopts a pure user-mode and CPU offloading method to provide a vhost backend device, and provides lower overhead and latency.
[0086] It should be noted that for the specific implementation process of the steps executed by the processor in this embodiment, reference can be made to Figure 1 the implementation process in the NVMe-oF user-mode client data access method provided in the corresponding embodiment, which will not be elaborated here.
[0087] An embodiment of the present application provides a data access device, which can be applied to Figure 1 the data access method of an NVMe-oF user-mode client provided in the corresponding embodiment. Referring to Figure 6 as shown, this data access device 6( Figure 6 the data access device 6 in is corresponding to Figure 5 the data access device 5 of the NVMe-oF user-mode client in) includes: a processor 601, a memory 602, and a communication bus 603, where:
[0088] The communication bus 603 is used to implement the communication connection between the processor 601 and the memory 602.
[0089] The processor 601 is used to execute the NVMe-oF user-mode client data access program stored in the memory 602 to implement the following steps:
[0090] Receive a data access request message sent by the virtual host vhost device;
[0091] Parse the data access request message to obtain a first server identifier and an access operation instruction;
[0092] Based on the first server identifier, select a first circular queue, and write the access operation instruction into the control instruction area of the first NVMe-oF server through the first circular queue; where the first circular queue is a queue between the vhost device and the first NVMe-oF server.
[0093] In other embodiments of the present application, the processor 601 is used to execute the NVMe-oF user-mode client data access program stored in the memory 602 to implement the following steps:
[0094] Obtain the first queue connection information, and based on the first queue connection information, connect the data stream circular queue of the vhost device with the circular queue of the first NVMe-oF server to establish a first circular queue.
[0095] In other embodiments of the present application, the processor 601 is used to execute the NVMe-oF user-mode client data access program stored in the memory 602 to implement the following steps:
[0096] In the scenario where the first NVMe-oF server is inaccessible, switch to the second NVMe-oF server to which the NVMe-oF user-mode client is connected;
[0097] Write the access operation instruction into the control instruction area of the second NVMe-oF server through the second circular queue; wherein, the second circular queue is a queue between the vhost device and the second NVMe-oF server.
[0098] In other embodiments of the present application, the scenario where the first NVMe-oF server is inaccessible includes at least one of the following: the network connection between the NVMe-oF user-mode client and the first NVMe-oF server is disconnected; the first NVMe-oF server crashes; the input / output communication between the NVMe-oF user-mode client and the first NVMe-oF server times out; an instruction to switch from the first NVMe-oF server to the second NVMe-oF server is received.
[0099] In other embodiments of the present application, the processor 601 is used to execute the data access program of the NVMe-oF user-mode client stored in the memory 602 to implement the following steps: receiving an instruction sent by the upper management system of the NVMe-oF user-mode client; or, receiving an instruction input by the user in the NVMe-oF user-mode client.
[0100] In other embodiments of the present application, the processor 601 is used to execute the data access program of the NVMe-oF user-mode client stored in the memory 602 to implement the following steps:
[0101] Manage the server identification and queue connection information of multiple NVMe-oF servers to generate a management list; wherein, the management list includes the first server identification and the first queue connection information corresponding to the first NVMe-oF server, and the second server identification and the second queue connection information corresponding to the second NVMe-oF server.
[0102] In other embodiments of the present application, the processor 601 is used to execute the data access program of the NVMe-oF user-mode client stored in the memory 602 to implement the following steps:
[0103] In the scenario where the first NVMe-oF server is inaccessible, select the second server identification from the management list;
[0104] Based on the second server identification, switch the connection object of the NVMe-oF user-mode client from the first NVMe-oF server to the second NVMe-oF server.
[0105] In other embodiments of the present application, the processor 601 is configured to execute the data access program of the NVMe-oF user-mode client stored in the memory 602 to implement the following steps:
[0106] If the received data access request message is a message using the vhost-block protocol or a message using the vhost-small computer system interface (SCSI) protocol, convert the data access request message into a message using the NVMe protocol.
[0107] In other embodiments of the present application, the processor 601 is configured to execute the data access program of the NVMe-oF user-mode client stored in the memory 602 to implement the following steps:
[0108] Manage the use of host resources for vhost devices; where the host resources include at least one of the following: storage resources, computing resources, and network resources.
[0109] The method provided by the embodiments of the present application can be directly embodied as a combination of software modules executed by the processor 601. The software modules can be located in a storage medium, and the storage medium is located in the memory 602. The processor 601 reads the executable instructions included in the software modules in the memory 602 and combines the necessary hardware to complete the method provided by the embodiments of the present application.
[0110] As an example, the processor can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0111] The memory can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memories, hard disk drives, optical disc drives, etc. The memory optionally includes one or more storage devices that are physically remote from the processor. The memory includes volatile memory or non-volatile memory, and can also include both volatile and non-volatile memory. The non-volatile memory can be a read-only memory (ROM), and the volatile memory can be a random access memory (RAM). The memory described in the embodiments of the present application is intended to include any suitable type of memory. In some embodiments, the memory is capable of storing data to support various operations. Examples of such data include programs, modules, and data structures, or subsets or supersets thereof, which are described below by way of example.
[0112] An embodiment of the present application provides a data access device, which receives a data access request message sent by a virtual host vhost device; parses the data access request message to obtain a first server identifier and an access operation instruction; selects a first circular queue based on the first server identifier, and writes the access operation instruction into the control instruction area of the first NVMe-oF server through the first circular queue; wherein, the first circular queue is a queue between the vhost device and the first NVMe-oF server; that is to say, the data access method provided by the present application not only is compatible with standard storage devices, i.e., remote access storage nodes such as NVMe-oF servers, but also can provide multiplexing high-availability functions. On this premise, the pure user-mode NVMe-oF client and circular queue docking technology are applied, and the vhost backend device is provided in a pure user-mode and CPU offloading manner, providing lower overhead and latency.
[0113] It should be noted that for the specific implementation process of the steps executed by the processor in this embodiment, reference can be made to Figure 1 the implementation process in the data access method of the NVMe-oF user-mode client provided in the corresponding embodiment, which will not be elaborated here.
[0114] An embodiment of the present application provides a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the following steps:
[0115] Receive a data access request message sent by a virtual host vhost device;
[0116] Parse the data access request message to obtain a first server identifier and an access operation instruction;
[0117] Select a first circular queue based on the first server identifier, and write the access operation instruction into the control instruction area of the first NVMe-oF server through the first circular queue; wherein, the first circular queue is a queue between the vhost device and the first NVMe-oF server.
[0118] In other embodiments of the present application, the one or more programs can be executed by one or more processors, and the following steps can also be implemented:
[0119] Obtain first queue connection information, and connect the data stream circular queue of the vhost device with the circular queue of the first NVMe-oF server based on the first queue connection information to establish a first circular queue.
[0120] In other embodiments of the present application, the one or more programs can be executed by one or more processors, and the following steps can also be implemented:
[0121] In the scenario where the first NVMe-oF server is inaccessible, switch to the second NVMe-oF server to which the user-mode client of NVMe-oF is connected;
[0122] Write the access operation instruction into the control instruction area of the second NVMe-oF server through the second circular queue; wherein, the second circular queue is a queue between the vhost device and the second NVMe-oF server.
[0123] In other embodiments of the present application, the scenario where the first NVMe-oF server is inaccessible includes at least one of the following: the network connection between the user-mode client of NVMe-oF and the first NVMe-oF server is disconnected; the first NVMe-oF server crashes; the input / output communication between the user-mode client of NVMe-oF and the first NVMe-oF server times out; an instruction to switch from the first NVMe-oF server to the second NVMe-oF server is received.
[0124] In other embodiments of the present application, when the one or more programs are executed by one or more processors, the following steps may also be implemented: receiving an instruction sent by the upper management system of the NVMe-oF user-mode client; or, receiving an instruction input by the user in the user-mode client of NVMe-oF.
[0125] In other embodiments of the present application, when the one or more programs are executed by one or more processors, the following steps may also be implemented:
[0126] Manage the server identifiers and queue connection information of multiple NVMe-oF servers to generate a management list; wherein, the management list includes the first server identifier and the first queue connection information corresponding to the first NVMe-oF server, and the second server identifier and the second queue connection information corresponding to the second NVMe-oF server.
[0127] In other embodiments of the present application, when the one or more programs are executed by one or more processors, the following steps may also be implemented:
[0128] In the scenario where the first NVMe-oF server is inaccessible, select the second server identifier from the management list;
[0129] Based on the second server identifier, switch the connection object of the user-mode client of NVMe-oF from the first NVMe-oF server to the second NVMe-oF server.
[0130] In other embodiments of the present application, when the one or more programs are executed by one or more processors, the following steps may also be implemented:
[0131] If the received data access request message is a message using the vhost-block protocol or a message using the vhost-small computer system interface (SCSI) protocol, convert the data access request message into a message using the NVMe protocol.
[0132] In other embodiments of the present application, the one or more programs may be executed by one or more processors, and the following steps may also be implemented: manage the use of host resources by the vhost device; wherein, the host resources include at least one of the following: storage resources, computing resources, and network resources.
[0133] It should be noted that for the specific implementation process of the steps executed by the processor in this embodiment, reference may be made to Figure 1 the implementation process in the data access method of the NVMe-oF user space client provided in the corresponding embodiment, which will not be elaborated here.
[0134] It should be pointed out here that the descriptions of the above storage medium and device embodiments are similar to those of the above method embodiments and have similar beneficial effects to the method embodiments. For the technical details not disclosed in the storage medium and device embodiments of the present application, please refer to the descriptions of the method embodiments of the present application for understanding.
[0135] The above computer storage medium / memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a ferromagnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM), etc.; it may also be various terminals including one or any combination of the above memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc.
[0136] It should be understood that the "one embodiment" or "an embodiment" or "the embodiments of the present application" or "the foregoing embodiments" or "some embodiments" or "some implementation manners" mentioned throughout the specification mean that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, the "in one embodiment" or "in an embodiment" or "the embodiments of the present application" or "the foregoing embodiments" or "some embodiments" or "some implementation manners" that appear throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the magnitudes of the serial numbers of the above processes do not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. The serial numbers of the embodiments of the present application above are only for description and do not represent the advantages or disadvantages of the embodiments.
[0137] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined, or can be integrated into another method, or some features can be ignored, or not executed. In addition, the couplings, direct couplings or communication connections between the components shown or discussed with each other can be through some interfaces, and the indirect couplings or communication connections of devices or units can be electrical, mechanical or other forms.
[0138] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units; they can be located in one place or distributed to multiple network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0139] In addition, each functional unit in the embodiments of the present application can be all integrated in a processing unit, or each unit can be separately a unit, or two or more units can be integrated in one unit; the above integrated units can be implemented in the form of hardware, or in the form of hardware plus software functional units.
[0140] The methods disclosed in several method embodiments provided by the present application can be combined arbitrarily without conflict to obtain new method embodiments.
[0141] The features disclosed in several product embodiments provided by the present application can be combined arbitrarily without conflict to obtain new product embodiments.
[0142] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0143] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps including the above method embodiments; and the foregoing storage medium includes: various media such as removable storage devices, read-only memory (ROM), magnetic disks, or optical discs that can store program codes.
[0144] Alternatively, if the integrated units in this application are implemented in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence or the part that contributes to the related art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of the various embodiments of this application. And the foregoing storage medium includes: various media such as removable storage devices, ROM, magnetic disks, or optical discs that can store program codes.
[0145] It should be noted that the drawings in the embodiments of this application are only for illustrating the schematic positions of various components on the terminal device and do not represent the actual positions in the terminal device. The actual positions of each component or each area can be changed or offset according to the actual situation (for example, the structure of the terminal device). Moreover, the ratios of different parts in the terminal device in the figure do not represent the actual ratios.
[0146] The above is only the implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed in this application can easily think of changes or substitutions, which should all be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims
1. A data access method for an NVMe-oF user-mode client, the method comprising: Receive a data access request message sent by a virtual host vhost device; Parse the data access request message to obtain a first server identifier and an access operation instruction; Based on the first server identifier, select a first circular queue, and write the access operation instruction into the control instruction area of the first NVMe-oF server through the first circular queue; wherein, the first circular queue is a queue established by connecting the data stream circular queue of the vhost device and the circular queue of the first NVMe-oF server.
2. The method according to claim 1, before selecting the first circular queue based on the first server identifier, the method comprising: Obtain first queue connection information, and based on the first queue connection information, connect the data stream circular queue of the vhost device to the circular queue of the first NVMe-oF server to establish the first circular queue.
3. The method according to claim 1, after selecting the first circular queue based on the first server identifier, the method comprising: In the scenario where the first NVMe-oF server is inaccessible, switch to the second NVMe-oF server connected to the user-space client of the NVMe-oF; Write the access operation instruction into the control instruction area of the second NVMe-oF server through a second circular queue; wherein, the second circular queue is a queue between the vhost device and the second NVMe-oF server.
4. The method according to claim 3, the scenario where the first NVMe-oF server is inaccessible includes at least one of the following: The network connection between the user-mode client of NVMe-oF and the first NVMe-oF server is disconnected; The first NVMe-oF server crashes; The input / output communication between the user-mode client of NVMe-oF and the first NVMe-oF server times out; Receiving an instruction to switch from the first NVMe-oF server to the second NVMe-oF server.
5. The method according to claim 4, the receiving an instruction to switch from the first NVMe-oF server to the second NVMe-oF server includes: Receive the instruction sent by the upper-layer management system of the NVMe-oF user-space client; Or, Receive the instruction input by the user in the user-space client of the NVMe-oF.
6. The method according to claim 3, the method further comprising: Manage the server identifiers and queue connection information of multiple NVMe-oF servers to generate a management list; wherein, the management list includes the first server identifier and the first queue connection information corresponding to the first NVMe-oF server, and the second server identifier and the second queue connection information corresponding to the second NVMe-oF server.
7. The method according to claim 6, in the scenario where the first NVMe-oF server is inaccessible, switching to the second NVMe-oF server to which the user-mode client of NVMe-oF is connected includes: In the scenario where the first NVMe-oF server is inaccessible, select the second server identifier from the management list; Based on the second server identifier, switch the connection object of the user-space client of the NVMe-oF from the first NVMe-oF server to the second NVMe-oF server.
8. The method according to claim 1, after receiving a data access request message sent by a virtual host vhost device, the method comprising: If the received data access request message is a message using the vhost-block protocol or a message using the vhost-small computer system interface scsi protocol, convert the data access request message into a message using the NVMe protocol.
9. The method according to claim 1, further comprising: Manage the use of host resources by the vhost device; wherein, the host resources include at least one of the following: storage resources, computing resources, and network resources.
10. An NVMe-oF user-mode client data access device, the device comprising: A receiving module, configured to receive a data access request message sent by a virtual host vhost device; A processing module, configured to parse the data access request message to obtain a first server identifier and an access operation instruction; The processing module is further configured to select a first circular queue based on the first server identifier; The processing module is configured to write the access operation instruction into the control instruction area of the first NVMe-oF server through a first circular queue; wherein, the first circular queue is established by connecting the data stream circular queue of the vhost device and the circular queue of the first NVMe-oF server.
Citation Information
Patent Citations
Methods and apparatus to process commands from virtual machines
CN111133416A