CN-121984940-A - Message processing method and remote direct memory access system
Abstract
The embodiment of the invention relates to the technical field of computers, in particular to a message processing method and a remote direct memory access system. According to the embodiment of the invention, the first element of the receiving work queue is obtained as the reference element through the pre-fetching analysis module, the reference element is analyzed to obtain the reference information of the reference receiving buffer, the reference information is sent to the aggregation processing module, the aggregation processing module determines the target aggregation information of the target operation message according to the reference information, and obtains the target data according to the target aggregation information, and sends the target data to the reference receiving buffer, so that one or more request operation messages processed by one first element are dynamically matched, the data carried by the target operation message are aggregated, the storage space of the receiving buffer is fully utilized, the utilization rate of the storage space of the receiving buffer is improved, the frequency of obtaining the first element by the remote direct memory access network card is reduced, the PCIe operation is reduced, the processing delay is reduced, and the PCIe bandwidth utilization rate is improved.
Inventors
- SONG QIN
- BU PINGFAN
- GAO YU
Assignees
- 无锡大普联芯科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251224
Claims (10)
- 1. The message processing method is characterized by being applied to a remote direct memory access system, wherein the remote direct memory access system comprises a host and a remote direct memory access network card which are in communication connection, the host comprises a receiving work queue and a plurality of receiving caches, the receiving work queue comprises a plurality of first elements, one first element corresponds to one receiving cache, the remote direct memory access network card comprises a message cache module, an aggregation processing module and a prefetch analysis module, and the aggregation processing module is in communication connection with the message cache module and the prefetch analysis module; The message processing method comprises the following steps: the message buffer module receives and stores a first message sequence, wherein the first message sequence comprises at least one reference message, and the reference message carries candidate data; The pre-fetching analysis module acquires a first element of the receiving work queue as a reference element, analyzes the reference element to acquire reference information of a reference receiving buffer corresponding to the reference element, and sends the reference information to the aggregation processing module, wherein the reference information comprises the storage space size of the reference receiving buffer; The aggregation processing module determines target aggregation information of target operation messages in at least one reference message according to the reference information, obtains candidate data carried by the target operation messages as target data according to the target aggregation information, and sends the target data to the reference receiving buffer, wherein the target operation messages comprise one or more request operation messages in the first message sequence, the request operation messages are reference messages with operation codes meeting preset conditions, the target aggregation information comprises target quantity and target identification of the target operation messages, and the storage space size of the reference receiving buffer is larger than or equal to the size of the target data.
- 2. The method of claim 1, wherein the aggregation processing module includes a message aggregation module and a message processing module, the message processing module is communicatively connected to the message aggregation module, the message buffering module, and the prefetch parsing module, the message aggregation module is also communicatively connected to the message buffering module and the prefetch parsing module, and the reference information further includes a reference identifier of the reference receiving buffer; The aggregation processing module determines target aggregation information of a target operation message in at least one reference message according to the reference information, acquires candidate data carried by the target operation message as target data according to the target aggregation information, and sends the target data to the reference receiving cache, and the aggregation processing module comprises the following steps: the message aggregation module receives the reference information, traverses a first message sequence of the message cache module, determines one or more request operation messages in the first message sequence, obtains the target aggregation information according to the request operation messages and the reference information, and sends the target aggregation information to the message processing module; The message processing module receives the reference information, acquires candidate data carried by the target operation message from the first message sequence of the message buffer module according to the target aggregation information as the target data, and sends the target data to the reference receiving buffer corresponding to the reference identifier.
- 3. The method of claim 2, wherein the message aggregation module traverses a first message sequence of the message cache module, and wherein determining one or more of the request operation messages at the first message sequence comprises: Traversing a first message sequence according to the storage sequence number of the reference message, and comparing the operation code of the traversed reference message with a reference operation code, wherein the first message sequence comprises at least one reference message which is sequenced from small to large according to the storage sequence number, and the reference operation code comprises one or more operation codes corresponding to a request operation; and responding to any operation code in the reference operation code of the reference message, and determining the reference message as the request operation message.
- 4. The method of claim 2, wherein the message aggregation module obtains the target aggregate information according to the request operation message and the reference information, comprising: updating the size of a current storage space as the size of the storage space of the reference receiving cache, wherein the current storage space is a space for storing candidate data carried by the request operation message; Selecting one request operation message from a second message sequence as a candidate operation message according to the storage sequence number, wherein the second message sequence comprises one or more request operation messages which are ordered from small to large according to the storage sequence number; Comparing the size of the candidate data carried by the candidate operation message with the size of the current storage space to obtain a comparison result; And obtaining the target aggregation information according to the comparison result.
- 5. The method of claim 4, wherein the message aggregation module obtains the target aggregation information according to the comparison result, comprising: responding to the comparison result that the size of the candidate data carried by the candidate operation message is smaller than or equal to the size of the current storage space, and updating the size of the current storage space according to the size of the candidate data carried by the candidate operation message; Determining the candidate operation message as the target operation message, and executing aggregation operation on the target operation message to obtain statistical information, wherein the statistical information comprises target identifiers and target numbers of the target operation message; And responding to the comparison result that the size of the candidate data carried by the candidate operation message is larger than the size of the current storage space, and acquiring the statistical information as the target aggregation information.
- 6. The method of claim 5, wherein the message aggregation module performs an aggregation operation with respect to the target operation message to obtain statistical information, comprising: initializing the statistical quantity of the target operation message to be zero; Adding 1 to the statistical quantity of the target operation messages, wherein the statistical quantity is the target quantity of the target operation messages; And recording the target identification of the target operation message.
- 7. The method according to any one of claims 2-6, wherein the obtaining, by the message processing module, candidate data carried by the target operation message from the first message sequence of the message buffer module according to the target aggregation information as the target data includes: Determining a target operation message corresponding to the target identifier in the first message sequence according to the target identifier; acquiring candidate data carried by all the target operation messages; And compressing and merging the candidate data carried by all the target operation messages to obtain the target data.
- 8. The method of claim 2, wherein the remote direct memory access network card further comprises a completion reporting module, the completion reporting module being communicatively coupled to the message processing module, the host further comprising a completion queue, the message processing method further comprising: the message processing module generates a message processing state instruction and sends the message processing state instruction to the completion reporting module, wherein the message processing state instruction comprises an element state identifier and a message state identifier, the element state identifier is used for representing that the reference element is consumed and used, and the message state identifier is used for representing that the target operation message is processed correctly; The completion reporting module generates a second element according to the message processing state instruction, and sends the second element to the host, so that the host adds the second element to the completion queue, wherein the second element is used for indicating that the target operation message is correctly processed and the reference element is consumed and used.
- 9. The method of claim 8, wherein the message processing module generating a message processing status instruction and sending the message processing status instruction to the completion reporting module comprises: Responding to the target data to send to the reference receiving buffer, and generating the element state identifier and the message state identifier; Generating the message processing state instruction according to the element state identifier and the message state identifier; And sending the message processing state instruction to the completion reporting module.
- 10. A remote direct memory access system, comprising: The system comprises a host computer in communication connection and a remote direct memory access network card, wherein the host computer comprises a receiving work queue and a plurality of receiving caches, the receiving work queue comprises a plurality of first elements, one first element corresponds to one receiving cache, the remote direct memory access network card comprises a message cache module, an aggregation processing module and a pre-fetching analysis module, and the aggregation processing module is in communication connection with the message cache module and the pre-fetching analysis module; The remote direct memory access system is configured to perform the message processing method of any of claims 1-9.
Description
Message processing method and remote direct memory access system Technical Field The embodiment of the invention relates to the technical field of computers, in particular to a message processing method and a remote direct memory access system. Background Remote direct memory access (Remote Direct Memory Access, RDMA) allows a computer to directly access the memory of other computers. RDMA implements its access function through a Queue Pair (QP), one QP comprising a Send Work Queue (SQ) and a receive Work Queue (Receive Work Queue, RQ), the elements in either the Send or receive Work queues may be referred to as Work Queue elements (Work Queue Element, WQE). For RQ, only the request operations whose opcodes are send, SEND WITH IMMEDIATE, SEND WITH INVALIDATE, WRITE WITH IMMEDIATE (hereinafter collectively referred to as the request operations consuming RQ WQEs) consume RQ WQEs (i.e., the work queue elements of the receive work queue). In the related art, each time a receiving end processes a received request operation consuming the RQ WQE, the receiving end needs to acquire a RQ WQE from a RQ queue of the host, parse the RQ WQE to obtain related information (such as an associated receiving buffer and a position, a size, etc.) of the RQ WQE, and move a message carried by the request operation to the receiving buffer of the host according to the related information of the RQ WQE. For the receiving end, it does not know the message size carried by the request operation until it receives the request operation, but must ensure that the receiving buffer associated with the RQ WQE is larger than the size of the message carried by the request operation to be processed when preparing the RQ WQE. In the current practice, when the receiving end prepares the RQ WQE, the associated receiving buffer is uniformly configured according to the maximum message size carried by the following request operation, for example, in 10 request operations, the message size carried by one request operation is 1024 bytes, and the message sizes carried by the other nine request operations are 128 bytes, so that the receiving buffer sizes associated with the RQ WQE are all configured to be 1024 bytes. When the larger message accounts for a small proportion of the total message (for example, in the above example, the message size carried by one request operation is 1024 bytes, and the message sizes carried by nine request operations are 128 bytes), when the request operation carried by the message size is processed, the utilization rate of the storage space of the receiving cache is low, so that serious bandwidth waste is caused, and the receiving end needs to frequently read the RQ WQE and report the CQE from the RQ queue of the host (namely, the completion queue element, completion Queue Element) in a manner of preparing the RQ WQE for processing the message carried by the request operation, so that the processing delay is high and the PCIe bandwidth utilization rate is low. Disclosure of Invention Accordingly, one of the objectives of the embodiments of the present invention is to provide a message processing method and a remote direct memory access system, so as to solve the technical problems of low storage space and PCIe bandwidth utilization and high processing delay of a receiving buffer when processing a message carried by a request operation in the related art. In order to solve the technical problems, the embodiment of the invention provides the following technical scheme: In a first aspect, an embodiment of the present invention provides a method for processing a message, where the method is applied to a remote direct memory access system, where the remote direct memory access system includes a host and a remote direct memory access network card that are communicatively connected, the host includes a receive work queue and multiple receive caches, the receive work queue includes multiple first elements, one first element corresponds to each receive cache, and the remote direct memory access network card includes a message cache module, an aggregation processing module, and a prefetch parsing module, where the aggregation processing module is communicatively connected with the message cache module and the prefetch parsing module; the message processing method comprises the following steps: The message buffer module receives and stores a first message sequence, wherein the first message sequence comprises at least one reference message, and the reference message carries candidate data; The method comprises the steps that a pre-fetching analysis module obtains a first element of a receiving work queue as a reference element, analyzes the reference element to obtain reference information of a reference receiving buffer corresponding to the reference element, and sends the reference information to an aggregation processing module, wherein the reference information comprises the storage space size of the reference receiving buffer; Th