Data playback method, data processor, network interface card, device and storage medium
By storing the request queue and data in persistent memory in advance, and directly recovering and sending the request to be played after the storage stack restart, the problem of excessive interruption time of storage data paths in traditional methods is solved, improving data storage efficiency and simplifying process.
Patent Information
- Application Number
- CN202411194522.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-28
AI Technical Summary
After the storage stack is restarted, the traditional data playback method needs to read the IO request through DMA, resulting in the storage data path interruption time being too long, affecting the data storage efficiency on the host side, especially in the hardware encryption and decryption process.
The request queue and request data are stored in the persistent memory in advance. When the storage stack is restarted, the request to be replayed is directly restored from the persistent memory. The request is directly resented to the storage device without the need to use DMA and encryption and decryption technology.
It shortens the interruption time of storage data path on the host side, improves data storage efficiency, simplifies the playback process, and reduces complexity and maintenance difficulty.
Smart Images

Figure CN119088724A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data processors, and in particular to a data replay method, a data processor, a network interface card, a computer device, and a computer-readable storage medium. Background Art
[0002] In the Data Processing Unit (DPU), if the SPDK (Storage Performance Development Kit, hereinafter referred to as the "storage stack") service exits abnormally or needs to be upgraded, the IO (input and output) requests that have been read from the driver queue on the host side to the DPU cannot be processed normally. After the storage stack in the DPU is pulled up again, these IO requests need to be replayed to restore the interrupted data path on the host side.
[0003] In the traditional data replay method, after the storage stack is pulled up again, its process space and memory are initialized. The DPU needs to analyze the context information of the driver queue before the interruption, and use DMA (Direct Memory Access) to re-read the IO requests that need to be replayed from the host side to complete the subsequent IO processing flow. This method requires a second read of the IO requests that need to be replayed through DMA, which will cause the interruption time of the storage data path to be too long, affecting the data storage efficiency on the host side. Some DPUs are also designed with hardware encryption and decryption processes. When re-reading the IO requests that need to be replayed from the host side, the hardware encryption and decryption process will be used, which will further increase the interruption time of the storage data path. Summary of the invention
[0004] Based on this, it is necessary to provide a data replay method, a data processor, a network interface card, a computer device and a computer-readable storage medium to address the above technical problems, which can shorten the interruption duration of the storage data path on the host side and improve the data storage efficiency on the host side.
[0005] In a first aspect, the present application provides a data replay method, which is applied to a data processor, comprising:
[0006] In the case of a storage stack restart, a request queue to be replayed is obtained from the persistent memory; the request queue to be replayed is a queue obtained by mapping a transmission buffer in the persistent memory, and the transmission buffer is used to receive requests from the host side;
[0007] According to the request queue to be replayed, obtain the request to be replayed from the persistent memory;
[0008] The request to be replayed is resent to the target acceleration component pointing to the storage device to instruct the storage device to store the target data corresponding to the request to be replayed in the persistent memory.
[0009] In one embodiment, obtaining the request to be replayed from the persistent memory according to the request queue to be replayed includes:
[0010] Obtain from the persistent memory the target requests pointed to by the elements in the request queue to be replayed;
[0011] Read the status of each target request;
[0012] A target request with an initial state or a processing state is determined as a request to be replayed; the initial state is used to indicate that the target request has not been submitted to the target acceleration component pointing to the storage device, and the processing state is used to indicate that the target request has been submitted to the target acceleration component pointing to the storage device.
[0013] In one embodiment, obtaining a request queue to be replayed from a persistent memory includes:
[0014] Get the cursor information corresponding to each request queue from the persistent memory; the cursor information includes the head cursor information, the tail cursor information, and the middle cursor information;
[0015] The request queue whose head cursor information is inconsistent with the intermediate cursor information is determined as the request queue to be replayed;
[0016] From the persistent memory, obtain the target requests pointed to by each element in the request queue to be replayed, including:
[0017] Obtain at least one target element from the request queue to be replayed according to the head cursor information and the intermediate cursor information corresponding to the request queue to be replayed;
[0018] Get each target request pointed to by at least one target element from persistent memory.
[0019] In one embodiment, the persistent memory includes a data cache area and a request storage area, and the method further includes:
[0020] The data buffer area and the request storage area are split according to the set size to obtain data segments and request segments;
[0021] Use the data memory pool of the data plane development kit to manage the address information of the data segment;
[0022] Use the request memory pool of the data plane development kit to manage the address information of the request segment;
[0023] In the process of initializing the transmission buffer, a target data segment is allocated to each element in the transmission buffer using the data memory pool, and a target request segment is allocated to each element in the transmission buffer using the request memory pool;
[0024] According to the address information of the target data segment, the data corresponding to each element in the transmission buffer is stored in the data cache area;
[0025] According to the address information of the target request segment, the request corresponding to each element in the transmission buffer is stored in the request storage area.
[0026] In one embodiment, after obtaining the request to be replayed from the persistent memory according to the request queue to be replayed, the method further includes:
[0027] Remove the address information of the data segment corresponding to the request to be replayed from the data memory pool;
[0028] Remove the address information of the request segment corresponding to the request to be replayed from the request memory pool.
[0029] In one embodiment, after the request to be replayed is resent to the target acceleration component pointing to the storage device to instruct the storage device to store the target data corresponding to the request to be replayed in the persistent memory, the method further includes:
[0030] If a response is received for the request to be replayed, the response is placed in the receive buffer;
[0031] If it is detected that the host side has completed the operation corresponding to the response, the element corresponding to the request to be replayed is removed from the queue of requests to be replayed.
[0032] In one of the embodiments, the state of the request stored in the persistent memory includes any one of an initial state, a processing state, a waiting state, and a completion state; and the method further includes:
[0033] After storing the request corresponding to each element in the transmission buffer in the persistent memory, setting the state of the request in the persistent memory to an initial state; the initial state is used to represent that the request has not been submitted to the target acceleration component pointing to the storage device;
[0034] After the request to be replayed is resent to the target acceleration component pointing to the storage device, the state of the request to be replayed is updated to a processing state; the processing state is used to indicate that the request has been submitted to the target acceleration component pointing to the storage device;
[0035] After receiving a response to the request to be replayed, the state of the request to be replayed is updated to a waiting state; the waiting state is used to indicate that the storage device has responded but the host side has not responded;
[0036] After detecting that the host side has completed the operation corresponding to the response, the state of the request to be replayed is updated to a completed state; the completed state is used to indicate that the host side has responded;
[0037] Remove the elements corresponding to the requests to be replayed from the request queue to be replayed, including:
[0038] If the request queue to be replayed further includes at least one second element located before the first element, determining the state of the request pointed to by the at least one second element; the first element is the element corresponding to the request to be replayed;
[0039] If the status of the requests pointed to by at least one second element are all in the completed state, the first element and at least one second element are removed from the request queue to be replayed.
[0040] In a second aspect, the present application further provides a data processor, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0041] In the case of a storage stack restart, a request queue to be replayed is obtained from the persistent memory; the request queue to be replayed is a queue obtained by mapping a transmission buffer in the persistent memory, and the transmission buffer is used to receive requests from the host side;
[0042] According to the request queue to be replayed, obtain the request to be replayed from the persistent memory;
[0043] The request to be replayed is resent to the target acceleration component pointing to the storage device to instruct the storage device to store the target data corresponding to the request to be replayed in the persistent memory.
[0044] In a third aspect, the present application also provides a network interface card, comprising the data processor as described above and a plurality of interfaces, and the data processor communicates externally through the interfaces.
[0045] In a fourth aspect, the present application also provides a computer device, including a central processing unit and a data processor as described above, the data processor is used to dispatch messages to the central processing unit or the data processor itself for processing, and the central processing unit is used to process messages dispatched by the data processor.
[0046] In a fifth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0047] In the case of a storage stack restart, a request queue to be replayed is obtained from the persistent memory; the request queue to be replayed is a queue obtained by mapping a transmission buffer in the persistent memory, and the transmission buffer is used to receive requests from the host side;
[0048] According to the request queue to be replayed, obtain the request to be replayed from the persistent memory;
[0049] The request to be replayed is resent to the target acceleration component pointing to the storage device to instruct the storage device to store the target data corresponding to the request to be replayed in the persistent memory.
[0050] The above-mentioned data replay method, data processor, network interface card, computer device and computer-readable storage medium obtain the request queue to be replayed from the persistent memory when the storage stack is restarted; the request queue to be replayed is a queue obtained by mapping the transmission buffer in the persistent memory, and the transmission buffer is used to receive requests from the host side; according to the request queue to be replayed, the request to be replayed is obtained from the persistent memory; the request to be replayed is resent to the target acceleration component pointing to the storage device to instruct the storage device to store the target data corresponding to the request to be replayed in the persistent memory. In this method, the request queue, the request and the data corresponding to the request are stored in the persistent memory in advance. If the storage stack is restarted, the request to be replayed is restored from the persistent memory of the DPU, without the need for DAM and encryption and decryption technology, which can shorten the interruption time of the storage data path on the host side and improve the data storage efficiency on the host side. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0052] Figure 1 A data flow diagram of a traditional data replay method;
[0053] Figure 2 is a flow chart of a data replay method in one embodiment;
[0054] Figure 3 is a logic block diagram of a data processor in one embodiment;
[0055] Figure 4 is a flow chart of a data replay method in another embodiment;
[0056] Figure 5 The initialization process of the data replay method in one embodiment;
[0057] Figure 6 A schematic diagram of changes in a request queue in one embodiment;
[0058] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0060] It is understandable that hardware manufacturers usually customize private SPDK services in DPU to provide more flexible storage acceleration solutions for DPU. The private SPDK service in DPU uses TCP / RDMA (a combination of TCP protocol and RDMA technology, RDMA refers to Remote Direct Memory Access) network to simulate remote storage resources into physical disk devices on the PCIe (a high-speed serial computer expansion bus standard) bus, and then maps them to local block storage devices on the host side (host / VM), and combines Virtio / NVMe hardware virtualization and encryption and decryption acceleration technology to provide high-performance and secure data storage services for host / VM.
[0061] When the customized private SPDK service in the DPU exits abnormally or needs to be upgraded, the IO requests that have been read from the host / VM driver queue to the DPU cannot be processed normally, resulting in host / VM IO hang (disk read and write are too slow, causing threads and processes to hang) or IO interruption. This part of the unfinished IO request in the DPU is called replay IO. After the firmware that processes the storage data in the DPU is restarted, this part of the replay IO needs to be replayed to restore the interrupted data path in the host / VM.
[0062] Reference Figure 1 , Figure 1 The following is a data flow diagram of a traditional data replay method, where ARM CPU refers to the core processing unit in the DPU. The traditional DPU replay IO data flow includes:
[0063] 1. The VHOST layer (virtual host layer) collects the context information of accessing the host-side NVMe / Virtio driver queue before replay IO is interrupted in different scenarios such as NVMe (non-volatile memory host controller interface specification), virtio-blk (virtualized block storage), and virtio-crypto (used for encryption and decryption operations in virtualized environments) in the DPU hardware register, which may include the NVMe SQ (NVMe operation instruction submission queue) physical address, the Virtqueue (the actual data link for data exchange between the front-end and back-end ring queues) physical address, and the location information of the driver queue cursor.
[0064] 2. VHOST calculates the number of replay IOs and the position of replay IOs in the NVMe / vritio driver queue through the collected driver queue context information. The DPU reads the replay IOs that need to be replayed from the host side again through the InternalTX / RX ring (internal send or receive ring) through the DMA path and hardware encryption and decryption technology.
[0065] 3. The BDEV layer (block device layer) sends the replay IO in the Internal TX / RXring to the remote Storage Cloud (cloud storage device) again through NVMe-OF Transport (TCP / RDMA).
[0066] 4. After the Storage Cloud replies with a read / write response, it restores the interrupted data path on the host side.
[0067] It should be noted that if the storage data path is interrupted for too long, it will bring certain offline risks to terminal services with high IO continuity requirements; on the other hand, it will also affect the experience of terminal users. The shorter the replay IO time, the faster the data path is restored, and the more user-friendly the experience is for terminal users.
[0068] In the traditional data replay method, after the storage stack is pulled up again, its process space and memory are initialized. The DPU needs to analyze the context information of the driver queue before the interruption and use DMA (Direct Memory Access) to re-read the IO request that needs to be replayed from the host side to complete the subsequent IO processing flow. There are the following problems:
[0069] Pulling IO requests through DMA for the second time involves data interaction between the DPU and the host side. Initiating DMA transmission, data retransmission and verification, host-side response and scheduling, etc., all take time, which will cause the storage data path to be interrupted too long, affecting the data storage efficiency on the host side. A hardware encryption and decryption process is designed. When re-reading the IO request that needs to be replayed from the host side, the hardware encryption and decryption process is used, which will further increase the interruption time of the storage data path. In different scenarios such as NVMe, virtioblk / crypto, it is necessary to develop and design replay logic separately for the descriptor types stored in different driver queues, and the code is highly complex and difficult to maintain.
[0070] In the data replay method provided by this application, the request queue, request, and data corresponding to the request are stored in the persistent memory in advance. If the storage stack is restarted, the request to be replayed is restored from the persistent memory of the DPU, without the need for DAM and encryption and decryption technology, which can shorten the interruption time of the storage data path on the host side and improve the data storage efficiency on the host side. The replay process under different storage business scenarios is standardized, and encryption and decryption, NVMe, virtio (virtualization) and other scenarios can be handled indiscriminately, with simple logic and low maintenance difficulty.
[0071] In an exemplary embodiment, Figure 2 As shown, a data replay method is provided, and the method is applied to a data processor, comprising:
[0072] Step 202, when the storage stack is restarted, obtain the request queue to be replayed from the persistent memory; the request queue to be replayed is a queue mapped in the persistent memory for the transmission buffer, and the transmission buffer is used to receive requests from the host side.
[0073] Among them, the storage stack is the SPDK (Storage Performance Development Kit) running in the data processing unit (DPU). When the SPDK service exits abnormally or needs to be upgraded, the IO requests that have been read from the driver queue on the host side to the DPU cannot be processed normally. After the SPDK is restarted, these IO requests need to be replayed to restore the interrupted data path on the host side.
[0074] It can be understood that the transmission buffer is the tx ring (transmission ring buffer) in the DPU, which is used to receive requests from the host side. The tx ring is associated with one or more driver queues on the host side. The tx ring and the driver queue cooperate with each other for data transmission. Optionally, the request queue (request queue or replay queue) stored in the persistent memory corresponds to the driver queue on the host side.
[0075] Persistent Memory (PMEM) is a storage hardware that does not lose data after a power outage. Optionally, the persistent memory can be a persistent HugePages memory resource in the DPU.
[0076] In the specific implementation, the VHOST layer applies to reserve 4 parts of persistent shared memory (i.e., persistent memory), which are used to store request queues, cursor information, data, and requests respectively. During replay, the starting physical address of each shared memory can be obtained according to the shared memory identifier (shmid). Assuming that 32K replay queues corresponding to the driver queues are reserved, the request queue occupies 32K*512 (queue size)*8B=128MB of continuous shared memory in physical space, and the starting position of each replay queue can be indexed through the global qid.
[0077] The request queue stored in the persistent memory includes at least one element, each of which is a pointer to a request (replay request).
[0078] Step 204: Obtain the request to be replayed from the persistent memory according to the request queue to be replayed.
[0079] Among them, from the persistent memory, the request pointed to by each element in the request queue to be replayed is determined, and the replay request (i.e., the request to be replayed) to be replayed is determined therefrom. In one implementation, each element in the request queue to be replayed includes a request address (replay request addr), which points to a replay request object in a mempool (memory pool), and the corresponding request is obtained from the persistent memory according to the address information of the replay request object in the mempool, and the request to be replayed is determined from the request corresponding to each element in the request queue to be replayed.
[0080] Step 206: resend the request to be replayed to the target acceleration component pointing to the storage device to instruct the storage device to store the target data corresponding to the request to be replayed in the persistent memory.
[0081] The storage device is a remote storage device mounted on the PCIe bus (for example Figure 1 The target acceleration component is a vhost target pointing to a storage device, which is used to accelerate data transmission from a virtual machine to a backend storage or network device.
[0082] The persistent memory also stores data corresponding to each request. The BDEV layer resends the request to be replayed to the remote storage device, restores the interrupted data path, and instructs the storage device to store the target data corresponding to the request to be replayed in the persistent memory.
[0083] Reference Figure 3 , Figure 3 This is a logic block diagram of a data processor in an embodiment. An Internal TX / RX ring and a replay queue are set in the persistent Huge Pages memory resources of DPDK (DPDK, Data Plane Development Kit). By persisting replay IO through the huge page memory resources in the DPU, the storage data path can be efficiently restored.
[0084] In one implementation, after receiving a write data request through the tx ring, the DPU puts the request in the tx ring into the replay queue, determines the unprocessed requests by traversing the replay queue, and sends the unprocessed requests to the target acceleration component pointing to the storage device. That is, the data replay method and the normal IO process provided by the present application both complete the sending of requests through the replay queue, and can unify the replay process and normal IO processing process of different services.
[0085] In the above data replay method, when the storage stack is restarted, the request queue to be replayed is obtained from the persistent memory; the request queue to be replayed is a queue obtained by mapping the transmission buffer in the persistent memory, and the transmission buffer is used to receive requests from the host side; according to the request queue to be replayed, the request to be replayed is obtained from the persistent memory; the request to be replayed is resent to the target acceleration component pointing to the storage device to instruct the storage device to store the target data corresponding to the request to be replayed in the persistent memory. In this method, the request queue, the request, and the data corresponding to the request are stored in the persistent memory in advance. If the storage stack is restarted, the request to be replayed is restored from the persistent memory of the DPU, without the need for DAM and encryption and decryption technology, which can shorten the interruption time of the storage data path on the host side and improve the data storage efficiency on the host side.
[0086] In an exemplary embodiment, step 204 includes: obtaining from the persistent memory each target request pointed to by each element in the request queue to be replayed; reading the status of each target request; determining the target request whose status is an initial state or a processing state as a request to be replayed; the initial state is used to characterize that the target request has not been submitted to the target acceleration component pointing to the storage device, and the processing state is used to characterize that the target request has been submitted to the target acceleration component pointing to the storage device.
[0087] Among them, different states are recorded in the request, including the initial state (replay init), processing state (spdk_inflight), waiting state (rx_enqueue) and completion state (vpe_finish). The N elements in the request queue to be replayed point to N target requests, and the requests with the initial state or processing state among the N target requests are determined as requests to be replayed. The state of the target request is the initial state, which means that before the storage stack is restarted, the DPU obtains the target request from the host side, but has not submitted it to the target acceleration component pointing to the storage device. The state of the target request is the processing state, which means that before the storage stack is restarted, the DPU has submitted the target request to the target acceleration component pointing to the storage device, but the subsequent IO processing flow has been interrupted.
[0088] In this embodiment, by setting the status of the request, it is possible to determine which requests among the requests pointed to by the request queue need to be resent, ensuring that unfinished requests can be restored after the storage stack is restarted, thereby improving the stability and reliability of data storage.
[0089] In an exemplary embodiment, obtaining a request queue to be replayed from a persistent memory includes: obtaining cursor information corresponding to each request queue from the persistent memory; the cursor information includes head cursor information, tail cursor information, and middle cursor information; determining a request queue whose head cursor information is inconsistent with the middle cursor information as a request queue to be replayed;
[0090] Obtaining from the persistent memory the target requests pointed to by the elements in the request queue to be replayed, including: obtaining at least one target element from the request queue to be replayed according to the head cursor information and the intermediate cursor information corresponding to the request queue to be replayed; and obtaining from the persistent memory the target requests pointed to by the at least one target element.
[0091] The head cursor information is the head cursor information of the request queue, the middle cursor information is the spdk_head cursor information in the request queue, and the tail cursor information is the tail cursor information of the request queue. In any request queue, all elements in the request queue are stored between head and tail; the requests pointed to by each element between head and spdk_head have been submitted to the vhost target. Persistent memory includes a shared memory area with continuous physical space for storing cursor information.
[0092] If the head cursor information of a request queue is consistent with the intermediate cursor information, it indicates that the request queue is an empty queue or the requests pointed to by each element in the request queue have been processed. If the head cursor information of a request queue is inconsistent with the intermediate cursor information, it indicates that the request queue includes unprocessed elements, and the request queue is determined as a request queue to be replayed.
[0093] According to the head cursor information and intermediate cursor information corresponding to the request queue to be replayed, obtain at least one target element between head and spdk_head from the request queue to be replayed, and according to the information carried by the at least one target element, obtain the corresponding target request from the persistent memory.
[0094] In one implementation, the first address of the shared memory of the request queue and the shared memory of the cursor information is obtained through a unique shmid identifier, thereby accessing the shared memory of the request queue and the shared memory of the cursor information, and indexing the corresponding information in the shared memory of the request queue and the shared memory of the cursor information respectively through the global qid, thereby retrieving the requests to be replayed between the head and tail of all request queues.
[0095] In this embodiment, by storing the cursor information of the request queue in the persistent memory, the loss of cursor information can be prevented and the consistency of information during data transmission can be maintained. After the storage stack is restarted, it can be quickly restored to the previous state and continue to process unfinished requests, thereby shortening the interruption duration of the storage data path on the host side.
[0096] In an exemplary embodiment, Figure 4 As shown, the persistent memory includes a data cache area and a request storage area, and the method further includes:
[0097] Step 402, split the data buffer area and the request storage area according to the set size to obtain data segments and request segments.
[0098] Among them, the persistent memory includes a data cache area and a request storage area. The data cache area can be understood as a shared memory area for storing data (out buffer), and the request storage area can be understood as a shared memory area for storing requests (replay request).
[0099] In one implementation, the out buffer stores out data, including multiple 2MB hugepages, and the multiple hugepages are physically continuous. Similarly, the replay request also includes multiple 2MB hugepages that are physically continuous.
[0100] Set the size to the size of each element stored in the memory pool of the data plane development kit (DPDK), for example, 4KB. Optionally, obtain the first address of the out buffer and replay request shared memory area through the unique shmid identifier, and cut all consecutive 2MB hugepages in the out buffer and replay request shared memory area into 4KB segments.
[0101] Step 404: manage the address information of the data segment by using the data memory pool of the data plane development kit.
[0102] Step 406: manage the address information of the request segment using the request memory pool of the data plane development kit.
[0103] The split data segments are injected into the DPDK data memory pool (out buffer mempool), and the split request segments are injected into the DPDK request memory pool (request mempool).
[0104] It is understandable that the DPU Vhost layer applies for two idle DPDK mempools to manage replayrequest objects and out buffer objects respectively. The size of each element in the mempool is 4KB, and all element information in the mempool can be associated through the replay queue.
[0105] In one implementation, the address information of the data segment is injected into the out buffer mempool, and the data segment area in the persistent memory can be used through the out buffer mempool. The address information of the request segment is injected into the request mempool, and the request segment area in the persistent memory can be used through the request mempool. Optionally, the address information can be the first address of the data segment or the request segment.
[0106] Step 408, during the initialization of the transmission buffer, a target data segment is allocated to each element in the transmission buffer using the data memory pool, and a target request segment is allocated to each element in the transmission buffer using the request memory pool.
[0107] Among them, the transmission buffer (tx ring) can be understood as the hardware queue in the DPU. When the DPU hardware queue is initialized, the target data segment (i.e., a small data buffer) will be pre-applied from the DPDK data memory pool and injected into each element (entry) of the tx ring, so that each element in the transmission buffer is associated with the target data segment in the data buffer. Similarly, the target request segment (i.e., a small request storage area) is pre-applied from the DPDK request memory pool and injected into each entry of the tx ring, so that each element in the transmission buffer is associated with the target request segment in the request storage area.
[0108] Step 410, according to the address information of the target data segment, the data corresponding to each element in the transmission buffer is stored in the data cache area.
[0109] Step 412, according to the address information of the target request segment, the request corresponding to each element in the transmission buffer is stored in the request storage area.
[0110] Among them, when the DPU reads the write request data from the host side, it puts the data into the data buffer area associated with the tx ring according to the address information of the target data segment and the address information of the target request segment corresponding to each element applied in advance, and puts the request into the request storage area associated with the tx ring.
[0111] In this embodiment, the split data segments and request segments are managed by the DPDK memory pool, which can control and manage the use of persistent memory. Compared with applying for persistent memory when using it, the method of obtaining address information from the DPDK memory pool is faster and more effective. Pre-allocating data storage resources and requesting storage resources during the initialization process can improve the transmission performance of the IO path.
[0112] In an exemplary embodiment, after step 204, the method further includes: removing address information of a data segment corresponding to the request to be replayed from the data memory pool; and removing address information of a request segment corresponding to the request to be replayed from the request memory pool.
[0113] After the replay queue that needs to be replayed is determined, the data memory pool and the request memory pool are traversed to remove the address information of the data segment and the address information of the request segment related to the request to be replayed.
[0114] It is understandable that, since the address information associated with the replay request to be replayed is included in the process of initializing the transmission buffer, by removing the address information of the data segment and the address information of the request segment related to the request to be replayed, it is possible to avoid other normal IOs from applying for data resources and request resources from the memory pool and applying for the address information of the data segment and the address information of the request segment associated with the request to be replayed. Since concurrent access will cause data write exceptions, the present application can prevent concurrent access to the data cache area and the request storage area associated with the request to be replayed by removing the address information, thereby improving the security of data transmission.
[0115] In an exemplary embodiment, after step 206, the method further includes: if a response to the request to be replayed is received, placing the response in a receiving buffer; if it is detected that the host side has completed the operation corresponding to the response, removing the element corresponding to the request to be replayed from the request queue to be replayed.
[0116] Among them, SPDK processes the request to be replayed and returns it to BDEV. BDEV completes the response process with the host side. Specifically, the response is placed in the VHOST internal rx ring, that is, the receiving buffer. After completing the response process with the host side and detecting that the host side has completed the operation corresponding to the response, the element corresponding to replayrequest is removed from the replay queue. Optionally, if it is detected that the tail cursor information of the receiving buffer is updated, it is determined that the host side has completed the operation corresponding to the response. Optionally, based on the operation of removing the element in the request queue, the request and data pointed to by the element are further deleted from the persistent memory.
[0117] In this embodiment, the replayed request is removed from the queue of requests to be replayed, thereby releasing memory resources for use by other subsequent requests, thereby improving resource utilization.
[0118] In an exemplary embodiment, the state of the request stored in the persistent memory includes any one of an initial state, a processing state, a waiting state, and a completion state; and the method further includes:
[0119] After storing the request corresponding to each element in the transmission buffer in the persistent memory, the state of the request in the persistent memory is set to the initial state; the initial state is used to indicate that the request has not been submitted to the target acceleration component pointing to the storage device; after resending the request to be replayed to the target acceleration component pointing to the storage device, the state of the request to be replayed is updated to the processing state; the processing state is used to indicate that the request has been submitted to the target acceleration component pointing to the storage device; after receiving a response to the request to be replayed, the state of the request to be replayed is updated to the waiting state; the waiting state is used to indicate that the storage device has responded but the host side has not responded; after detecting that the host side has completed the operation corresponding to the response, the state of the request to be replayed is updated to the completion state; the completion state is used to indicate that the host side has responded;
[0120] Removing elements corresponding to the requests to be replayed from the request queue to be replayed, including: if the request queue to be replayed also includes at least one second element located before the first element, determining the status of the request pointed to by the at least one second element; the first element is the element corresponding to the request to be replayed; if the status of the requests pointed to by the at least one second element are all completed, removing the first element and at least one second element from the request queue to be replayed.
[0121] Among them, by storing the request status, the rollback mechanism can be supported to correctly handle unfinished requests. When the SPDK process exits during the process of adding or removing requests from the request queue, after the SPDK process is started again, the rollback mechanism can correctly handle the requests that were not successfully added or deleted from the request queue.
[0122] In one implementation, after the request corresponding to each element in the transmission buffer is stored in the persistent memory, the state of the request in the persistent memory is set to the initial state. Optionally, after the pointer of the request corresponding to each element in the transmission buffer is successfully placed in the request queue, the tx ring head cursor information of the transmission buffer is updated. If the SPDK process exits before successfully placing the request queue, after the SPDK process is started again, the elements between the tx ringhead and the tx ring tail are re-read from the transmission buffer. Assuming that the state of a request is the initial state, it means that the DPU obtains the request from the host side, but has not submitted it to the target acceleration component pointing to the storage device.
[0123] In one implementation, after the request to be replayed is resent to the target acceleration component pointing to the storage device, the status of the request to be replayed is updated to the processing status. Optionally, after the processing status is successfully updated, the spdk_head cursor information of the request queue to be replayed is updated. If the SPDK process exits before spdk_head is updated or the update process of the processing status is not completed, after the SPDK process is started again, the request with the status of the initial state or the processing state is searched from the request queue to be replayed, and resubmitted to the target acceleration component pointing to the storage device. Assuming that the status of a request is the processing status, it means that the DPU has submitted the request to the target acceleration component pointing to the storage device, but the subsequent IO processing process has not been completed.
[0124] In one implementation, after receiving a response to the request to be replayed, the status of the request to be replayed is updated to a waiting state. Optionally, after receiving a response to the request to be replayed, the response is placed in a receiving buffer, and the tail cursor information of the receiving buffer is updated. After the tail cursor information of the receiving buffer is updated, the status of the request to be replayed is updated to a waiting state. If the SPDK process exits before the status of the request to be replayed is updated, after the SPDK process is started again, the request with an initial state or a processing state is searched from the request queue to be replayed, and resubmitted to the target acceleration component pointing to the storage device. Assuming that the status of a request is a waiting state, it means that the DPU has submitted the request to the target acceleration component pointing to the storage device, the storage device has responded, and the host side has not responded.
[0125] In one implementation, after detecting that the host side has completed the operation corresponding to the response, the status of the request to be replayed is updated to the completed status. Optionally, after the hardware processes the response of the receiving buffer, the head cursor information of the receiving buffer is updated, and the status of the request to be replayed is updated to the completed status.
[0126] It can be understood that, assuming that the element corresponding to the request to be replayed is located at the kth position in the request queue to be replayed, if the status of the requests pointed to by the first k elements in the request queue to be replayed are all in the completed status, then the first k elements are removed from the request queue to be replayed, and the head cursor information of the request queue to be replayed is updated so that the head cursor information points to the k+1th element. Specifically, after the status of the request to be replayed is updated to the completed status, determine whether there is a second element before the first element in the request queue to be replayed. If there is no second element, remove the first element directly. If there is at least one second element, determine the status of the request pointed to by the second element. If the status of the requests pointed to by the second element are all in the completed status, remove the first element and at least one second element synchronously. If the status of the requests pointed to by the second element is not all completed, the element will not be removed and the head cursor information of the request queue to be replayed will not be updated. The request queue to be replayed will continue to search for requests with an initial status or a processing status, and resubmit them to the target acceleration component pointing to the storage device until the status of the requests pointed to by all elements in the request queue to be replayed are all completed.
[0127] In this embodiment, tracking the processing progress of the request and updating the corresponding status can avoid the situation where the request is lost or the processing is chaotic, thereby improving the reliability of data transmission.
[0128] In an exemplary embodiment, referring to Figure 5 , Figure 5 This is an initialization process of a data replay method in an embodiment; wherein four parts of shared memory are reserved in advance, namely, the shared memory area of the request queue (replay queue), the shared memory area of cursor information (replay cusor), the shared memory area of data (out buffer), and the shared memory area of the request (replay request). Apply for request and out buffer. Two idle DPDK mempools are used to manage replay request objects and out buffer objects respectively.
[0129] Each element in the request queue is a pointer to a request, including the replay request addr, which points to the replay request object in the request mempool. Each request has a different status. The initialization process of the data replay method is as follows:
[0130] 1. Divide the continuous 2MB hugepages in the out buffer area and replay request area into 4KB segments and register them in the request mempool and out buffer mempool of DPDK respectively.
[0131] 2. According to the data in the replay queue area and the replay cusor area, the request to be replayed is retrieved. In this way, the interrupted storage data path can be restored.
[0132] 3. Traverse the DPDK request mempool and out buffer mempool and remove all elements related to the request that needs to be replayed.
[0133] 4. Traverse the replay queue according to head, tail, and spdk_head, resubmit the unprocessed requests to SPDK BDEV, and send them to the target acceleration component pointing to the storage device.
[0134] 5. If the request processing is completed, BDEV completes the response process with the host side and removes the replay request from the replay queue.
[0135] In an exemplary embodiment, referring to Figure 6 , Figure 6 The following is a schematic diagram of the change of the request queue in an embodiment. The processing steps for the request queue are as follows:
[0136] ①. The DPU takes out the requests [x1,x5] from the VHOST internal tx ring and sets the status of these requests to the initial status, that is, status=replay_init. The head cursor information of the txring will not be updated until [x1,x5] is successfully placed in the replay queue. If the SPDK process exits when adding an element, after the SPDK process re-pulls, find the request [x1,x5] between the head cursor and the tail cursor in the tx ring, and repeat the adding action in step ①. In the normal process (no SPDK process restart), add the request [x1,x5], update the tail cursor of the replay queue, and proceed to the following step ②.
[0137] ②. Take out the request [x1,x4] from the replay queue and submit it to the vhost target, and update the status of [x1,x4] in the replay queue to the processing status, that is, status=spdk_inflight. After successfully updating the status of [x1,x4], update the spdk_head cursor information. Before updating the spdk_head cursor information or partially updating the processing status, if the SPDK process exits, after the SPDK process re-pulls, search for the [x1,x4] request with the status of the initial status or the processing status between the head and tail of the replay queue, and resubmit it to the vhost target. In the normal process, after updating the spdk_head cursor information, go to step ③.
[0138] ③. After SPDK completes the request of [x2,x3] out of order, BDEV needs to put the response and status into the VHOST internal rx ring and update the tail cursor information of the rx ring. After successfully updating the tail cursor information of the rx ring, update the status of [x2,x3] in the replay queue to the waiting state, that is, status=rx_enqueue. If the SPDK process exits before updating the status of [x2,x3], after the SPDK process re-pulls, return to step ② and resubmit [x2,x3]. In the normal process, after updating the status of [x2,x3], go to step ④.
[0139] ④. After the hardware processes the x2-related data in the VHOST internal rx ring, it notifies the software to update the status of the x2 request to the completed status, that is, status=vpe_finish, and updates the head cursor information of the rx ring. Check the status of the x1 request in the replayqueue to determine whether it is in the completed status. If the status of the x1 request is not in the completed status, continue to wait for the processing result of the x1 request. If the SPDK process exits before updating the head cursor information, after the SPDK process re-pull, search for requests with the status of the initial status or the processing status between the head and tail of the replay queue, and resubmit them to the vhost target. In the normal process, after updating the status of x2, go to step ⑤.
[0140] ⑤. Starting from the head of the replay queue, detect consecutive x1 requests and x2 requests in the completed state in the replay queue, update the head cursor information of the replay queue to point to the x3 element, remove x1 and x2 from the replay queue, and go to step ⑥.
[0141] ⑥. Repeat steps ③ to ⑤ starting from position x3 until the request for [x3, x4] is successfully removed from the replayqueue.
[0142] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0143] In an exemplary embodiment, a data processor is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: when a storage stack is restarted, a request queue to be replayed is obtained from a persistent memory; the request queue to be replayed is a queue obtained by mapping a transmission buffer in the persistent memory, and the transmission buffer is used to receive requests from a host side; according to the request queue to be replayed, the request to be replayed is obtained from the persistent memory; and the request to be replayed is resent to a target acceleration component pointing to a storage device to instruct the storage device to store target data corresponding to the request to be replayed in the persistent memory.
[0144] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining each target request pointed to by each element in the request queue to be replayed from the persistent memory; reading the status of each target request; determining the target request with an initial state or a processing state as the request to be replayed; the initial state is used to characterize that the target request has not been submitted to the target acceleration component pointing to the storage device, and the processing state is used to characterize that the target request has been submitted to the target acceleration component pointing to the storage device.
[0145] In one embodiment, the processor also implements the following steps when executing the computer program: obtaining cursor information corresponding to each request queue from the persistent memory; the cursor information includes head cursor information, tail cursor information and intermediate cursor information; determining the request queue whose head cursor information is inconsistent with the intermediate cursor information as the request queue to be replayed; obtaining at least one target element from the request queue to be replayed according to the head cursor information and the intermediate cursor information corresponding to the request queue to be replayed; and obtaining each target request pointed to by the at least one target element from the persistent memory.
[0146] In one embodiment, the processor also implements the following steps when executing the computer program: splitting the data cache area and the request storage area according to the set size to obtain data segments and request segments; using the data memory pool of the data plane development kit to manage the address information of the data segments; using the request memory pool of the data plane development kit to manage the address information of the request segments; in the process of initializing the transmission buffer, using the data memory pool to allocate a target data segment to each element in the transmission buffer, and using the request memory pool to allocate a target request segment to each element in the transmission buffer; according to the address information of the target data segment, the data corresponding to each element in the transmission buffer is stored in the data cache area; according to the address information of the target request segment, the request corresponding to each element in the transmission buffer is stored in the request storage area.
[0147] In one embodiment, when the processor executes the computer program, the following steps are also implemented: removing address information of the data segment corresponding to the request to be replayed from the data memory pool; removing address information of the request segment corresponding to the request to be replayed from the request memory pool.
[0148] In one embodiment, when the processor executes the computer program, the following steps are also implemented: if a response to the request to be replayed is received, the response is placed in a receiving buffer; if it is detected that the host side has completed the operation corresponding to the response, the element corresponding to the request to be replayed is removed from the request queue to be replayed.
[0149] In one embodiment, the processor further implements the following steps when executing the computer program: after storing the request corresponding to each element in the transmission buffer in the persistent memory, setting the status of the request in the persistent memory to the initial state; the initial state is used to characterize that the request has not been submitted to the target acceleration component pointing to the storage device; after resending the request to be replayed to the target acceleration component pointing to the storage device, updating the status of the request to be replayed to the processing state; the processing state is used to characterize that the request has been submitted to the target acceleration component pointing to the storage device; after receiving a response to the request to be replayed, updating the status of the request to be replayed to the waiting state; the waiting state is used to characterize that the storage device has responded and the host side has not responded; after detecting that the host side has completed the operation corresponding to the response, updating the status of the request to be replayed to the completion state; the completion state is used to characterize that the host side has responded; if the request queue to be replayed also includes at least one second element located before the first element, determining the status of the request pointed to by the at least one second element; the first element is the element corresponding to the request to be replayed; if the status of the request pointed to by the at least one second element is all in the completion state, removing the first element and at least one second element from the request queue to be replayed.
[0150] In an exemplary embodiment, a network interface card is provided, including a data processor as provided in any of the above embodiments and multiple interfaces, such as a PCI / PCIE interface, a network interface, etc., and the data processor communicates externally through the interface.
[0151] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data replay method is implemented.
[0152] In an exemplary embodiment, the computer device provided by the present application includes a central processing unit and a data processor provided in any of the above embodiments. The data processor is used to dispatch messages to the central processing unit or the data processor itself for processing, and the central processing unit is used to process the messages dispatched by the data processor.
[0153] Exemplarily, a central processing unit (CPU) can perform data interaction with a storage device through a data processing unit (DPU) to implement data storage and reading.
[0154] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0155] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program implements the following steps when executed by a processor: in the case of a storage stack restart, a request queue to be replayed is obtained from a persistent memory; the request queue to be replayed is a queue obtained by mapping a transmission buffer in the persistent memory, and the transmission buffer is used to receive requests from a host side; according to the request queue to be replayed, the request to be replayed is obtained from the persistent memory; and the request to be replayed is resent to a target acceleration component pointing to a storage device to instruct the storage device to store target data corresponding to the request to be replayed in the persistent memory.
[0156] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining from the persistent memory each target request pointed to by each element in the request queue to be replayed; reading the status of each target request; determining the target request with an initial status or a processing status as a request to be replayed; the initial status is used to characterize that the target request has not been submitted to the target acceleration component pointing to the storage device, and the processing status is used to characterize that the target request has been submitted to the target acceleration component pointing to the storage device.
[0157] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: cursor information corresponding to each request queue is obtained from the persistent memory; the cursor information includes head cursor information, tail cursor information and intermediate cursor information; the request queue whose head cursor information is inconsistent with the intermediate cursor information is determined as the request queue to be replayed; according to the head cursor information and the intermediate cursor information corresponding to the request queue to be replayed, at least one target element is obtained from the request queue to be replayed; and each target request pointed to by the at least one target element is obtained from the persistent memory.
[0158] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the data cache area and the request storage area are split according to the set size to obtain data segments and request segments; the address information of the data segments is managed by the data memory pool of the data plane development kit; the address information of the request segments is managed by the request memory pool of the data plane development kit; in the process of initializing the transmission buffer, the data memory pool is used to allocate a target data segment to each element in the transmission buffer, and the request memory pool is used to allocate a target request segment to each element in the transmission buffer; according to the address information of the target data segment, the data corresponding to each element in the transmission buffer is stored in the data cache area; according to the address information of the target request segment, the request corresponding to each element in the transmission buffer is stored in the request storage area.
[0159] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: removing the address information of the data segment corresponding to the request to be replayed from the data memory pool; removing the address information of the request segment corresponding to the request to be replayed from the request memory pool.
[0160] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if a response to the request to be replayed is received, the response is placed in the receiving buffer; if it is detected that the host side has completed the operation corresponding to the response, the element corresponding to the request to be replayed is removed from the request queue to be replayed.
[0161] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: after storing the requests corresponding to each element in the transmission buffer in the persistent memory, setting the status of the request in the persistent memory to the initial state; the initial state is used to characterize that the request has not been submitted to the target acceleration component pointing to the storage device; after resending the request to be replayed to the target acceleration component pointing to the storage device, updating the status of the request to be replayed to the processing state; the processing state is used to characterize that the request has been submitted to the target acceleration component pointing to the storage device; after receiving a response to the request to be replayed, updating the status of the request to be replayed to the waiting state; the waiting state is used to characterize that the storage device has responded and the host side has not responded; after detecting that the host side has completed the operation corresponding to the response, updating the status of the request to be replayed to the completion state; the completion state is used to characterize that the host side has responded; if the request queue to be replayed also includes at least one second element located before the first element, determining the status of the request pointed to by the at least one second element; the first element is the element corresponding to the request to be replayed; if the status of the request pointed to by the at least one second element is all in the completion state, removing the first element and at least one second element from the request queue to be replayed.
[0162] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0163] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0164] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0165] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A data playback method, characterized in that: The data replay method is applied to a data processor, and the method comprises: In the case of a storage stack restart, a request queue to be replayed is obtained from the persistent memory; the request queue to be replayed is a queue obtained by mapping a transmission buffer in the persistent memory, and the transmission buffer is used to receive requests from the host side; According to the request queue to be replayed, obtaining the request to be replayed from the persistent memory; The request to be replayed is resent to a target acceleration component pointing to a storage device to instruct the storage device to store target data corresponding to the request to be replayed in the persistent memory.
2. The method according to claim 1, characterized in that The acquiring the request to be replayed from the persistent memory according to the request queue to be replayed includes: Obtaining, from the persistent memory, each target request pointed to by each element in the request queue to be replayed; Read the status of each target request; A target request in an initial state or a processing state is determined as a request to be replayed; the initial state is used to characterize that the target request has not been submitted to a target acceleration component pointing to a storage device, and the processing state is used to characterize that the target request has been submitted to a target acceleration component pointing to a storage device.
3. The method according to claim 2, characterized in that The obtaining of the request queue to be replayed from the persistent memory includes: Obtaining cursor information corresponding to each request queue from the persistent memory; the cursor information includes head cursor information, tail cursor information, and middle cursor information; The request queue whose head cursor information is inconsistent with the intermediate cursor information is determined as the request queue to be replayed; The step of obtaining, from the persistent memory, each target request pointed to by each element in the request queue to be replayed includes: Obtain at least one target element from the request queue to be replayed according to the head cursor information and the intermediate cursor information corresponding to the request queue to be replayed; From the persistent memory, each target request pointed to by the at least one target element is obtained.
4. The method according to claim 1, characterized in that: The persistent memory includes a data cache area and a request storage area, and the method further includes: Splitting the data buffer area and the request storage area according to set sizes to obtain data segments and request segments; Using the data memory pool of the data plane development kit, the address information of the data segment is managed; Using the request memory pool of the data plane development kit, managing the address information of the request segment; In the process of initializing the transmission buffer, the data memory pool is used to allocate a target data segment for each element in the transmission buffer, and the request memory pool is used to allocate a target request segment for each element in the transmission buffer; According to the address information of the target data segment, the data corresponding to each element in the transmission buffer is stored in the data cache area; According to the address information of the target request segment, the request corresponding to each element in the transmission buffer is stored in the request storage area.
5. The method according to claim 4, characterized in that After obtaining the request to be replayed from the persistent memory according to the request queue to be replayed, the method further includes: Removing address information of the data segment corresponding to the request to be replayed from the data memory pool; The address information of the request segment corresponding to the request to be replayed is removed from the request memory pool.
6. The method according to any one of claims 1 to 5, characterized in that After resending the request to be replayed to the target acceleration component pointing to the storage device to instruct the storage device to store the target data corresponding to the request to be replayed in the persistent memory, the method further includes: If a response to the request to be replayed is received, placing the response into the receiving buffer; If it is detected that the host side has completed the operation corresponding to the response, the element corresponding to the request to be replayed is removed from the request queue to be replayed.
7. The method according to claim 6, characterized in that The state of the request stored in the persistent memory includes any one of an initial state, a processing state, a waiting state, and a completion state; the method further includes: After storing the request corresponding to each element in the transmission buffer in the persistent memory, setting the state of the request in the persistent memory to an initial state; the initial state is used to indicate that the request has not been submitted to the target acceleration component pointing to the storage device; After the request to be replayed is resent to the target acceleration component pointing to the storage device, the state of the request to be replayed is updated to a processing state; the processing state is used to indicate that the request has been submitted to the target acceleration component pointing to the storage device; After receiving a response to the request to be replayed, updating the state of the request to be replayed to a waiting state; the waiting state is used to indicate that the storage device has responded but the host side has not responded; After detecting that the host side has completed the operation corresponding to the response, updating the state of the request to be replayed to a completed state; the completed state is used to indicate that the host side has responded; The removing, from the request queue to be replayed, the element corresponding to the request to be replayed, comprises: If the request queue to be replayed further includes at least one second element located before the first element, determining the state of the request pointed to by the at least one second element; the first element is the element corresponding to the request to be replayed; If the status of the requests pointed to by the at least one second element are all in the completed status, then the first element and the at least one second element are removed from the request queue to be replayed.
8. A data processor, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
9. A network interface card, characterized in that: The method comprises the data processor as claimed in claim 8 and a plurality of interfaces, wherein the data processor communicates externally through the interfaces.
10. A computer device, characterized in that: It comprises a central processing unit and a data processor as claimed in claim 8, wherein the data processor is used to dispatch messages to the central processing unit or the data processor itself for processing, and the central processing unit is used to process the messages dispatched by the data processor.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Content playback device, content playback method, computer-readable storage medium, and content playback system
CN101364941A
Data processing method, storage medium and processor
CN114356219A
Network I / O processing method and device based on SPDK
CN117834561A
Integrated network-attachable controller that interconnects a solid-state drive with a remote server computer
US10860511B1
Intermediary for storage command transfers
US20200319812A1
Cited By
Network card cache management method and device, computer equipment and storage medium
CN119324905A
Data replay method, data processing unit, network interface card, device, and storage medium
WO2026046003A1
