Search

CN-122001949-A - Data transmission method based on remote direct memory access and related equipment thereof

CN122001949ACN 122001949 ACN122001949 ACN 122001949ACN-122001949-A

Abstract

The application discloses a data transmission method based on RDMA and related equipment thereof, which can reduce the time cost and the performance cost required by the whole data transmission process to a certain extent. The method of the application comprises that a first processor can provide a memory block for a first RDMA network card, and the memory quickly comprises a plurality of sub-memories such as a first sub-memory and a second sub-memory. After the second RDMA network card sends the packet to the first RDMA network card, the first RDMA network card may generate the first address of the first data because the packet carries the first data generated by the second processor. The first RDMA network card may then store a first address in the first sub-memory and store the first data in the second sub-memory, the first address describing a location of the first data in the second sub-memory. The first RDMA network card may then notify the first processor to read the first address from the first sub-memory to read the first data from the second sub-memory based on the first address, thereby enabling data transfer.

Inventors

  • LIANG DU
  • YU JIAYANG
  • DUAN ZHENGCHAO

Assignees

  • 华为云计算技术有限公司

Dates

Publication Date
20260508
Application Date
20241105

Claims (18)

  1. 1. A method of remote direct memory access, RDMA, based data transfer, the method being applied to a first server, the first server comprising a first RDMA network card and a first processor, the method comprising: The first processor provides a memory block for the first RDMA network card, wherein the memory block comprises a first sub-memory and a second sub-memory; the first RDMA network card receives a first message sent by the second server, wherein the first message carries first data generated by the second server; The first RDMA network card generates a first address of the first data carried by the first message, wherein the first address is used for indicating the position of the first data in the second sub-memory; the first RDMA network card stores the first address in the first sub-memory and stores the first data in the second sub-memory; The first RDMA network card informs the first processor to acquire the first address from the first sub-memory and acquires the first data from the second sub-memory based on the first address.
  2. 2. The method according to claim 1, wherein the method further comprises: The first RDMA network card divides the memory block to obtain a plurality of sub memories, wherein the sizes of the sub memories are equal to a preset size, and the sub memories comprise the first sub memory and the second sub memory.
  3. 3. The method of claim 1 or 2, wherein the size of the first address is smaller than the size of the first sub-memory, and the size of the first data is smaller than or equal to the size of the second sub-memory.
  4. 4. A method according to any one of claims 1 to 3, wherein the memory block further comprises a third sub-memory, the method further comprising: The first RDMA network card receives a second message sent by the second server, wherein the second message carries second data generated by the second server; the first RDMA network card generates a second address of the second data carried by the second message, wherein the second address is used for indicating the position of the first data in the third sub-memory; The first RDMA network card stores the second address in the first sub-memory and stores the second data in the third sub-memory; the first RDMA network card informs the first processor to acquire the second address from the first sub-memory, and acquires the second data from the third sub-memory based on the second address.
  5. 5. The method of claim 4, wherein the location of the first address in the first sub-memory is adjacent to the location of the second address in the second sub-memory.
  6. 6. The method of claim 4 or 5, wherein the size of the second address is smaller than the size of the first sub-memory, and the size of the second data is smaller than or equal to the size of the third sub-memory.
  7. 7. The method according to any one of claims 4 to 6, wherein the first data and the second data are obtained by dividing third data by the second server, the size of the third data is larger than the size of the second sub-memory, and the size of the third data is larger than the size of the third sub-memory.
  8. 8. A server, wherein the server acts as a first server, the first server comprising a first RDMA network card and a first processor; The first processor is configured to provide a memory block to the first RDMA network card, where the memory block includes a first sub-memory and a second sub-memory; The first RDMA network card is used for receiving a first message sent by a second server, and the first message carries first data generated by the second server; the first RDMA network card is further configured to generate a first address of the first data carried by the first packet, where the first address is used to indicate a location of the first data in the second sub-memory; The first RDMA network card is further configured to store the first address in the first sub-memory, and store the first data in the second sub-memory; The first RDMA network card is further configured to notify the first processor to obtain the first address from the first sub-memory, and obtain the first data from the second sub-memory based on the first address.
  9. 9. The server of claim 8, wherein the first RDMA network card is further configured to divide the memory block to obtain a plurality of sub-memories, the plurality of sub-memories having a size equal to a preset size, the plurality of sub-memories including the first sub-memory and the second sub-memory.
  10. 10. The server according to claim 8 or 9, wherein the size of the first address is smaller than the size of the first sub-memory, and the size of the first data is smaller than or equal to the size of the second sub-memory.
  11. 11. The server according to any one of claims 8 to 10, wherein the memory block further comprises a third sub-memory; The first RDMA network card is further configured to receive a second packet sent by the second server, where the second packet carries second data generated by the second server; the first RDMA network card is further configured to generate a second address of the second data carried by the second packet, where the second address is used to indicate a location of the first data in the third sub-memory; the first RDMA network card is further configured to store the second address in the first sub-memory and store the second data in the third sub-memory; The first RDMA network card is further configured to notify the first processor to obtain the second address from the first sub-memory, and obtain the second data from the third sub-memory based on the second address.
  12. 12. The server of claim 11, wherein the location of the first address in the first sub-memory is adjacent to the location of the second address in the second sub-memory.
  13. 13. The server according to claim 11 or 12, wherein the size of the second address is smaller than the size of the first sub-memory, and the size of the second data is smaller than or equal to the size of the third sub-memory.
  14. 14. The server according to any one of claims 11 to 13, wherein the first data and the second data are obtained by dividing third data by the second server, the size of the third data is larger than the size of the second sub-memory, and the size of the third data is larger than the size of the third sub-memory.
  15. 15. An RDMA system comprising a second server and the first server of any of claims 8-14.
  16. 16. A cluster of computing devices, the cluster of computing devices comprising at least one computing device, each computing device comprising a processor and memory: The memory is used for storing instructions; The processor is configured to cause the cluster of computing devices to perform the method of any one of claims 1 to 7 in accordance with the instructions.
  17. 17. A computer storage medium storing one or more instructions which, when executed by one or more computers, cause the one or more computers to implement the method of any one of claims 1to 7.
  18. 18. A computer program product, characterized in that it stores instructions that, when executed by a computer, cause the computer to implement the method of any one of claims 1 to 7.

Description

Data transmission method based on remote direct memory access and related equipment thereof Technical Field The embodiment of the application relates to the technical field of computers, in particular to a data transmission method based on remote direct memory access (remote direct memory access, RDMA) and related equipment thereof. Background With the rapid development of computer technology, RDMA technology is widely used in communication between physical servers. In the communication process, the physical server initiating access is called a transmitting end, the physical server being accessed is called a receiving end, and the transmitting end can directly access the memory at the receiving end side, so that data can be directly written into the memory at the receiving end. In the related art, when a transmitting end needs to transmit data to a receiving end, the transmitting end may notify the receiving end of address information of the data, where the address information is used to describe a location of the data in a memory of the transmitting end. The receiving end may then initiate a data read request to the sending end, the request carrying the address information. Then, the sending end can read the data from the own memory based on the address information carried by the request and remotely write the data into the memory of the receiving end, so that the receiving end reads the data from the own memory, thereby completing data transmission. In the above process, both the transmitting end and the receiving end are involved in a large number of operations for realizing data transmission, which results in excessive time cost and performance overhead required for the whole data transmission process. Disclosure of Invention The embodiment of the application provides a data transmission method based on RDMA and related equipment thereof, which can reduce the time cost and the performance cost required by the whole data transmission process to a certain extent. A first aspect of an embodiment of the present application provides a method for remote direct memory access RDMA-based data transfer, where the method may be implemented by an RDMA system, where the RDMA system may include a first server and a second server, where the first server may include a first RDMA network card and a first processor, and the second server may include a second RDMA network card and a second processor. The method comprises the following steps: before the first server and the second server perform data transmission, the first processor of the first server may provide a memory block to the first RDMA network card of the first server, where the memory block may include a plurality of sub-memories, such as a first sub-memory and a second sub-memory. When the second processor of the second server needs to send the first data to the first processor, the second processor may provide the first data to the second RDMA network card of the second server, so the second RDMA network card may generate a first packet carrying the first data and send the first packet to the first RDMA network card. After receiving the first message, the first RDMA network card can analyze the first message to obtain first data. Then, the first RDMA network card may generate a first address of the first data, where the first address may be used to describe a location where the first data is stored in the second sub-memory. After the first data and the first address are obtained, the first RDMA network card can store the first address in the first sub-memory and store the first data in the second sub-memory. After the first data and the first address are stored, the first RDMA network card may notify the first processor to read the first address from the first sub-memory, and then read the first data from the second sub-memory based on the first address. Thus, the transmission of the first data is successfully completed between the first processor and the second processor. The first processor of the first server can provide a memory block for the first RDMA network card of the first server, and the memory block comprises a plurality of sub-memories such as a first sub-memory and a second sub-memory. After the second RDMA network card of the second server sends the first message to the first RDMA network card of the first server, the first RDMA network card of the first server may apply for the first sub-memory and the second sub-memory from the memory block and generate the first address of the first data because the first message carries the first data generated by the second processor of the second server. Then, the first RDMA network card of the first server may store a first address in the first sub-memory, and store the first data in the second sub-memory, where the first address is used to describe a location of the first data in the second sub-memory. The first RDMA network card of the first server may then inform the first processor of the first serv