A queue page table management method and device based on remote direct memory access
By executing a queue page table management method based on remote direct memory access on the RDMA network card, the problem of large page table access overhead in RDMA queue access is solved, and efficient queue page table management is realized, reducing access latency and storage overhead.
Patent Information
- Application Number
- CN202311641570.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-01
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2043-12-01
AI Technical Summary
During the existing remote direct memory access (RDMA) queue access, page table access overhead is high, resulting in performance bottlenecks.
By executing a queue page table management method based on remote direct memory access on the RDMA network card, the user state driver allocates the queue buffer in the user state and creates a queue. The kernel state driver obtains the physical page link list, allocates the queue page table, and writes the page table information to the queue register to set the initial value.
This method can efficiently store and manage queue page tables, significantly reducing access latency and storage overhead of RDMA queue page tables.
Smart Images

Figure CN117873921B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network communication technology, and in particular to a queue page table management method and device based on remote direct memory access. Background Art
[0002] Remote Direct Memory Access (RDMA) is a high-performance network technology. The RoCEv2 RDMA network card implements zero-copy, operating system kernel bypass network transmission services by hardware offloading the InfiniBand transport layer, effectively reducing the server CPU occupancy rate during network data transmission. The InfibiBand transport layer uses queues as the interface for software and hardware interaction. The queues involved include the send queue (SQ), receive queue (RQ), shared receive queue (SRQ) and completion queue (CQ). Queues are generally stored in the server memory. The RDMA network card user state driver allocates queue storage space with continuous virtual address space and physical page alignment in the user process address space. In modern Linux operating systems, when an RDMA queue occupies more than one physical page, it is usually manifested as a discontinuous physical page. The RDMA network card reads the RDMA queue through the PCIe (Peripheral Component Interconnect Express) bus in a direct memory access (DMA) manner. DMA cannot directly use the virtual address of the user process and needs to use the DMA address uniformly allocated by the operating system kernel to access the memory.
[0003] Existing technologies such as Figure 1 As shown, the RDMA kernel-mode driver obtains the DMA address of the corresponding storage space and stores it in units of pages ( Figure 1 The mapping relationship between the queue storage space virtual address and the DMA address is organized in a multi-level page table, and the page table information is synchronized to the RDMA network card. The queue page table information is generally stored in the server main memory. When the RDMA network card accesses the queue, it needs to first obtain the corresponding queue DMA address based on the queue virtual address to be accessed and the queue page table base address.
[0004] For ease of understanding, an example is given: assuming that the physical page size of the operating system is a typical value of 4KB, the storage size of each queue page table entry is 8B, and the typical queue access basic block size is 64B. If the queue storage space size is less than or equal to 4KB, the page table level is one, and the page table includes only one page table entry. The page table entry can be directly synchronized to the queue information storage space on the RDAM network card. During the queue access process, there is no need to initiate DMA to read the queue page table through the PCIe bus. If the queue storage space size is greater than 4KB and less than or equal to 2MB, the page table level is two, the first-level page table stores the DMA base address of the second-level page table, and the second-level page table stores the queue page table entries. The size of the second-level queue page table is 4KB, which cannot be directly synchronized to the limited RDMA network card queue information storage space. Therefore, during the queue access process, every time 64 queue basic blocks are accessed, a DMA is initiated through the PCIe bus to read the next queue page table entry; if the queue storage space size is greater than 2MB and less than or equal to 1GB, the page table level is three, the first-level page table stores the DMA base address of the second-level page table, and the second-level page table stores the DMA base address of the third-level page table. During the queue access process, every time 64 queues are accessed, a second DMA is initiated through the PCIe bus to read the next queue page table entry. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a queue page table management method and device based on remote direct memory access to eliminate or improve one or more defects existing in the prior art and solve the problem of high page table access overhead during the existing remote direct memory access queue access process.
[0006] On the one hand, the present invention provides a queue page table management method based on remote direct memory access, the method is executed on a remote direct memory access network card, and comprises the following steps:
[0007] The remote direct memory access user state driver allocates a queue buffer in the user state and creates a queue; the remote direct memory access user state driver initiates a registration request for the queue to the kernel state driver based on a preset function;
[0008] The remote direct memory access kernel state driver obtains the physical page linked list allocated to the queue from the operating system kernel, and allocates a section of memory for the queue as a queue page table;
[0009] The remote direct memory access kernel-mode driver traverses each item in the physical page linked list, and writes each item of information into the queue page table in sequence;
[0010] The remote direct memory access kernel mode driver writes the base address of the queue page table into the queue register, writes the queue page table pointer into the queue register, and sets an initial value.
[0011] In some embodiments of the present invention, the queue page table management method based on remote direct memory access further includes:
[0012] The remote direct memory access kernel mode driver allocates a continuous and physically page-aligned memory segment for the queue as a queue page table.
[0013] In some embodiments of the present invention, the remote direct memory access kernel-mode driver traverses each item in the physical page linked list and writes each item of information into the queue page table in sequence, further comprising:
[0014] Each entry in the queue page table is 8 bytes, the lower 12 bits are the number of physical pages mapped by the entry, and the upper 52 bits are the upper 52 bits of the initial physical page address corresponding to the entry;
[0015] If the entries of the physical page linked list map more than 4096 physical pages, they are split into multiple queue page table entries for storage.
[0016] In some embodiments of the present invention, the queue page table management method based on remote direct memory access further includes:
[0017] The remote direct memory access kernel mode driver writes the base address of the queue page table and the queue page table pointer into the queue register based on the PCIe protocol standard.
[0018] In some embodiments of the present invention, after the remote direct memory access kernel mode driver writes the base address of the queue page table into the queue register, writes the queue page table pointer into the queue register, and sets the initial value, the method further includes:
[0019] The remote direct memory access kernel state driver returns queue creation completion information to the remote direct memory access user state driver;
[0020] The remote direct memory access user mode driver receives the queue creation completion information, and the queue creation process ends.
[0021] In some embodiments of the present invention, after the queue is created, the method further includes:
[0022] The remote direct memory access kernel mode driver determines the number of queue page table entries;
[0023] If it is greater than or equal to two items, the first item and the second item of the queue page table are written into the first cache item and the second cache item of the queue register in sequence, and the initial values of the first cache item and the second cache item are modified; if it is less than two items, the item is written into the first cache item, and the initial value of the first cache item is modified;
[0024] The remote direct memory access kernel mode driver sets the initial value of the queue register cache item pointer.
[0025] In some embodiments of the present invention, when the current cache item pointer points to the first cache item and the queue page table items are greater than or equal to two items, when the remote direct memory access network card accesses the queue, the method further includes:
[0026] The remote direct memory access network card initiates a direct memory access read queue basic block based on the physical address of the first cache item;
[0027] Determine the remaining length of the physical page mapped by the first cache item; if the remaining length is a queue basic block, the remote direct memory access network card initiates a queue page table item prefetch request; and check the valid bit of the second cache item, if the valid bit is valid, point the current cache item pointer to the second cache item, and initialize the remaining length.
[0028] In some embodiments of the present invention, if the remaining length is a queue basic block, the remote direct memory access network card initiates a queue page table entry prefetch request, further comprising:
[0029] Initiate a queue page table entry prefetch request based on the current cache entry pointer to read the next page table entry;
[0030] A pre-fetched page table entry obtained based on the queue page table entry pre-fetch request is returned, and the pre-fetched page table entry is used to replace the consumed page table entry.
[0031] On the other hand, the present invention provides a queue page table management device based on remote direct memory access, the device is applied to a remote direct memory access network card, and the device includes:
[0032] The queue access module is used to implement the read and write functions of each queue;
[0033] A queue information storage module, used to store a base address of a queue page table, a queue page table pointer, a valid bit value of a first cache item, a valid bit value of a second cache item, and a cache item pointer;
[0034] The page table entry cache maintenance module is used to receive and execute the queue page table entry pre-fetch request initiated by the queue access module.
[0035] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the methods mentioned above.
[0036] The beneficial effects of the present invention are at least:
[0037] The present invention provides a queue page table management method and device based on remote direct memory access, including: the remote direct memory access user state driver allocates a queue buffer in the user state and creates a queue; the remote direct memory access user state driver initiates a queue registration request to the kernel state based on a preset function; the remote direct memory access kernel state driver obtains the physical page list allocated to the queue from the operating system kernel, and allocates memory for the queue as a queue page table; the remote direct memory access kernel state driver traverses each item in the physical page list, and writes each item of information into the queue page table in sequence; the remote direct memory access kernel state driver writes the base address of the queue page table into the queue register, writes the queue page table pointer into the queue register, and sets an initial value. The method provided by the present invention can efficiently and conveniently store and manage the queue page table, greatly reducing the access delay and storage overhead of the remote direct memory access queue page table.
[0038] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.
[0039] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:
[0041] Figure 1 The figure is a schematic diagram of queue page table mapping in units of pages in the prior art according to an embodiment of the present invention.
[0042] Figure 2 The figure is a schematic diagram of the steps of a queue page table management method based on remote direct memory access in one embodiment of the present invention.
[0043] Figure 3 It is a schematic diagram of a queue page table storage mechanism based on continuous pages in a queue page table management method based on remote direct memory access in one embodiment of the present invention.
[0044] Figure 4 The figure is a schematic diagram of the process of initializing queue page table entries based on ping-pong cache in one embodiment of the present invention.
[0045] Figure 5 The figure is a schematic diagram of a queue page table entry maintenance process based on ping-pong cache in one embodiment of the present invention.
[0046] Figure 6 The figure is a schematic diagram of a queue page table entry pre-fetching process based on ping-pong cache in one embodiment of the present invention.
[0047] Figure 7 It is a schematic diagram of the structure of a queue page table management device based on remote direct memory access in one embodiment of the present invention. DETAILED DESCRIPTION
[0048] 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 and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0049] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.
[0050] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.
[0051] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.
[0052] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
[0053] It should be emphasized here that the step marks mentioned below are not intended to limit the order of the steps, but it should be understood that the steps can be executed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be executed simultaneously.
[0054] In order to solve the problem of high page table access overhead in the existing remote direct memory access queue access process, the present invention proposes a queue page table management method based on remote direct memory access, which is executed on a remote direct memory access RDMA network card, such as Figure 2 As shown, the method includes the following steps S101 to S104:
[0055] Step S101: the remote direct memory access user state driver allocates a queue buffer in the user state and creates a queue; the remote direct memory access user state driver initiates a queue registration request to the kernel state driver based on a preset function.
[0056] Step S102: the remote direct memory access kernel-mode driver obtains the physical page linked list allocated to the queue from the operating system kernel, and allocates a section of memory for the queue as a queue page table.
[0057] Step S103: the remote direct memory access kernel-mode driver traverses each item in the physical page linked list, and writes each item of information into the queue page table in sequence.
[0058] Step S104: the remote direct memory access kernel mode driver writes the base address of the queue page table into the queue register, writes the queue page table pointer into the queue register, and sets an initial value.
[0059] In step S101, the remote direct memory access user state driver allocates memory space in the user state as a queue buffer for storing queue data, control information, etc., and creates a queue. When creating a queue, the size of the queue and other related parameters can be specified.
[0060] The remote direct memory access user-mode driver calls the preset function provided by the remote direct memory access kernel-mode driver and initiates a queue registration request to the kernel-mode driver. The kernel-mode driver allocates resources for the queue and initializes it according to the parameters passed by the user-mode driver.
[0061] In step S102, the remote direct memory access kernel state driver obtains the physical page list Scatter List of the queue through the interface provided by the operating system kernel. The physical page list contains information about all physical pages related to the queue, exemplarily including information such as the starting address, size and access rights of the physical page, as well as other relevant information such as the memory area to which the physical page belongs and the node where it is located.
[0062] The remote direct memory access kernel-mode driver allocates a section of memory for the queue as a queue page table, wherein the queue page table is an array, and each element (i.e., queue page table entry) corresponds to the address mapping information of a physical page.
[0063] In some embodiments, the remote direct memory access kernel mode driver allocates a continuous and physically page-aligned memory segment for the queue as a queue page table.
[0064] In step S103, the remote direct memory access kernel-mode driver sequentially traverses each item in the physical page linked list, and writes the corresponding physical page address mapping information into the queue page table sequentially.
[0065] In some embodiments, each entry of the queue page table, that is, each queue page table entry contains 8 bytes, wherein the lower 12 bits are the number of physical pages mapped by this entry, and the upper 52 bits are the upper 52 bits of the initial physical page address corresponding to this entry.
[0066] In some embodiments, if the current physical page link table entry maps more than 4096 physical pages, it needs to be split into multiple queue page table entries for storage.
[0067] In step S104, the remote direct memory access kernel-mode driver writes the base address of the queue page table into the queue register used to store the queue information related to the remote direct memory access network card, and also writes the queue page table pointer into the queue register used to store the queue information related to the remote direct memory access network card, and sets the initial value of the queue page table pointer. Exemplarily, the initial value is set to 0.
[0068] In some embodiments, the remote direct memory access kernel mode driver writes the base address of the queue page table and the queue page table pointer into the queue register based on the PCIe protocol standard.
[0069] In some embodiments, after step S104, the following steps are further included:
[0070] After the queue creation process is completed, the remote direct memory access kernel state driver returns the control right to the remote direct memory access user state driver and returns the queue creation completion information to the remote direct memory access user state driver.
[0071] After the remote direct memory access user state driver receives the queue creation completion information returned by the kernel state driver, the queue creation process is completed. At this time, the application can access the queue through the interface provided by the remote direct memory access user state driver to perform operations such as data transmission.
[0072] Based on the above description, compared with the prior art, the method provided by the present invention can use one queue page table entry to map a continuous physical page. To facilitate understanding and reflect the technical effect, an example comparison is given below:
[0073] The existing remote direct memory access queue page table storage mechanism adopts a mapping mechanism based on pages, thereby ensuring that the remote direct memory access network card can query the corresponding page table entry within a constant time complexity.
[0074] For example, the base address of the remote direct memory access queue in the process virtual address space is defined as VA_BASE, the basic block virtual address of the remote direct memory access queue currently to be accessed is VA_CURRENT, the 4KB page offset PAGE_SHIFT is 12, >> represents a logical right shift operation, then the corresponding queue page table entry index PT_IDX = (VA_CURRENT >> PAGE_SHIFT) - VA_BASE >> PAGE_SHIFT, for example Figure 1 The mapping method shown in , according to PT_IDX, can directly locate the corresponding queue page table entry.
[0075] However, when the operating system allocates storage space for remote direct memory access queues, there are multiple physical pages that are continuous, such as Figure 3 As shown, 6 virtual pages correspond to three consecutive physical page blocks, the first block includes 1 physical page, the second block includes 2 physical pages, and the third block includes 3 physical pages. Figure 3 The queue memory distribution shown in the figure uses the existing traditional queue page table storage mechanism, which consumes 6 queue page table entry storage spaces. During the operation of the remote direct memory access network card, a complete access to a queue requires 6 PCIe DMA reads of the queue page table entries.
[0076] If a queue page table entry is used to map a continuous physical page according to the present invention, such as Figure 3 As shown, queue page table entry_0 maps 1 physical page, queue page table entry_1 maps 2 physical pages, and queue page table_2 maps 3 physical pages. That is, using the queue page table management method proposed by the present invention, storage Figure 3 The queue page table information shown only consumes three queue page table entry storage spaces, and a remote direct memory access network card only needs three PCIe DMA reads of the queue page table entries to fully access a queue.
[0077] At the same time, considering that the queue page table management mechanism proposed in the present invention cannot be used to directly determine PT_IDX using the queue basic block VA, therefore, in the present invention, for each queue, a page table item read pointer is maintained, pointing to the next queue page table item to be read, and exemplarily, the initial value is 0, because the remote direct memory access network card strictly accesses the queue in sequence, so each time the page table item read pointer is used to access the queue page table, the queue page table item read pointer is incremented as the next queue page table item pointer to be accessed.
[0078] In some embodiments, based on the queue creation management method of steps S101 to S104, the present invention also proposes a queue page table entry cache and pre-fetch mechanism based on ping-pong cache. Among them, ping-pong operation is a technology commonly used in computer systems to reduce the demand for main memory access and improve the efficiency of data transmission.
[0079] Two queue page table cache items are maintained in the queue information, namely the first cache item (recorded as cache item 0) and the second cache item (recorded as cache item 1). Two valid bits (Valid0 and Valid1) are used to record whether the cache item is valid, and a current cache item pointer (0 / 1) is used to record the currently used cache item identifier, such as Figure 4 As shown, specifically:
[0080] After the queue page table is created based on steps S101 to S104, the remote direct memory access kernel-mode driver determines the number of queue page table entries. If the number is greater than or equal to two, the first item and the second item of the queue page table are written into the first cache item and the second cache item of the queue register in sequence, and the initial values of the first cache item and the second cache item are modified, that is, the first item of the queue page table is written into cache item 0, the second item of the queue page table is written into cache item 1, and Valid0 and Valid1 are initialized to 1; if the number is less than two, the item (the only item) is written into the first cache item, and the initial value of the first cache item is modified, that is, the item is written into cache item 0, and Valid0 is initialized to 1.
[0081] The remote direct memory access kernel-mode driver initializes the cache item pointer of the queue register to 0.
[0082] In some embodiments, remote direct memory access kernel-mode drivers all write information via PCIe.
[0083] Considering that the remote direct memory access network card accesses the queue strictly in sequence, when the remote direct memory access network card accesses the queue for the first time, it does not need to read the queue page table entry through PCIe DMA, and directly uses the first cache entry.
[0084] In some embodiments, the present invention proposes to maintain a variable in the queue information: remaining length. The remaining length is used to record the remaining length of the continuous physical pages mapped by the currently used cache entry, in bytes. Figure 5 As shown, assuming that the current cache item pointer is 0, that is, the current cache item pointer points to the first cache item, and the queue page table items are greater than or equal to two items, specifically:
[0085] The remote direct memory access network card initiates a direct memory access read queue basic block based on the physical address of the first cache item. The remaining length of the physical page mapped by the first cache item is determined; if the remaining length is a queue basic block, the remote direct memory access network card initiates a queue page table item prefetch request; and checks the valid bit of the second cache item. If the valid bit is valid, the current cache item pointer is pointed to the second cache item, and the remaining length is initialized.
[0086] Among them, the remaining length is a queue basic block, which means that the page table entry pointed to by the current cache item pointer is consumed after completing this access. Therefore, after completing the current PCIe DMA access queue request, check the valid bit of another cache page table entry. If the cache page table entry is valid, update the current cache item pointer to point to the cache page table entry, and use the cache page table entry for subsequent access to the queue.
[0087] In some embodiments, based on the above description, if the remaining length is a queue basic block, the remote direct memory access network card initiates a queue page table entry prefetch request, such as Figure 6 As shown, specifically:
[0088] If the page table entry pointed to by the current cache entry pointer is consumed after completing this access, the page table entry prefetch is triggered, and a PCIe DMA request is initiated to pre-read the next page table entry based on the current queue page table pointer. When the pre-fetched page table entry pre-read by the PCIe DMA request is returned, the pre-fetched page table entry is used to replace the consumed page table entry.
[0089] A cache page table entry can support multiple PCIe DMA queue accesses. For example, the queue basic block size is 64 bytes. In the worst case, a page table entry only maps a 4KB physical page, so the physical page mapped by a page table entry can accommodate 64 queue basic blocks. Therefore, a cache page table entry can support 64 queue accesses, requiring 64 PCIe DMA reads, while the prefetching of a cache page table entry only requires 1 PCIe DMA read. Generally, before the current cache page table entry is used up, the page table entry prefetched by PCIe DMA has been returned and the page table entry is updated. In the present invention, in the process of remote direct memory access network card accessing the queue, there must be a currently available cache item, and there will be no situation where waiting for a valid page table item hinders the PCIe DMA read queue. Therefore, it can be considered that the present invention reduces the address translation overhead in the large-scale remote direct memory access queue access process to 0.
[0090] Corresponding to the queue page table management method based on remote direct memory access, the present invention also provides a queue page table management device based on remote direct memory access, such as Figure 7 As shown, the device comprises:
[0091] The queue access module is used to implement the read and write functions of each queue.
[0092] The queue information storage module is used to store the base address of the queue page table, the queue page table pointer, the valid bit value of the first cache item, the valid bit value of the second cache item and the cache item pointer.
[0093] The page table entry cache maintenance module is used to receive and execute the queue page table entry prefetch request initiated by the queue access module.
[0094] In some embodiments, queue access and queue page table access are both implemented through the PCIe bus interface.
[0095] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the queue page table management method based on remote direct memory access are implemented.
[0096] Corresponding to the above method, the present invention also provides a device, which includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, the processor is used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the device implements the steps of the method described above.
[0097] The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned edge computing server deployment method are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.
[0098] In summary, the present invention provides a queue page table management method and device based on remote direct memory access, including: the remote direct memory access user state driver allocates a queue buffer in the user state and creates a queue; the remote direct memory access user state driver initiates a queue registration request to the kernel state driver based on a preset function; the remote direct memory access kernel state driver obtains the physical page list assigned to the queue from the operating system kernel, and allocates memory for the queue as a queue page table; the remote direct memory access kernel state driver traverses each item in the physical page list, and writes each item of information into the queue page table in sequence; the remote direct memory access kernel state driver writes the base address of the queue page table into the queue register, writes the queue page table pointer into the queue register, and sets an initial value. The method provided by the present invention can efficiently and conveniently store and manage the queue page table, greatly reducing the access delay and storage overhead of the remote direct memory access queue page table.
[0099] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0100] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0101] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.
[0102] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A queue page table management method based on remote direct memory access, characterized in that: The method is performed on a remote direct memory access network card and comprises the following steps: The remote direct memory access user state driver allocates a queue buffer in the user state and creates a queue; the remote direct memory access user state driver initiates a registration request for the queue to the kernel state driver based on a preset function; The remote direct memory access kernel state driver obtains the physical page linked list allocated to the queue from the operating system kernel, and allocates a section of memory for the queue as a queue page table; The remote direct memory access kernel-mode driver traverses each item in the physical page linked list, and writes each item of information into the queue page table in sequence; The remote direct memory access kernel mode driver writes the base address of the queue page table into the queue register, writes the queue page table pointer into the queue register, and sets an initial value; The remote direct memory access kernel-mode driver determines the number of queue page table entries; if it is greater than or equal to two, the first item and the second item of the queue page table are written into the first cache item and the second cache item of the queue register in sequence, and the initial values of the first cache item and the second cache item are modified; if it is less than two, the item is written into the first cache item, and the initial value of the first cache item is modified; the remote direct memory access kernel-mode driver sets the initial value of the queue register cache item pointer; When the current cache item pointer points to the first cache item and the queue page table item is greater than or equal to two items, when the remote direct memory access network card accesses the queue, the remote direct memory access network card initiates a direct memory access to read the queue basic block based on the physical address of the first cache item; determines the remaining length of the physical page mapped by the first cache item; if the remaining length is one queue basic block, the remote direct memory access network card initiates a queue page table item prefetch request; and checks the valid bit of the second cache item. If the valid bit is valid, the current cache item pointer is pointed to the second cache item and the remaining length is initialized; if the remaining length is one queue basic block, the remote direct memory access network card initiates a queue page table item prefetch request based on the current cache item pointer to read the next page table item; returns a prefetch page table item obtained based on the queue page table item prefetch request, and uses the prefetch page table item to replace the consumed page table item.
2. The queue page table management method based on remote direct memory access according to claim 1, characterized in that: The method further comprises: The remote direct memory access kernel mode driver allocates a continuous and physically page-aligned memory segment for the queue as a queue page table.
3. The queue page table management method based on remote direct memory access according to claim 1, characterized in that: The remote direct memory access kernel state driver traverses each item in the physical page linked list and writes each item of information into the queue page table in sequence, and further includes: Each entry in the queue page table is 8 bytes, the lower 12 bits are the number of physical pages mapped by the entry, and the upper 52 bits are the upper 52 bits of the initial physical page address corresponding to the entry; If the entries of the physical page linked list map more than 4096 physical pages, they are split into multiple queue page table entries for storage.
4. The queue page table management method based on remote direct memory access according to claim 1, characterized in that: The method further comprises: The remote direct memory access kernel mode driver writes the base address of the queue page table and the queue page table pointer into the queue register based on the PCIe protocol standard.
5. The queue page table management method based on remote direct memory access according to claim 1, characterized in that: After the remote direct memory access kernel mode driver writes the base address of the queue page table into a queue register, writes the queue page table pointer into the queue register, and sets an initial value, the method further includes: The remote direct memory access kernel state driver returns queue creation completion information to the remote direct memory access user state driver; The remote direct memory access user mode driver receives the queue creation completion information, and the queue creation process ends.
6. A queue page table management device based on remote direct memory access, characterized in that: The device is applied to a remote direct memory access network card. When the device is executed, the steps of the queue page table management method based on remote direct memory access according to any one of claims 1 to 5 are implemented. The device includes: Queue access module, used to implement the read and write functions of each queue; A queue information storage module, used to store a base address of a queue page table, a queue page table pointer, a valid bit value of a first cache item, a valid bit value of a second cache item, and a cache item pointer; The page table entry cache maintenance module is used to receive and execute the queue page table entry pre-fetch request initiated by the queue access module.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Method and device for creating security page table and accessing memory
CN114116524A
Data processing method and device, equipment and storage medium
CN115729880A