Nothing Special   »   [go: up one dir, main page]

CN109426632B - Memory access method and device - Google Patents

Memory access method and device Download PDF

Info

Publication number
CN109426632B
CN109426632B CN201810102233.0A CN201810102233A CN109426632B CN 109426632 B CN109426632 B CN 109426632B CN 201810102233 A CN201810102233 A CN 201810102233A CN 109426632 B CN109426632 B CN 109426632B
Authority
CN
China
Prior art keywords
rdma
service device
memory address
specified
opposite
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810102233.0A
Other languages
Chinese (zh)
Other versions
CN109426632A (en
Inventor
朱勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN201810102233.0A priority Critical patent/CN109426632B/en
Publication of CN109426632A publication Critical patent/CN109426632A/en
Application granted granted Critical
Publication of CN109426632B publication Critical patent/CN109426632B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Bus Control (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a memory access method and device. In the application, by generating the WR chain meeting the condition for the RDMA operation, the WR for indicating the completion of the RDMA operation and the WR for realizing the RDMA operation can be arranged in the same WR chain, and the WR for indicating the completion of the RDMA operation is arranged at the end of the WR chain, which means that the WR for indicating the completion of the RDMA operation is implicitly executed in the RDMA operation, so that the opposite-end service equipment can timely sense the completion of the RDMA operation in the flow of the RDMA operation, and the processing efficiency of the RDMA operation is improved.

Description

Memory access method and device
Technical Field
The present application relates to data communication technologies, and in particular, to a memory access method and apparatus.
Background
In the application of Remote Direct Memory Access (RDMA), the target Memory is remotely accessed in a Direct Memory Access (DMA) mode, so that the overhead caused by Memory copy and kernel context switching is reduced, and high-performance transmission of data is realized.
In RDMA applications, common operations are RDMA send operations, RDMA operations. Wherein RDMA SEND operations are used to SEND data in small chunks (e.g., less than 4k in size); while RDMA operations are primarily directed to continuous, large chunks of data. Here, the RDMA operation may be an RDMA READ operation or an RDMA WRITE write operation.
In RDMA use, timely learning of completion of an RDMA operation to process information related to the RDMA operation as soon as possible is a key to improving the efficiency of RDMA operation processing.
Disclosure of Invention
The application provides a memory access method and a memory access device, which are used for improving the processing efficiency of RDMA (remote direct memory access) operation.
The technical scheme provided by the application comprises the following steps:
a memory access method is applied to business equipment and comprises the following steps:
generating a Work Request (WR) chain for the RDMA operation that satisfies a condition: the last WR in the WR chain is used to indicate RDMA operation completion;
and when the RDMA operation is initiated to an opposite end service device, transmitting the WR in the WR chain to the opposite end service device in sequence.
A memory access device applied to business equipment comprises:
a processing module, configured to generate a WR chain for a remote direct memory access RDMA operation, where the WR chain satisfies a condition: the last WR in the WR chain is used to indicate RDMA operation completion;
and the service module is used for sending the WR in the WR chain to the opposite end service equipment according to the sequence when the RDMA operation is initiated to the opposite end service equipment.
According to the technical scheme, the WR chain meeting the conditions is generated for the RDMA operation, so that the WR for indicating the completion of the RDMA operation and the WR for realizing the RDMA operation are arranged in the same WR chain and the WR for indicating the completion of the RDMA operation is arranged at the end of the WR chain, the WR for indicating the completion of the RDMA operation is implicitly executed in the same operation flow, namely the RDMA operation flow, the completion of the RDMA operation can be known by the opposite-end service equipment in the RDMA operation flow, the opposite-end service equipment can timely sense the completion of the RDMA operation, and then corresponding operations such as informing an upper-layer application to process related information of the RDMA operation can be executed for the completed RDMA operation, and the processing efficiency of the RDMA operation is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 illustrates an RDMA READ operation implementation flow diagram;
FIG. 2 shows a schematic of the structure of WR;
FIG. 3 shows a structural diagram of a WR chain corresponding to an RDMA READ operation;
fig. 4 is a flowchart of a memory access method provided in the present application;
FIG. 5 is a flow diagram of an implementation of an RDMA READ operation in accordance with embodiment 1 of the present application;
FIG. 6 is a flowchart of RDMA WRITE operation implementation of embodiment 1 of the present application;
FIG. 7 is a flow diagram of an implementation of an RDMA READ operation in accordance with embodiment 2 of the present application;
FIG. 8 is a flowchart illustrating operation RDMA WRITE according to embodiment 3 of the present application;
FIG. 9 is a schematic diagram of the apparatus provided herein;
fig. 10 is a schematic hardware structure diagram of the apparatus shown in fig. 9 provided in the present application.
Detailed Description
In RDMA applications, the processing efficiency of RDMA operations is often reduced by some unnecessary time consumption when performing RDMA operations. The RDMA operation here may be an RDMA READ operation or an RDMA WRITE operation. The RDMA READ operation is described as an example below:
referring to FIG. 1, FIG. 1 shows an RDMA READ operation implementation flow diagram. As shown in fig. 1, the process may include the following steps:
step 101, a first service device initiates an RDMA SEND operation (denoted as RDMA SEND operation 1a) for requesting a memory address to a second service device.
Here, the first service device and the second service device are only named for convenience of distinction and are not intended to be limiting.
As an embodiment, the RDMA SEND operation 1a carries a data identifier of data (denoted as data 100) to be READ by the RDMA READ operation to be performed, and the purpose of the data identifier is to obtain, from the second service device, a memory address (denoted as memory address 1b, which is summarized as an address required by the RDMA READ operation) locally used by the second service device for recording the data 100.
After receiving the RDMA SEND operation 1a, the second service device finds the data 100 according to the data identifier carried in the RDMA SEND operation 1a, and if the second service device finds that the data 100 is recorded in the local memory, the second service device encapsulates a memory address 1b used for recording the data 100 in the local memory in the RDMA SEND operation (denoted as RDMA SEND operation 2a) and returns the RDMA SEND operation to the first service device; if the second service device finds that the data 100 is not recorded in the local memory, the second service device records the data 100 in the local memory first, and then the second service device encapsulates the memory address 1b used for recording the data 100 in the local memory in an RDMA SEND operation (referred to as an RDMA SEND operation 2a) and returns the RDMA SEND operation to the first service device.
It should be noted that, as an embodiment, encapsulating, by the second service device, the memory address 1b used for recording the data 100 in the local memory in an RDMA SEND operation (denoted as an RDMA SEND operation 2a) and returning the encapsulated memory address to the first service device may specifically be: the second service device divides the memory address 1b into a plurality of address blocks according to the data volume of the data 100, where the size of each address block may be equal or different, and the application is not particularly limited; and then packaging each address block and the data length corresponding to each address block in an RDMA SEND operation (denoted as RDMA SEND operation 2a) and returning the RDMA SEND operation to the first service equipment. For example: if the data amount of the data 100 is 512k, the second service device divides the memory address 1b into 128 address blocks, sets a data length (for example, 4k) corresponding to each address block, and encapsulates each address block and the data length corresponding to each address block in an RDMA SEND operation (denoted as RDMA SEND operation 2a) to be returned to the first service device.
In step 102, the first service device receives the RDMA SEND operation 2a returned by the second service device. After which the following step 103 is performed.
And 103, the first service equipment generates a Work Request (WR: Work Request) chain corresponding to the RDMA READ operation according to the memory address 1b carried by the RDMA SEND operation 2 a.
Based on the above specific description that the second service device encapsulates the memory address 1b used for recording the data 100 in the local memory in the RDMA SEND operation (denoted as RDMA SEND operation 2a) and returns the RDMA SEND operation to the first service device, in this step 103, the RDMA SEND operation 2a received by the first service device carries each address block whose memory address 1b is substantially divided. Based on this, in this step 103, generating the WR chain corresponding to the RDMA READ operation according to the memory address 1b carried by the RDMA SEND operation 2a specifically includes:
WRs of the RDMA READ operation (which correspond to the address blocks according to which the WRs are generated) are sequentially generated according to the address blocks carried by the RDMA SEND operation 2a and the data lengths corresponding to the address blocks, and the sequentially generated WRs are connected in series to form a WR chain. For example, if the RDMA SEND operation 2a specifically carries 128 address blocks and the data length corresponding to each address block is 4k, in this step 102, a first WR may be generated according to the first address block carried by the RDMA SEND operation 2a, where the first WR corresponds to the first address block, and a second WR may be generated according to the second address block carried by the RDMA SEND operation 2a, where the second WR corresponds to the second address block, and so on, and finally 128 WRs are generated. Fig. 2 shows the structure of WR. Then, the 128 generated WRs are concatenated in sequence to form a WR chain, i.e., the WR chain corresponding to the RDMA READ operation, as shown in fig. 3.
The WR shown in fig. 2 mainly includes: an operation type field (Opcode), a local memory address field (Localbuf _ addr _ info), an opposite memory address field (Remote _ addr _ info), a Flag bit field (Flag), and a Next WR field (Next). Here, applied to the RDMA READ operation flow shown in fig. 1, Opcode is RDMA READ; the Localkuf _ addr _ info comprises a starting memory address of the data read based on the WR in the local memory and the address length occupied by the read data; the Remote _ addr _ info includes the start address of the address block corresponding to the WR and the address length of the address block. Flag is default value; next is used to indicate the Next WR.
Based on Next in WR, concatenating the sequentially generated WRs together in the above order to form a WR chain may specifically be: and (4) pointing the Next of the first WR to the second WR, pointing the Next of the second WR to the third WR, and so on, and finally, connecting all WRs in series to form a WR chain.
It should be noted that the Flag of the last WR in the WR chain generated in step 103 is set to be IB _ SEND _ signed, which is intended to trigger the first service device to generate a CQE message (Opcode is RADM READ), so that the first service device (specifically, the RDMA application of the first service device) determines that the RDMA READ operation initiated by the device is completed by parsing the CQE message (Opcode is RADM READ), specifically referring to step 105 below.
Step 104, the first service device sequentially sends the WRs in the WR chain to the second service device in a serial manner.
In this step 104, after the first service device sends the WR in the WR chain to the second service device, the second service device may receive the WR sent from the first service device, and when the second service device receives the WR sent from the first service device, RDMA hardware of the second service device, such as a network card, READs data according to Remote _ addr _ info in the received WR, and returns the READ data to the first service device, and at this time, in the whole data reading process, the RDMA application of the second service device does not sense the RDMA READ operation.
In addition, in this step 104, the step of sending, by the first service device, the WR to the second service device in a serial manner specifically includes: after the first service device sends a WR every time, if data returned by the second service device for the WR is received, continuing to send the next WR, and so on, and finally, after the first service device sends the last WR in the WR chain, if data returned by the second service device for the last WR is received, it means that the RDMA READ operation initiated by the first service device is completed. At this time, the first service device performs step 105 described below.
Step 105, the first service device generates a CQE message (Opcode is RADM READ) based on IB _ SEND _ signed set by Flag of the last WR that has been sent, determines that the RDMA READ operation initiated by the device is completed by parsing the CQE message (Opcode is RADM READ), and then executes step 106.
In application, even if the first service device finishes sending the last WR of the WR chain and receives data returned by the second service device for the last WR, the first service device (specifically, the RDMA application program of the first service device) itself does not logically determine whether the RDMA READ operation initiated by the first service device is completed, and in order to ensure that the first service device (specifically, the RDMA application program of the first service device) can know that the RDMA READ operation initiated by the first service device is completed when receiving the data returned by the second service device for the last WR of the sent WR chain, as described above, the first service device sets IB _ SEND _ SIGNALED for the Flag of the last WR of the WR chain. Thus, as described in step 105, when the first service device finishes sending the last WR of the WR chain and also receives data returned by the second service device for the last WR, the first service device generates a CQE message (Opcode is RADM READ) based on IB _ SEND _ signed set by Flag of the last WR that has been sent, and thus, the first service device determines that the RDMA READ operation initiated by the device is completed by parsing the CQE message (Opcode is RADM READ).
In this application, when the RDMA READ operation initiated by the first service device is completed, the second service device (specifically, the RDMA application of the second service device) does not sense that the entire RDMA READ operation is completed, and in order to ensure that the second service device senses that the RDMA READ operation initiated by the first service device is completed, and thus to facilitate the second service device to execute relevant processing such as address release and the like in time after the RDMA READ operation is completed, it is necessary to switch from the original process of executing the RDMA READ operation to the process of executing the RDMA SEND operation, which is specifically shown in step 106 below.
Step 106, the first service device initiates an RDMA SEND operation (denoted as RDMA SEND operation 3a) for indicating completion of the RDMA READ operation to the second service device again.
When the second service device receives the RDMASEND operation 3a, it confirms that the rdmasead operation is completed according to the RDMASEND operation 3a, and then, it can execute relevant processing such as address release and the like in time for the completed RDMA READ operation.
Thus, the flow shown in fig. 1 is completed.
In the flow shown in fig. 1, when the first service device receives the data returned by the second service device for the last WR, it means that the RDMA READ operation initiated by the first service device is completed. As can be seen from the flow shown in fig. 1, after the RDMAREAD operation initiated by the first service device is completed, the second service device (specifically, the RDMA application of the second service device) does not know in time, but knows after 4 time periods (Δ t1 to Δ t 4). Where Δ t1 is the time when the first service device processes RDMA READ completion related information such as step 105 above, and Δ t2 is the time when the first service device switches from the RDMA READ operational flow to the RDMA SEND operational flow; Δ t3 is the transmission time of RDMA SEND operation 3 a; Δ t4 is the time at which the second service device receives and recognizes the RDMA SEND operation 3 a.
The time Δ t1 and the time Δ t2 are the time locally consumed by the first service device, and the second service device can only know completion of the RDMA READ operation after the first service device consumes the local time Δ t1 and the time Δ t2, which is equivalent to the time locally consumed by the first service device being superposed on the time for the second service device to know completion of the RDMA READ operation, so that the second service device cannot timely know completion of the RDMA READ operation, and further cannot timely respond to relevant processing such as address release of the RDMA READ operation by the second service device, and the processing efficiency of the RDMA READ operation is reduced.
The RDMAREAD operation is used as an example to describe the problem of RDMA READ operation, that is, the opposite-end service device cannot timely know the completion of RDMA READ operation, and the processing efficiency of RDMA READ operation is reduced. Similarly, the RDMA WRITE operation has a similar problem in that the peer service device cannot timely know that RDMAWRITE operation is completed, which reduces the processing efficiency of RDMA WRITE operation.
In order to solve the above problem, the present application provides a method as shown in fig. 4.
Referring to fig. 4, fig. 4 is a flowchart of a memory access method provided in the present application. The flow is applied to any business equipment.
As shown in fig. 4, the process may include the following steps:
step 401, generating a WR chain satisfying the condition for the RDMA operation, where the condition is: the last WR in the WR chain is used to indicate RDMA operation completion.
WR for implementing the RDMA operation is placed in the same WR chain as a WR for indicating completion of the RDMA operation to a peer traffic device (denoted as WR400), which means WR400 is part of the RDMA operation, corresponding to WR400 being performed with the RDMA operation, via step 401.
Step 402, when the RDMA operation is initiated to the opposite end service device, the WR in the WR chain is sent to the opposite end service device in sequence.
In the application, the WR400 and the WR for realizing the RDMA operation are arranged in the same WR chain and at the end of the WR chain, so that the WR400 and the WR for realizing the RDMA operation are implicitly executed in the same operation flow, namely the RDMA operation flow, an RDMA SEND operation flow different from the RDMA operation flow is not required to be additionally initiated to inform the opposite-end service equipment, the opposite-end service equipment can timely sense the completion of the RDMA operation, further the related information of the RDMA operation can be timely processed, and the processing efficiency of the RDMA operation is improved.
The flow shown in fig. 4 is completed.
Through the flow shown in fig. 4, the WR400 and the WR for implementing the RDMA operation are implicitly performed in the same operation flow, that is, the flow of the RDMA operation, so that it is ensured that the opposite-end service device can know completion of the RDMA operation in the flow of the RDMA operation, on one hand, the service device initiating the RDMA operation can be saved from switching from the RDMA operation, such as the RDMA READ operation flow, to the RDMA SEND operation flow again to notify the opposite-end service device of a message that the RDMA operation is completed, on the other hand, the situation that the local consumption time of the service device initiating the RDMA operation (such as Δ t1 and Δ t2) is overlapped to the time that the opposite-end service device knows completion of the RDMA access operation is also avoided, and finally, compared with the flow shown in fig. 1, the flow shown in fig. 4 can advance the time that the opposite-end service device knows completion of the RDMA operation, and improve the processing efficiency of the RDMA operation.
In an example, the generating a corresponding work request WR chain for the RDMA operation in step 401 may specifically include: generating a WR for realizing the RDMA operation according to a first memory address required by the RDMA operation acquired from the opposite end service device; generating a first specified WR to indicate completion of the RDMA operation; composing the WR used to implement the RDMA operation, the first specified WR, into the WR chain, wherein the first specified WR is the last WR of the WR chain.
In one example, the first designated WR above refers to: opcode is the WR for RDMA SEND (RDMA SEND WR for short). RDMA SEND WR is different from RDMA WRITE WR (Opcode is WR of RDMA WRITE) or RDMA READ WR (Opcode is WR of RDMA READ). RDMA SEND WR is described below by way of example 1:
example 1:
referring to fig. 5, fig. 5 is a flowchart of an implementation of an RDMA READ operation according to embodiment 1 of the present application. As shown in fig. 5, the process may include the following steps:
in step 501, the service device 5_1 initiates an RDMA SEND operation (denoted as RDMA SEND operation S11) for requesting a memory address to the service device 5_ 2.
This step 501 is similar to step 101 described above.
Step 502, the service device 5_1 receives the RDMA SEND operation S12 returned by the service device 5_2, and generates at least one WR (denoted as RDMA READ WR) for implementing the RDMA READ operation according to the memory address (denoted as M1) carried by the RDMA SEND operation S12.
In this step 502, Opcode of each RDMA READ WR generated by the service device 5_1 is RDMA READ.
At step 503, service device 5_1 generates RDMA SEND WR indicating completion of the RDMA READ operation to service device 5_2, assembling respective RDMA READ WR, RDMA SEND WR into a WR chain, where RDMA SEND WR is the last WR of the WR chain.
RDMA SEND WR generated in this step 503 differs from RDMA READ WR in that its Opcode is RDMA SEND.
As an embodiment, in this step 503, the step of forming a WR chain from each of RDMA READ WR and RDMA SEND WR may specifically include: next, first RDMA READ WR is directed to second RDMA READ WR, Next second RDMA READ WR is directed to third RDMA READ WR, and so on, and the last RDMA READ WR is concatenated RDMA SEND WR to form a WR chain.
Finally, the service device 5_1 generates a WR chain for the RDMA READ operation that satisfies the following condition, via step 503: the last WR in the WR chain is used to indicate to traffic device 5_2 that the RDMA READ operation initiated by traffic device 5_1 is complete.
Traffic device 5_1 sends the WRs in the WR chain to traffic device 5_2 in order, step 504.
As an example, in this step 504, the service device 5_1 sequentially sends WRs in the WR chain to the service device 5_2 in a serial manner.
In this step 504, after the service device 5_1 sends a WR to the service device 5_2, the service device 5_2 receives the WR.
If the WR received by the service device 5_2 is RDMA READ WR, the RDMA hardware of the service device 5_2, such as the network card, READs data according to the memory address carried by the Remote _ addr _ info in RDMA READ WR and returns the data to the service device 5_1, so that the service device 5_1 writes data (corresponding to reading data through an RDMA READ operation) according to Localbuf _ addr _ info in RDMA READ WR, and the RDMA application of the service device 5_2 is not aware in the whole data reading process.
If the WR received by the service device 5_2 is RDMASEND WR, the hardware of the service device 5_2, such as a network card, generates a CQE message, the Opcode of the CQE message is a type (recv) for indicating reception RDMA SEND WR, and sends the generated CQE message to the RDMA application, at this time, the RDMA application of the service device 5_2 parses the received RDMA SEND WR according to the CQE message, and further learns completion of the RDMA READ operation by parsing RDMA SEND WR. At this time, the service device 5_2 learns that the RDMA READ operation is completed, that is, it is implemented that the message indicating completion of the RDMA READ operation initiated by the service device 5_1 is indicated to the service device 5_2 through RDMA SEND WR. In fact, based on the fact that service device 5_1 sequentially sends a description of WRs to service device 5_2 in a serial manner, when service device 5_2 receives RDMA SEND WR, it does also mean that the RDMA READ operation was successfully completed. In other words, in this embodiment 1, once RDMA SEND WR is received by the service device 5_2, it does mean that the RDMA READ operation is completed. Thus, in this embodiment 1, it means that the service device 5_2 knows completion of the RDMA READ operation in the RDMA READ operation flow.
Meanwhile, after sending RDMA SEND WR, the service device 5_1 also performs the following step 505.
Step 505, the service device 5_1 generates a CQE message (Opcode is RADM SEND), and determines that the RDMA READ operation initiated by the device is completed by parsing the CQE message (Opcode is RADM SEND).
To this end, through step 505, the service device 5_1 also knows that the RDMA READ operation initiated by the present device is completed, and it is implemented by RDMA SEND WR to instruct the present service device 5_1 to generate a corresponding completion CQE message (Opcode is RDMA SEND) after the transmission completion of RDMA SEND WR, so as to instruct the completion of the RDMA READ operation initiated by the present device.
The flow shown in fig. 5 is completed.
As can be seen from the flow shown in fig. 5, in this embodiment 1, after receiving the last WR RDMA SEND WR in the WR chain, the service device 5_2 can know, according to the received RDMA SEND WR, that the RDMA READ operation initiated by the service device 5_1 is completed, so that the service device 5_2 can know that the RDMA READ operation is completed in the flow of the RDMA READ operation, the time for the service device 5_2 to know that the RDMA READ operation is completed is advanced, and the processing efficiency of the RDMA READ operation is improved.
Embodiment 1 is described above with an RDMA READ operation as an example, and embodiment 1 is described below with an RDMA WRITE operation as an example:
referring to fig. 6, fig. 6 is a flowchart of an implementation of RDMA WRITE operation in embodiment 1 of the present application. As shown in fig. 6, the process may include the following steps:
in step 601, the service device 6_1 initiates an RDMA SEND operation (denoted as RDMA SEND operation S21) for requesting a memory address to the service device 6_ 2.
As an embodiment, the RDMA SEND operation S21 herein carries the data size L of the data to be written by the RDMA WRITE operation to be performed (denoted as data D600), and the purpose of the RDMA SEND operation is to obtain, from the service device 6_2, the memory address (denoted as memory address M2, which is summarized as an address required for RDMA WRITE operation) that is locally used by the service device 6_2 to record the data D600 written by the service device 6_1 through RDMA WRITE operation.
After the service device 6_2 receives the RDMA SEND operation S21, a memory address (denoted as memory address M2) in the local memory, which is intended to record that the service device 6_1 writes the data D600 through RDMA WRITE operation, is determined according to the data size L carried by the RDMA SEND operation S21, and the memory address M2 is encapsulated in the RDMA SEND operation (denoted as RDMA SEND operation S22) and returned to the service device 6_ 1.
As an embodiment, the step of encapsulating the memory address M2 in an RDMA SEND operation (referred to as an RDMA SEND operation S22) and returning the memory address M2 to the service device 6_1 may specifically be: dividing M2 into a plurality of address blocks according to the data size L, where the size of each address block may be equal or different, and the application is not particularly limited; then, the divided address blocks and the data lengths corresponding to the address blocks are encapsulated in an RDMA SEND operation (denoted as RDMA SEND operation S22) and returned to the service device 6_ 1. For example: if the data size L is 512k, the service device 6_2 divides the memory address M2 into 128 address blocks, sets the data length (e.g., 4k) corresponding to each address block, and encapsulates each address block and the data length corresponding to each address block in an RDMA SEND operation (denoted as RDMA SEND operation S22) to be returned to the service device 6_ 1.
In step 602, the service device 6_1 receives the RDMA SEND operation S22 returned by the service device 6_2, and generates at least one WR (denoted as RDMA WRITE WR) for implementing RDMA WRITE operation according to the memory address M2 carried in the RDMA SEND operation S22.
Based on the above description that the service device 6_2 encapsulates the memory address M2 in the RDMA SEND operation (referred to as RDMA SEND operation S22) and returns the RDMA SEND operation to the service device 6_1, in this step 602, the RDMA SEND operation S22 received by the service device 6_1 carries the address blocks in which the memory address M1 is divided. Based on this, in this step 602, generating at least one RDMA WRITE WR according to the memory address M2 carried by the RDMA SEND operation S22 specifically includes:
RDMA WRITE WR is generated sequentially according to the address block carried by the RDMA SEND operation S22 and the data length corresponding to the address block, and Opcode of each RDMA WRITE WR is RDMA WRITE. For example, if the RDMA SEND operation S22 specifically carries 128 address blocks and each address block has a corresponding data length of 4k, in this step 602, a first address block RDMA WRITE WR corresponding to the first address block may be generated according to the first address block carried by the RDMA SEND operation S22, a second address block RDMA WRITE WR corresponding to the second address block may be generated according to the second address block carried by the RDMA SEND operation S22, and so on, and finally 128 address blocks RDMA WRITE WR are generated.
Here, the structure of each generated RDMA WRITE WR is similar to that shown in fig. 2, and is applied to the operation flow RDMA WRITE shown in fig. 6, and then the following fields in each generated RDMA WRITE WR are specifically:
Opcode:RDMA WRITE;
localbuf _ addr _ info: the WR writing method comprises the steps of writing data based on the WR into a starting memory address of a local memory and the address length occupied by the written data;
remote _ addr _ info: the WR address comprises the initial address of the address block corresponding to the WR and the address length of the address block;
flag: a default value;
next: indicating the next WR.
In step 603, the service device 6_1 generates RDMA SEND WR for indicating RDMA WRITE that the operation is completed to the service device 6_2, and groups RDMA WRITE WR and RDMA SEND WR into a WR chain, where RDMA SEND WR is the last WR of the WR chain.
RDMA SEND WR generated in this step 603 is different from RDMA WRITE WR, whose Opcode is RDMA SEND.
As an embodiment, in this step 603, the step of forming the WR chain from each of RDMA WRITE WR and RDMA SEND WR may specifically include: next, first RDMA WRITE WR is directed to second RDMA WRITE WR, Next second RDMA WRITE WR is directed to third RDMA WRITE WR, and so on, and the last RDMA WRITE WR is concatenated RDMA SEND WR to form a WR chain.
Finally, the service device 6_1 generates a WR chain for RDMA WRITE operations, which satisfies the following condition, through step 603: the last WR in the WR chain is used to indicate to traffic device 6_2 that the RDMA WRITE operation initiated by traffic device 6_1 is complete.
At step 604, traffic device 6_1 sends WRs in the WR chain to traffic device 6_2 in order.
In this step 604, the service device 6_1 sequentially sends WRs in the WR chain to the service device 6_2 in a serial manner.
After traffic device 6_1 sends a WR in the WR chain to traffic device 6_2, traffic device 6_2 receives the WR.
If the WR received by the service device 6_2 is RDMA WRITE WR, the RDMA hardware of the service device 6_2, such as the network card, writes data (corresponding to write data through RDMA WRITE operation) according to the received Remote _ addr _ info field RDMA WRITE WR, and the RDMA application of the service device 6_2 is not aware in the whole data writing process.
If the WR received by the service device 6_2 is RDMA SEND WR, the hardware of the service device 6_2, such as the network card, generates a CQE message (Opcode is recv) and sends the CQE message to the RDMA application, at this time, the RDMA application of the service device 6_2 parses the received RDMA SEND WR according to the CQE message, and further learns completion of RDMA WRITE operation through parsing RDMA SEND WR, at this time, the service device 6_2 learns completion of RDMA WRITE operation, that is, the completion of RDMA WRITE operation initiated by the service device 6_1 is indicated to the service device 6_2 through RDMA SEND WR. In fact, based on the fact that traffic device 6_1 sequentially sends a description of the WR to traffic device 6_2 in a serial manner, when traffic device 6_2 receives RDMA SEND WR, it does also mean that the RDMA WRITE operation was successfully completed. In other words, in this embodiment 1, once the service device 6_2 receives RDMA SEND WR, it does mean that RDMA WRITE operation is completed. Thus, in this embodiment 1, it means that the service device 6_2 knows RDMA WRITE that the operation is completed in the RDMA WRITE operation flow.
Meanwhile, after sending RDMA SEND WR, the service device 6_1 also performs the following step 605.
Step 605, the service device 6_1 generates a CQE message (Opcode is RADM SEND), and determines that RDMA WRITE operations initiated by the device are completed by parsing the CQE message (Opcode is RADM SEND).
Up to this point, through step 605, the service device 6_1 also knows that the RDMA WRITE operation initiated by the device is completed, and thus, it is indicated that, through step RDMA SEND WR, the service device 6_1 generates a corresponding completion CQE message (Opcode is RDMA SEND) after the RDMA SEND WR sending is completed, so as to indicate that the RDMAWRITE operation initiated by the device is completed. At this point, the service device 6_1 knows that the RDMA WRITE operation initiated by the device is completed
The flow shown in fig. 6 is completed.
As can be seen from the flow shown in fig. 6, in this embodiment 1, after receiving the last WR, that is, RDMA SEND WR, in the WR chain, the service device 6_2 can know that RDMA WRITE operation initiated by the service device 6_1 is completed according to the received RDMA SEND WR, so that the service device 6_2 can know that RDMA WRITE operation is completed in the flow of RDMA WRITE operation, and the time for the service device 6_2 to know that RDMA WRITE operation is completed is advanced, thereby improving the processing efficiency of RDMA WRITE operation.
Embodiment 1 was described above with operation RDMAWRITE as an example.
The description of embodiment 1 is completed so far.
In another example, the first designated WR described above refers to: opcode is a WR of RDMA WRITE (noted as WR 700). It should be noted that the first specified WR is specifically defined as a WR with Opcode of RDMA WRITE, so that the RDMA operation such as RDMA WRITE operation or RDMA READ operation is completed by the WR with Opcode of RDMA WRITE. Hereinafter, the details are described by way of example 2.
Example 2:
referring to fig. 7, fig. 7 is a flowchart of an implementation of an RDMA READ operation according to embodiment 2 of the present application. As shown in fig. 7, the process may include the following steps:
in step 701, the service device 7_1 initiates an RDMA SEND operation (denoted as RDMA SEND operation S31) for requesting a memory address to the service device 7_ 2.
As an embodiment, the RDMA SEND operation S31 carries the data identifier of the data (denoted as data D700) to be READ by the RDMA READ operation to be performed, and the purpose of the operation is to obtain the memory address locally used by the service device 7_2 for recording the data D00.
After the service device 7_2 receives the RDMA SEND operation S31, finding the data D700 according to the data identifier carried in the RDMA SEND operation S31, if the service device 7_2 finds that the data D700 has been recorded in the local memory, encapsulating a memory address (denoted as M311) used for recording the data D700 in the local memory and selecting a free address (denoted as M312) from the local memory according to previous negotiation with the service device 7_1 in the RDMA SEND operation (denoted as RDMA SEND operation S32) and returning the encapsulated free address to the service device 7_ 1; if the service device 7_2 finds that the data D700 is not recorded in the local memory, the service device 7_2 records the data D700 in the local memory, and then encapsulates a free address (denoted as M312) selected from the local memory according to the previous negotiation with the service device 7_1 and used for recording the memory address (denoted as M311) of the data D700 in an RDMA SEND operation (denoted as RDMA SEND operation S32) and returns the RDMA SEND operation to the service device 7_ 1.
It should be noted that, as described in step 101 above, in this embodiment 2, encapsulating the memory address (denoted as M311) used for recording the data D700 in the local memory and the free address block (M312) in the RDMA SEND operation (denoted as RDMA SEND operation S32) by the service device 7_2 and returning the encapsulated result to the service device 7_1 specifically may be: the service device 7_2 divides the memory address M311 into a plurality of address blocks according to the data amount of the data D700, the size of the divided address blocks may be equal to or different from the size of the free address block M312, and then the service device 7_2 encapsulates each divided address block and the data length corresponding to each address block, and the free address block M312 in an RDMA SEND operation (denoted as RDMA SEND operation S32) and returns the RDMA SEND operation to the service device 7_ 1.
Step 702, the service device 7_1 receives the RDMA SEND operation S32 returned by the service device 7_2, and generates at least one WR (denoted as RDMA READ WR) for implementing the RDMA READ operation according to the memory address M311 (divided address block) carried by the RDMA SEND operation S32.
In this step 702, Opcode of each RDMA READ WR generated by the service device 7_1 is RDMA READ.
At step 703, traffic device 7_1 generates WR700 indicating completion of the RDMA READ operation to traffic device 5_2, Opcode of WR700 being RDMA WRITE, traffic device 7_1 grouping respective RDMA READ WR together with WR700 into a WR chain, where WR700 is the last WR of the WR chain.
WR700 generated in step 703 is generated from the free address block M312, and WR700 carries M312. As an embodiment, in combination with the WR structure shown in fig. 2, here, Opcode of WR700 is RDMA WRITE, Remote _ addr _ info carries the free address block M312, Localbuf _ addr _ info locally records the memory address of the specified identifier for the service device 7_1, Flag is IB _ SEND _ signed, and Next is null. The specified identifier here refers to an identifier negotiated by the service device 7_1 and the service device 7_2 for indicating completion of the RDMA operation.
As an embodiment, in this step 703, the forming of the WR chains from RDMA READ WR and WR700 may specifically include: the Next of the first RDMA READ WR is directed to the second RDMA READ WR, the Next of the second RDMA READ WR is directed to the third RDMA READ WR, and so on, and the Next of the last RDMA READ WR is concatenated with the WR700 to form a WR chain.
Finally, the service device 7_1 generates a WR chain for the RDMA READ operation, which satisfies the following condition, through step 703: the last WR in the WR chain is used to indicate to traffic device 7_2 that the RDMA READ operation initiated by traffic device 7_1 is complete.
Traffic device 7_1 sends the WRs in the WR chain to traffic device 7_2 in order, step 704.
As an example, in this step 704, traffic device 7_1 sequentially sends WRs in the WR chain to traffic device 7_2 in a serial manner.
In this step 704, after the service device 7_1 sends a WR in the WR chain to the service device 7_2, the service device 7_2 receives the WR.
When the service device 7_2 receives RDMA READ WR, it executes the process according to the description of step 504;
when service device 7_2 receives WR700, service device 7_2 reads the specified id from Localbuf _ addr _ info of WR700 and writes the specified id to free address block M312 indicated by Remote _ addr _ info of WR 700. It should be noted that, in this application, after the service device 7_2 sends the free address block M312 to the service device 7_1, the service device 7_2 (specifically, the RDMA application program of the service device 7_ 2) may monitor in real time whether the free address block M312 writes the specified identifier, and once it is monitored that the free address block M312 writes the specified identifier, based on the description of the specified identifier, the service device 7_2 may consider that the RDMA READ operation is completed, at this time, the service device 7_2 knows that the RDMA READ operation is completed, that is, it is implemented that a message that the RDMA READ operation initiated by the service device 7_1 is completed is indicated to the service device 7_2 through the WR 700. In fact, based on the fact that traffic device 7_1 sequentially sends a description of the WR to traffic device 7_2 in a serial manner, when traffic device 7_2 receives WR700, it does also mean that the RDMA READ operation was successfully completed. In other words, in this embodiment 2, once the WR700 is received by the service device 7_2, it does mean that the RDMA READ operation is completed. Thus, in this embodiment 2, it means that the service device 7_2 knows completion of the RDMA READ operation in the RDMA READ operation flow.
Meanwhile, after the WR700 is transmitted, the service device 7_1 performs the following step 705.
In step 705, the service device 7_1 generates a CQE message (Opcode is RADM WRITE), and determines that the RDMA READ operation initiated by the device is completed by parsing the CQE message (Opcode is RADM WRITE).
Here, because the Flag of WR700 is IB _ SEND _ SIGNALED, based on IB _ SEND _ SIGNALED, after sending WR700, service device 7_1 generates a CQE message (Opcode is RADM WRITE), and determines that the RDMA READ operation corresponding to the WR chain where WR700 is located is completed by parsing the CQE message (Opcode is RADM WRITE)), that is, it is achieved that WR700 indicates that service device 7_1 generates a corresponding completion CQE message (Opcode is RDMA SEND) after the WR700 completes sending, so as to indicate that the RDMA READ operation initiated by the service device is completed. At this point, the service device 7_1 knows that the RDMA READ operation initiated by the device is completed.
The flow shown in fig. 7 is completed.
As can be seen from the flow shown in fig. 7, in this embodiment 2, after receiving the last WR (e.g., WR700) in the WR chain, the service device 7_2 (e.g., a network card) can write the specified identifier in the free address block M312 sent by the service device 7_2 according to the received WR700, and based on the description of the specified identifier, the service device 7_2 can know, according to the specified identifier, that the RDMA READ operation initiated by the service device 7_1 is completed, so that the service device 7_2 can know that the RDMA READ operation is completed in the RDMA READ operation flow, and the time for the service device 7_2 to know that the RDMA READ operation is completed is advanced, thereby improving the processing efficiency of the RDMA READ operation.
Embodiment 2 was described above with an example of an RDMA READ operation, and the RDMA WRITE operation is similar to an RDMA READ operation and will not be described one by one here.
The description of embodiment 2 is completed so far.
Example 3:
in contrast to the above embodiments 1 and 2, the second designated WR indicating the completion of the RDMA WRITE does not need to be additionally generated in the present embodiment 3.
This embodiment 3 applies to the case of RDMA WRITE operation.
As an embodiment, in this embodiment 3, the generating a WR chain satisfying the condition for the RDMA operation in step 401 includes steps a1 to a 5:
step a1, obtaining, from the opposite-end service device, a third memory address required by the RDMA WRITE operation and a fourth memory address which is idle and continuous with the third memory address;
a step a2, generating a WR (RDMA WRITE WR) for implementing the RDMA WRITE operation according to the third memory address; different ones of RDMAWRITE WR carry different opposite-end memory addresses, all RDMAWRITE WR carrying opposite-end memory addresses constituting the third memory address.
In conjunction with the WR structure shown in fig. 2, in step a2, each RDMA WRITE WR carries the peer memory address through the peer memory address field. Specifically, the peer memory address carried by the peer memory address field of each RDMA WRITE WR consists of the peer starting memory address and the address length (also called the peer memory address length). The peer-to-peer memory address fields of RDMAWRITE WR each carry different peer-to-peer starting memory addresses, but the peer-to-peer starting memory addresses carried by the peer-to-peer memory address fields of RDMAWRITE WR and the address length are combined together to form a third memory address.
Step a3, finding a second designated WR from the generated RDMAWRITE WR, wherein the opposite-end memory address carried by the second designated WR is closest to the fourth memory address;
step a4, performing a specified modification on the second specified WR to indicate that the opposite end service device writes a specified identifier in the fourth memory address, where the specified identifier is an identifier negotiated between the local device and the opposite end service device and used for indicating that the RDMAWRITE operation is completed.
Here, specifying the modification includes: and increasing the length of the opposite-end memory address carried by the second designated WR by the address length occupied by the fourth memory address, wherein the second designated WR carries a fifth memory address, and the fifth memory address is a memory address used for recording the designated identifier by the device. In connection with the WR structure shown in fig. 2, the above specified modification may specifically include: increasing the address length carried by the opposite-end memory address field (Remote _ addr _ info) in the second designated WR by the address length occupied by the fourth memory address; a local memory address field (Localbuf _ addr _ info) carrying a fifth memory address is newly added in the second specified WR, and the fifth memory address (denoted as M413) is a memory address of the local memory for recording the specified identifier.
Step a5, forming the generated RDMA WRITE WR into the WR chain, wherein the second designated WR is the last WR of the WR chain.
This example 3 is described in detail below:
referring to fig. 8, fig. 8 is a flowchart of an implementation of RDMAWRITE operation according to embodiment 3 of the present application. As shown in fig. 8, the process may include the following steps:
in step 801, the service device 8_1 initiates an RDMA SEND operation (denoted as RDMA SEND operation S41) for requesting a memory address to the service device 8_ 2.
As an embodiment, the RDMA SEND operation S41 carries the data size of the data (denoted as data D800) to be written by the operation RDMA WRITE to be performed, and the purpose of the operation is to obtain the memory address of the service device 8_2 local to the service device 8_2 for recording the data D800 written by the service device 8_1 through RDMA WRITE operation.
After the service device 8_2 receives the RDMASEND operation S41, it determines a memory address (i.e., the third memory address, which is denoted as M411) in the local memory, which is used for recording the data D800 written by the service device 8_1 through RDMA WRITE operation, according to the size of the data carried by the RDMASEND operation S41, and then encapsulates the memory address (i.e., the third memory address, which is denoted as M411) in the local memory, which is used for recording the data D800, and a free address (i.e., the fourth memory address, which is denoted as M412) which is continuous with M411, from the local memory according to the previous negotiation with the service device 8_1, into an RDMA SEND operation (denoted as RDMA SEND operation S42) and returns the RDMA SEND operation S42 to the service device 8_ 1.
It should be noted that, as described in step 101 above, in this embodiment 3, the encapsulation of M411 and M412 by the service device 8_2 in the RDMA SEND operation S42 and returning to the service device 8_1 may specifically be: the service device 8_2 divides the M411 into a plurality of address blocks according to the data amount of the data D800, the size of the divided address blocks may be equal to or different from that of the M412, and then the service device 8_2 encapsulates the divided address blocks, the data lengths corresponding to the address blocks, and the free address block M412 in the rdmask operation S42 and returns the rdmask operation S42 to the service device 8_ 1.
In step 802, the service device 8_1 receives the RDMA SEND operation S42 returned by the service device 8_2, and generates at least one WR (denoted as RDMA WRITE WR) for implementing RDMA WRITE operation according to the memory address M411 carried in the RDMA SEND operation S42.
This step 802 is similar to step 602 described above.
For example, if M411 is divided into 1 to 128 address blocks, and each address block has a data length of 4k, a first WR is generated according to the first address block, a second WR is generated according to the second address block, and so on, and finally 128 WRs are generated, so in step 802, the WR chain generated by service device 8_1 is composed of 128 WRs in sequence.
In step 803, the service device 8_1 finds a second specified WR from the generated RDMA WRITE WR, where the peer memory address carried by the second specified WR is closest to M412.
Taking M412 and M411 as consecutive, and M412 is after M411 as an example, if the service device 8_1 generates RDMA WRITE WR according to M411 in the order of addresses from front to back, the second designated WR found in this step 803 is the last RDMA WRITE WR; for another example, if the service device 8_1 generates RDMA WRITE WR according to M411 in the order from the back to the front of the address, the second designated WR found in this step 803 is the first RDMA WRITE WR. Finally, the peer memory address carried by the second designated WR found in this step 803 is closest to M412.
In step 804, the service device 8_1 performs the specified modification on the second specified WR as described above to instruct the service device 8_1 to write the specified identifier in M412, where the specified identifier is the identifier negotiated between the service device 8_1 and the service device 8_2 and used for instructing RDMAWRITE to complete the operation.
Taking the last RDMA WRITE WR generated by the service device 8_1 as the second designated WR as an example, based on the above description about the designated modification, in this step 804, as shown in fig. 8, the structure of the last RDMA WRITE WR is updated as follows compared with the other RDMA WRITE WR:
one extra Localbu _ addr _ info (denoted as Localbu _ addr _ info2, and already denoted as Localbu _ addr _ info1) is added, and the address length contained in the Remote _ addr _ info is increased by the address length occupied by the M412. Through the update, the service device 8_1 can be instructed to read the specified identifier from the memory address M413 indicated by the Localbuf _ addr _ info2 and write the read specified identifier into M412, which will be described in detail below.
At step 805, the WR generated to implement the RDMA WRITE operation is grouped into the WR chain, where the second designated WR is the last WR of the WR chain.
Taking the last designated WR RDMA WRITE WR generated by the service device 8_1 as an example, as an embodiment, in this step 805, forming the WR for implementing the RDMA WRITE operation into the WR chain specifically may include: next of the first RDMA WRITE WR is directed to the second RDMA WRITE WR, Next of the second RDMA WRITE WR is directed to the third RDMA WRITE WR, and so on, and eventually all RDMA WRITE WR are concatenated to form a WR chain.
Finally, the service device 8_1 generates a WR chain for RDMA WRITE operations, which satisfies the following condition, through step 805: the last WR in the WR chain is used to indicate to traffic device 8_2 that the RDMA WRITE operation initiated by traffic device 6_1 is complete.
Traffic device 8_1 sends the WRs in the WR chain to traffic device 8_2 in order, step 806.
In this step 806, traffic device 8_1 sequentially sends WRs in the WR chain to traffic device 8_2 in a serial manner.
After traffic device 8_1 sends a WR in the WR chain to traffic device 8_2, traffic device 8_2 receives the WR. When traffic device 8_2 receives the last WR of the WR chain, traffic device 8_2 writes the specified identification in free address block M412 based on the description of the last WR as above. It should be noted that, in this application, after the service device 8_2 sends the free address block M412, the service device 8_2(RDMA application) may monitor in real time whether the free address block M412 writes the specified identifier, and once the free address block M412 writes the specified identifier, the service device 8_2 may easily and timely monitor. Based on the description of the specific identifier, when the service device 8_2(RDMA application) detects that the free address block M412 writes to the specific identifier, it means that RDMA WRITE operation is completed, and at this time, the service device 8_2 knows RDMA WRITE operation is completed, that is, it is achieved that the service device 8_2 knows RDMA WRITE operation initiated by the service device 8_1 is completed. In fact, based on traffic device 8_1 sequentially sending descriptions of WRs to traffic device 8_2 in a serial manner, when traffic device 8_2 receives the last WR of the WR chain, it does also mean that RDMA WRITE completed successfully. In other words, in this embodiment 3, once the last WR of the WR chain is received by the service device 8_2, it does mean that the operation RDMA WRITE is completed. Thus, in this embodiment 3, it means that the service device 8_2 knows RDMA WRITE that the operation is completed in the RDMA WRITE operation flow.
Meanwhile, the service device 8_1 performs the following step 807 after transmitting the last WR.
In step 807, the service device 8_1 generates a CQE message (Opcode is RADM WRITE), and determines that the RDMA WRITE operation initiated by the present device is completed by parsing the CQE message (Opcode is RADMWRITE).
Here, since the Flag of the last WR is IB _ SEND _ SIGNALED, based on IB _ SEND _ SIGNALED, the service device 8_1 generates a CQE message (Opcode is RADM WRITE) after sending the last WR, and determines that RDMA WRITE operation is completed by parsing the CQE message (Opcode is RADM WRITE)), so that the service device 8_1 knows that RDMA WRITE operation initiated by the device is completed.
The flow shown in fig. 8 is completed.
As can be seen from the flow shown in fig. 8, in this embodiment 3, by performing the above specified modification on one RDMA WRITE WR (the above second specified WR) for implementing RDMA WRITE operation by the service device 8_1, it can be achieved that the service device 8_2 can know completion of RDMA WRITE operation in the flow of RDMA WRITE operation, and the processing efficiency of RDMA WRITE operation is improved.
The description of embodiment 3 is completed so far.
The method provided by the present application is described above, and the device provided by the present application is described below:
referring to fig. 9, fig. 9 is a diagram illustrating a structure of the apparatus according to the present invention. The device is applied to business equipment and comprises:
a processing module, configured to generate a WR chain for a remote direct memory access RDMA operation, where the WR chain satisfies a condition: the last WR in the WR chain is used to indicate RDMA operation completion;
and the service module is used for sending the WR in the WR chain to the opposite end service equipment according to the sequence when the RDMA operation is initiated to the opposite end service equipment.
As an embodiment, the processing module is specifically configured to:
generating a WR for realizing the RDMA operation according to a first memory address required by the RDMA operation acquired from the opposite end service device;
generating a first specified WR to indicate completion of the RDMA operation;
composing the WR used to implement the RDMA operation, the first specified WR, into the WR chain, wherein the first specified WR is the last WR of the WR chain.
As an example, the first specified WR is: opcode is a WR of type SEND sent for RDMA.
For one embodiment, the first specified WR includes a second memory address; the second memory address is: obtaining idle addresses except the first memory address from the opposite terminal service equipment;
the first designated WR is used to instruct the peer service device to write a designated identifier in the second memory address, where the designated identifier is an identifier negotiated between the local device and the peer service device and used to instruct the RDMA operation to complete.
For one embodiment, the RDMA operation is an RDMA WRITE operation; the processing module is specifically configured to:
acquiring a third memory address required by the RDMA WRITE operation and a fourth memory address which is idle and continuous with the third memory address from the opposite-end service equipment;
generating a WR for implementing the RDMA WRITE operation according to the third memory address; different WRs carry different opposite terminal memory addresses, and the opposite terminal memory addresses carried by all WRs form the third memory address;
finding a second specified WR from the generated WRs for realizing the RDMA WRITE operation, wherein the opposite-end memory address carried by the second specified WR is closest to the fourth memory address;
performing specified modification on the second specified WR to indicate that the opposite-end service device writes a specified identifier in the fourth memory address, where the specified identifier is an identifier negotiated between the local device and the opposite-end service device and used for indicating that the RDMAWRITE operation is completed; the specified modification includes: increasing the address length in the opposite-end memory address information carried by the second designated WR by the address length occupied by the fourth memory address; a fifth memory address is carried in a second designated WR, and the fifth memory address is a memory address used for recording a designated identifier by the device;
composing the WR chain from the WRs generated to implement the RDMA WRITE operation, wherein the second designated WR is the last WR of the WR chain.
Thus, the description of the apparatus shown in fig. 9 is completed.
Referring to fig. 10, fig. 10 is a schematic diagram of a hardware structure of the apparatus shown in fig. 9 provided in the present application. As shown in fig. 10, the hardware structure includes:
a processor 1001, a machine-readable storage medium 1002 having machine-executable instructions stored thereon.
The processor 1001 and the machine-readable storage medium 1002 may communicate via a system bus 603, among other things. Also, the processor 1001 may perform the memory access method described above by reading and executing machine-executable instructions corresponding to the memory access method in the machine-readable storage medium 1002 by the processor 1001.
The machine-readable storage medium 1002 referred to herein may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: random Access Memory (RAM), volatile Memory, non-volatile Memory, flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, dvd, etc.), or similar storage media, or a combination thereof.
Thus, the description of the hardware configuration shown in fig. 10 is completed.
Also provided in this application is a machine-readable storage medium, such as machine-readable storage medium 1002 in fig. 10, comprising machine-executable instructions that are executable by processor 1001 in a memory access device to implement the memory access methods described above.
Specifically, the processor 1001 may perform the operations in the above memory access method by calling and executing machine-executable instructions in the machine-readable storage medium corresponding to the memory access method.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (8)

1. A memory access method is applied to business equipment and comprises the following steps:
when a first memory address required by remote memory direct access RDMA operation is acquired from an opposite-end service device, generating a WR for realizing the RDMA operation according to the first memory address required by the RDMA operation acquired from the opposite-end service device;
generating a first specified WR to indicate completion of the RDMA operation; wherein the first designated WR is the last WR of the WR chain;
composing the WR used to implement the RDMA operation, the first specified WR, into the WR chain;
and when the RDMA operation is initiated to an opposite end service device, transmitting the WR in the WR chain to the opposite end service device in sequence.
2. The method of claim 1,
the first specified WR is: the operation type is RDMA Send type WR.
3. The method of claim 1,
the first specified WR is: an operation type of RDMA WRITE type WR;
the first designated WR comprises a second memory address; the second memory address is: obtaining idle addresses except the first memory address from the opposite terminal service equipment;
the first designated WR is used to instruct the peer service device to write a designated identifier in the second memory address, where the designated identifier is an identifier negotiated between the local device and the peer service device and used to instruct the RDMA operation to complete.
4. The method of claim 1, wherein the RDMA operation is an RDMA WRITE operation;
when a third memory address required by the RDMA WRITE operation and a fourth memory address which is idle and continuous with the third memory address are obtained from opposite-end service equipment, generating a WR for realizing the RDMA WRITE operation according to the third memory address; different WRs carry different opposite terminal memory addresses, and the opposite terminal memory addresses carried by all WRs form the third memory address;
finding a second specified WR from the generated WRs for realizing the RDMA WRITE operation, wherein the opposite-end memory address carried by the second specified WR is closest to the fourth memory address;
performing specified modification on the second specified WR to indicate that the opposite-end service device writes a specified identifier in the fourth memory address, where the specified identifier is an identifier negotiated between the local device and the opposite-end service device and used for indicating that the RDMAWRITE operation is completed; the specified modification includes: increasing the length of the memory address of the opposite terminal carried by the second designated WR by the length of the address occupied by the fourth memory address; a fifth memory address is carried in a second designated WR, and the fifth memory address is a memory address used for recording a designated identifier by the device;
composing the WR chain from the WRs generated to implement the RDMA WRITE operation, wherein the second designated WR is the last WR of the WR chain.
5. A memory access device, which is applied to a service device, and includes:
the processing module is used for generating WR (write flash) for realizing the RDMA (remote memory Access) operation according to the first memory address required by the RDMA operation acquired from the opposite-end service equipment when the first memory address required by the RDMA operation of the remote memory direct access is acquired from the opposite-end service equipment; generating a first specified WR to indicate completion of the RDMA operation; wherein the first designated WR is the last WR of the WR chain; composing the WR used to implement the RDMA operation, the first specified WR, into the WR chain;
and the service module is used for sending the WR in the WR chain to the opposite end service equipment according to the sequence when the RDMA operation is initiated to the opposite end service equipment.
6. The apparatus of claim 5,
the first specified WR is: the operation type is RDMA Send type WR.
7. The apparatus of claim 5, wherein the first specified WR is: an operation type of RDMA WRITE type WR;
the first designated WR comprises a second memory address; the second memory address is: obtaining idle addresses except the first memory address from the opposite terminal service equipment;
the first designated WR is used to instruct the peer service device to write a designated identifier in the second memory address, where the designated identifier is an identifier negotiated between the local device and the peer service device and used to instruct the RDMA operation to complete.
8. The apparatus of claim 5, wherein the RDMA operation is an RDMAWRITE operation;
the processing module is specifically configured to:
when a third memory address required by the RDMA WRITE operation and a fourth memory address which is idle and continuous with the third memory address are obtained from the opposite-end service device, generating a WR for realizing the RDMA WRITE operation according to the third memory address; different WRs carry different opposite terminal memory addresses, and the opposite terminal memory addresses carried by all WRs form the third memory address;
finding a second specified WR from the generated WRs for realizing the RDMA WRITE operation, wherein the opposite-end memory address carried by the second specified WR is closest to the fourth memory address;
performing specified modification on the second specified WR to indicate that the opposite-end service device writes a specified identifier in the fourth memory address, where the specified identifier is an identifier negotiated between the local device and the opposite-end service device and used for indicating that the RDMAWRITE operation is completed; the specified modification includes: increasing the address length of the opposite-end memory address carried by the second designated WR by the address length occupied by the fourth memory address; a fifth memory address is carried in a second designated WR, and the fifth memory address is a memory address used for recording a designated identifier by the device;
composing the WR chain from the WRs generated to implement the RDMA WRITE operation, wherein the second designated WR is the last WR of the WR chain.
CN201810102233.0A 2018-02-01 2018-02-01 Memory access method and device Active CN109426632B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810102233.0A CN109426632B (en) 2018-02-01 2018-02-01 Memory access method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810102233.0A CN109426632B (en) 2018-02-01 2018-02-01 Memory access method and device

Publications (2)

Publication Number Publication Date
CN109426632A CN109426632A (en) 2019-03-05
CN109426632B true CN109426632B (en) 2021-09-21

Family

ID=65513715

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810102233.0A Active CN109426632B (en) 2018-02-01 2018-02-01 Memory access method and device

Country Status (1)

Country Link
CN (1) CN109426632B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102446073A (en) * 2010-08-30 2012-05-09 国际商业机器公司 Delaying acknowledgment of an operation until operation completion confirmed by local adapter read operation
CN104346285A (en) * 2013-08-06 2015-02-11 华为技术有限公司 Memory access processing method, device and system
CN105450588A (en) * 2014-07-31 2016-03-30 华为技术有限公司 RDMA-based data transmission method and RDMA network cards
CN105487937A (en) * 2015-11-27 2016-04-13 华为技术有限公司 RDMA (Remote Direct Memory Access) implementation method and device
CN105518611A (en) * 2014-12-27 2016-04-20 华为技术有限公司 Remote direct memory access method, equipment and system
CN105718216A (en) * 2014-11-03 2016-06-29 英特尔公司 Apparatus and Method for RDMA with Commit ACKs
CN105893323A (en) * 2016-05-23 2016-08-24 华为技术有限公司 Data reading method and data reading equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9953006B2 (en) * 2015-06-23 2018-04-24 International Business Machines Corporation Lock-free processing of stateless protocols over RDMA

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102446073A (en) * 2010-08-30 2012-05-09 国际商业机器公司 Delaying acknowledgment of an operation until operation completion confirmed by local adapter read operation
CN104346285A (en) * 2013-08-06 2015-02-11 华为技术有限公司 Memory access processing method, device and system
CN105450588A (en) * 2014-07-31 2016-03-30 华为技术有限公司 RDMA-based data transmission method and RDMA network cards
CN105718216A (en) * 2014-11-03 2016-06-29 英特尔公司 Apparatus and Method for RDMA with Commit ACKs
CN105518611A (en) * 2014-12-27 2016-04-20 华为技术有限公司 Remote direct memory access method, equipment and system
CN105487937A (en) * 2015-11-27 2016-04-13 华为技术有限公司 RDMA (Remote Direct Memory Access) implementation method and device
CN105893323A (en) * 2016-05-23 2016-08-24 华为技术有限公司 Data reading method and data reading equipment

Also Published As

Publication number Publication date
CN109426632A (en) 2019-03-05

Similar Documents

Publication Publication Date Title
USRE46488E1 (en) Direct data transfer between slave devices
KR102532173B1 (en) Memory access technology and computer system
CN111340470B (en) Block chain transaction processing method, node and contract container
JP4452690B2 (en) Electronic device, control method thereof, host device and control method thereof
JP6333353B2 (en) Apparatus and method for a distributed memory system including a memory node
KR20170010810A (en) Method, device and user equipment for reading/writing data in nand flash
CN107798063B (en) Snapshot processing method and snapshot processing device
CN106170757A (en) A kind of date storage method and device
WO2017147794A1 (en) Differential data backup method and device
CN114780465A (en) Method and device for creating sharable remote direct data access link
CN109426632B (en) Memory access method and device
CN111930510B (en) Electronic device and data processing method
US10168939B2 (en) Reading records from a tape medium
CN113238856A (en) RDMA (remote direct memory Access) -based memory management method and device
CN104077374A (en) Method and device for achieving internet protocol (IP) disk file storage
CN110187837B (en) File access method, device and file system
CN116610623A (en) Data reading method and device, electronic equipment and storage medium
CN109992197B (en) Data reading and writing method and device, electronic equipment and storage medium
US11363100B2 (en) Network attached device for accessing removable storage media
CN105117353A (en) FPGA with general data interaction module and information processing system using same
CN108140005B (en) System and method for providing file information in a memory system protocol
CN110069422B (en) Memory buffer recovery method based on MIPS multi-core processor
US8375066B2 (en) Generating unique identifiers
CN105955916B (en) A kind of method that writing immediate, equipment and system
CN112765049B (en) Method, device, equipment and readable medium for updating L2P table

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant