Data processing method based on remote direct memory access, and related devices
By using request conversion and dedicated channels from bilateral primitives to unilateral primitives in RDMA communication, the problem of rkey being easily guessed is solved, and data security is improved and cost savings are achieved.
Patent Information
- Application Number
- PCT/CN2024/117085
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-02-26
- Filing Date
- 2024-09-05
- Publication Date
- 2025-09-04
AI Technical Summary
In the existing RDMA unilateral communication methods, the rkey of the client device is easily speculated and stolen by attackers, resulting in data security issues.
The request generated by the RDMA bilateral primitive is converted into a request for the RDMA unilateral primitive. After receiving the request, the RDMA network card of the server device directly determines its source and processes it to avoid transmitting rkeys and establish a special communication channel to ensure data security.
Effectively prevent attackers from stealing data by impersonating client devices, improving data security while avoiding additional hardware costs and processor performance overhead.
Smart Images

Figure CN2024117085_04092025_PF_FP_ABST
Abstract
Description
A data processing method based on remote direct memory access and related equipment
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on February 26, 2024, with application number 202410211475.9 and application name “A data processing method based on remote direct memory access and related equipment”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] Embodiments of the present application relate to the field of computer technology, and in particular to a data processing method based on remote direct memory access (RDMA) and related devices. Background Art
[0003] RDMA technology allows client devices to directly access the memory of server devices. The communication architecture built based on RDMA technology has been widely used in data centers due to its various advantages such as lower communication latency, higher bandwidth and higher resource utilization.
[0004] RDMA technology provides two communication modes: unilateral communication and bilateral communication. In the unilateral communication mode, when a client device accesses the memory of a server device, the server device's processor does not participate in the process. In the bilateral communication mode, the server device's processor does participate in the process. In the current unilateral communication mode, when a client device needs to process data, it can send an RDMA request to the server device's RDMA network card. The RDMA request contains the remote key (rkey) assigned by the server device to the client device. Therefore, after the server device's RDMA network card determines that the rkey in the request is valid, it can allow the client device to access the server's memory to obtain and process the data required by the client device in the memory.
[0005] In the current one-sided communication mode, the RKey assigned by the server device to different client devices is poorly random, resulting in the client device's RKey being easy to guess and easily misused by attackers. They can then impersonate the client device to access the server device's memory, thereby stealing data, leaking user privacy, and causing a series of data security issues.
[0006] Summary of the Invention
[0007] The embodiments of the present application provide a data processing method based on RDMA and related devices, which can prevent attackers from invading server devices and stealing data, thereby ensuring data security.
[0008] A first aspect of an embodiment of the present application provides a data processing method based on remote direct memory access (RDMA), which is applied to a server device including a memory and an RDMA network card. The method includes:
[0009] When a client device needs to process target data, it can use the RDMA bilateral primitive to generate a first RDMA request. The first RDMA request is used to request that the target data be processed in the target memory area of the server device's memory. The target memory area refers to a memory area in the server device's memory that is dedicated to the client device. The data stored in the target memory area can be directly accessed and processed by the client device.
[0010] After receiving the first RDMA request, the RDMA network card of the server device can convert the first RDMA request constructed based on the RDMA bilateral primitive into a second RDMA request constructed based on the RDMA unilateral primitive. The second RDMA request can also be used to request processing of target data in the target memory area.
[0011] After receiving the second RDMA request, since the second RDMA request is constructed based on the RDMA one-sided primitive and is used to request processing of the target data in the target memory area, the RDMA network card of the server device can complete the processing of the target data in the target memory area in the memory of the server device according to the instruction of the second RDMA request, thereby obtaining the data processing result of the target data.
[0012] After obtaining the data processing result, the RDMA network card of the server device can return the data processing result to the client device for use by the client device.
[0013] The above method demonstrates that, because the first RDMA request transmitted between the client and server devices is constructed based on RDMA bilateral primitives, it does not carry the client device's exclusive target memory region's RKey. Furthermore, after establishing a communication connection, a dedicated communication channel is established between the client and server devices for transmitting RDMA requests. Therefore, once the server's RDMA network card receives the first RDMA request through this communication channel, it can directly determine that the first RDMA request is from the client device and grant the client device access to the target memory region. The server's RDMA network card then converts the first RDMA request into a second RDMA request constructed based on RDMA unilateral primitives and, according to the target memory region indicated in the second RDMA request, completes processing of the target data. Therefore, because the RDMA request transmitted between the client and server devices is constructed based on RDMA bilateral primitives and does not carry the RKey, the server device no longer needs to provide the client device with the RKey when establishing a connection. Therefore, an attacker cannot obtain any information about the client device's RKey and can only randomly guess the client device's RKey. Then, when an attacker impersonates a client device and sends an RDMA request based on a one-sided primitive, the request will be rejected because the rkey is incorrect, making it impossible for the attacker to invade the server device and steal data, thus ensuring data security.
[0014] In one possible implementation, an RDMA network card includes multiple work queues, each work queue includes multiple RDMA requests for indicating an operation, the multiple RDMA requests included in each work queue are constructed based on RDMA unilateral primitives, a first RDMA request is used to request a target operation to be performed on target data in a target memory area, and the RDMA network card converts the first RDMA request to obtain a second RDMA request, including: the RDMA network card generates the second RDMA request based on the first RDMA request and a first RDMA request in a target work queue, the multiple work queues include a target work queue, and the target work queue includes multiple RDMA requests for indicating the target operation. In the aforementioned implementation, after a server device and a client device establish a connection, a processor of the server device may create multiple work queues constructed based on RDMA unilateral primitives at the RDMA network card of the server device, wherein each of the multiple work queues includes multiple RDMA requests for indicating an operation, and the multiple RDMA requests included in each work queue are constructed based on RDMA unilateral primitives. Therefore, the multiple unilateral work queues correspond one-to-one to the multiple operations. After the server device's RDMA network card receives the first RDMA request, the server device's RDMA network card may determine a target work queue corresponding to the target operation from among multiple work queues, as the first RDMA request is used to request a target operation to be performed on target data in a target memory area. It will be appreciated that the target work queue contains multiple RDMA requests indicating the target operation. The server device's RDMA network card may then retrieve the first RDMA request in the target work queue from the target work queue. The server device's RDMA network card may then process the first RDMA request and the first RDMA request in the target work queue to obtain a second RDMA request.
[0015] In one possible implementation, the server device further includes a processor. The method further includes: after the processor instructs the RDMA network card to establish multiple communication channels with the client device, the RDMA network card receives an offload request from the processor, each of the multiple communication channels can transmit an RDMA request indicating a specific operation, and the offload request indicates multiple work queues corresponding one-to-one to the multiple communication channels; and the RDMA network card creates the multiple work queues based on the offload request. In the aforementioned implementation, when the client device initiates multiple communication connections to the server device, the client device needs to notify the server device of the type of each communication connection, so as to establish multiple communication channels of different types between the client device and the server device. These multiple communication channels correspond one-to-one to multiple operations. That is, each of the multiple communication channels can specifically transmit an RDMA request indicating a specific operation. After the multiple communication channels are established between the RDMA network card of the client device and the RDMA network card of the server device, the processor of the server device can send an offload request to the RDMA network card of the server device, the offload request indicating multiple work queues corresponding one-to-one to the multiple communication channels. The RDMA network card of the server device can then create the multiple work queues based on the offload request. In this way, for any one of the multiple communication channels, the RDMA network card of the server device has a work queue corresponding to the communication channel. At this point, the processor of the server device successfully offloads the computing logic for the RDMA request to the RDMA network card of the server device.
[0016] In one possible implementation, the RDMA network card generates a second RDMA request based on a first RDMA request and a first RDMA request in a target work queue. If the RDMA network card receives the first RDMA request via a target communication channel, the RDMA network card generates the second RDMA request based on the first RDMA request and the first RDMA request in the target work queue. The target communication channel can transmit RDMA requests indicating target operations. In the aforementioned implementation, after the RDMA network card of the server device receives the first RDMA request from the client device, the RDMA network card of the server device can determine the communication channel through which the first RDMA request was received. If the RDMA network card of the server device receives the first RDMA request via the target communication channel, the RDMA network card of the server device can obtain the first RDMA request in the target work queue from the target work queue corresponding to the target communication channel. The RDMA network card of the server device can then parse the first RDMA request to obtain an identifier of the target memory region and an identifier of the target data in the form of RDMA bilateral primitives, and convert the identifiers into identifiers of the target memory region and the target data in the form of RDMA unilateral primitives. Since the first RDMA request already contains the identifier of the target operation presented in the form of an RDMA unilateral primitive, the RDMA network card of the server device can add the identifier of the target memory area and the identifier of the target data presented in the form of an RDMA unilateral primitive to the first RDMA request, thereby obtaining a second RDMA request.
[0017] In one possible implementation, the method further includes: the RDMA network card receiving a reuse request from the processor; and after the RDMA network card uses the first RDMA request in the target work queue, the RDMA network card, based on the reuse request, sets the first RDMA request in the target work queue as the last RDMA request in the target work queue. In the aforementioned implementation, after the server device's RDMA network card receives the reuse request from the server device's processor, the server device's RDMA network card then has RDMA request reuse functionality. Due to this functionality, after the server device's RDMA network card uses the first RDMA request in the target work queue, the server device's RDMA network card can ensure that the first RDMA request in the target work queue is not consumed, but remains in the target work queue as the last RDMA request in the target work queue for subsequent reuse by the server device's RDMA network card. Thus, RDMA requests in the work queue can be used immediately and can also be reused by the server device's RDMA network card independently. This process does not require the server device's processor to participate, thereby saving performance overhead for the server device's processor.
[0018] In one possible implementation, after the RDMA network card uses the first RDMA request in the target work queue, the RDMA network card, based on a reuse request, sets the first RDMA request in the target work queue as the last RDMA request in the target work queue. This includes: when the RDMA network card uses the first RDMA request in the target work queue, the RDMA network card sets, in the target work queue, an identifier of the first RDMA request from a first value to a second value, where the first value indicates that the RDMA request is not used and the second value indicates that the RDMA request is used. After the RDMA network card uses the first RDMA request, the RDMA network card sets, in the target work queue, an identifier of the first RDMA request from the second value to the first value, and sets the first RDMA request as the last RDMA request in the target work queue. In the aforementioned implementation, since the RDMA network card of the server device has the function of multiplexing RDMA requests, when the RDMA network card of the server device uses the first RDMA request in the target work queue, the RDMA network card of the server device can set the identifier of the first RDMA request from the first value to the second value in the target work queue, where the first value is used to represent that the RDMA request is not used, and the second value is used to indicate that the RDMA request is used. After the RDMA network card of the server device uses the first RDMA request, the RDMA network card of the server device can reset the identifier of the first RDMA request from the second value to the first value in the target work queue, and make the first RDMA request the last RDMA request in the target work queue. In this way, the RDMA network card of the server device implements multiplexing of the RDMA request.
[0019] In one possible implementation, the RDMA network card processes the target data in the target memory area based on the second RDMA request, and the data processing result obtained includes: the RDMA network card performs a target operation on the target data in the target memory area based on the second RDMA request to obtain the data processing result, and the target operation includes any one of the following: a read operation and a write operation. In the aforementioned implementation, if the second RDMA request is used to request a read operation on the target data in the target memory area, the RDMA network card of the server device can perform a read operation on the target data in the target memory area according to the instruction of the second RDMA request. If the second RDMA request is used to request a write operation on the target data in the target memory area, the RDMA network card of the server device can perform a write operation on the target data in the target memory area according to the instruction of the second RDMA request. In this way, the RDMA network card of the server device can successfully complete the processing of the target data.
[0020] A second aspect of an embodiment of the present application provides an RDMA network card, which is arranged in a server device, and the server device also includes a memory. The RDMA network card includes: a receiving module, used to receive a first RDMA request from a client device, the first RDMA request is constructed based on an RDMA bilateral primitive, and the first RDMA request is used to request processing target data in a target memory area of the memory; a processing module, used to convert the first RDMA request to obtain a second RDMA request, the second RDMA request is constructed based on an RDMA unilateral primitive, and the second RDMA request is used to request processing target data in the target memory area; the processing module is also used to process the target data in the target memory area based on the second RDMA request to obtain a data processing result; and a sending module, used to return the data processing result to the client device.
[0021] As can be seen from the above-mentioned device, when a client device needs to process target data, it can construct a first RDMA request using RDMA bilateral primitives and send the first RDMA request to the server device. The first RDMA request is used to request that the target data be processed in the target memory area of the server device's memory. After receiving the first RDMA request, the server device's RDMA network card can convert the first RDMA request to obtain a second RDMA request constructed based on RDMA unilateral primitives. The second RDMA request is used to request that the target data be processed in the target memory area. Then, the server device's RDMA network card processes the target data in the target memory area based on the second RDMA request, thereby obtaining a data processing result, and returns the data processing result to the client device. In the above-mentioned process, since the first RDMA request constructed based on RDMA bilateral primitives is transmitted between the client device and the server device, the first RDMA request does not carry the rkey of the target memory area exclusive to the client device. Furthermore, after establishing a communication connection between the client device and the server device, a communication channel dedicated to transmitting RDMA requests is established between them. Therefore, once the server device's RDMA network card receives a first RDMA request through this communication channel, it can directly determine that the first RDMA request is from the client device and allow the client device to access the target memory area. The server device's RDMA network card can then convert the first RDMA request into a second RDMA request based on RDMA unilateral primitives and, according to the target memory area indicated in the second RDMA request, complete the processing of the target data. Therefore, because the RDMA requests transmitted between the client device and the server device are based on RDMA bilateral primitives and do not carry an RKey, the server device no longer needs to provide the client device with an RKey when establishing a connection. Therefore, an attacker cannot obtain any information about the client device's RKey and can only randomly guess the client device's RKey. Consequently, when an attacker impersonating a client device sends an RDMA request based on a unilateral primitive, the request will be rejected due to an incorrect RKey, preventing the attacker from invading the server device and stealing data, thereby ensuring data security.
[0022] In one possible implementation, an RDMA network card includes multiple work queues, each work queue includes multiple RDMA requests for indicating an operation, the multiple RDMA requests included in each work queue are constructed based on RDMA one-sided primitives, a first RDMA request is used to request a target operation to be performed on target data in a target memory area, and a processing module is used to generate a second RDMA request based on the first RDMA request and the first RDMA request in the target work queue, the multiple work queues include a target work queue, and the target work queue includes multiple RDMA requests for indicating the target operation.
[0023] In one possible implementation, the server device further includes a processor and a receiving module, which is further used to receive an offload request from the processor after the processor instructs the RDMA network card to establish multiple communication channels with the client device, each of the multiple communication channels can transmit an RDMA request for indicating an operation, and the offload request is used to indicate multiple work queues corresponding one-to-one to the multiple communication channels; the processing module is further used to create multiple work queues based on the offload request.
[0024] In one possible implementation, the processing module is configured to generate a second RDMA request based on the first RDMA request and the first RDMA request in the target work queue if the RDMA network card receives a first RDMA request through a target communication channel. The target communication channel can transmit an RDMA request for indicating a target operation.
[0025] In one possible implementation, the receiving module is further configured to receive a reuse request from the processor; and the processing module is further configured to, after the RDMA network card uses the first RDMA request in the target work queue, make the first RDMA request in the target work queue the last RDMA request in the target work queue based on the reuse request.
[0026] In one possible implementation, the processing module is configured to: when the RDMA network card uses the first RDMA request in the target work queue, set the identifier of the first RDMA request in the target work queue from a first value to a second value, where the first value indicates that the RDMA request is not used and the second value indicates that the RDMA request is used. After the RDMA network card uses the first RDMA request, set the identifier of the first RDMA request in the target work queue from the second value to the first value, and mark the first RDMA request as the last RDMA request in the target work queue.
[0027] In one possible implementation, the processing module is configured to perform a target operation on the target data in the target memory area based on the second RDMA request to obtain a data processing result, where the target operation includes any one of the following: a read operation and a write operation.
[0028] A third aspect of an embodiment of the present application provides a device, which serves as a server device. The server device includes a processor, a memory, and an RDMA network card. The RDMA network card is communicatively connected to the processor, and the RDMA network card is communicatively connected to the memory. The RDMA network card is used to execute the method described in the first aspect or any possible implementation method of the first aspect on the memory based on instructions from the processor.
[0029] A fourth aspect of an embodiment of the present application provides a computer storage medium storing one or more instructions, which, when executed by one or more computers, enables the one or more computers to implement the method described in the first aspect or any possible implementation method of the first aspect.
[0030] A fifth aspect of the embodiments of the present application provides a computer program product, which stores instructions. When the instructions are executed by a computer, the computer implements the method described in the first aspect or any possible implementation method of the first aspect.
[0031] In an embodiment of the present application, when a client device needs to process target data, it can use the RDMA bilateral primitive to construct a first RDMA request and send the first RDMA request to the server device. The first RDMA request is used to request that the target data be processed in the target memory area of the server device's memory. After the RDMA network card of the server device receives the first RDMA request, it can convert the first RDMA request to obtain a second RDMA request constructed based on the RDMA unilateral primitive. The second RDMA request is used to request that the target data be processed in the target memory area. Then, the RDMA network card of the server device processes the target data in the target memory area based on the second RDMA request, thereby obtaining a data processing result, and returns the data processing result to the client device. In the aforementioned process, since the first RDMA request constructed based on the RDMA bilateral primitive is transmitted between the client device and the server device, the first RDMA request does not carry the rkey of the target memory area exclusive to the client device. Furthermore, after establishing a communication connection between the client device and the server device, a communication channel dedicated to transmitting RDMA requests is established between them. Therefore, once the server device's RDMA network card receives a first RDMA request through this communication channel, it can directly determine that the first RDMA request is from the client device and allow the client device to access the target memory area. The server device's RDMA network card can then convert the first RDMA request into a second RDMA request based on RDMA unilateral primitives and, according to the target memory area indicated in the second RDMA request, complete the processing of the target data. Therefore, because the RDMA requests transmitted between the client device and the server device are based on RDMA bilateral primitives and do not carry an RKey, the server device no longer needs to provide the client device with an RKey when establishing a connection. Therefore, an attacker cannot obtain any information about the client device's RKey and can only randomly guess the client device's RKey. Consequently, when an attacker impersonating a client device sends an RDMA request based on a unilateral primitive, the request will be rejected due to an incorrect RKey, preventing the attacker from invading the server device and stealing data, thereby ensuring data security.
[0032] Furthermore, in the embodiment of the present application, in order to prevent the server device from being invaded by attackers, it is only necessary to improve the function of the RDMA network card of the server device. There is no need to add additional hardware to the server device or configure additional intelligent network devices for the server device, and deployment can be achieved at a lower hardware cost.
[0033] Furthermore, in an embodiment of the present application, in order to prevent the server device from being invaded by attackers, a new communication method is provided. When the server device processes the RDMA request from the client device and completes data processing, the processor does not need to be involved, which also saves the processor's performance overhead.
[0034] Furthermore, in an embodiment of the present application, the RDMA requests in the unilateral work queue may be reused by the RDMA network card of the server device immediately after being used by the RDMA network card of the server device. This process does not require the participation of the processor of the server device, which can save the performance consumption of the processor of the server device. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] FIG1 is a schematic diagram of the structure of a data processing system provided in an embodiment of the present application;
[0036] FIG2 is another schematic diagram of the structure of the data processing system provided in an embodiment of the present application;
[0037] FIG3 is another structural diagram of a data processing system provided in an embodiment of the present application;
[0038] FIG4 is a flow chart of a data processing method based on RDMA provided in an embodiment of the present application;
[0039] FIG5 is another schematic diagram of the structure of the data processing system provided in an embodiment of the present application;
[0040] FIG6 is another schematic diagram of the structure of the data processing system provided in an embodiment of the present application;
[0041] FIG7 is a schematic diagram of a comparison result provided by an embodiment of the present application;
[0042] FIG8 is another schematic diagram of the comparison results provided by an embodiment of the present application;
[0043] FIG9 is another schematic diagram of the comparison results provided by an embodiment of the present application;
[0044] FIG10 is another schematic diagram of the comparison results provided in an embodiment of the present application;
[0045] FIG11 is another schematic diagram of the comparison results provided by an embodiment of the present application;
[0046] FIG12 is a schematic diagram of the structure of an RDMA network card provided in an embodiment of the present application;
[0047] FIG13 is a schematic structural diagram of a server device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] The embodiments of the present application provide a data processing method based on RDMA and related devices, which can prevent attackers from invading server devices and stealing data, thereby ensuring data security.
[0049] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, and this is merely a way of distinguishing the objects of the same attributes when describing them in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0050] RDMA technology allows client devices to directly access the memory of server devices. The communication architecture built based on RDMA technology has been widely used in data centers due to its various advantages such as lower communication latency, higher bandwidth and higher resource utilization.
[0051] RDMA technology provides two communication modes: unilateral and bilateral. In unilateral communication, when a client device accesses the server device's memory, the server device's processor does not participate in the process. In bilateral communication, the server device's processor does participate in the process. In the current unilateral communication mode, when a client device needs to process certain data, it can send an RDMA request to the server device's RDMA network card to indicate this data. The RDMA request contains the RKey assigned by the server device to the client device. Therefore, after the server device's RDMA network card determines that the RKey in the request is valid, the server device's RDMA network card can directly access the server device's memory to find the data indicated by the RDMA request and process it, thereby obtaining the data processing result. The server device's RDMA network card can then return the data processing result to the client device. In this way, unilateral communication is successfully completed.
[0052] In the current one-sided communication mode, the RKeys assigned by the server device to different client devices are poorly random (for example, the difference between the RKeys of different client devices is fixed, etc.), resulting in the RKeys of client devices being easy to guess and easily misused by attackers. They can then impersonate the client device to access the server device's memory, thereby stealing data, leaking user privacy, and causing a series of data security issues.
[0053] Furthermore, in some related technologies, to prevent server-side devices from being hacked, improvements can be made to the server-side device's hardware. For example, additional hardware can be added to the server-side device or additional intelligent network devices can be configured for the server-side device to address the security vulnerabilities inherent in the aforementioned one-way communication approach. However, the hardware costs associated with this approach are prohibitively high.
[0054] Furthermore, in other related technologies, in order to prevent the server device from being invaded by attackers, a bilateral communication method can be used to replace the unilateral communication method. However, the bilateral communication method requires the participation of the processor of the server device, resulting in excessive performance overhead of the processor.
[0055] In order to solve the above problems, an embodiment of the present application provides a data processing method based on RDMA, which can be implemented by a data processing system. Figure 1 is a structural diagram of the data processing system provided by an embodiment of the present application. As shown in Figure 1, the data processing system includes multiple devices and a network, and multiple devices communicate with each other through the network. Among them, multiple devices can be presented in a variety of ways. For example, these multiple devices can be computing devices (for example, servers), or these multiple devices can also be storage devices (for example, storage arrays), or these multiple devices can also be other devices that support RDMA technology, etc., which are not limited here. The network can be built based on a protocol that supports RDMA technology, which can be any one of the Infiniband (IB) protocol, the RDMA over converged rthernet (RoCE) protocol based on converged Ethernet, and the Internet Wide Area RDMA protocol (iWARP).
[0056] In this system, any two devices can communicate over the network. For ease of description, the device that generates and sends RDMA requests will be referred to as a client device, and the device that receives and processes RDMA requests will be referred to as a server device. The following provides a preliminary introduction to the communication method between client and server devices, using Figure 2. Figure 2 is another schematic diagram of the structure of the data processing system provided in an embodiment of the present application. As shown in Figure 2, the client device or server device can be any of the devices in Figure 1.
[0057] The server device may include a processor, memory, and an RDMA network card. The processor, memory, and RDMA network card are connected via a bus, such as the Peripheral Component Interconnect Express (PCIe) standard. Of course, the bus can also be other types of buses that connect devices within the device. In addition to the data bus, the bus may also include a power bus, a control bus, and a status signal bus. The processor may be a central processing unit (CPU). Of course, the processor may also be other general-purpose processors, digital signal processing (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The RDMA network card, also known as a host channel adapter (HCA), is a smart network card that supports RDMA technology.
[0058] The client device also includes a processor, memory, and RDMA network card. For an introduction to the client device's processor, memory, and RDMA network card, refer to the aforementioned description of the server device's processor, memory, and RDMA network card, and will not be repeated here.
[0059] The above describes the server device and client device from a purely hardware perspective. The following describes the server device and client device from a software and hardware perspective. FIG3 is another structural diagram of the data processing system provided by an embodiment of the present application. As shown in FIG3 , the following further describes the various components of the server device and client device in conjunction with the communication process between the server device and the client device:
[0060] After the client device is started, the client's processor can run applications and the RDMA communication library (LibSecRDMA). The client device's RDMA communication library can provide a secure interface for the server device's application. When the client device's application needs to access the server device's memory to process target data, the client device's application can call the secure interface, causing the client device's RDMA communication library to generate an RDMA request using RDMA bilateral primitives. The RDMA request is used to request that the target data be processed in a memory region (MR) dedicated to the client device in the server device's memory. The client device's RDMA communication library can then send the RDMA request to the client device's RDMA network card, causing the client device's RDMA network card to send the RDMA request to the server device via the communication channel between the client device's RDMA network card and the server device.
[0061] After the server device boots up, its processor may also run applications and an RDMA communication library. Server applications can register their own dedicated MRs in the server device's memory, which store the server application's data. The server application can further partition its own MR into multiple MRs and assign them to different client devices. In other words, each client device has its own dedicated MR in the server device's memory, which the corresponding client device can remotely access and process the data in. When a communication connection is established between the server and client devices, the server's RDMA communication library no longer provides the client device with the RKey for the client's dedicated MR. Instead, after the communication connection is established, it creates work queues based on RDMA unilateral primitives on the server's RDMA network card (equivalent to offloading the computational logic originally handled by the server's RDMA communication library to the server's RDMA network card). These work queues contain RDMA requests generated using RDMA unilateral primitives. These RDMA requests are not immediately executed by the server's RDMA network card, but instead await execution triggered by RDMA requests generated using RDMA bilateral primitives from the client.
[0062] When the client needs to process target data, the RDMA network card of the server device can receive an RDMA request from the client device through the communication channel between the RDMA network card of the server device and the client device. The RDMA request is generated based on the RDMA bilateral primitive. Then, the RDMA network card of the server device can use the RDMA requests in the work queue and the RDMA request from the client device to generate a new RDMA request. The new RDMA request is also used to request the processing of the target data in the MR dedicated to the client device. Since the new RDMA request is generated based on the unilateral primitive, the RDMA network card of the server device can directly execute the new RDMA request to process the target data in the MR, thereby obtaining the processing result of the target data. In this way, the server device can return the processing result to the client for use by the client application.
[0063] In addition, the RDMA communication library of the server device can also deploy multiplexing logic in the RDMA network card of the server device. That is, after the RDMA network card of the server device uses the RDMA requests in the work queue, it will not consume these RDMA requests, but the work queue can still retain these RDMA requests, thereby realizing the multiplexing of RDMA requests.
[0064] Based on the above data processing system, it can be seen that the communication between the client device and the server device adopts a new communication method that combines traditional unilateral and bilateral communication methods. Since the RDMA requests transmitted between the client device and the server device are generated based on the RDMA bilateral primitive, the RDMA requests do not carry the RKey. Moreover, after the client device and the server device establish a communication connection, a communication channel dedicated to transmitting RDMA requests exists between them. Therefore, once the RDMA network card of the server device receives an RDMA request through this communication channel, it can directly determine that the RDMA request comes from the client device and allow the client device to access its dedicated memory MR. Based on this RDMA request, it converts the RDMA request into an RDMA request generated based on the RDMA unilateral primitive. Based on this RDMA request, the client device's dedicated memory MR is accessed in the server device's memory to complete data processing. Therefore, attackers can no longer impersonate the client device and access the client device's dedicated memory MR at the server device to steal data, effectively improving data security. To further understand the working process of the above data processing system, the following further describes this process with reference to Figure 4. FIG4 is a flow chart of an RDMA-based data processing method provided in an embodiment of the present application. As shown in FIG4 , the method may be implemented by a server device in a data processing system as shown in FIG2 or FIG3 . The method includes:
[0065] 401. An RDMA network card of a server device receives a first RDMA request from a client device. The first RDMA request is constructed based on an RDMA bilateral primitive and is used to request processing target data in a target memory area of a memory of the server device.
[0066] In this embodiment, when the processor of the client device needs to process target data, it can use RDMA bilateral primitives to generate a first RDMA request (for example, a Send request, etc.). The first RDMA request is used to request to process the target data in the target memory area of the server device's memory, where the target memory area refers to an exclusive memory area in the server device's memory allocated to the client device. The data stored in this memory area (including the target data) can be directly accessed and processed by the client device.
[0067] After obtaining the first RDMA operation, the processor of the client device may send the first RDMA request to the RDMA network card of the client device, so that the RDMA network card of the client device sends the first RDMA request to the RDMA network card of the server device.
[0068] Specifically, the first RDMA request may be presented in the following manner:
[0069] The first RDMA request may include information such as the identifier of the target memory area (for example, the location information of the target memory area in the memory of the server device, etc.), the identifier of the target data located in the target memory area (for example, the location information of the target data in the target memory area, etc.), and the identifier of the target operation for the target data (for example, the type of the target operation, etc.). All of this information is presented in the form of RDMA bilateral primitives, so the first RDMA request can be used to request a target operation on the target data in the target memory area. It is worth noting that since the first RDMA request is constructed based on the RDMA bilateral primitive, the first RDMA request does not include the rkey of the target memory area. In addition, since there can be multiple operations for the data in this embodiment, the target operation is any one of the multiple operations, for example, the target operation is a write operation, and for example, the target operation is a read operation, etc.
[0070] For example, as shown in Figure 5 (Figure 5 is another structural diagram of the data processing system provided by an embodiment of the present application), when the application of the client device needs to process target data, it can call the security interface provided by the RDMA communication library of the client device, so that the RDMA communication library of the client device uses the RDMA bilateral primitive to generate a Send request for it. The Send request is used to request a read operation on the target data in the target MR in the memory of the server device.
[0071] 402. The RDMA network card converts the first RDMA request to obtain a second RDMA request. The second RDMA request is constructed based on the RDMA one-sided primitive. The second RDMA request is used to request processing of target data in the target memory area.
[0072] After receiving the first RDMA request, the RDMA network card of the server device can convert the first RDMA request constructed based on the RDMA bilateral primitive into a second RDMA request (e.g., a Read request or a Write request, etc.) constructed based on the RDMA unilateral primitive. Since the first and second RDMA requests only differ in their expression and their essential content is similar, the second RDMA request can also be used to request processing of target data in the target memory area.
[0073] Specifically, the first RDMA request may be presented in the following manner:
[0074] The second RDMA request may include information such as the identifier of the target memory area, the identifier of the target data located in the target memory area, and the identifier of the target operation on the target data. This information is presented in the form of RDMA unilateral primitives, so the second RDMA request can be used to request the target operation to be performed on the target data in the target memory area. It is worth noting that although the second RDMA request is constructed based on the RDMA unilateral primitives, it is a request generated internally by the server device, so the second RDMA request does not include the rkey of the target memory area.
[0075] As in the above example, after the RDMA network card of the server device receives a Send request, since the Send request is used to request a read operation on the target data in the target MR, the Send request generated using the RDMA bilateral primitive can be converted into a Read request generated using the RDMA unilateral primitive. The Read request is used to request a read operation on the target data in the target MR.
[0076] Specifically, the RDMA network card of the server device may obtain the second RDMA request in the following manner:
[0077] After a connection is established between a server device and a client device, the server device's processor creates multiple work queues (WQs) based on RDMA unilateral primitives at the server device's RDMA network card. For ease of explanation, these multiple work queues will be referred to as multiple unilateral work queues. Each of these multiple unilateral work queues contains multiple RDMA requests indicating a specific operation, and each work queue contains multiple RDMA requests based on RDMA unilateral primitives. This indicates that the multiple unilateral work queues correspond one-to-one to the multiple operations.
[0078] Because the first RDMA request is used to request a target operation to be performed on target data in a target memory region, the RDMA network card of the server device can determine a target unilateral work queue corresponding to the target operation from multiple unilateral work queues (the target unilateral work queue is the aforementioned target work queue, which contains multiple RDMA requests indicating the target operation). Next, the RDMA network card of the server device can obtain the first RDMA request of the target unilateral work queue from the target unilateral work queue. The RDMA network card of the server device can then parse the first RDMA request to obtain the identifier of the target memory region and the identifier of the target data presented in the form of RDMA bilateral primitives, and convert them into the identifier of the target memory region and the identifier of the target data presented in the form of RDMA unilateral primitives. Because the first RDMA request of the target unilateral work queue already contains the identifier of the target operation presented in the form of RDMA unilateral primitives, the RDMA network card of the server device can add the identifier of the target memory region and the identifier of the target data presented in the form of RDMA unilateral primitives to the first RDMA request of the target unilateral work queue, thereby obtaining a second RDMA request.
[0079] More specifically, the processor of the server device may instruct the RDMA network card of the server device to create multiple unilateral work queues in the following manner:
[0080] When a client device initiates multiple communication connections with a server device, the client device needs to notify the server device of the type of each communication connection in order to establish multiple communication channels of different types between the client device and the server device. For example, when the client device's processor establishes a communication connection with the server device's processor, the client device's processor may send a connection request to the server device's processor to inform the server device's processor that the type of the communication connection is a read operation (or write operation). Therefore, the server device's processor may, based on the connection request, instruct the server device's RDMA network card and the client device's RDMA network card to complete the communication connection. After the communication connection is successful, the communication channel established between the client device's RDMA network card and the server device's RDMA network card corresponds to a read operation (i.e., the communication channel can specifically transmit RDMA requests indicating read operations (or write operations)). Thus, the multiple communication channels established between the client device and the server device correspond one-to-one to multiple operations. That is, each of the multiple communication channels can specifically transmit RDMA requests indicating a specific operation.
[0081] When multiple communication channels are established between the RDMA network card of the client device and the RDMA network card of the server device, the RDMA network card of the server device will create multiple bilateral work queues. The multiple bilateral work queues correspond one-to-one to the multiple communication channels. Each bilateral work queue is used to receive RDMA requests from the client device transmitted by its corresponding communication channel.
[0082] After establishing multiple communication channels between the RDMA network card of the client device and the RDMA network card of the server device, the processor of the server device can offload the computing logic to the RDMA network card of the server device. That is, the processor of the server device can send an offload request to the RDMA network card of the server device. The offload request is used to indicate multiple unilateral work queues corresponding one-to-one to the multiple communication channels. Then, the RDMA network card of the server device can create multiple unilateral work queues based on the offload request and associate the multiple unilateral work queues with the multiple bilateral work queues one-to-one. In this way, for any one of the multiple communication channels, the RDMA network card of the server device has a bilateral work queue corresponding to the communication channel, and a unilateral work queue corresponding to the bilateral work queue.
[0083] Still taking the above example as shown in FIG6 (FIG. 6 is another structural diagram of the data processing system provided by an embodiment of the present application, and FIG6 is obtained by drawing on the basis of FIG5), when a client device needs to establish a communication connection with a server device, the RDMA communication library of the client device may send a connection request to the RDMA communication library of the server device to declare the type of communication connection to the RDMA communication library of the server device, such as a read operation or a write operation. Then, based on the connection request, the RDMA communication library of the server device may cause the RDMA network card of the server device and the RDMA network card of the client device to establish communication channel 1 and communication channel 2 in succession, wherein communication channel 1 specifically transmits RDMA requests for indicating read operations, and communication channel 2 specifically transmits RDMA requests for indicating write operations.
[0084] When the RDMA network card of the server device establishes communication channel 1 and communication channel 2 with the RDMA network card of the client device, it can create a bilateral work queue 1 corresponding to communication channel 1 and a bilateral work queue 2 corresponding to communication channel 2, wherein the bilateral work queue 1 is used to receive the RDMA requests transmitted by the communication channel 1, and the bilateral work queue 2 is used to transmit the RDMA requests transmitted by the communication channel 2.
[0085] After the RDMA network card of the server device successfully establishes communication channel 1 and communication channel 2 with the RDMA network card of the client device, the RDMA communication library of the server device can send an offload request to the RDMA network card of the server device, so that the RDMA network card of the server device generates a unilateral work queue 1 corresponding to the bilateral work queue 1 and a unilateral work queue 2 corresponding to the bilateral work queue 2 based on the offload request, wherein the unilateral work queue 1 includes multiple initial Read requests generated using RDMA unilateral primitives (each initial Read request includes an identifier of a read operation presented in the form of an RDMA unilateral primitive), and the unilateral work queue 2 includes multiple initial Write requests generated using RDMA unilateral primitives (each initial Write request includes an identifier of a write operation presented in the form of an RDMA unilateral primitive).
[0086] More specifically, based on the above communication channel, bilateral work queue, and unilateral work queue, the RDMA network card of the server device can also obtain the second RDMA request in the following manner:
[0087] After the server device's RDMA network card receives the first RDMA request from the client device, the server device's RDMA network card can determine the specific communication channel through which the first RDMA request was received. For example, because the first RDMA request is used to request a target operation to be performed on target data in a target memory area, the client device's network card can send the first RDMA request to the server device's RDMA network card via the target communication channel (the target communication channel can specifically transmit RDMA requests indicating target operations). After the first RDMA request arrives at the server device's RDMA network card, the target bilateral work queue corresponding to the target communication channel receives the first RDMA request and directly triggers the target unilateral work queue corresponding to the target bilateral work queue. After detecting this triggering operation, the server device's RDMA network card can obtain the first RDMA request in the target unilateral work queue from the target work queue and process the first RDMA request and the first RDMA request in the target unilateral work queue to obtain a second RDMA request.
[0088] Still using the above example, if the RDMA network card of the server device receives a Send request sent by the client device through communication channel 1, the Send request will be received by the bilateral work queue 1 and trigger the unilateral work queue 1. After the RDMA network card of the server device detects the trigger, it can obtain the first initial Read request from the unilateral work queue 1. Then, the server device can parse the Send request, obtain the identifier of the target MR and the identifier of the target data presented in the form of RDMA bilateral primitives, and convert them into the identifier of the target MR and the identifier of the target data presented in the form of RDMA unilateral primitives. Since the first initial Read request already contains the identifier of the read operation presented in the form of RDMA unilateral primitives, the RDMA network card of the server device can add the identifier of the target MR and the identifier of the target data presented in the form of RDMA unilateral primitives to the first initial Read request, thereby obtaining the final Read request.
[0089] 403. The RDMA network card processes the target data in the target memory area based on the second RDMA request, obtains a data processing result, and returns the data processing result to the client device.
[0090] After receiving the second RDMA request, the server's RDMA network card can directly locate the target memory area in the server's memory based on the second RDMA request. Since the second RDMA request is constructed based on the RDMA one-sided primitive and is used to request the processing of the target data in the target memory area, the server's RDMA network card can process the target data in the target memory area, thereby obtaining the data processing result for the target data. Finally, the server's RDMA network card can return the data processing result to the client device for use.
[0091] Specifically, the RDMA network card of the server device can process the target data in the following ways:
[0092] Because the second RDMA request is used to request a target operation on the target data in the target memory area, the server device's RDMA network card can perform the target operation on the target data in the target memory area according to the instructions of the second RDMA request, thereby obtaining a data processing result. For example, if the second RDMA request is used to request a read operation on the target data in the target memory area, the server device's RDMA network card will perform the read operation on the target data in the target memory area. For another example, if the second RDMA request is used to request a write operation on the target data in the target memory area, the server device's RDMA network card will perform the write operation on the target data in the target memory area.
[0093] As in the above example, after receiving the final Read request, the RDMA network card of the server device can find the target MR in the memory of the server device based on the final Read request, read the target data, obtain the data processing result, and return the data processing result to the client device.
[0094] Furthermore, the processor of the server device may also deploy multiplexing logic at the RDMA network card of the server device, as follows:
[0095] The server's RDMA network card receives a reuse request from the server's processor. This reuse request enables the server's RDMA network card to reuse RDMA requests. This functionality ensures that after the server's RDMA network card uses the first RDMA request in the target work queue, the first RDMA request in the target work queue is not consumed. Instead, it remains in the target work queue and serves as the last RDMA request in the target work queue, ready for subsequent reuse by the server's RDMA network card.
[0096] Specifically, the RDMA network card of the server device can reuse RDMA requests in the following ways:
[0097] In the target work queue, each RDMA request has a unique identifier (metadata), and the initial value of the RDMA request identifier is a first value, which is used to indicate that the RDMA request is not in use (i.e., the RDMA request is available). Since the RDMA network card of the server device has the function of multiplexing RDMA requests, when the RDMA network card of the server device uses the first RDMA request in the target work queue, the RDMA network card of the server device can set the identifier of the first RDMA request from the first value to the second value in the target work queue, where the second value is used to indicate that the RDMA request has been in use (i.e., the RDMA request is unavailable). After the RDMA network card of the server device uses the first RDMA request, the RDMA network card of the server device can reset the identifier of the first RDMA request from the second value to the first value in the target work queue, and make the first RDMA request the last RDMA request in the target work queue.
[0098] In addition, the communication method provided in the embodiment of the present application (for example, offload in the subsequent figures) and the communication method provided by the related technology (for example, native in the subsequent figures) can be compared in terms of certain performance indicators. The comparison results are shown in Figures 7 and 8 (Figure 7 is a schematic diagram of the comparison results provided in the embodiment of the present application, and Figure 8 is another schematic diagram of the comparison results provided in the embodiment of the present application).
[0099] Based on Figures 7 and 8, when the input / output (IO) request size is 32KB, the embodiment of the present application incurs a 9.7% performance overhead in average latency (AVG) and an 11.9% performance overhead in P99 tail latency compared to the related art. When the IO request size is 2MB, the performance overhead of the embodiment of the present application in both average latency and P99 tail latency is less than 1% compared to the related art.
[0100] Furthermore, the communication method provided in the embodiment of the present application can be compared with the communication method provided in the related art in terms of other performance indicators. The comparison results are shown in Figure 9 (Figure 9 is another schematic diagram of the comparison results provided in the embodiment of the present application).
[0101] Figure 9 shows the bandwidth for reading remote memory at different numbers of concurrent threads and different IO depths (number of requests pending at the same time). When the IO depth is 10 and the number of threads is 12, the bandwidth reduction achieved by the embodiment of the present application is only 2.0% compared to the related art. When the IO depth is 10 and the number of threads is 24, the bandwidth reduction achieved by the embodiment of the present application is only 3.3% compared to the related art.
[0102] Furthermore, the communication method provided in the embodiment of the present application can be compared with the communication method provided by the related technology in terms of other performance indicators. The comparison results are shown in Figures 10 and 11 (Figure 10 is another schematic diagram of the comparison results provided in the embodiment of the present application, and Figure 11 is another schematic diagram of the comparison results provided in the embodiment of the present application).
[0103] Based on Figures 10 and 11, it can be seen that in a distributed key-value store (KVS), when the value size and the number of threads are different, the client device uses the embodiments of the present application and related technologies to perform put operations. When the value size is 32KB and the number of threads is 24, the performance overhead caused by the embodiment of the present application on the latency of the put operation is only 2.5%, and the overhead caused on the throughput is only 2.4%. When the value size is 64KB and the number of threads is 24, the performance overhead caused by the embodiment of the present application on the latency of the put operation is only 1.8%, and the overhead caused on the throughput is only 2.2%.
[0104] In an embodiment of the present application, when a client device needs to process target data, it can use the RDMA bilateral primitive to construct a first RDMA request and send the first RDMA request to the server device. The first RDMA request is used to request that the target data be processed in the target memory area of the server device's memory. After the RDMA network card of the server device receives the first RDMA request, it can convert the first RDMA request to obtain a second RDMA request constructed based on the RDMA unilateral primitive. The second RDMA request is used to request that the target data be processed in the target memory area. Then, the RDMA network card of the server device processes the target data in the target memory area based on the second RDMA request, thereby obtaining a data processing result, and returns the data processing result to the client device. In the aforementioned process, since the first RDMA request constructed based on the RDMA bilateral primitive is transmitted between the client device and the server device, the first RDMA request does not carry the rkey of the target memory area exclusive to the client device. Furthermore, after establishing a communication connection between the client device and the server device, a communication channel dedicated to transmitting RDMA requests is established between them. Therefore, once the server device's RDMA network card receives a first RDMA request through this communication channel, it can directly determine that the first RDMA request is from the client device and allow the client device to access the target memory area. The server device's RDMA network card can then convert the first RDMA request into a second RDMA request based on RDMA unilateral primitives and, according to the target memory area indicated in the second RDMA request, complete the processing of the target data. Therefore, because the RDMA requests transmitted between the client device and the server device are based on RDMA bilateral primitives and do not carry an RKey, the server device no longer needs to provide the client device with an RKey when establishing a connection. Therefore, an attacker cannot obtain any information about the client device's RKey and can only randomly guess the client device's RKey. Consequently, when an attacker impersonating a client device sends an RDMA request based on a unilateral primitive, the request will be rejected due to an incorrect RKey, preventing the attacker from invading the server device and stealing data, thereby ensuring data security.
[0105] Furthermore, in the embodiment of the present application, in order to prevent the server device from being invaded by attackers, it is only necessary to improve the function of the RDMA network card of the server device. There is no need to add additional hardware to the server device or configure additional intelligent network devices for the server device, and deployment can be achieved at a lower hardware cost.
[0106] Furthermore, in an embodiment of the present application, in order to prevent the server device from being invaded by attackers, a new communication method is provided. When the server device processes the RDMA request from the client device and completes data processing, the processor does not need to be involved, which also saves the processor's performance overhead.
[0107] Furthermore, in an embodiment of the present application, the RDMA requests in the unilateral work queue may be reused by the RDMA network card of the server device immediately after being used by the RDMA network card of the server device. This process does not require the participation of the processor of the server device, which can save the performance consumption of the processor of the server device.
[0108] The above is a detailed description of the RDMA-based data processing method provided by the embodiment of the present application. The following will introduce the RDMA network card and server device provided by the embodiment of the present application. Figure 12 is a structural diagram of the RDMA network card provided by the embodiment of the present application. As shown in Figure 12, the RDMA network card is set in the server device, and the server device also includes memory. The RDMA network card includes:
[0109] The receiving module 1201 is used to receive a first RDMA request from a client device, where the first RDMA request is constructed based on an RDMA bilateral primitive and is used to request processing target data in a target memory area of the memory; for example, the receiving module 1201 can be used to implement step 401 of the embodiment shown in FIG. 4 .
[0110] The processing module 1202 is used to convert the first RDMA request to obtain a second RDMA request, where the second RDMA request is constructed based on the RDMA one-sided primitive and is used to request processing of target data in the target memory area. For example, the processing module 1202 can be used to implement step 402 of the embodiment shown in Figure 4.
[0111] The processing module 1202 is further configured to process the target data in the target memory area based on the second RDMA request to obtain a data processing result; for example, the processing module 1202 may be used to implement step 403 of the embodiment shown in FIG. 4 .
[0112] The sending module 1203 is configured to return the data processing result to the client device. For example, the sending module 1203 may be used to implement step 403 of the embodiment shown in FIG4 .
[0113] In an embodiment of the present application, when a client device needs to process target data, it can use the RDMA bilateral primitive to construct a first RDMA request and send the first RDMA request to the server device. The first RDMA request is used to request that the target data be processed in the target memory area of the server device's memory. After the RDMA network card of the server device receives the first RDMA request, it can convert the first RDMA request to obtain a second RDMA request constructed based on the RDMA unilateral primitive. The second RDMA request is used to request that the target data be processed in the target memory area. Then, the RDMA network card of the server device processes the target data in the target memory area based on the second RDMA request, thereby obtaining a data processing result, and returns the data processing result to the client device. In the aforementioned process, since the first RDMA request constructed based on the RDMA bilateral primitive is transmitted between the client device and the server device, the first RDMA request does not carry the rkey of the target memory area exclusive to the client device. Furthermore, after establishing a communication connection between the client device and the server device, a communication channel dedicated to transmitting RDMA requests is established between them. Therefore, once the server device's RDMA network card receives a first RDMA request through this communication channel, it can directly determine that the first RDMA request is from the client device and allow the client device to access the target memory area. The server device's RDMA network card can then convert the first RDMA request into a second RDMA request based on RDMA unilateral primitives and, according to the target memory area indicated in the second RDMA request, complete the processing of the target data. Therefore, because the RDMA requests transmitted between the client device and the server device are based on RDMA bilateral primitives and do not carry an RKey, the server device no longer needs to provide the client device with an RKey when establishing a connection. Therefore, an attacker cannot obtain any information about the client device's RKey and can only randomly guess the client device's RKey. Consequently, when an attacker impersonating a client device sends an RDMA request based on a unilateral primitive, the request will be rejected due to an incorrect RKey, preventing the attacker from invading the server device and stealing data, thereby ensuring data security.
[0114] In one possible implementation, the RDMA network card includes multiple work queues, each work queue includes multiple RDMA requests for indicating an operation, the multiple RDMA requests included in each work queue are constructed based on RDMA one-sided primitives, a first RDMA request is used to request a target operation to be performed on target data in a target memory area, and the processing module 1202 is used to generate a second RDMA request based on the first RDMA request and the first RDMA request in the target work queue, the multiple work queues include a target work queue, and the target work queue includes multiple RDMA requests for indicating the target operation.
[0115] In one possible implementation, the server device further includes a processor, and the receiving module 1201 is further used to receive an offload request from the processor after the processor instructs the RDMA network card to establish multiple communication channels with the client device. Each of the multiple communication channels can transmit an RDMA request for indicating an operation, and the offload request is used to indicate multiple work queues corresponding one-to-one to the multiple communication channels; the processing module 1202 is further used to create multiple work queues based on the offload request.
[0116] In one possible implementation, the processing module 1202 is configured to generate a second RDMA request based on the first RDMA request and the first RDMA request in the target work queue if the RDMA network card receives the first RDMA request through the target communication channel. The target communication channel can transmit the RDMA request for indicating the target operation.
[0117] In one possible implementation, the receiving module 1201 is further configured to receive a reuse request from the processor; and the processing module 1202 is further configured to, after the RDMA network card uses the first RDMA request in the target work queue, make the first RDMA request in the target work queue the last RDMA request in the target work queue based on the reuse request.
[0118] In one possible implementation, the processing module 1202 is configured to: when the RDMA network card uses the first RDMA request in the target work queue, set the identifier of the first RDMA request in the target work queue from a first value to a second value, where the first value indicates that the RDMA request is not used and the second value indicates that the RDMA request is used. After the RDMA network card uses the first RDMA request, set the identifier of the first RDMA request in the target work queue from the second value to the first value, and mark the first RDMA request as the last RDMA request in the target work queue.
[0119] In one possible implementation, the processing module 1202 is configured to perform a target operation on the target data in the target memory area based on the second RDMA request to obtain a data processing result, where the target operation includes any one of the following: a read operation and a write operation.
[0120] It should be noted that the information interaction, implementation process, etc. between the modules / units of the above-mentioned device are based on the same concept as the method embodiment of the present application, and the technical effects they bring are the same as those of the method embodiment of the present application. For specific contents, please refer to the description in the method embodiment shown above in the embodiment of the present application, and no further details will be given here.
[0121] FIG13 is a schematic diagram of the structure of a server device provided in an embodiment of the present application. As shown in FIG13 , the server device 1300 includes a processor 1301, a memory 1302, an RDMA network card 1303, a bus 1304, and a memory 1305. The processor 1301, the memory 1302, the RDMA network card 1303, and the memory 1305 communicate via the bus 1304, and communication can also be achieved through other means such as wireless transmission. The processor 1301 is used to run applications and the RDMA communication library. For an introduction to applications and RDMA communication, please refer to the relevant description section of the embodiment shown in FIG3 above, which will not be repeated here.
[0122] The RDMA network card 1303 includes a processor 1306, a memory 1307, and a communication interface 1308. The processor 1306 is configured to execute computer-executable instructions stored in the memory to implement the following operation steps:
[0123] receiving a first RDMA request from a client device, where the first RDMA request is constructed based on an RDMA bilateral primitive, and the first RDMA request is used to request processing target data in a target memory area of a memory;
[0124] Converting the first RDMA request to obtain a second RDMA request, where the second RDMA request is constructed based on an RDMA unilateral primitive and is used to request processing target data in a target memory area;
[0125] The target data is processed in the target memory area based on the second RDMA request, a data processing result is obtained, and the data processing result is returned to the client device.
[0126] It should be understood that in the embodiments of the present application, the processor 1301 or the processor 1306 may be a CPU, or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0127] Memory 1302 or memory 1307 may include a read-only memory and a random access memory, and provide instructions and data to the processor. Memory 1302 or memory 1307 may also include a non-volatile random access memory. For example, memory 1302 or memory 1307 may also store device type information.
[0128] Memory 1302 or memory 1307 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0129] In addition to the data bus, the bus 1304 may also include a power bus, a control bus, a status signal bus, etc. However, for the sake of clarity, various buses are labeled as bus 1304 in the figure.
[0130] It should be understood that the server device 1300 according to the embodiment of the present application may correspond to the server device shown in Figure 12, and may correspond to the server device executing the method shown in Figure 4 according to the embodiment of the present application. In addition, the device can also be any device in the system shown in Figure 1, and the above-mentioned and other operations and / or functions of each module in the server device 1300 are respectively for implementing the corresponding processes of each method in the figure. For the sake of brevity, they will not be repeated here.
[0131] An embodiment of the present application further provides a computer storage medium storing one or more instructions, which, when executed by one or more computers, enable the one or more computers to implement the method steps of the embodiment shown in FIG. 4 .
[0132] An embodiment of the present application further provides a computer program product, which stores instructions. When the instructions are executed by a computer, the computer implements the method steps of the embodiment shown in FIG4 .
[0133] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0134] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0135] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0136] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0137] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
Claims
1. A data processing method based on remote direct memory access (RDMA), characterized in that: The method is applied to a server device, wherein the server device includes a memory and an RDMA network card, and the method includes: The RDMA network card receives a first RDMA request from a client device, where the first RDMA request is constructed based on an RDMA bilateral primitive and is used to request the server device to process target data in a target memory area of the memory; The RDMA network card converts the first RDMA request to obtain a second RDMA request, where the second RDMA request is constructed based on an RDMA unilateral primitive, and the second RDMA request is used to request the server device to process the target data in the target memory area; The RDMA network card processes the target data in the target memory area based on the second RDMA request, obtains a data processing result, and returns the data processing result to the client device.
2. The method according to claim 1, characterized in that The RDMA network card includes multiple work queues, each work queue includes multiple RDMA requests for indicating an operation, the multiple RDMA requests included in each work queue are constructed based on RDMA unilateral primitives, the first RDMA request is used to request a target operation to be performed on the target data in the target memory area, and the RDMA network card converts the first RDMA request to obtain a second RDMA request, including: The RDMA network card generates a second RDMA request based on the first RDMA request and a first RDMA request in a target work queue, wherein the multiple work queues include the target work queue, and the target work queue includes multiple RDMA requests for indicating the target operation.
3. The method according to claim 2, characterized in that The server device further includes a processor, and the method further includes: After the processor instructs the RDMA network card to establish multiple communication channels with the client device, the RDMA network card receives an offload request from the processor, each of the multiple communication channels can transmit an RDMA request for indicating an operation, and the offload request is used to indicate the multiple work queues corresponding one-to-one to the multiple communication channels; The RDMA network card creates the multiple work queues based on the offload request.
4. The method according to claim 3, characterized in that The RDMA network card generates a second RDMA request based on the first RDMA request and the first RDMA request in the target work queue, comprising: If the RDMA network card receives the first RDMA request through a target communication channel, the RDMA network card generates a second RDMA request based on the first RDMA request and the first RDMA request in the target work queue. The target communication channel can transmit the RDMA request for indicating the target operation.
5. The method according to any one of claims 2 to 4, characterized in that The method further comprises: The RDMA network card receives a multiplexing request from the processor; After the RDMA network card uses the first RDMA request in the target work queue, the RDMA network card uses the first RDMA request in the target work queue as the last RDMA request in the target work queue based on the multiplexing request.
6. The method according to claim 5, characterized in that The step of, after the RDMA network card uses the first RDMA request in the target work queue, using the first RDMA request in the target work queue as the last RDMA request in the target work queue based on the multiplexing request, comprising: When the RDMA network card uses a first RDMA request in the target work queue, the RDMA network card sets an identifier of the first RDMA request in the target work queue from a first value to a second value, where the first value is used to indicate that the RDMA request is not used and the second value is used to indicate that the RDMA request is used; After the RDMA network card uses the first RDMA request, the RDMA network card sets the identifier of the first RDMA request from the second value to the first value in the target work queue, and makes the first RDMA request the last RDMA request in the target work queue.
7. The method according to any one of claims 1 to 6, characterized in that The RDMA network card processes the target data in the target memory area based on the second RDMA request, and obtains a data processing result, including: The RDMA network card performs a target operation on the target data in the target memory area based on the second RDMA request to obtain a data processing result, where the target operation includes any one of the following: a read operation and a write operation.
8. An RDMA network card, characterized in that: The RDMA network card is provided in a server device, and the server device further includes a memory. The RDMA network card includes: A receiving module, configured to receive a first RDMA request from a client device, wherein the first RDMA request is constructed based on an RDMA bilateral primitive, and the first RDMA request is used to request the server device to process target data in a target memory area of the memory; A processing module is configured to convert the first RDMA request to obtain a second RDMA request, wherein the second RDMA request is based on RDMA A one-sided primitive is constructed, wherein the second RDMA request is used to request the server device to process the target data in the target memory area; The processing module is further configured to process the target data in the target memory area based on the second RDMA request to obtain a data processing result; The sending module is used to return the data processing result to the client device.
9. The RDMA network card according to claim 8, wherein: The RDMA network card includes multiple work queues, each work queue includes multiple RDMA requests for indicating an operation, the multiple RDMA requests included in each work queue are constructed based on RDMA one-sided primitives, the first RDMA request is used to request a target operation to be performed on the target data in the target memory area, and the processing module is used to generate a second RDMA request based on the first RDMA request and a first RDMA request in a target work queue, the multiple work queues include the target work queue, and the target work queue includes multiple RDMA requests for indicating the target operation.
10. The RDMA network card according to claim 9, wherein: The server device further includes a processor, and the receiving module is further configured to receive an offload request from the processor after the processor instructs the RDMA network card to establish multiple communication channels with the client device, each of the multiple communication channels being capable of transmitting an RDMA request for indicating an operation, and the offload request being configured to indicate the multiple work queues corresponding one-to-one to the multiple communication channels; The processing module is further configured to create the multiple work queues based on the uninstall request.
11. The RDMA network card according to claim 10, wherein: The processing module is configured to generate a second RDMA request based on the first RDMA request and the first RDMA request in the target work queue if the RDMA network card receives the first RDMA request through a target communication channel, and the target communication channel can transmit the RDMA request for indicating the target operation.
12. The RDMA network card according to any one of claims 9 to 11, wherein: The receiving module is further configured to receive a multiplexing request from the processor; The processing module is further configured to, after the RDMA network card uses the first RDMA request in the target work queue, make the first RDMA request in the target work queue the last RDMA request in the target work queue based on the multiplexing request.
13. The RDMA network card according to claim 12, wherein: The processing module is used to: When the RDMA network card uses a first RDMA request in the target work queue, in the target work queue, setting an identifier of the first RDMA request from a first value to a second value, wherein the first value is used to indicate that the RDMA request is not used and the second value is used to indicate that the RDMA request is used; After the RDMA network card uses the first RDMA request, in the target work queue, the identifier of the first RDMA request is set from the second value to the first value, and the first RDMA request is used as the last RDMA request in the target work queue.
14. The RDMA network card according to any one of claims 8 to 13, wherein: The processing module is configured to perform a target operation on the target data in the target memory area based on the second RDMA request to obtain a data processing result, where the target operation includes any one of the following: a read operation and a write operation.
15. A device, characterized in that The device serves as a server device, comprising a processor, a memory, and an RDMA network card, wherein the RDMA network card is communicatively connected to the processor, and the RDMA network card is communicatively connected to the memory, and the RDMA network card is configured to execute the method according to any one of claims 1 to 7 on the memory based on instructions from the processor.
16. A computer storage medium, characterized in that The computer storage medium stores one or more instructions, which, when executed by one or more computers, enable the one or more computers to implement the method of any one of claims 1 to 7.
17. A computer program product, characterized in that The computer program product stores instructions, which, when executed by a computer, enable the computer to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Information processing method, device and system and storage medium
CN113326155A
Remote data updating method, RDMA system and storage medium
CN115933973A
Methods and systems for providing trusted signaling of domain-specific security policies
US20130097656A1