A method and apparatus for receiving an RDMA request packet

By introducing the SRCQ queue management WQE descriptor into RDMA communication to replace the traditional two-level page table structure, the performance bottleneck caused by multi-level page table lookups in SRQ queue management is solved, achieving more efficient RDMA request message processing and performance improvement.

CN121217669BActive Publication Date: 2026-04-07SHENZHEN JAGUAR MICROSYSTEMS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In existing RDMA communication, the shared receive queue (SRQ) management method leads to bandwidth performance bottlenecks and processing delays in multi-level page table lookups, which are particularly pronounced with long queue lengths.

Method used

An SRCQ queue corresponding to SRQ is introduced to manage WQE descriptors, replacing the traditional two-level page table structure. By querying and managing WQE descriptors through the SRCQ queue, the reporting order of SRQ CQE is consistent with the sending order of SRQ WQE, which simplifies the design of the receiver RDMA engine and reduces processing latency.

Benefits of technology

The design of the receiver RDMA engine is simplified, the processing latency of each request message is significantly reduced, the performance of the receiver RDMA engine is improved, and the consistency between the reporting order of SRQ CQE and the sending order of SRQ WQE is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121217669B_ABST
    Figure CN121217669B_ABST
Patent Text Reader

Abstract

The application relates to an RDMA request message receiving method and device, which comprises the following steps: when a request message needing to consume an SRQ WQE is received, a target SRCQ queue is determined according to the request message, and it is inquired whether a corresponding WQE descriptor exists in the target SRCQ queue; if the WQE descriptor exists, the message is processed and the corresponding WQE descriptor is updated; if the WQE descriptor does not exist, a new SRQ WQE is applied, a new WQE descriptor is generated and stored at the tail of the target SRCQ queue, then the request message is processed and the WQE descriptor is updated, finally, whether the SRQ CQE is reported is judged according to the WQE descriptor at the head of the target SRCQ queue; if the SRQ CQE is reported, the WQE descriptor at the head of the queue is dequeued, the SRQ CQE is generated and reported, and the dequeuing of the WQE descriptor follows the first-in-first-out principle; through the application, the design of a receiving end RDMA engine can be simplified and the performance of the receiving end RDMA engine can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of RDMA (Remote Direct Memory Access) technology, in particular to an RDMA request message receiving method and device, an RDMA engine, a network card device and a computer program product. BACKGROUND

[0002] In the field of communication technology, the RDMA (Remote Direct Memory Access) protocol is widely used due to its low latency and high throughput characteristics. The basic unit of RDMA communication is a queue pair (QP), which is composed of a sending queue (SQ) and a receiving queue (RQ). However, in normal use, the use of RQ is much less than the use of SQ, and the RQ of each QP consumes memory resources. Therefore, in order to save resources for the receiving end, a shared receiving queue (SRQ) is designed in RDMA communication. When a large number of QPs are needed, SRQ can be used to save memory. As shown in Figure 1 , QP0, QP1 and QP2 share an SRQ queue together, which can save two RQ queues.

[0003] As shown in Figure 2 , the process of receiving an RDMA request message based on SRQ is as follows:

[0004] Step 1: When the receiving end is initialized, the software issues SRQ WQE in the order of WQE1→WQE2→WQE3, and waits for the receiving request message; WQE refers to a work queue entry, which contains related information required to process the request message, such as data storage address resources;

[0005] Step 2: The sending end sends three request messages to the receiving end in the order of QP0→QP1→QP2, and the three request messages all consume the SRQ WQE of the receiving end. The messages arrive at the receiving end in the order of QP0→QP1→QP2.

[0006] Step 3: The receiving end allocates an SRQ WQE to each of the three QP request messages in the order of QP0→QP1→QP2, respectively, wherein QP0 is allocated to WQE1, QP1 is allocated to WQE2, and QP2 is allocated to WQE3, and then the three QP request messages are processed respectively.

[0007] Step 4, since the traffic conditions of each QP are different, the order of processing completion of the request messages of the three QPs may not be consistent with the order of receiving the three messages, and each request message generates a SRQCQE after processing completion, which notifies the software that the SRQ WQE occupied by the request message has been released and can be recycled. The CQE refers to a completion queue entry. For example, the message of QP1 is completed first, the message of QP2 is completed second, and the message of QP0 is completed last, which makes the order of reporting on the SRQ CQE inconsistent with the order of issuing the SRQ WQE by the software, resulting in that when the software recycles the SRQ queue unit and reissues the SRQ WQE, the order of issuance is different from that at the initialization time.

[0008] In order to solve the problem that the order of issuing the SRQ WQE by the software is inconsistent with the last time, a two-level page table is used to manage the SRQ WQE, as shown in Figure 3 The first level page table is an index page table of the SRQ WQE, and the first level page table can continuously save the index numbers of the SRQ WQE issued by the software. The second level page table is an SRQ WQE page table, and each unit in the second level page table corresponds to an SRQ WQE. The order of issuance of all units in the second level page table is completely out of order. When the receiving end receives a request message that needs to consume an SRQ WQE, an index number of the SRQ WQE is first applied by using the head pointer of the index page table of the SRQ WQE, and then the corresponding SRQ WQE is read from the SRQ WQE page table according to the applied index number. When the receiving end processes the request message and reports the SRQ CQE out of order, the software recycles the corresponding SRQ queue unit and issues a new SRQ WQE, writes the new SRQ WQE into the recycled SRQ WQE unit, and then writes the index number of the SRQ WQE unit into the unit pointed to by the tail pointer of the index page table of the SRQ WQE.

[0009] Figure 3 The method needs to use a two-level page table structure to record the SRQ WQE, and needs to query the two-level page table twice when each request message consumes the SRQ WQE, and needs to flush the two-level page table twice when the software issues a new SRQ WQE. Since the positions of the SRQ WQEs consumed by two adjacent request messages are completely random, each message needs to access the two-level page table twice, which causes the page table query bandwidth to become a performance bottleneck. Moreover, the two-level page table query by each request message causes the processing delay of the receiving end to become longer, especially when the length of the SRQ queue is very long, the index page table of the SRQ WQE and the page table of the SRQ WQE are each implemented by using a multi-level sub-page table, which causes the number of levels of the page table actually queried by each request message to become larger, and aggravates the processing delay. SUMMARY

[0010] The present application aims to provide an RDMA request message receiving method and device, an RDMA engine, a network card device and a computer program product, so as to simplify the design of the receiving end RDMA engine and improve the performance of the receiving end RDMA engine.

[0011] To achieve the above-mentioned purpose, according to the first aspect of the present application, an RDMA request message receiving method is provided, the method comprising:

[0012] receiving a request message, determining that the request message needs to consume an SRQ WQE, determining a target SRCQ queue according to the request message, and querying whether a corresponding target WQE descriptor exists in the target SRCQ queue; wherein one SRCQ queue corresponds to one SRQ queue;

[0013] If the target WQE descriptor exists, a target SRQ WQE is obtained according to the target WQE descriptor, the request message is processed according to the target SRQ WQE, after the processing of the request message is completed, the target WQE descriptor is updated;

[0014] If the target WQE descriptor does not exist, an SRQ WQE is applied from the target SRCQ queue, the target WQE descriptor is generated according to the applied SRQ WQE, the target WQE descriptor is stored in the SRCQ queue unit at the tail of the target SRCQ queue, and the request message is processed according to the applied SRQ WQE, after the processing of the request message is completed, the target WQE descriptor is updated;

[0015] It is determined whether to report an SRQ CQE according to the WQE descriptor in the SRCQ queue unit at the head of the target SRCQ queue, if yes, the WQE descriptor in the SRCQ queue unit at the head of the target SRCQ queue is dequeued, an SRQ CQE is generated according to the currently dequeued WQE descriptor and is reported to the corresponding software process; wherein the descriptors of each SRCQ queue unit in the target SRCQ queue are dequeued in accordance with the first-in-first-out principle, and CQE is a completion queue unit.

[0016] In some embodiments, the target SRCQ queue is determined according to the request message, and it is queried whether a corresponding target WQE descriptor exists in the target SRCQ queue, comprising:

[0017] The message sequence number and the queue pair number are obtained by parsing the request message;

[0018] The target SRQ queue is determined according to the queue pair number obtained by parsing, and the target SRCQ queue is determined according to the target SRQ queue;

[0019] According to the parsed message sequence number, it is inquired whether the corresponding target WQE descriptor exists in the target SRCQ queue.

[0020] In some embodiments, the method comprises:

[0021] After the processing of the request message is completed, the number of received request messages in the target WQE descriptor is updated to the current value plus one when the target WQE descriptor is updated.

[0022] The determination of whether to report the SRQ CQE according to the WQE descriptor in the SRCQ queue unit at the head of the target SRCQ queue comprises:

[0023] The WQE descriptor in the SRCQ queue unit at the head of the target SRCQ queue is acquired and parsed, and if the message length in the WQE descriptor is equal to the number of received request messages, it is determined to report the SRQ CQE.

[0024] In some embodiments, the target SRCQ queue is managed by a linked list, the linked list comprises a head pointer and a tail pointer, the head pointer points to the SRCQ queue unit at the head of the target SRCQ queue, and the tail pointer points to the SRCQ queue unit at the tail of the target SRCQ queue.

[0025] According to a second aspect of the present application, an RDMA request message receiving device is provided, comprising:

[0026] A descriptor query module is configured to receive a request message, determine that the request message needs to consume an SRQ WQE, determine a target SRCQ queue according to the request message, and inquire whether a corresponding target WQE descriptor exists in the target SRCQ queue; wherein the SRQ is a shared receiving queue, the WQE is a work queue unit, and one SRCQ queue corresponds to one SRQ queue.

[0027] A message processing module is configured to acquire a target SRQ WQE according to the target WQE descriptor if the target WQE descriptor exists, process the request message according to the target SRQ WQE, update the target WQE descriptor after the processing of the request message is completed, apply an SRQ WQE from the target SRCQ queue if the target WQE descriptor does not exist, generate the target WQE descriptor according to the applied SRQ WQE, store the target WQE descriptor to the SRCQ queue unit at the tail of the target SRCQ queue, process the request message according to the applied SRQ WQE, and update the target WQE descriptor after the processing of the request message is completed.

[0028] The CQE reporting module is configured to determine whether to report an SRQ CQE according to a WQE descriptor in a SRCQ queue unit at a head of the target SRCQ queue, and if so, to dequeue the WQE descriptor in the SRCQ queue unit at the head of the target SRCQ queue, generate an SRQ CQE according to the currently dequeued WQE descriptor, and report the SRQ CQE to a corresponding software process; wherein the descriptors in each SRCQ queue unit in the target SRCQ queue are dequeued in a first-in-first-out manner, and the CQE is a completion queue unit.

[0029] In some embodiments, the descriptor querying module is configured to parse the request message to obtain a message sequence number and a queue pair number, determine a target SRQ queue according to the obtained queue pair number, determine the target SRCQ queue according to the target SRQ queue, and query whether a corresponding target WQE descriptor exists in the target SRCQ queue according to the obtained message sequence number.

[0030] In some embodiments, the message processing module is configured to, after completing processing of the request message and updating the target WQE descriptor, update a number of received request messages in the target WQE descriptor to a current value plus one.

[0031] The CQE reporting module is configured to obtain and parse a WQE descriptor in a SRCQ queue unit at a head of the target SRCQ queue, and if a message length in the WQE descriptor is equal to a number of received request messages, determine to report an SRQ CQE.

[0032] In some embodiments, the target SRCQ queue is managed by a linked list, the linked list includes a head pointer and a tail pointer, the head pointer points to a SRCQ queue unit at a head of the target SRCQ queue, and the tail pointer points to a SRCQ queue unit at a tail of the target SRCQ queue.

[0033] According to a third aspect of the present application, an RDMA engine is provided, including the RDMA request message receiving device according to the second aspect of the present application.

[0034] According to a fourth aspect of the present application, a network card device is provided, including:

[0035] A communication interface is configured to communicate with other electronic devices.

[0036] A memory is configured to store computer program instructions.

[0037] A processor is configured to execute the computer program instructions to support the network card device to implement the method according to the first aspect of the present application.

[0038] According to a fifth aspect of the present application, a computer program product is provided, comprising computer program instructions instructing a computer device to perform corresponding operations as described in the first aspect of the present application.

[0039] The present application provides an RDMA request message receiving method and device, an RDMA engine, a network card device and a computer program product, which have the following beneficial effects:

[0040] By introducing the SRCQ queue corresponding to the SRQ to manage the WQE descriptor, the traditional two-level page table structure is replaced. When processing the request message sent by the sending end, the receiving end RDMA engine only needs to query whether a corresponding target WQE descriptor exists in the target SRCQ queue according to the request message. If it exists, the request message is processed and the target WQE descriptor is updated after the message processing is completed. If it does not exist, an SRQ WQE is applied and a corresponding target WQE descriptor is generated. The target WQE descriptor is written into the target SRCQ queue, and then the request message is processed and the target WQE descriptor is updated after the message processing is completed. The complex multi-level page table lookup operation is avoided, thereby simplifying the design of the receiving end RDMA engine, significantly reducing the processing delay of each request message, and improving the performance of the receiving end RDMA engine. At the same time, by storing each newly generated WQE descriptor at the tail of the SRCQ queue and strictly following the first-in-first-out principle to take out the WQE descriptor from the head of the queue to report the CQE, it is ensured that the reporting order of the SRQ CQE is consistent with the issuing order of the SRQ WQE, which is beneficial to the RDMA engine to sequentially read multiple adjacent SRQ WQE for processing multiple request messages in a pre-fetching manner, further reducing the reading delay of the SRQ WQE, and improving the performance of the receiving end RDMA engine.

[0041] Other features and advantages of the present application will be described in the following description. BRIEF DESCRIPTION OF DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiment or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.

[0043] Figure 1 A schematic diagram for multiple QPs disclosed in the background art sharing one SRQ.

[0044] Figure 2 A schematic diagram for implementing the RDMA request message receiving based on the SRQ disclosed in the background art.

[0045] Figure 3 A schematic diagram of a two-level page table disclosed in the background art.

[0046] Figure 4 A flow chart of an RDMA request message receiving method in an embodiment of the present application.

[0047] Figure 5 A schematic diagram of an SRQ queue ring structure in an embodiment of the present application.

[0048] Figure 6 A framework structure diagram of an RDMA request message receiving device in an embodiment of the present application. DETAILED DESCRIPTION

[0049] The detailed description of the drawings is intended as a description of the current preferred embodiments of the present application and is not intended to represent the only forms in which the present application can be constructed or utilized. It is to be understood that the same or equivalent functions can be accomplished by different embodiments that are intended to be encompassed within the scope of the present application.

[0050] One embodiment of the present application provides an RDMA request message receiving method, comprising the following steps:

[0051] In step S10, a request message is received, it is determined that the request message needs to consume an SRQ WQE, a target SRCQ queue is determined according to the request message, and it is inquired whether a corresponding target WQE descriptor exists in the target SRCQ queue; wherein, SRQ (Shared Receive Queue) is a shared receive queue, WQE is a work queue unit, SRCQ (Shared Complete Queue) is a shared complete queue, and one SRCQ corresponds to one SRQ queue.

[0052] Specifically, in RDMA communication, part of the request messages need to consume an SRQ WQE resource of a receiving end to be processed, and the processing of part of the request messages does not need to consume the SRQ WQE resource of the receiving end. When the receiving end RDMA engine receives a request message which needs to consume an SRQ WQE, it is first needed to determine whether the request message is a "first message of a new message (Message)" or a "subsequent message of an existing message". It is to be noted that when the data amount carried by a message is too large, the message will be split into multiple request messages for sequential sending. For the "first message of a new message (Message)", the receiving end RDMA engine has not allocated any resource for it. For the "subsequent message of an existing message", the messages before it have arrived, and the receiving end RDMA engine has allocated resources for it and started processing.

[0053] The traditional SRQ (Shared Receive Queue) uses a two-level page table to manage WQE (Work Queue Element), which causes the page table query to become a performance bottleneck. Each queue pair (QP) caches the descriptor of the SRQ WQE in the context (QPC), but each queue pair (QP) can only cache one descriptor of the SRQ WQE, which limits each queue pair (QP) to receive and process only one request message requiring the consumption of the SRQ WQE at a time. If the second to nth request message requiring the consumption of the SRQ WQE arrives before the first request message requiring the consumption of the SRQ WQE is completely processed, the receiving end can only discard these early-arriving request messages, which reduces the transmission efficiency of the entire queue pair (QP). That is, in the traditional SRQ implementation, the queue pair (QP) using the SRQ cannot support out-of-order message reception.

[0054] In the method of the embodiment, an SRCQ queue (corresponding to the SRQ queue one-to-one) is introduced, and a WQE descriptor is generated for each SRQ WQE. The WQE descriptor is managed by the SRCQ queue to replace the two-level page table. One SRCQ queue corresponds to one SRQ queue, and multiple SQ queues can share one SRQ queue. Of course, for a special SQ queue, one SQ queue can also use one SRQ queue independently. Each software process of the receiving end has an independent SQ queue, and the SQ queue is part of the queue pair (QP). Therefore, there is a determined correspondence between the queue pair (QP) and the SRQ queue, and between the SRQ queue and the SRCQ queue. One SRCQ queue includes a plurality of SRCQ units organized in sequence, and each SRCQ unit is used to store one WQE descriptor.

[0055] In the embodiment, the request message is first parsed. The request message carries information such as the queue pair (QP) corresponding to the request message, the message sequence number, and the packet sequence number (PSN). According to the information carried by the request message, it can be determined whether there is a target WQE descriptor in the target SRCQ queue. If not, the request message is the first message of a new message. If there is, the request message is a subsequent message of an existing message.

[0056] In step S20, if the target WQE descriptor exists, the target SRQ WQE is obtained according to the target WQE descriptor, the request message is processed according to the target SRQ WQE, and the target WQE descriptor is updated after the processing of the request message is completed.

[0057] Specifically, each WQE descriptor is generated according to a corresponding SRQ WQE, the WQE descriptor includes relevant information of the corresponding SRQ WQE, thus, the corresponding target SRQ WQE can be obtained according to the target WQE descriptor, and the request message is processed using the target SRQ WQE, after the processing of the request message is completed, part of information in the target WQE descriptor is updated, the part of information is used to record whether all request messages of a corresponding message are processed.

[0058] In step S30, if the target WQE descriptor does not exist, an SRQ WQE is applied from the target SRQ queue, the target WQE descriptor is generated according to the applied SRQ WQE, the target WQE descriptor is stored in the SRCQ queue unit at the tail of the target SRCQ queue, and the request message is processed according to the applied SRQ WQE, after the processing of the request message is completed, the target WQE descriptor is updated.

[0059] Specifically, if the target WQE descriptor does not exist, a new SRQ WQE is needed to process the request message, a corresponding target WQE descriptor is generated for the new SRQ WQE, and the target WQE descriptor is stored in the SRCQ queue unit at the tail of the target SRCQ queue, then the request message is processed using the target SRQ WQE, after the processing of the request message is completed, part of information in the target WQE descriptor is updated, the part of information is used to record whether all request messages of a corresponding message are processed; for example, the descriptor includes "the number of request messages of a message that need to be received and processed", each time a request message is processed, the recorded "the number of request messages of a message that need to be received and processed" is reduced by 1, if "the number of request messages of a message that need to be received and processed" is 0, whether all request messages of a corresponding message are processed; for another example, the descriptor includes "the number of request messages of a message that need to be received and processed" and "the number of request messages of a message that have been received and processed", each time a request message is processed, the recorded "the number of request messages of a message that have been received and processed" is increased by 1, if "the number of request messages of a message that need to be received and processed" is equal to "the number of request messages of a message that have been received and processed", whether all request messages of a corresponding message are processed; the above is only an example, other ways can also be used to record whether all request messages of a corresponding message are processed, which are all within the protection scope of the embodiment.

[0060] Step S40, determining whether to report the SRQ CQE according to the WQE descriptor in the SRCQ queue unit of the head of the target SRCQ queue, if yes, the WQE descriptor in the SRCQ queue unit of the head of the target SRCQ queue is dequeued, the SRQ CQE is generated according to the currently dequeued WQE descriptor and is reported to the corresponding software process; wherein the descriptors of each SRCQ queue unit in the target SRCQ queue are dequeued according to the first-in-first-out principle, and the CQE is a completion queue unit;

[0061] Specifically, in the embodiment, the dequeuing of the WQE descriptor in each SRCQ queue is in accordance with the first-in-first-out principle, and the WQE descriptor at the head of the SRCQ queue is dequeued when the dequeuing condition is met, that is, all the request packet processing of the corresponding message recorded in the WQE descriptor is completed, then the corresponding SRQ CQE is generated according to the dequeued WQE descriptor, and is reported to the corresponding software process, as described above, the SRQ, SQ / QP and software process have a corresponding relationship; after the WQE descriptor at the current head is dequeued, the adjacent WQE descriptor after the WQE descriptor at the current head is automatically called the WQE descriptor at the new head, and is dequeued in the next priority.

[0062] In summary, the method of the embodiment manages the WQE descriptor by introducing the SRCQ queue corresponding to the SRQ, replaces the traditional two-level page table structure, and replaces the traditional implementation mode of using the distributed queue pair (QP) context to manage the WQE descriptor, realizes the centralized management of the WQE descriptor, and the receiving end RDMA engine only needs to query whether there is a corresponding target WQE descriptor in the target SRCQ queue according to the request packet when processing the request packet sent by the sending end, if there is, the request packet is processed and the target WQE descriptor is updated after the packet processing is completed, if not, an SRQ WQE is applied and a corresponding target WQE descriptor is generated, the target WQE descriptor is written into the target SRCQ queue, then the request packet is processed and the target WQE descriptor is updated after the packet processing is completed, avoiding the complex multi-level page table lookup operation, thereby simplifying the design of the receiving end RDMA engine, and significantly reducing the processing delay of each request packet, and improving the performance of the receiving end RDMA engine; at the same time, by storing each newly generated WQE descriptor at the tail of the SRCQ queue and strictly following the first-in-first-out principle to take out the WQE descriptor from the head of the queue to report the CQE, it is ensured that the reporting order of the SRQ CQE is consistent with the issuing order of the SRQ WQE, which is beneficial to the RDMA engine to sequentially read multiple adjacent SRQ WQE for processing multiple request packets by pre-fetching, further reducing the reading delay of the SRQ WQE, and improving the performance of the receiving end RDMA engine.

[0063] As described above, the receiving RDMA engine, by introducing an SRCQ queue, ensures that the RDMA engine reports the results of SRQ CQEs in the order they are sent by the software. When the software process receives SRQ CQEs sequentially, releases the original SRQ WQEs, reuses the original SRQ WQEs, and sends new SRQ WQEs, the sending order remains consistent with the previous sending order. In this way, the SRQ WQE queue between the software process and the receiving RDMA engine can be used as follows: Figure 5 The simple circular structure shown illustrates that when the software process issues an SRQ WQE, it issues it to the SRQ cell pointed to by the PI pointer (producer index) in the SRQ WQE queue, and then the PI pointer is incremented. When the RDMA engine consumes an SRQ WQE, it requests one from the SRQ cell pointed to by the CI pointer (consumer index) in the SRQ WQE queue, and then the CI pointer is incremented. Since the two-level page table data format is no longer needed, the RDMA engine can quickly read the SRQ WQE pointed to by the CI pointer. Furthermore, because SRQ WQEs are read sequentially, the RDMA engine can also prefetch multiple adjacent SRQ WQEs following the CI pointer, further reducing read latency. Figure 5 As shown, the CI pointer points to WQE1. The RDMA engine can prefetch WQE1~4 at once. When the RDMA engine needs to use WQE2~4, it does not need to read from DDR memory again. In addition, since SRQ CQE out-of-order delivery is only introduced when the receiver's RDMA engine receives the request message and starts processing, the SRCQ units in the SRCQ queue can be released when the RDMA engine finishes processing the request message and reports the SRQ CQE. Therefore, theoretically, each SRCQ queue does not need to maintain the same length as the SRQ queue, and only a small amount of resources are needed to meet the performance requirements.

[0064] In some embodiments, the target WQE descriptor includes a message sequence number (MSN), a queue pair number, a message length, the number of received request messages, and SQE WQE information. The message sequence number (MSN) is used to distinguish different messages and can be understood as the message's identity information. The queue pair number refers to the queue pair (QP) number used to distinguish different queue pairs. The message length refers to the number of request messages to be received corresponding to the message. The number of received request messages refers to the number of request messages corresponding to the message that have been received by the receiving end RDMA engine.

[0065] In some embodiments, in step S10, determining the target SRCQ queue based on the request message and querying whether a corresponding target WQE descriptor exists in the target SRCQ queue includes:

[0066] obtaining a message sequence number and a queue pair number from the request packet;

[0067] determining a target SRQ queue according to the queue pair number, and determining the target SRCQ queue according to the target SRQ queue;

[0068] querying whether a corresponding target WQE descriptor exists in the target SRCQ queue according to the message sequence number.

[0069] Specifically, as described above, the queue pair (QP) has a corresponding relationship with the SRQ queue, and the SRQ queue has a corresponding relationship with the SRCQ queue. Therefore, the target SRQ queue can be determined according to the queue pair number, and the target SRCQ queue can be further determined according to the target SRQ queue. All request packets of one message are processed using one SRQ WQE resource, and the SRQ WQE has a one-to-one corresponding relationship with the message. The WQE descriptor contains the sequence number of the corresponding message. Therefore, whether there is a matching WQE descriptor can be queried according to the message sequence number carried by the request packet.

[0070] In some embodiments, in steps S20 and S30, after the processing of the request packet is completed, the target WQE descriptor is updated, and the number of received request packets in the target WQE descriptor is updated to the current value plus one;

[0071] In step S40, the determination of whether to report the SRQ CQE according to the WQE descriptor in the SRCQ queue unit at the head of the target SRCQ queue includes:

[0072] The WQE descriptor in the SRCQ queue unit at the head of the target SRCQ queue is obtained and parsed. If the message length in the WQE descriptor is equal to the number of received request packets, it is determined that the SRQ CQE is reported.

[0073] Specifically, if the message length in the WQE descriptor is equal to the number of received request packets, it is identified that the message corresponding to the WQE descriptor has been processed, and the corresponding SRQ WQE resource needs to be recycled. At this time, the SRQ CQE needs to be generated and reported to the software process.

[0074] In some embodiments, the target SRCQ queue is managed by a linked list, and the linked list includes a head pointer and a tail pointer. The head pointer points to the SRCQ queue unit at the head of the target SRCQ queue, and the tail pointer points to the SRCQ queue unit at the tail of the target SRCQ queue.

[0075] Specifically, in the embodiment, the SRCQ queue is managed in a linked list structure, the head of the linked list corresponds to the earliest applied SRQ WQE, and the tail of the linked list corresponds to the last applied SRQ WQE. When the receiving end RDMA engine generates and reports the SRQ CQE, it must be generated and reported in the order from the head of the linked list to the tail of the linked list. Therefore, the SRCQ queue realizes the function of the RDMA engine generating and reporting the SRQ CQE in the order of the software process issuing the SRQ WQE. The RDMA engine must report the SRQ CQE to the software process when the SRQ WQE corresponding to the head of the linked list meets the condition of generating and reporting the SRQ CQE. Otherwise, even if the SRQ WQE corresponding to the WQE descriptor in the other queue unit after the head of the linked list meets the condition of generating and reporting the SRQ CQE, the SRQ CQE cannot be immediately reported to the software process.

[0076] Corresponding to the RDMA request message receiving method of the above-mentioned embodiment, as shown in Figure 6 Another embodiment of the application provides an RDMA request message receiving device, which comprises:

[0077] A descriptor query module 1 is configured to receive a request message, determine that the request message needs to consume an SRQ WQE, determine a target SRCQ queue according to the request message, and query whether a target WQE descriptor corresponding to the target SRCQ queue exists. The SRQ is a shared receiving queue, the WQE is a work queue unit, and one SRCQ queue corresponds to one SRQ queue.

[0078] A message processing module 2 is configured to acquire a target SRQ WQE according to the target WQE descriptor if the target WQE descriptor exists, process the request message according to the target SRQ WQE, update the target WQE descriptor after the processing of the request message is completed, apply an SRQ WQE from the target SRQ queue if the target WQE descriptor does not exist, generate the target WQE descriptor according to the applied SRQ WQE, store the target WQE descriptor to an SRCQ queue unit at the tail of the target SRCQ queue, and process the request message according to the applied SRQ WQE, and update the target WQE descriptor after the processing of the request message is completed.

[0079] The CQE reporting module 3 is configured to determine whether to report an SRQ CQE according to a WQE descriptor in a SRCQ queue unit at the head of the target SRCQ queue, and if so, dequeue the WQE descriptor in the SRCQ queue unit at the head of the target SRCQ queue, generate an SRQ CQE according to the currently dequeued WQE descriptor, and report the SRQ CQE to a corresponding software process; wherein the descriptors in each SRCQ queue unit in the target SRCQ queue are dequeued in a first-in-first-out manner, and the CQE is a completion queue unit.

[0080] In some embodiments, the target WQE descriptor includes a message sequence number, a queue pair number, a message length, a number of received request messages, and information of an SQE WQE.

[0081] In some embodiments, the descriptor querying module 1 is configured to parse the request message to obtain a message sequence number and a queue pair number, determine a target SRQ queue according to the parsed queue pair number, determine the target SRCQ queue according to the target SRQ queue, and query whether a corresponding target WQE descriptor exists in the target SRCQ queue according to the parsed message sequence number.

[0082] In some embodiments, the message processing module 2 is configured to update the number of received request messages in the target WQE descriptor to a current value plus one when the target WQE descriptor is updated after the processing of the request message is completed.

[0083] The CQE reporting module 3 is configured to obtain and parse the WQE descriptor in the SRCQ queue unit at the head of the target SRCQ queue, and determine to report an SRQ CQE if the message length in the WQE descriptor is equal to the number of received request messages.

[0084] In some embodiments, the target SRCQ queue is managed by a linked list, the linked list includes a head pointer and a tail pointer, the head pointer points to a SRCQ queue unit at the head of the target SRCQ queue, and the tail pointer points to a SRCQ queue unit at the tail of the target SRCQ queue.

[0085] Another embodiment of the present application provides an RDMA engine including the RDMA request message receiving device as described in the above embodiments.

[0086] Another embodiment of the present application provides a network card device including:

[0087] A communication interface configured to communicate with other electronic devices;

[0088] A memory configured to store computer program instructions;

[0089] The processor is configured to execute the computer program instructions to support the network card device to implement the RDMA request message receiving method as described in the above embodiments.

[0090] In this embodiment, the memory mainly includes a program storage area and a data storage area, wherein the program storage area can store application programs required by the operation device and at least one function, etc., and the data storage area can store relevant data, etc. In addition, the memory can be a high-speed random access memory, and can also be a non-volatile memory such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., or the memory can also be other volatile solid-state storage devices.

[0091] The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or the processor can also be any conventional processor. The processor is the control center of the network card device, and connects various parts of the network card device through various interfaces and lines.

[0092] Another embodiment of the present application provides a computer program product including computer program instructions, which instruct a computer device to perform operations corresponding to the RDMA request message receiving method as described in the above embodiments.

[0093] Specifically, the computer program product includes a series of computer program instructions, which are codes written in computer programs and define how to perform specific operations. The computer program instructions are designed to be loaded onto a computer device and guide the device to perform specific operations, which refer to the steps in the RDMA request message receiving / receiving method as described in the above embodiments. In this way, the computer program product of the present embodiment provides a complete software solution, which can run on various computer devices to implement the RDMA request message receiving / receiving method of the above embodiments.

[0094] Having described various embodiments of the application, it is to be understood that the above description is meant not to be exhaustive or limited to the various embodiments disclosed. Many modifications and variations are possible in light of the above teachings without departing from the scope and spirit of the described embodiments. It is also to be understood that the terminology used herein is for the purpose of describing particular embodiments only, and is not intended to limit the scope of the various embodiments described herein, since the scope of the various embodiments is limited solely by the claims.

Claims

1. A method for receiving RDMA request messages, characterized in that, The method includes: Receive a request message, determine that the request message requires SRQ WQE consumption, determine the target SRCQ queue based on the request message, and query whether there is a corresponding target WQE descriptor in the target SRCQ queue; wherein, one SRCQ queue corresponds to one SRQ queue; If the target WQE descriptor exists, then the target SRQ WQE is obtained according to the target WQE descriptor, the request message is processed according to the target SRQ WQE, and the target WQE descriptor is updated after the processing of the request message is completed. If the target WQE descriptor does not exist, an SRQ WQE is requested from the target SRQ queue. The target WQE descriptor is generated based on the requested SRQ WQE, stored in the SRCQ queue unit at the tail of the target SRCQ queue, and the request message is processed based on the requested SRQ WQE. After processing the request message, the target WQE descriptor is updated. Whether to report an SRQ CQE is determined based on the WQE descriptor in the SRCQ queue unit at the head of the target SRCQ queue. If so, the WQE descriptor in the SRCQ queue unit at the head of the target SRCQ queue is dequeued, and an SRQ CQE is generated based on the currently dequeued WQE descriptor and reported to the corresponding software process. The dequeueing of descriptors from each SRCQ queue unit in the target SRCQ queue follows the first-in-first-out (FIFO) principle.

2. The method according to claim 1, characterized in that, The step of determining the target SRCQ queue based on the request message and querying whether a corresponding target WQE descriptor exists in the target SRCQ queue includes: Parse the request message to obtain the message sequence number and queue number; The target SRQ queue is determined based on the queue numbers obtained from the parsing, and the target SRCQ queue is determined based on the target SRQ queue. Based on the parsed message sequence number, query whether there is a corresponding target WQE descriptor in the target SRCQ queue.

3. The method according to claim 1, characterized in that, The method includes: After processing the request message, when updating the target WQE descriptor, the number of received request messages in the target WQE descriptor is updated to the current value plus one. The step of determining whether to report SRQCQE based on the WQE descriptor in the SRCQ queue unit at the head of the target SRCQ queue includes: Obtain and parse the WQE descriptor in the SRCQ queue unit of the target SRCQ queue header. If the message length in the WQE descriptor is equal to the number of received request messages, then determine to report SRQ CQE.

4. The method according to any one of claims 1 to 3, characterized in that, The target SRCQ queue is managed by a linked list, which includes a head pointer and a tail pointer. The head pointer points to the SRCQ queue unit at the head of the target SRCQ queue, and the tail pointer points to the SRCQ queue unit at the tail of the target SRCQ queue.

5. An RDMA request message receiving device, characterized in that, include: The descriptor query module is used to receive a request message, determine the target SRCQ queue based on the request message when it is determined that the request message needs to consume SRQ WQE, and query whether there is a corresponding target WQE descriptor in the target SRCQ queue; wherein, one SRCQ queue corresponds to one SRQ queue; The message processing module is configured to: if the target WQE descriptor exists, obtain a target SRQ WQE based on the target WQE descriptor, process the request message based on the target SRQ WQE, and update the target WQE descriptor after processing the request message; if the target WQE descriptor does not exist, request an SRQ WQE from the target SRQ queue, generate the target WQE descriptor based on the requested SRQ WQE, store the target WQE descriptor in the SRCQ queue unit at the tail of the target SRCQ queue, process the request message based on the requested SRQ WQE, and update the target WQE descriptor after processing the request message. The CQE reporting module is used to determine whether to report an SRQ CQE based on the WQE descriptor in the SRCQ queue unit at the head of the target SRCQ queue. If so, the WQE descriptor in the SRCQ queue unit at the head of the target SRCQ queue is dequeued, and an SRQ CQE is generated based on the currently dequeued WQE descriptor and reported to the corresponding software process. The dequeueing of descriptors from each SRCQ queue unit in the target SRCQ queue follows the first-in-first-out principle, and the CQE is the completion queue unit.

6. The apparatus according to claim 5, characterized in that, The descriptor query module is used to parse the request message to obtain the message sequence number and queue pair number, determine the target SRQ queue based on the parsed queue pair number, determine the target SRCQ queue based on the target SRQ queue, and query whether a corresponding target WQE descriptor exists in the target SRCQ queue based on the parsed message sequence number.

7. The apparatus according to claim 5, characterized in that, The message processing module is used to update the number of received request messages in the target WQE descriptor to the current value plus one when updating the target WQE descriptor after processing the request message; The CQE reporting module is used to obtain and parse the WQE descriptor in the SRCQ queue unit of the target SRCQ queue header. If the message length in the WQE descriptor is equal to the number of received request messages, then it is determined to report SRQ CQE.

8. The apparatus according to any one of claims 5 to 7, characterized in that, The target SRCQ queue is managed by a linked list, which includes a head pointer and a tail pointer. The head pointer points to the SRCQ queue unit at the head of the target SRCQ queue, and the tail pointer points to the SRCQ queue unit at the tail of the target SRCQ queue.

9. An RDMA engine, characterized in that, Includes the RDMA request message receiving device as described in any one of claims 5 to 8.

10. A network interface card (NIC) device, characterized in that, include: A communication interface used for communicating with other electronic devices; Memory is used to store computer program instructions; A processor is configured to execute the computer program instructions to support the network interface card device in implementing the RDMA request message receiving method as described in any one of claims 1 to 4.

11. A computer program product, characterized in that, It includes computer program instructions that instruct a computer device to perform the RDMA request message receiving method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Low-latency RDMA acceleration system based on memory registration

    CN120469941A

  • Message uploading method, data processing unit and computer program product

    CN120834970A