Descriptor queue and memory optimization method, system and application for network storage service

By combining the descriptor queue of the network card and the memory and using DMA for zero-copy data transmission, the problem of high CPU overhead in network storage technology is solved and the performance and efficiency of the network storage business are improved.

CN113535395BActive Publication Date: 2024-09-06XIDIAN UNIV
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202110793832.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-14
Publication Date
2024-09-06
Estimated Expiration
2041-07-14

AI Technical Summary

Technical Problem

In existing network storage technology, the separation of network transmission and storage services results in high CPU overhead, inter-process communication and data copying increase waiting time, and the maximum efficiency cannot be achieved.

Method used

Combine the send descriptor queue of the network card with the read descriptor queue of the memory, and combine the receive descriptor queue of the network card with the write descriptor queue of the memory to perform zero-copy data transmission through DMA to reduce CPU overhead.

Benefits of technology

It improves the service performance of the network storage business, reduces the CPU load, and provides stronger network storage business capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113535395B
    Figure CN113535395B
Patent Text Reader

Abstract

The present invention belongs to the field of network storage technology, and discloses a descriptor queue and memory optimization method, system and application of a network storage service. The descriptor queue and memory optimization method of the network storage service include: in the network data reading direction: combining the sending descriptor queue of the network card with the reading descriptor queue of the memory; in the network data storage direction: combining the receiving descriptor queue of the network card with the writing descriptor queue of the memory. The present invention uses the memory Buffer in the system as an intermediate container and uses bidirectional DMA to complete the zero-copy data transmission of the CPU; the network card and the memory share the descriptor ring queue, and use the descriptor to transmit status information and control instructions, reducing the CPU overhead, making it particularly suitable for high-performance network storage service scenarios. The present invention improves the service performance of the network storage service, reduces the CPU load, and provides stronger network storage service capabilities on CPUs with the same processing power.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of network storage, and in particular relates to a descriptor queue and memory optimization method, system and application of a network storage service. Background Art

[0002] Nowadays, with the widespread use of Ethernet, network file transmission and storage is a very common service. Ordinary servers divide network transmission and storage into two steps. However, switching between processes will cause more CPU overhead and data copying. Although there are some user-mode drivers designed to reduce data copying, there are still events such as inter-process communication that will increase CPU overhead or waiting time.

[0003] In the existing network card architecture, multi-queue technology and descriptors are mostly used to complete the transmission and sending of data packets, where the queue is a circular buffer with continuous physical addresses in the memory, used to hold descriptors, and the descriptors point to the starting address and length of a real and valid piece of data in the memory. In addition, it also includes the necessary information to instruct the network card to send or receive; in the existing storage device architecture, there are multi-queue storage descriptor queues such as OpenChanel, whose queues are also a circular buffer with continuous physical addresses in the memory, used to hold descriptors, and the descriptors point to the starting address and length of a real and valid piece of data in the memory. In addition, it also contains the necessary information to instruct the storage to read or write.

[0004] However, the queue structure of existing network transmission is similar to that of storage, but it is not combined with applications, and cannot achieve maximum efficiency when facing network storage services. At the same time, after the existing technology separates the network service from the storage service, at least two threads are required for data processing, which easily leads to more inter-process notification events and waiting time, increasing CPU overhead. Therefore, a new descriptor queue and memory optimization method for network storage services is urgently needed to make up for the defects of the existing technology.

[0005] Through the above analysis, the problems and defects of the prior art are as follows:

[0006] (1) The existing network transmission queue structure is similar to that of storage, but it is not combined with applications. It cannot achieve maximum efficiency when facing network storage services. The network transmission control system and the storage control system belong to different subsystems and require inter-thread communication, resulting in large CPU overhead. In addition, data copying is also involved in some scenarios.

[0007] (2) After separating the network service from the storage service, at least two threads are required for data processing, which easily leads to more inter-process notification events and waiting time, increasing CPU overhead.

[0008] The difficulty of solving the above problems and defects is: the new method needs to integrate the network service descriptor queue and the storage service descriptor queue, and try to use hardware to complete the modulation and demodulation of the descriptor to reduce CPU overhead.

[0009] The significance of solving the above problems and defects is that the present invention improves the service performance of network storage services, reduces CPU load, and can provide stronger network storage service capabilities on a CPU with the same processing power. Summary of the invention

[0010] In view of the problems existing in the prior art, the present invention provides a descriptor queue and memory optimization method, system and application for a network storage service.

[0011] The present invention is implemented as follows: a descriptor queue and memory optimization method for a network storage service, the descriptor queue and memory optimization method for the network storage service comprising: in the network data reading direction: combining the sending descriptor queue of the network card with the reading descriptor queue of the memory; in the network data storage direction: combining the receiving descriptor queue of the network card with the writing descriptor queue of the memory.

[0012] Further, in the network data reading direction, the descriptor queue and memory optimization method of the network storage service includes:

[0013] (1) The host creates a descriptor ring buffer and uses descriptors to fill the descriptor buffer. The descriptors point to the memory space allocated on the main memory for use as a data buffer. The host notifies the address of the descriptor ring buffer to the read channel of the memory device and the send channel of the network card device at the same time. That is, the read channel of the memory device and the send channel of the network card device share a descriptor ring buffer.

[0014] (2) The host notifies the memory device of the available descriptors through the configuration register. The memory device checks the number of available descriptors and moves the descriptors from the descriptor ring queue to the memory device through DMA. The memory device extracts the address and length information of the buffer contained in the descriptor and the address information of the data to be read on the memory, and uses DMA to move the data to the buffer in the memory.

[0015] (3) The memory device writes the execution status of the data movement back to the status field of the corresponding descriptor in the descriptor queue, and notifies the network card in a point-to-point P2P operation that a new descriptor is available in the send descriptor ring buffer.

[0016] (4) The network card device checks the number of available send descriptors and reads the descriptor ring buffer; parses the descriptor and extracts the buffer address, length and status information of the memory device moving data in the descriptor, and uses DMA to read data from the main memory buffer. Finally, the data is sent through the network.

[0017] Through these steps, the present invention offloads part of the work originally done on the CPU to the hardware for execution, that is, the control plane is left to be executed on the CPU, while the data plane is offloaded to the hardware DMA for execution.

[0018] Furthermore, in step (1), the memory device refers to an SSD or other non-volatile storage device rather than a main memory.

[0019] Furthermore, in step (1), the descriptor includes three parts: a memory file handle to be read, a pointer to a main memory buffer, and a memory execution status.

[0020] The descriptor ring buffer is managed in the form of multiple queues and supports the transmission of control information through a shared buffer of a read channel of a storage device and a send channel of a network card, including:

[0021] The driver is responsible for maintaining the producer pointer of the descriptor buffer, while the memory maintains the consumer pointer as a user. After the driver generates a new read request, it modulates the descriptor into the descriptor ring buffer and updates the producer pointer. After the memory checks that the producer pointer is updated, it reads and processes the corresponding descriptor, and after processing, it updates the status information to the corresponding descriptor, and uses hardware to update the consumer pointer of the network card so that the descriptor is processed by the network card.

[0022] Further, in the network data storage direction, the descriptor queue and memory optimization method of the network storage service includes:

[0023] (1) The host creates a descriptor ring buffer and uses descriptors to fill the descriptor buffer. The descriptors point to the memory space allocated on the main memory for use as a data buffer. The host notifies the address of the descriptor ring buffer to the receiving channel of the network card device and the storage channel of the memory device at the same time. That is, the storage channel of the memory device and the receiving channel of the network card device share a descriptor ring buffer.

[0024] (2) The network card pre-reads the descriptor to the network card's receiving channel and extracts the buffer address and length information contained in the descriptor, as well as the address information of the data to be stored in the memory, and then waits for the reception of the storage service. When the storage service data is received from the remote end, the data is moved to the buffer pointed to by the descriptor in DMA mode.

[0025] (3) The network card device writes the network data reception information and data movement status back to the status field of the descriptor, and notifies the storage device of the existence of an available descriptor in a P2P manner.

[0026] (4) After the memory device reads the available descriptors and parses them in order, it uses DMA to move the data from the Buffer to the memory device and store it.

[0027] Network storage applications are divided into two directions. The present invention uses this mechanism in both directions, which are relatively similar, but the data flow directions are opposite.

[0028] Furthermore, in step (1), the descriptor includes three parts: a memory file handle to be stored, a pointer to a main memory buffer, and a network card execution status.

[0029] The descriptor ring buffer is managed in the form of a queue and supports transmitting control information through a shared buffer of a storage channel of a storage device and a receiving channel of a network card, including:

[0030] The driver is responsible for maintaining the producer pointer of the descriptor buffer, while the network card maintains the consumer pointer as a user. Every time the driver generates a new storage request, it modulates it into a descriptor, places it into the descriptor ring buffer and updates the producer pointer. After the network card device detects the update of the producer pointer, it reads and processes the corresponding descriptor, and after the processing is completed, it updates the status information to the corresponding descriptor, and uses hardware to update the consumer pointer of the memory so that the descriptor is processed by the memory.

[0031] Another object of the present invention is to provide a control method for network storage service optimization system memory reading and writing that implements the descriptor queue and memory optimization method of the network storage service, and the control method for network storage service optimization system memory reading and writing comprises:

[0032] (1) Memory pool creation: This mechanism is executed only once when the system is initialized. It is used to create a number of memory blocks that is consistent with the number of descriptors. The memory blocks are used to bind one-to-one with the descriptors in the descriptor queue. That is, the physical address in the descriptor points to the corresponding memory block, and the status information in the descriptor indicates the filling information of the data in the memory block.

[0033] (2) Memory pool recycling: Since the descriptor queue is a circular queue, the address of the descriptor will be cyclically filled with data and read from the descriptor. The descriptor contains information about the real data, namely the address and status of the buffer. Therefore, the buffer is also recycled and used as an intermediate container to move data from the network card and the memory.

[0034] (3) Memory pool recycling: When the system is shut down or the memory service is shut down, the system memory is released by recycling the buffer pointed to by the descriptor.

[0035] Another object of the present invention is to provide a descriptor queue and memory optimization system for a network storage service applying the descriptor queue and memory optimization method for the network storage service, the descriptor queue and memory optimization system for the network storage service comprising:

[0036] The network data reading module is used to combine the sending descriptor queue of the network card with the reading descriptor queue of the memory in the network data reading direction;

[0037] The network data storage module is used to combine the receiving descriptor queue of the network card with the writing descriptor queue of the memory in the network data storage direction.

[0038] Another object of the present invention is to provide a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and when the computer program is executed by the processor, the processor performs the following steps:

[0039] In the network data reading direction: combine the network card's send descriptor queue with the memory's read descriptor queue; in the network data storage direction: combine the network card's receive descriptor queue with the memory's write descriptor queue.

[0040] Another object of the present invention is to provide an information data processing terminal, which is used to implement the descriptor queue and memory optimization system of the network storage service.

[0041] In combination with all the above technical solutions, the advantages and positive effects of the present invention are as follows: the descriptor queue and memory optimization method for the network storage service provided by the present invention use the memory Buffer in the system as an intermediate container and use bidirectional DMA to complete the zero-copy data transmission of the CPU; the network card and the memory share the descriptor ring queue, and use the descriptor to transmit status information and control instructions, which further reduces the CPU overhead, making it particularly suitable for high-performance network storage service scenarios.

[0042] The present invention further reduces the system memory creation and recovery overhead brought by the network storage service during operation through the creation, recycling and recovery mechanism of the memory pool, so that the memory overhead that previously required multiple creation and recovery is reduced to once. The present invention improves the service performance of the network storage service, reduces the CPU load, and can provide stronger network storage service capabilities on CPUs with the same processing power. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0044] Figure 1 It is a flow chart of a descriptor queue and memory optimization method for a network storage service provided by an embodiment of the present invention.

[0045] Figure 2 It is a schematic diagram of a descriptor and a queue buffer in a network data reading direction provided by an embodiment of the present invention.

[0046] Figure 3 It is a schematic diagram of a descriptor and a queue buffer in a network data storage direction provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0048] In view of the problems existing in the prior art, the present invention provides a descriptor queue and memory optimization method, system and application for a network storage service. The present invention is described in detail below in conjunction with the accompanying drawings.

[0049] like Figure 1 As shown, the descriptor queue and memory optimization method for the network storage service provided by the embodiment of the present invention includes the following steps:

[0050] S101, in the network data reading direction: combining the sending descriptor queue of the network card with the reading descriptor queue of the memory;

[0051] S102, in the network data storage direction: combining the receiving descriptor queue of the network card with the writing descriptor queue of the memory.

[0052] The descriptor queue and memory optimization system for network storage services provided by the embodiment of the present invention includes:

[0053] The network data reading module is used to combine the sending descriptor queue of the network card with the reading descriptor queue of the memory in the network data reading direction;

[0054] The network data storage module is used to combine the receiving descriptor queue of the network card with the writing descriptor queue of the memory in the network data storage direction.

[0055] The technical solution of the present invention is further described below in conjunction with specific embodiments.

[0056] Example 1

[0057] In view of the problems existing in the prior art, the present invention provides a method for combining network transmission services with storage services to optimize network storage services, and specifically relates to an optimization method for descriptor queues in network storage services.

[0058] The present invention is a method for optimizing a descriptor queue for a network storage service, comprising:

[0059] In the network data reading direction: combine the network card's send descriptor queue with the memory's read descriptor queue; in the network data storage direction: combine the network card's receive descriptor queue with the memory's write descriptor queue.

[0060] In the network data reading direction:

[0061] In the first step, the host creates a descriptor ring buffer and fills the descriptor buffer with descriptors. These descriptors point to the memory space allocated on the main memory as a data buffer. The host notifies the address of the descriptor ring buffer to the read channel of the storage device (the storage device in the present invention refers to SSD or other non-volatile storage devices rather than the main memory) and the sending channel of the network card device at the same time, that is, the read channel of the storage device and the sending channel of the network card device share a descriptor ring buffer.

[0062] In the second step, the host notifies the memory device of the available descriptors through the configuration register. The storage device checks the number of available descriptors and moves the descriptors from the descriptor ring queue to the memory device through DMA. The memory device then extracts the buffer address and length information contained in the descriptor, as well as the address information of the data to be read on the memory, and then uses DMA to move the data to the buffer in the memory.

[0063] In the third step, the memory device writes the execution status of the data movement back to the status field of the corresponding descriptor in the descriptor queue, and notifies the network card in a P2P (point-to-point) operation mode that a new descriptor is available in the send descriptor ring buffer.

[0064] In the fourth step, the network card device checks the number of available send descriptors and reads the descriptor ring buffer. It then parses the descriptor and extracts the buffer address, length and status information of the memory device moving data in the descriptor, and uses DMA to read data from the main memory buffer. Finally, the data is sent through the network.

[0065] Furthermore, the descriptor ring buffer is managed in the form of multiple queues and supports transmitting control information through a shared buffer of a read channel of a storage device and a send channel of a network card. The specific implementation includes:

[0066] The driver is responsible for maintaining the producer pointer of the descriptor buffer, while the memory maintains the consumer pointer as a user. After the driver generates a new read request, it modulates it into a descriptor and places it into the descriptor ring buffer and updates the producer pointer. After the memory checks that the producer pointer is updated, it reads and processes the corresponding descriptor, and updates the status information to the corresponding descriptor after the processing is completed. Subsequently, the hardware is used to update the consumer pointer of the network card so that the descriptor is processed by the network card.

[0067] The above descriptor contains three parts: the memory file handle to be read, the pointer to the main memory buffer, and the memory execution status. Figure 2 .

[0068] In the network data storage direction:

[0069] In the first step, the host creates a descriptor ring buffer and fills it with descriptors. These descriptors point to the memory space allocated on the main memory as a data buffer. The host notifies the address of the descriptor ring buffer to the receiving channel of the network card device and the storage channel of the memory device at the same time. That is, the storage channel of the memory device and the receiving channel of the network card device share a descriptor ring buffer.

[0070] In the second step, the network card pre-reads the descriptor to the network card's receiving channel and extracts the buffer address and length information contained in the descriptor, as well as the address information of the data to be stored in the memory, and then waits for the reception of the storage service. When the storage service data is received from the remote end, the data is moved to the buffer pointed to by the descriptor in DMA mode.

[0071] In the third step, the network card device writes the network data reception information and data transfer status back to the status field of the descriptor, and notifies the storage device of the existence of an available descriptor in a P2P manner.

[0072] In the fourth step, the memory device reads the available descriptors and parses them in order, and then uses DMA to move the data from the Buffer buffer to the memory device and store it.

[0073] Furthermore, the descriptor ring buffer is managed in the form of a queue and supports transmitting control information through a shared buffer of a storage channel of a storage device and a receiving channel of a network card. The specific implementation includes:

[0074] The driver is responsible for maintaining the producer pointer of the descriptor buffer, while the network card, as a user, maintains the consumer pointer. Every time the driver generates a new storage request, it modulates it into a descriptor and places it into the descriptor ring buffer and updates the producer pointer. After the network card device detects the update of the producer pointer, it reads and processes the corresponding descriptor, and updates the status information to the corresponding descriptor after the processing is completed. Subsequently, the consumer pointer of the memory is updated using hardware so that the descriptor is processed by the memory.

[0075] The above descriptor contains three parts: the file handle of the memory to be stored, the pointer to the main memory buffer and the network card execution status. Figure 3 .

[0076] Another object of the present invention is to provide a control method for optimizing system memory reading and writing for network storage services by implementing the optimization method, comprising:

[0077] Memory pool creation: This mechanism is only executed once when the system is initialized. It is used to create a number of memory blocks that is consistent with the number of descriptors. These memory blocks are used to bind one-to-one with the descriptors in the descriptor queue. That is, the physical address in the descriptor points to the corresponding memory block, and the status information in the descriptor indicates the filling information of the data in the memory block.

[0078] Memory pool recycling: Since the descriptor queue is a circular queue, the address of the descriptor will be cyclically filled with data and read from the descriptor. These descriptors contain information about the real data, that is, the address and status of the Buffer. Therefore, the Buffer is also recycled as an intermediate container to move data from the network card and storage.

[0079] Memory pool recycling: When the system is shut down or the storage service is shut down, the system memory is released by recycling the buffer pointed to by the descriptor.

[0080] Example 2

[0081] Taking the network monitoring service as an example, the server needs to continuously receive video data from the network camera and store it in the local memory. The video data is accessed from the remote network to the server and stored. The optimization of the network storage of the present invention includes:

[0082] S101, when the system is initialized, a storage descriptor circular queue is allocated, and the descriptor queue is shared by the network card and the memory device, so that the network card can transmit status information and control instructions to the memory device;

[0083] S102, when the system is initialized, a memory pool is allocated and filled into the address of the corresponding descriptor ring queue, so that these memories are used as intermediate containers to move data from the network card to the storage.

[0084] The step S101 specifically includes:

[0085] Step 1: The host allocates a memory block with continuous physical addresses in the memory as a descriptor ring buffer. This ring buffer can have multiple uses for multi-channel devices on the corresponding hardware. After the initialization of the memory block operation is completed, the host configures the base address and length of the memory buffer area to the registers of the network card and storage device to inform them of the descriptor ring buffer information.

[0086] Step 2: When the network camera is connected to the server, it will send data frames to the server at regular intervals. At this time, the host needs to store the network data.

[0087] Step 3: The host allocates a file handle to the storage device, that is, obtains the write address of the storage device, and then fills the information and control information into the descriptor, and notifies the network card that a new descriptor is available by updating the producer pointer.

[0088] Step 4: The network card reads the descriptor through DMA and parses the available buffer address. After receiving the data, it can use DMA to move the data to the buffer and notify the storage device in P2P mode that the buffer has data.

[0089] Step 5: The memory obtains the descriptor from the corresponding descriptor queue, parses its status information and control instructions, and then moves the data from the buffer to the memory, and then writes the status back to the descriptor for the host to use cyclically.

[0090] The step S102 specifically includes:

[0091] Step 1: When the host allocates the descriptor buffer size in the memory, it allocates the number of descriptors N that can be accommodated in a queue. Then the host needs to allocate N data buffers, which are bound to the descriptors one by one.

[0092] Step 2: The host fills the physical address and length of each buffer into the corresponding position of the descriptor. After that, the buffer can be recycled as the status information in the descriptor changes.

[0093] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When the use is implemented in whole or in part in the form of a computer program product, the computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL) or wireless (e.g., infrared, wireless, microwave, etc.) mode) to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk SolidState Disk (SSD)), etc.

[0094] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.

Claims

1. A descriptor queue and memory optimization method for a network storage service, characterized in that: The descriptor queue and memory optimization method of the network storage service in the network data reading direction: combining the sending descriptor queue of the network card with the reading descriptor queue of the memory; In the direction of network data storage: combine the receive descriptor queue of the network card with the write descriptor queue of the memory; In the network data reading direction, the descriptor queue and memory optimization method of the network storage service include: (1) The host creates a descriptor ring buffer and fills the descriptor buffer with descriptors. The descriptors point to the memory space allocated on the main memory for use as a data buffer. The host notifies the address of the descriptor ring buffer to the read channel of the memory device and the send channel of the network card device at the same time. That is, the read channel of the memory device and the send channel of the network card device share a descriptor ring buffer. (2) The host notifies the memory device of the available descriptors through the configuration register. The memory device checks the number of available descriptors and moves the descriptors from the descriptor ring queue to the memory device through DMA. The memory device extracts the address and length information of the buffer contained in the descriptor and the address information of the data to be read on the memory, and uses DMA to move the data to the buffer in the memory. (3) The memory device writes the execution status of the data move back to the status field of the corresponding descriptor in the descriptor queue, and notifies the network card that a new descriptor is available in the send descriptor ring buffer in a point-to-point P2P operation; (4) The network card device checks the number of available send descriptors and reads the descriptor ring buffer; parses the descriptor and extracts the buffer address, length and data transfer status information of the memory device in the descriptor, and uses DMA to read data from the main memory buffer. Finally, the data is sent through the network; In the network data storage direction, the descriptor queue and memory optimization method of the network storage service include: (1) The host creates a descriptor ring buffer and fills the descriptor buffer with descriptors. The descriptors point to the memory space allocated on the main memory for use as a data buffer. The host notifies the address of the descriptor ring buffer to the receiving channel of the network card device and the storage channel of the memory device at the same time. That is, the storage channel of the memory device and the receiving channel of the network card device share a descriptor ring buffer. (2) The network card pre-reads the descriptor to the network card's receiving channel and extracts the buffer address and length information contained in the descriptor, as well as the address information of the data to be stored in the memory, and then waits for the reception of the storage service. When the storage service data is received from the remote end, the data is moved to the buffer pointed to by the descriptor in DMA mode; (3) The network card device writes the network data reception information and data movement status back to the status field of the descriptor, and notifies the storage device of the existence of an available descriptor through P2P; (4) After the memory device reads the available descriptors and parses them in sequence, it uses DMA to move the data from the Buffer buffer to the memory device and store it.

2. The descriptor queue and memory optimization method for network storage services as claimed in claim 1, characterized in that: In step (1), the memory device refers to an SSD or other non-volatile storage device rather than a main memory.

3. The descriptor queue and memory optimization method for network storage services as claimed in claim 1, characterized in that: In step (1), the descriptor includes three parts: a memory file handle to be read, a pointer to the main memory buffer, and a memory execution status; The descriptor ring buffer is managed in the form of multiple queues and supports the transmission of control information through a shared buffer of a read channel of a storage device and a send channel of a network card, including: The driver is responsible for maintaining the producer pointer of the descriptor buffer, while the memory maintains the consumer pointer as a user. After the driver generates a new read request, it modulates the descriptor into the descriptor ring buffer and updates the producer pointer. After the memory checks that the producer pointer is updated, it reads and processes the corresponding descriptor, and after processing, it updates the status information to the corresponding descriptor, and uses hardware to update the consumer pointer of the network card so that the descriptor is processed by the network card.

4. The descriptor queue and memory optimization method for network storage services as claimed in claim 1, characterized in that: In step (1), the descriptor includes three parts: a memory file handle to be stored, a pointer to the main memory buffer, and the network card execution status; The descriptor ring buffer is managed in the form of a queue and supports transmitting control information through a shared buffer of a storage channel of a storage device and a receiving channel of a network card, including: The driver is responsible for maintaining the producer pointer of the descriptor buffer, while the network card maintains the consumer pointer as a user. Every time the driver generates a new storage request, it modulates it into a descriptor, places it into the descriptor ring buffer and updates the producer pointer. After the network card device detects the update of the producer pointer, it reads and processes the corresponding descriptor, and after the processing is completed, it updates the status information to the corresponding descriptor, and uses hardware to update the consumer pointer of the memory so that the descriptor is processed by the memory.

5. A control method for optimizing system memory reading and writing for network storage services by implementing the descriptor queue and memory optimization method for network storage services as claimed in any one of claims 1 to 4, characterized in that: The control method for optimizing system memory reading and writing for network storage services includes: (1) Memory pool creation: This mechanism is executed only once when the system is initialized. It is used to create a number of memory blocks that is consistent with the number of descriptors. The memory blocks are used to bind one-to-one with the descriptors in the descriptor queue. That is, the physical address in the descriptor points to the corresponding memory block, and the status information in the descriptor indicates the filling information of the data in the memory block. (2) Memory pool recycling: Since the descriptor queue is a circular queue, the address of the descriptor will be cyclically filled with data and read from the descriptor. The descriptor contains the information of the real data, that is, the address and status of the buffer. Therefore, the buffer is also recycled and used as an intermediate container to move data from the network card and the memory. (3) Memory pool recycling: When the system is shut down or the memory service is shut down, the system memory is released by recycling the buffer pointed to by the descriptor.

6. A descriptor queue and memory optimization system for a network storage service implementing the descriptor queue and memory optimization method for a network storage service according to any one of claims 1 to 4, characterized in that: The descriptor queue and memory optimization system of the network storage service includes: The network data reading module is used to combine the sending descriptor queue of the network card with the reading descriptor queue of the memory in the network data reading direction; The network data storage module is used to combine the receiving descriptor queue of the network card with the writing descriptor queue of the memory in the network data storage direction.

7. An information data processing terminal, characterized in that: The information data processing terminal is used to implement the descriptor queue and memory optimization system of the network storage service as described in claim 6.

8. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the descriptor queue and memory optimization method for the network storage service as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Submission method of descriptor of network interface card (NIC) based on mixing of PIO (process input output) and DMA (direct memory access)

    CN103150278A

  • Method and system for capturing network data

    CN104506379A

  • A message forwarding method and network equipment

    CN109783250A

  • Data transmission device and data transmission system

    CN113079113A

  • DMA descriptor queue read and cache write pointer arrangement

    US20060288129A1