Method, electronic device and computer program product for processing data

By generating write requests carrying multiple destination addresses and data block sizes during RDMA operations, the performance issues caused by multiple communications in existing technologies are resolved, achieving efficient data block writing and improving system performance and user experience.

CN114817121BActive Publication Date: 2025-11-25EMC IP HLDG CO LLC
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110093823.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-22
Publication Date
2025-11-25
Estimated Expiration
2041-01-22

AI Technical Summary

Technical Problem

In RDMA operations, existing technologies require multiple communications and resource consumption when writing to multiple remote memory addresses, leading to performance issues, especially a severe degrade in system performance when transferring small data blocks.

Method used

By obtaining the size and destination address information of multiple data blocks through the network interface card, a write request carrying multiple destination addresses and data block sizes is generated and sent, reducing the number of communications and resource consumption.

Benefits of technology

It improves system performance and data processing efficiency, reduces the use of network and computing resources, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114817121B_ABST
    Figure CN114817121B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to a method, an electronic device and a computer program product for processing data. The method comprises obtaining, at a first network interface card coupled with a first device, information related to a plurality of data blocks to be written to a second device, the information comprising sizes of the plurality of data blocks and a plurality of destination addresses of a memory of the second device to which the plurality of data blocks are to be written. The method further comprises generating, based on the information, a write request for the plurality of data blocks, the write request indicating at least the plurality of destination addresses and the sizes of the plurality of data blocks. The method further comprises sending the write request to a second network interface card coupled with the second device to cause the plurality of data blocks to be written to the plurality of destination addresses. By the method, system performance can be improved by reducing the number of communications, while reducing the consumption of hardware resources.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present disclosure relate to the field of data processing, and more particularly, to a method, an electronic device and a computer program product for processing data. BACKGROUND

[0002] With the development of data access technology between remote computing devices, a new Remote Direct Memory Access (RDMA) technology is proposed. RDMA enables a computing device to write data directly into the memory of a target computer through a network without causing any impact on the operating systems of the two computing devices.

[0003] The principle of RDMA technology implementation is to offload data access operations performed by a computing device to a local network interface card coupled with the computing device to perform. During the RDMA operation, the network interface card coupled with the local computing device controls the network interface card of the target computer to send data to implement access to the memory of the target computing device. However, there are still many problems to be solved during the RDMA operation. SUMMARY

[0004] Embodiments of the present disclosure provide a method, an electronic device and a computer program product for processing data.

[0005] According to a first aspect of the present disclosure, a method for processing data is provided. The method comprises obtaining, at a first network interface card coupled with a first device, information about a plurality of data blocks to be written to a second device, the information comprising sizes of the plurality of data blocks and a plurality of destination addresses of a memory of the second device to which the plurality of data blocks are to be written. The method further comprises generating, based on the information, a write request for the plurality of data blocks, the write request indicating at least the plurality of destination addresses and the sizes of the plurality of data blocks. The method further comprises sending, to a second network interface card coupled with the second device, the write request to cause the plurality of data blocks to be written to the plurality of destination addresses.

[0006] According to a second aspect of the present disclosure, a method for processing data is provided. The method comprises receiving, at a second network interface card coupled with a second device, from a first network interface card coupled with a first device, a write request for a plurality of data blocks, the write request indicating at least sizes of the plurality of data blocks and a plurality of destination addresses of a memory of the second device to which the plurality of data blocks are to be written. The method further comprises causing, based on the plurality of sizes, the plurality of data blocks to be written to the plurality of destination addresses.

[0007] According to a third aspect of the present disclosure, there is provided an electronic device. The electronic device comprises at least one processor; and a memory coupled to the at least one processor and having stored thereon instructions that, when executed by the at least one processor, cause the device to perform actions comprising: obtaining, at a first network interface card coupled to a first device, information about a plurality of data blocks to be written to a second device, the information comprising sizes of the plurality of data blocks and a plurality of destination addresses of a memory of the second device to which the plurality of data blocks are to be written; generating, based on the information, a write request for the plurality of data blocks, the write request indicating at least the plurality of destination addresses and the sizes of the plurality of data blocks; and sending, to a second network interface card coupled to the second device, the write request to cause the plurality of data blocks to be written to the plurality of destination addresses.

[0008] According to a fourth aspect of the present disclosure, there is provided an electronic device. The electronic device comprises at least one processor; and a memory coupled to the at least one processor and having stored thereon instructions that, when executed by the at least one processor, cause the device to perform actions comprising: receiving, at a second network interface card coupled to a second device, from a first network interface card coupled to a first device, a write request for a plurality of data blocks, the write request indicating at least sizes of the plurality of data blocks and a plurality of destination addresses of a memory of the second device to which the plurality of data blocks are to be written; and causing, based on the plurality of sizes, the plurality of data blocks to be written to the plurality of destination addresses.

[0009] According to a fifth aspect of the present disclosure, there is provided a computer program product tangibly stored on a non-transitory computer readable medium and comprising machine executable instructions that, when executed by a machine, cause the machine to perform the steps of the method in the first aspect of the present disclosure.

[0010] According to a sixth aspect of the present disclosure, there is provided a computer program product tangibly stored on a non-transitory computer readable medium and comprising machine executable instructions that, when executed by a machine, cause the machine to perform the steps of the method in the second aspect of the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0011] The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings in which like reference characters refer to like parts throughout the different views of the drawings.

[0012] Figure 1 a flowchart illustrating a process 100 for remote direct memory access of data in a conventional scheme;

[0013] Figure 2A schematic diagram illustrating an example environment 200 in which apparatus and / or methods in accordance with embodiments of the disclosure can be implemented;

[0014] Figure 3 A flowchart illustrating a method 300 for processing data in accordance with embodiments of the disclosure;

[0015] Figure 4 A schematic diagram illustrating an example 400 of a header in accordance with embodiments of the disclosure;

[0016] Figure 5 A schematic diagram illustrating an example 500 of a subheader in accordance with embodiments of the disclosure;

[0017] Figure 6 A schematic diagram illustrating an example 600 of an operation code in accordance with embodiments of the disclosure;

[0018] Figure 7 A flowchart illustrating a method 700 for processing data in accordance with embodiments of the disclosure;

[0019] Figure 8 A flowchart illustrating an example process 800 for remote direct memory access of data in accordance with embodiments of the disclosure;

[0020] Figure 9 A schematic block diagram of an example device 900 suitable for use in implementing embodiments of the disclosure is illustrated.

[0021] In the various drawings, like or corresponding elements are denoted by like or corresponding reference numerals. DETAILED DESCRIPTION

[0022] Embodiments of the disclosure will be described below in greater detail with reference to the accompanying drawings. While certain embodiments of the disclosure are shown in the drawings, it is understood that the disclosure can be embodied in various forms and should not be interpreted as being limited to the embodiments set forth herein; rather, these embodiments are provided so that the disclosure will be thorough and complete, and fully convey the scope of the disclosure to those skilled in the art. It is understood that the drawings and embodiments of the disclosure are for illustrative purposes only and are not intended to limit the scope of the disclosure.

[0023] In the description of embodiments of the disclosure, the term "includes" and its variants are to be read as open-ended terms that mean "includes, but is not limited to." The term "based on" is to be read as "based, at least in part, on." The term "one embodiment" or "an embodiment" are to be read as "at least one embodiment." The term "first," "second," and the like, can refer to different or the same objects. Other explicit or implicit definitions can also be included below.

[0024] The principles of the present disclosure will now be described with reference to a number of example embodiments illustrated in the drawings. Although the preferred embodiments of the present disclosure are shown in the drawings, it is understood that these embodiments are merely presented by way of example and are not intended to limit the scope of the present disclosure in any way.

[0025] In some board card designs, a Non-Transparent Bridge (NTB) is used as the underlying transport. It provides remote direct memory access (RDMA) between storage processors (SPs). Through the non-transparent bridge, data from an SP is bundled together and then transmitted to a separate target address on a remote SP, and many data sizes are usually small.

[0026] In the NTB, the way of transmitting data to only one target address at a time does not show poor performance. Because the storage processors connected through the non-transparent bridge are usually connected through the same physical board. So these data transmissions are like memory accesses, there is no extra overhead between the SPs. But when using RDMA instead of NTB as the underlying transport, the performance will be worse. There are many network communication overheads involved during the transmission of these bundled data.

[0027] Currently, in the case of RDMA write operation, the RDMA technology only supports Scatter Gather List (SGL) locally. This means that the user can write the source data specified by the scatter / gather list to a single remote address. With this design, when writing data packets to multiple remote destination addresses in an RDMA manner, the data packets can only be divided into multiple data blocks according to different destination addresses to be stored, and then the multiple data blocks are written to multiple different remote addresses by using different RDMA write operations.

[0028] As Figure 1As shown, when data block 1 114, data block 2 116, data block 3 118 and data block 4 120 located at four different addresses are written into storage block 1 122, storage block 2 124, storage block 3 126 and storage block 4 128 corresponding to four different destination addresses using RDMA operations, 4 work queue elements need to be generated in work queue 104. Each work queue element includes at least the source address of the data block, the destination address of the storage block to be stored into and the size or length of the data block. An RDMA operation is performed for each work queue element to write one data block into the corresponding storage block. For each work queue element, the corresponding data block is fetched based on the source address of the data block and then an RDMA write request is generated in combination with an RDMA Extended Transport Header (RETH) and a Base Transport Header (BTH) and other headers. For example, if the transmission is performed using an InfiniBand (IB) network, the other headers can be Local Route Headers (LRH) and Global Route Headers (GRH). If a traditional network is used, the other headers can be Ethernet or TCP / IP headers.

[0029] The local network interface card 106 then transmits each RDMA write request to the remote network interface card 108 to write data block 1 114, data block 2 116, data block 3 118 and data block 4 120 in source memory 110 into storage block 1 122, storage block 2 124, storage block 3 126 and storage block 4 128 of destination memory 112. For each RDMA write request, the remote network interface card 108 sends an acknowledgement message to the local network interface card. After the acknowledgement message indicates that the data block is received by the function, the local network interface card 106 generates a completion queue element and puts it into completion queue 102 to notify the upper layer application that the data block write is completed.

[0030] Therefore, at least 4 round-trip communications are needed in this process to complete the data transmission of all the 4 data blocks and additional resources are needed to handle the 4 work queue elements and 4 completion queue elements.

[0031] In the case where more small data blocks are to be written into the destination memory, this approach will cause serious performance problems. Compared with pure payload transmission, the large amount of communication overhead will reduce the system performance.

[0032] At least to address the above and other potential problems, embodiments of the present disclosure propose a method for processing data. In the method, a network interface card obtains information related to a plurality of data blocks to be written to a second device, the information including sizes of the plurality of data blocks and a plurality of destination addresses of a memory of the second device to which the plurality of data blocks are to be written. Then, the network interface card generates a write request for the plurality of data blocks with the obtained information, the write request indicating at least the plurality of destination addresses and the sizes of the plurality of data blocks. The network interface card then sends the write request to a second network interface card coupled with the second device to cause the plurality of data blocks to be written to the plurality of destination addresses. By the method, system performance can be improved by reducing the number of communications, while reducing the consumption of hardware resources.

[0033] Embodiments of the present disclosure will be described in detail below with further reference to the drawings. Figure 2 A block diagram of an example system 200 in which embodiments of the present disclosure can be implemented is shown. It should be understood that the architecture of the system 200 is described for illustrative purposes only and is not intended to suggest any limitation as to the scope of the present disclosure.

[0034] The system 200 includes a device 202 and a device 204. For ease of description, the device 202 can also be referred to as a first device, and the device 204 can also be referred to as a second device. The device 202 and the device 204 include, but are not limited to, a personal computer, a server computer, a handheld or laptop device, a mobile device such as a mobile phone, a personal digital assistant (PDA), a media player, etc., a multiprocessor system, a consumer electronic product, a minicomputer, a mainframe computer, a distributed computing environment including any of the above systems or devices, etc.

[0035] The device 202 has a memory 206. The memory 206 stores therein data blocks 214-1, 214-2, …, 214-N to be stored into a memory 208 of the device 204, where N is a positive integer. For ease of description, each of the data blocks 214-1, 214-2, …, 214-N is referred to as a data block 214. The N data blocks 214 are to be stored in N storage blocks of the memory 206.

[0036] The device 202 generates one element in a work queue based on a source address, a destination address and a data block length of the data block 214 to be stored in a storage block 216-1, 216-2, …, 216-N of the device 204. In addition to the above factors, the device 202 can additionally generate the element based on other information such as a data carrying identification. The data carrying identification is an identifier indicating whether the generated write request includes a plurality of data blocks.

[0037] Network interface cards 210 and 212 are coupled to corresponding devices 202 and 204, respectively. For ease of description, network interface card 210 may be referred to as a first network interface card, and network interface card 212 may be referred to as a second network interface card. In one example, the coupling is a wired connection. In another example, the coupling is implemented through a slot connection. The above examples are only used to describe the present disclosure and are not intended to specifically limit the present disclosure.

[0038] The network interface cards 210 and 212, respectively coupled to the corresponding devices 202 and 204, are merely examples and not specific limitations of this disclosure. In some embodiments, network interface cards 210 and 212 are included in devices 202 and 204, respectively.

[0039] In some embodiments, network interface cards 210 and 212 are implemented by physical hardware. In some embodiments, network interface cards 210 and 212 are implemented by software. The above examples are merely for describing this disclosure and are not intended to limit the scope of this disclosure.

[0040] The network interface card 210 then generates a write request based on the work queue element to write multiple data blocks 214 into memory block 216 of memory 208 in device 204, such as an RDMA write request.

[0041] The write request generated by network interface card 210 includes a header containing multiple headers corresponding to the plurality of data blocks and the total size of the plurality of data blocks. The sub-header includes the destination address and size corresponding to one of the data blocks. The first network interface card 210 sends the generated write request to the second network interface card 212 for storing the plurality of data blocks into the memory 208 of device 204.

[0042] When a data block needs to be transmitted, network interface card 210 obtains data block 214 by directly accessing memory 206 using the source address. The obtained data block 214 is then sent to the second network interface card 212 along with a write request or as a payload packet in a write operation. The second network interface card 212 caches the received data block in a memory block within the second network interface card 212. Then, the second network interface card 212 stores the received data block in the memory block of memory 208 indicated by the destination address via direct memory access.

[0043] The above methods can improve the efficiency of application migration, reduce the use of network and computing resources, and improve data processing efficiency and user experience.

[0044] The above combination Figure 2 A block diagram of an example system 200 in which embodiments of the present disclosure can be implemented is described. The following is in conjunction with…Figure 3 A flowchart of a method 300 for processing data according to embodiments of the present disclosure is described. The method 300 can be performed at the network interface card 210 in the first device 202 and any suitable computing device. Figure 2

[0045] At block 302, the first network interface card 210 obtains information about a plurality of data blocks 214 to be written to the second device 204. The information includes the size of the plurality of data blocks 214 and a plurality of destination addresses of the memory 208 of the second device 204 to which the plurality of data blocks 214 are to be written.

[0046] In some embodiments, when performing a write operation, an application in the first device 202 generates a work queue element when it needs to store a plurality of data blocks to a plurality of different destination addresses in the memory 208 of the second device 204. The work queue element is then put into a work queue. The network interface card 210 then obtains the work queue element from the work queue.

[0047] In some embodiments, the work queue element includes information about the plurality of data blocks. The information includes the source storage address, the destination storage address, and the data block size or data length of each data block in the plurality of data blocks. Alternatively or additionally, the work queue element also includes a data carrying identification indicating whether the write request sent by the network interface card includes the plurality of data blocks. The above examples are merely used to describe the present disclosure and not to limit the present disclosure specifically, the work queue element can include any suitable information.

[0048] In some embodiments, the work queue element includes an indication of the storage location of the storage area where the above information is located. The network interface card 210 obtains the indication of the storage location of the information in the first device from the work queue element. For example, a pointer in the work queue element points to the storage location of the information. The network interface card 210 then obtains the information from the storage location based on the indication. In this way, the network interface card can quickly obtain the information, and the amount of information can be adjusted as needed.

[0049] At block 304, the first network interface card 210 generates a write request for the plurality of data blocks based on the information, the write request indicating at least the plurality of destination addresses and the size of the plurality of data blocks.

[0050] In some embodiments, the first network interface card 210 obtains a data carrying identification from the first device 202, the data carrying identification indicating whether the write request includes the plurality of data blocks. For example, the network interface card obtains the data carrying identification from the work queue element. The first network interface card 210 then determines whether to carry the plurality of data blocks in the sent write request based on the data carrying identification. ​

[0051] If the data carry flag indicates that the write request does not include multiple data blocks, the first network interface card 210 generates a write request with multiple destination addresses, multiple sizes and the number of multiple data blocks. The write request includes a header, which includes multiple sub-headers corresponding to the multiple data blocks and the total size of the multiple data blocks. The sub-headers include the destination address and the size corresponding to one of the multiple data blocks. By this method, the write request can carry multiple destination addresses, which accelerates the storage of data, reduces the number of communications and improves the performance of the system.

[0052] The header and the sub-header will be described below with reference to Figure 4 and Figure 5 Figure 4 An example 400 of the header according to an embodiment of the present disclosure is shown. For example, the header can be referred to as RDMA Multiple New Extended Transport Header (RMNETH).

[0053] The header includes a flag field, a reserved field, a number of sub-headers field, a total size of multiple data blocks field and N sub-headers. The flag field can be used to support some advanced functions. For example, it can be used to indicate whether to support a flushing operation, such as indicating whether to perform a flushing operation on the data block to ensure the persistent storage of the data before sending the acknowledgement message of receiving the data. The above example is only used to describe the present disclosure, and is not a specific limitation of the present disclosure. Those skilled in the art can set the function of the flag according to the needs.

[0054] The reserved field in the header is some data bits reserved for future functions. Figure 4 The header structure shown is only an example, and is not a specific limitation of the present disclosure. Those skilled in the art can adjust or set the format of the header and adjust the size of each field according to the needs, for example, increase or decrease the field, such as adding a version field, etc.

[0055] Figure 5 An example 500 of the sub-header according to an embodiment of the present disclosure is shown. The sub-header can be referred to as RDMA New Extended Transport Header (RNETH).

[0056] As Figure 5 ​As shown, the sub-header includes 16 bytes, in which the virtual address is used to store the destination address. The sub-header also includes a key field, which is used to verify at the destination memory to determine whether the memory where the destination address is located can be operated on. The sub-header also includes a flag field, a reserved field, a padding field used to make the transmitted data block conform to a specified length, and the length of the data block to be transmitted. The length of the data block to be transmitted is also referred to as the DMA length.

[0057] The flag field can be used to support certain advanced functions, such as a fusion operation. Through the fusion operation, a complex command can be created by "fusing" several simpler IO commands together, which are specified by the sub-header. This flag field can be used to define the first / intermediate / last command in the fusion operation. Figure 6 The sub-header structure shown is merely an example, and is not a specific limitation of the present disclosure. Those skilled in the art can adjust or set the format of the sub-header as needed, and adjust the size of each field, for example, increase or decrease the field, etc.

[0058] Now returning Figure 3 Continuing the description. In some embodiments, the first network interface card 210 generates a write request upon determining that the data carrying identification indicates that the write request includes multiple data blocks. The write request includes a header and the multiple data blocks. In this way, the multiple data blocks can be carried in the write request, reducing the number of data transmissions.

[0059] At block 306, the first network interface card 210 sends the write request to the second network interface card coupled to the second device, so that the multiple data blocks are written to the multiple destination addresses.

[0060] In some embodiments, if the write request includes multiple data blocks, the second network interface card 212 receives the write request and successfully allocates a storage block corresponding to the total size in the header to store the multiple data blocks, and transmits a confirmation message to the first network interface card that the write request is successfully received.

[0061] In some embodiments, if the write request does not include multiple data blocks, the second network interface card 212 receives the write request and successfully allocates a storage block corresponding to the total size in the header, and transmits a confirmation message to the first network interface card 210 that the write request is successfully received. After receiving the confirmation message, the first network interface card 210 sends the multiple data blocks to the second network interface card 212. If the size of the multiple data blocks does not exceed the maximum transmission unit, the multiple data blocks are transmitted to the second network interface card 212 through one write operation. If it exceeds the maximum transmission unit, the multiple data blocks are sent through two or more write operations.

[0062] Figure 6 Example 600 of an opcode for determining the content in a write request or write operation is shown. This opcode is included in the Basic Transport Header (BTH), which is set in... Figure 4 The header shown is preceded by this opcode. This opcode is used to indicate the content following the basic transport header. For example, bits 5-7 of the opcode being 110 indicates a reliable connection in the network. When bits 0-4 of the opcode are 00000, it indicates a write request, and the content following the basic transport header is... Figure 4 The header shown. If bits 0-4 are 00001, it indicates that the first part of a write operation is being transmitted. Following this basic transmission header are the header and multiple data blocks as the payload. If... Figure 4 If the header and multiple data blocks are transmitted separately, the different parts of the transmitted data blocks can be identified by bits 0-4 of the opcode being 00010 and 00011. Alternatively, bits 0-4 of the opcode being 00100 can be used to identify the payload and the corresponding immediate operation. It should be noted that... Figure 6 The examples shown are merely illustrative of opcodes and are not intended to limit the scope of this disclosure. Those skilled in the art can set the format and specific content of the opcodes as needed.

[0063] Return now Figure 3 Continuing the description, if the first network interface card 210 receives an acknowledgment message from the second device 204 for multiple data blocks 214, it provides the first device 202 with completion information indicating that the multiple data blocks have been written to the second device 204. Alternatively or additionally, if the data blocks are sent to the second network interface card 212 via multiple write operations, a corresponding acknowledgment message is sent after each write operation. This method ensures accurate data transmission to the second network interface card.

[0064] In some embodiments, network interface card 210 acquires multiple data blocks from multiple source addresses in the memory of a first device, for example, from work queue elements. Based on these multiple source addresses, network interface card 210 acquires the multiple data blocks by performing a direct memory access operation.

[0065] The above methods can improve the efficiency of application migration, reduce the use of network and computing resources, and improve data processing efficiency and user experience.

[0066] The above combination Figures 3-6 A flowchart of a method 300 for processing data according to an embodiment of this disclosure is described below. Figure 7 A flowchart describing a method 700 for processing data according to embodiments of the present disclosure is provided. Method 700 can be performed in... Figure 2 It can be executed on the second network interface card 212 or any suitable computing device.

[0067] At block 702, the second network interface card 212 receives, at the second network interface card coupled with the second device, a write request for a plurality of data blocks from the first network interface card coupled with the first device, the write request indicating at least sizes of the plurality of data blocks and a plurality of destination addresses of a memory 208 of the second device 204 to which the plurality of data blocks are to be written;

[0068] In some embodiments, the second network interface card 212 obtains, from a header of the write request, a plurality of sub-headers corresponding to the plurality of data blocks and a total size of the plurality of data blocks. The second network interface card 212 then obtains, from each of the plurality of sub-headers, a destination address corresponding to one of the plurality of data blocks and a size. The network interface card 211 allocates a storage block corresponding to the total size. In this way, the storage location of the data can be quickly and accurately determined, and the plurality of data blocks can be stored to the plurality of different destination addresses.

[0069] In some embodiments, the second network interface card 212 determines whether the plurality of data blocks are included in the write request. The network interface card 212 reads the plurality of data blocks from the write request if it is determined that the plurality of data blocks are included in the write request. The second network interface card 212 writes the plurality of data blocks to the storage block. In this way, the plurality of data blocks can be quickly obtained, improving the efficiency of obtaining the data blocks.

[0070] In some embodiments, the network interface card 212 sends an acknowledgement message for the write request to the first network interface card 210 if it is determined that the plurality of data blocks are not included in the write request. The network interface card 212 then receives the plurality of data blocks from the first network interface card 210 to be stored in a storage block within the network interface card 212. If the plurality of data blocks are stored in the storage block, the network interface card 212 sends an acknowledgement message for the plurality of data blocks to the first network interface 210 to indicate that the data blocks are successfully received. In this way, a large amount of data blocks can be quickly transmitted to the network interface card 212 to enable fast storage of the data.

[0071] At block 704, based on the plurality of sizes, the second network interface card 212 causes the plurality of data blocks to be written to the plurality of destination addresses. Each data block is determined from the received data using the size of each data block, and then written to the memory 208.

[0072] In some embodiments, the second network interface card 212 causes the plurality of data blocks to be written to the plurality of destination addresses in the memory 208 of the second device 204 by a direct memory access operation, such as a plurality of storage blocks corresponding to the plurality of destination addresses. In this way, the storage of the data can be accelerated without consuming computing resources of the computing device.

[0073] Through the above method, the efficiency of application migration can be improved, the use of network resources and computing resources is reduced, and the data processing efficiency and user experience are improved.

[0074] The above describes Figure 7 a flowchart of a method 700 for processing data of embodiments of the present disclosure. The following describes Figure 8 a flowchart of an example process 800 for performing a remote direct memory access to data according to embodiments of the present disclosure. The process 800 can be performed at the first network interface card 210 and the second network interface card 212 in the first network interface card 210 and any suitable computing device. Figure 2

[0075] As Figure 8 shown, the first device places a work queue element into a work queue 804. From the work queue element, information about data block 1 214-1, data block 2 214-2, data block 3 214-3, and data block 4 214-4 can be obtained. The information includes the source addresses of data block 1 214-1, data block 2 214-2, data block 3 214-3, and data block 4 214-4 in memory 206, the destination addresses of storage block 1 216-1, storage block 2 216-2, storage block 3 216-3, and storage block 4 216-4 in memory 208 to which the data blocks are to be sent, and the lengths of the data blocks. The work queue element also indicates that the data blocks are to be sent separately from the header.

[0076] Based on the obtained information, the network interface card 210 generates a header as Figure 4 shown. The header is combined with a basic transport header BTH and other network protocol headers to form a write request. The write request is then sent 806 to the network interface card 212.

[0077] ​The network interface card 212 then allocates a memory block equivalent to the total size of the data blocks within the memory of the network interface card 212 based on the received write request. If the memory block allocation is successful, an acknowledgement message for the write request can be sent 808 to the first network interface card 210, e.g., the acknowledgement message indicates that the write request is processed successfully. The network interface card then sends 810 the data block 1 214-1, data block 2 214-2, data block 3 214-3 and data block 4 214-4 to the second network interface card 212. The second network interface card 212 stores the received data blocks into the allocated memory block. The second network interface card 212 sends 812 an acknowledgement message to the first network interface card 210 that the data blocks are received. The second network interface 212 then writes the data blocks into memory block 1 216-1, memory block 2 216-2, memory block 3 216-3 and memory block 4 216-4 using direct memory access operations. Furthermore, after the first network interface card 210 receives the acknowledgement message from the second network interface card 212 that the data blocks are successfully received, a completion queue element is generated and put into the completion queue 802 to indicate that the storage of the data blocks is completed.

[0078] By the above method, the system performance can be improved by reducing the number of communications, and the consumption of hardware resources can be reduced.

[0079] Figure 9 A schematic block diagram of an example device 900 that can be used to implement embodiments of the present disclosure is shown. Figure 2 The device 900 can be utilized in the first network interface card 210 and / or the second network interface card 212 in the system 700. As shown, the device 900 includes a central processing unit (CPU) 901 that can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 902 or computer program instructions loaded from a storage page 908 into a random access memory (RAM) 903. Various programs and data required for the operation of the device 900 can also be stored in the RAM 903. The CPU 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0080] A plurality of components in the device 900 are connected to the I / O interface 905, including an input unit 906, e.g., a keyboard, a mouse, etc., an output unit 907, e.g., various types of displays, speakers, etc., a storage page 908, e.g., a magnetic disk, an optical disk, etc., and a communication unit 909, e.g., a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0081] The various processes and processes described above, such as the methods 200, 700, and 800, can be performed by the processing unit 901. For example, in some embodiments, the methods 200, 700, and 800 can be implemented as a computer software program tangibly embodied in a machine readable medium, such as the storage 908. In some embodiments, portions or all of the computer program can be loaded and / or installed onto the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded onto the RAM 903 and executed by the CPU 901, one or more acts of the methods 200, 700, and 800 described above can be performed.

[0082] The present disclosure can be a method, apparatus, system, and / or computer program product. The computer program product can include a computer readable storage medium (or media) having computer readable program instructions thereon for performing various aspects of the present disclosure.

[0083] The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or punched tape, a

[0084] The computer readable program instructions described herein can be downloaded to respective computing / processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing / processing device.

[0085] Computer readable program instructions for carrying out operations of the present disclosure can be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate array (FPGA), or programmable logic array (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.

[0086] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0087] These computer readable program instructions can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer readable program instructions can also be stored in a computer readable storage medium that can include random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other data storage device. When the computer readable program instructions are loaded into the computer and other programmable data processing apparatus, a series of operational steps are implemented that provide processes such that the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0088] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0089] The flow diagrams and the block diagrams in the drawings are presented to illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow diagrams and the block diagrams can represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logic functions. In some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks can sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flow diagrams, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and

[0090] Embodiments of the present disclosure have been described above, and the description is intended to be illustrative of the embodiments and not restrictive. Many modifications and variations of the described embodiments are possible and are within the scope of the disclosure. The selection of terms is intended to best describe the principles of the embodiments, practical application, or technical improvements over the technology found in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method for processing data, comprising: Information related to multiple data blocks to be written to the second device is obtained at a first network interface card coupled to the first device. The information includes the size of the multiple data blocks and multiple destination addresses of the memory of the second device to which the multiple data blocks are to be written. Based on the information, write requests are generated for the plurality of data blocks, the write requests indicating at least a plurality of destination addresses and the size of the plurality of data blocks; as well as The write request is sent to a second network interface card coupled to the second device to cause the plurality of data blocks to be written to the plurality of destination addresses; Generating the write request includes: Obtain a data carrying identifier, which indicates whether the write request includes the plurality of data blocks; as well as In response to the data carrying identifier indicating that the write request does not include the plurality of data blocks, the write request is generated based on the plurality of destination addresses, the plurality of sizes, and the number of the plurality of data blocks, wherein the write request includes a header that includes the number of sub-headers and the total size of the plurality of data blocks, and the sub-headers include the destination address and size corresponding to one of the plurality of data blocks.

2. The method according to claim 1, wherein obtaining the information includes: Obtain an indication of the storage location of the information in the first device; as well as The information is retrieved from the storage location based on the instruction.

3. The method according to claim 1, wherein generating the write request further comprises: In response to the data carrying identifier indicating that the write request includes the plurality of data blocks, the write request is generated, the write request including the header and the plurality of data blocks.

4. The method according to claim 1, further comprising: If an acknowledgment message for the write request is received from the second device, the plurality of data blocks are sent to the second device; as well as If an acknowledgment message for the plurality of data blocks is received from the second device, the first device is provided with completion information indicating that the plurality of data blocks have been written to the second device.

5. The method according to claim 1, further comprising: Obtain multiple source addresses of the multiple data blocks in the memory of the first device; as well as Based on the multiple source addresses, the multiple data blocks are obtained by performing direct memory access operations.

6. A method for processing data, comprising: At a second network interface card coupled to a second device, write requests for multiple data blocks are received from a first network interface card coupled to a first device. The write requests indicate at least the size of the multiple data blocks and multiple destination addresses of the memory of the second device to which the multiple data blocks are to be written. as well as Based on the multiple sizes, the multiple data blocks are written to the multiple destination addresses; The write request is generated through the following operations: Obtain a data carrying identifier, which indicates whether the write request includes the plurality of data blocks; as well as In response to the data carrying identifier indicating that the write request does not include the plurality of data blocks, the write request is generated based on the plurality of destination addresses, the plurality of sizes, and the number of the plurality of data blocks, wherein the write request includes a header that includes the number of sub-headers and the total size of the plurality of data blocks, and the sub-headers include the destination address and size corresponding to one of the plurality of data blocks.

7. The method of claim 6, wherein receiving the write request comprises: Obtain from one header of the write request multiple sub-headers corresponding to the multiple data blocks and the total size of the multiple data blocks; Obtain the destination address and size corresponding to one of the data blocks from each of the plurality of sub-headers; Allocate storage blocks corresponding to the total size.

8. The method according to claim 7, further comprising: Determine whether the write request includes the plurality of data blocks; as well as If it is determined that the write request includes the plurality of data blocks, obtain the plurality of data blocks from the write request; Write the plurality of data blocks into the storage block.

9. The method according to claim 7, further comprising: If it is determined that the write request does not include the plurality of data blocks, an acknowledgment message for the write request is sent to the first network interface card; as well as Receive the plurality of data blocks from the first network interface card and store them in the storage block; If the plurality of data blocks are stored in the storage block, an acknowledgment message for the plurality of data blocks is sent to the first network interface card.

10. The method of claim 6, wherein writing the plurality of data blocks to the plurality of destination addresses comprises: The plurality of data blocks are written to the plurality of destination addresses in the memory of the second device via direct memory access operations.

11. An electronic device, the electronic device comprising: At least one processor; as well as A memory, coupled to the at least one processor and having instructions stored thereon, the instructions causing the device to perform actions when executed by the at least one processor, the actions including: Information related to multiple data blocks to be written to the second device is obtained at a first network interface card coupled to the first device. The information includes the size of the multiple data blocks and multiple destination addresses of the memory of the second device to which the multiple data blocks are to be written. Based on the information, write requests are generated for the plurality of data blocks, the write requests indicating at least a plurality of destination addresses and the size of the plurality of data blocks; and The write request is sent to a second network interface card coupled to the second device to cause the plurality of data blocks to be written to the plurality of destination addresses; Generating the write request includes: Obtain a data carrying identifier, the data carrying identifier indicating whether the write request includes the plurality of data blocks; and In response to the data carrying identifier indicating that the write request does not include the plurality of data blocks, the write request is generated based on the plurality of destination addresses, the plurality of sizes, and the number of the plurality of data blocks, wherein the write request includes a header that includes the number of sub-headers and the total size of the plurality of data blocks, and the sub-headers include the destination address and size corresponding to one of the plurality of data blocks.

12. The device of claim 11, wherein obtaining the information comprises: Obtain an indication of the storage location of the information in the first device; as well as The information is retrieved from the storage location based on the instruction.

13. The device of claim 11, wherein generating the write request further comprises: In response to the data carrying identifier indicating that the write request includes the plurality of data blocks, the write request is generated, the write request including the header and the plurality of data blocks.

14. The device according to claim 11, wherein the action further includes: If an acknowledgment message for the write request is received from the second device, the plurality of data blocks are sent to the second device; as well as If an acknowledgment message for the plurality of data blocks is received from the second device, the first device is provided with completion information indicating that the plurality of data blocks have been written to the second device.

15. The device according to claim 11, wherein the action further includes: Obtain multiple source addresses of the multiple data blocks in the memory of the first device; as well as Based on the multiple source addresses, the multiple data blocks are obtained by performing direct memory access operations.

16. An electronic device, the electronic device comprising: At least one processor; as well as A memory, coupled to the at least one processor and having instructions stored thereon, the instructions causing the device to perform actions when executed by the at least one processor, the actions including: At a second network interface card coupled to the second device, write requests for multiple data blocks are received from a first network interface card coupled to the first device. These write requests at least indicate the size of the multiple data blocks and multiple destination addresses of the memory of the second device to which the multiple data blocks will be written. Based on the multiple sizes, the multiple data blocks are written to the multiple destination addresses; The write request is generated through the following operations: Obtain a data carrying identifier, the data carrying identifier indicating whether the write request includes the plurality of data blocks; and In response to the data carrying identifier indicating that the write request does not include the plurality of data blocks, the write request is generated based on the plurality of destination addresses, the plurality of sizes, and the number of the plurality of data blocks, wherein the write request includes a header that includes the number of sub-headers and the total size of the plurality of data blocks, and the sub-headers include the destination address and size corresponding to one of the plurality of data blocks.

17. The device of claim 16, wherein receiving the write request comprises: Obtain from one header of the write request multiple sub-headers corresponding to the multiple data blocks and the total size of the multiple data blocks; Obtain the destination address and size corresponding to one of the data blocks from each of the plurality of sub-headers; Allocate storage blocks corresponding to the total size.

18. The device according to claim 17, wherein the action further includes: Determine whether the write request includes the plurality of data blocks; as well as If it is determined that the write request includes the plurality of data blocks, obtain the plurality of data blocks from the write request; Write the plurality of data blocks into the storage block.

19. The device according to claim 17, wherein the action further includes: If it is determined that the write request does not include the plurality of data blocks, an acknowledgment message for the write request is sent to the first network interface card; as well as Receive the plurality of data blocks from the first network interface card and store them in the storage block; If the plurality of data blocks are stored in the storage block, an acknowledgment message for the plurality of data blocks is sent to the first network interface card.

20. The apparatus of claim 16, wherein writing the plurality of data blocks to the plurality of destination addresses comprises: The plurality of data blocks are written to the plurality of destination addresses in the memory of the second device via direct memory access operations.

21. A computer program product tangibly stored on a non-volatile computer-readable medium and comprising machine-executable instructions that, when executed, cause a machine to perform the steps of the method according to any one of claims 1 to 5.

22. A computer program product tangibly stored on a non-volatile computer-readable medium and comprising machine-executable instructions that, when executed, cause a machine to perform the steps of the method according to any one of claims 6 to 10.

Citation Information

Patent Citations

  • Method and device for reading and writing data under RDMA and network system

    CN103929415A