Communication method and device of data processor
By setting a preset transmission channel between the data processor and the host, receiving and encapsulating information to be transmitted, the problem of large communication overhead and dependent network configuration in the prior art is solved, and the communication effect of low resource consumption and network decoupling is achieved.
Patent Information
- Application Number
- CN202411751296.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, communication between the data processor and the host needs to go through two protocol stacks, resulting in high overhead, high development and operation and maintenance complexity, and dependent on the host's network configuration and status.
Through the preset transmission channel between the host and the data processor DPU, the information to be transmitted by the communication end in the host is sent through the kernel module, and the processing process in the DPU encapsulates it into message transmission, realizing the uninstallation of the host protocol stack.
It avoids the duplicate protocol stack overhead for communication between the host and DPU, reduces resource consumption on the host side, and is decoupled from the network channel, and does not rely on the host's network configuration and status.
Smart Images

Figure CN119669138A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the technical field of computer and network communication, and more particularly, to a communication method and device for a data processor. Background Art
[0002] The Data Processing Unit (DPU) is a new generation of processors for data-centric computing. In an application scenario, an application client in a host needs to communicate with a server in a DPU, or a server in a host needs to communicate with an application client in a DPU.
[0003] In the prior art, two sets of communication channels are usually provided for control plane information and data plane information, which results in relatively large communication overhead and also causes additional development and operation and maintenance complexity. Summary of the invention
[0004] The embodiments of the present disclosure provide a communication method and device for a data processor to overcome the above problems.
[0005] In a first aspect, an embodiment of the present disclosure provides a communication method of a data processor, including:
[0006] Receiving, through a preset transmission channel between the host and the data processor DPU, first information to be transmitted sent by the first communication end in the host through the kernel module in the host, wherein the first information to be transmitted is information that the first communication end in the host needs to send to the second communication end in the DPU;
[0007] The first information to be transmitted is encapsulated into a first message through a processing process in the DPU, and the first message is transmitted to the second communication end.
[0008] In a second aspect, an embodiment of the present disclosure provides a communication method of a data processor, including:
[0009] Sending first information to be transmitted to a kernel module in the host through a first communication terminal in the host, wherein the first information to be transmitted is information that the first communication terminal in the host needs to send to a second communication terminal in the DPU;
[0010] Through a preset transmission channel between the host and the DPU, the kernel module in the host sends the first information to be transmitted to the processing process in the DPU, so that the processing process in the DPU encapsulates the first information to be transmitted into a first message and transmits the first message to the second communication end.
[0011] In a third aspect, an embodiment of the present disclosure provides a communication device of a data processor, including:
[0012] A communication unit, configured to receive, through a preset transmission channel between the host and the data processor DPU, first information to be transmitted sent by a first communication terminal in the host through a kernel module in the host, wherein the first information to be transmitted is information that the first communication terminal in the host needs to send to a second communication terminal in the DPU;
[0013] A processing unit is used to encapsulate the first information to be transmitted into a first message through a processing process in the DPU, and transmit the first message to the second communication end.
[0014] In a fourth aspect, an embodiment of the present disclosure provides a communication device of a data processor, including:
[0015] A processing unit, configured to send first information to be transmitted to a kernel module in the host through a first communication terminal in the host, wherein the first information to be transmitted is information that the first communication terminal in the host needs to send to a second communication terminal in the DPU;
[0016] A communication unit is used to send the first information to be transmitted to the processing process in the DPU by the kernel module in the host through a preset transmission channel between the host and the DPU, so that the processing process in the DPU encapsulates the first information to be transmitted into a first message and transmits the first message to the second communication end.
[0017] In a fifth aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;
[0018] The memory stores computer-executable instructions;
[0019] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the communication method of the data processor described in the first aspect and various possible designs of the first aspect, or the communication method of the data processor described in the second aspect and various possible designs of the second aspect.
[0020] In a sixth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions. When the processor executes the computer execution instructions, the communication method of the data processor described in the first aspect and various possible designs of the first aspect, or the communication method of the data processor described in the second aspect and various possible designs of the second aspect is implemented.
[0021] In the seventh aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the communication method of the data processor described in the first aspect and various possible designs of the first aspect, or the communication method of the data processor described in the second aspect and various possible designs of the second aspect.
[0022] The communication method and device of the data processor provided in the embodiment of the present disclosure receives, through a preset transmission channel between the host and the DPU, first information to be transmitted sent by the first communication end in the host through the kernel module in the host, wherein the first information to be transmitted is information that the first communication end in the host needs to send to the second communication end in the DPU; the first information to be transmitted is encapsulated into a first message through the processing process in the DPU, and the first message is transmitted to the second communication end. In this embodiment, the protocol stack of the host is unloaded through the kernel module in the host and the processing process in the DPU, avoiding the repeated overhead of the two protocol stacks of the host and the DPU in one communication between the host and the DPU, reducing the resource consumption on the host side, and being decoupled from the network channel, and not dependent on the network configuration and status of the host. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0024] Figure 1 A schematic diagram of the architecture of a communication method for a data processor provided in one embodiment of the present disclosure;
[0025] Figure 2 A flow chart of a communication method for a data processor provided by an embodiment of the present disclosure;
[0026] Figure 3 A flow chart of a communication method of a data processor provided by another embodiment of the present disclosure;
[0027] Figure 4 A structural block diagram of a communication device of a data processor provided in an embodiment of the present disclosure;
[0028] Figure 5 A structural block diagram of a communication device of a data processor provided by another embodiment of the present disclosure;
[0029] Figure 6 A schematic diagram of the hardware structure of a communication device of a data processor provided in one embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0031] In the prior art, two sets of communication channels are usually provided for control plane information and data plane information, wherein the control plane information is transmitted through a standard network forwarding channel between a host and a DPU.
[0032] The data plane information is transmitted through another set of high-performance channels between the host and DPU. It is independent of the network path, does not depend on the network status and configuration, and is not affected by network security.
[0033] It can be seen that in the prior art, when communicating through a standard network forwarding channel, one communication needs to go through the host's protocol stack and the DPU's protocol stack. For example, when the first communication end in the host sends control plane information to the second communication end in the DPU, the host protocol stack needs to process the control plane information before sending it out, and the DPU protocol stack also needs to process the received control plane information before sending it to the second communication end, that is, one communication needs to go through two protocol stacks, there is duplicate overhead, and it will also bring additional development and operation and maintenance complexity, and the control plane information depends on the network configuration and status of the host. In addition, it is necessary to design two sets of channels at the same time, and the two sets of channels coexist, which will also bring additional development and operation and maintenance complexity.
[0034] In order to solve at least one of the above technical problems, the embodiment of the present disclosure provides a communication method for a data processor, which receives, through a preset transmission channel between the host and the DPU, first information to be transmitted sent by the first communication end in the host through the kernel module in the host, wherein the first information to be transmitted is information that the first communication end in the host needs to send to the second communication end in the DPU; the first information to be transmitted is encapsulated into a first message through the processing process in the DPU, and the first message is transmitted to the second communication end. In this embodiment, the protocol stack of the host is unloaded through the kernel module in the host and the processing process in the DPU, avoiding the repeated overhead of the two protocol stacks of the host and the DPU in one communication between the host and the DPU, reducing the resource consumption on the host side, and decoupling from the network channel, and not relying on the network configuration and status of the host.
[0035] The architecture of the communication method of the data processor of the embodiment of the present disclosure is as follows: Figure 1As shown, a first communication terminal and a kernel module are deployed in a host, a processing process and a second communication terminal are deployed in a DPU, and a preset transmission channel is pre-deployed between the host and the DPU, wherein the first communication terminal in the host can be a client of an application, and the second communication terminal in the DPU can be a server of the application, or the first communication terminal in the host can be a server of the application, and the second communication terminal in the DPU can be a client of the application, and the above communication method can be implemented based on the kernel module in the host and the processing process in the DPU.
[0036] It should be noted that the activation of the functions related to the embodiments of the present disclosure, the data obtained, the processing and storage methods of the data, etc., shall all be authorized in advance by the user and other rights holders associated with the user, and shall comply with the relevant laws and regulations and the agreements between the rights holders.
[0037] The communication method of the data processor disclosed in the present invention will be described in detail below in conjunction with specific embodiments.
[0038] refer to Figure 2 , Figure 2 A flow chart of a communication method of a data processor provided in an embodiment of the present disclosure. The method of this embodiment can be applied in a DPU, and the communication method of the data processor includes:
[0039] S201. Receive, through a preset transmission channel between a host and a data processor DPU, first information to be transmitted that is sent by a first communication terminal in the host through a kernel module in the host, wherein the first information to be transmitted is information that the first communication terminal in the host needs to send to a second communication terminal in the DPU.
[0040] In this embodiment, the first communication end in the host can be the client of the application, and the second communication end in the DPU can be the server of the application, or the first communication end in the host can be the server of the application, and the second communication end in the DPU can be the client of the application.
[0041] A preset transmission channel is pre-configured between the host and the DPU. The preset transmission channel can be a PCIe (Peripheral Component Interconnect Express) channel. The PCIe channel is a high-speed serial computer expansion bus standard channel that can achieve point-to-point dual-channel high-bandwidth transmission without the need to use a traditional network forwarding channel. It is independent and decoupled from the network and storage data paths and does not depend on the network configuration and status of the host. Of course, the preset transmission channel can also be any other non-network forwarding channel, which is not limited in this embodiment.
[0042] In addition, this embodiment is inspired by the work in the field of TCP protocol offloading, but unlike the traditional TCP protocol stack offloading which aims to accelerate the TCP transmission and reception between the application and the remote end, this embodiment applies the idea of TCP protocol stack offloading to the communication between the host and the DPU, and provides a host TCP protocol stack offloading and data forwarding mechanism to avoid the repeated overhead of two protocol stacks of the host and the DPU in one communication. A kernel module is configured on the host side, and a corresponding processing process is configured on the DPU side. The processing process of the protocol stack is implemented once on the DPU through the processing process, that is, the protocol stack is implemented from the software. In this embodiment, the host side protocol stack is unloaded, and compared with the TCP protocol stack, the host side kernel has only a thinner forwarding layer, and under the same load, the host side resource occupancy is lower.
[0043] In a specific implementation, when the first communication end in the host needs to send the first information to be transmitted to the second communication end in the DPU, the first communication end in the host can directly transmit the first information to be transmitted to the kernel module in the host, and the kernel module in the host does not perform protocol stack processing on the first information to be transmitted, but directly transmits it to the processing process of the DPU through a preset transmission channel between the host and the DPU.
[0044] S202. Encapsulate the first information to be transmitted into a first message through a processing process in the DPU, and transmit the first message to the second communication end.
[0045] In this embodiment, after receiving the first information to be transmitted, the processing process in the DPU can perform protocol stack processing on the first information to be transmitted, encapsulate it into a first message, and then transmit the first message to the second communication end in the DPU to realize communication from the first communication end to the second communication end.
[0046] The communication method of the data processor provided in this embodiment receives, through a preset transmission channel between the host and the DPU, first information to be transmitted sent by the first communication end in the host through the kernel module in the host, wherein the first information to be transmitted is information that the first communication end in the host needs to send to the second communication end in the DPU; the first information to be transmitted is encapsulated into a first message through the processing process in the DPU, and the first message is transmitted to the second communication end. In this embodiment, the protocol stack of the host is unloaded through the kernel module in the host and the processing process in the DPU, avoiding the repeated overhead of the two protocol stacks of the host and the DPU in one communication between the host and the DPU, reducing the resource consumption on the host side, and being decoupled from the network channel, and not dependent on the network configuration and status of the host.
[0047] On the basis of any of the above embodiments, since data plane information usually requires low latency and low performance jitter, while control plane information does not have high requirements for latency and performance jitter, different processing methods can be used for the two different situations where the first information to be transmitted is control plane information and data plane information, or the first information to be transmitted can be divided into two different situations of general information and low-latency information (or other classification methods, not limited to data plane information and control plane information) and different processing methods are used. Among them, the processing process of the two different types of first information to be transmitted on the host side is the same, and both are sent by the kernel module in the host to the processing process in the DPU through the preset transmission channel between the host and the DPU, and the difference lies in the processing process on the DPU side.
[0048] In an optional embodiment, when the first information to be transmitted is control plane information, the above S202 may specifically be:
[0049] If the first information to be transmitted is control plane information, encapsulating the first information to be transmitted into a first message through a processing process in the DPU, wherein the first message is a control plane message;
[0050] The first message is transmitted to the second communication end by a local loopback method through a processing process in the DPU.
[0051] In this embodiment, if the first information to be transmitted is control plane information, the first information to be transmitted is encapsulated as a control plane message in the processing process in the DPU, that is, the first message is a control plane message. Further, the first message is transmitted to the second communication end by the processing process in the DPU in a local loopback manner, wherein the local loopback manner is implemented by the local loopback address 127.0.0.1, which is used for self-communication, that is, the address of the first message is filled with the local loopback address 127.0.0.1. When the processing process in the DPU sends the first message, it will route and process it inside the DPU and transmit it to the second communication end without network transmission. It should be noted that since there may be multiple second communication ends in the DPU, different second communication ends can be bound to different ports, and then when the first message is transmitted by the local loopback, the port of the second communication end receiving the first message can also be carried in the first message, such as "127.0.0.1", 2223, and then the first message can be sent to the port of the second communication end by the local loopback.
[0052] It should be noted that, in this embodiment, the transmission via local loopback is not limited to control plane messages, and some data plane messages that do not require low latency and low performance jitter can also be transmitted via local loopback.
[0053] In another optional embodiment, when the first information to be transmitted is data plane information, the above S202 may specifically be:
[0054] If the first information to be transmitted is data plane information, encapsulating the first information to be transmitted into a first message through a processing process in the DPU, wherein the first message is a data plane message;
[0055] The first message is stored in a shared memory in the DPU so that the second communication end obtains the first message from the shared memory.
[0056] In this embodiment, if the first information to be transmitted is data plane information, the first information to be transmitted is encapsulated as a data plane message in the processing process in the DPU, that is, the first message is a data plane message. Since data plane messages generally have low latency and low performance jitter requirements, when transmitted by local loopback or other methods, it is usually necessary to first copy from user state to kernel state and then from kernel state to user state. The delay is increased after two copies. In order to avoid two copies, a shared memory is configured in the DPU in this embodiment. The processing process in the DPU can directly store the first message directly in the shared memory, and the second communication end can directly obtain the first message from the shared memory. Optionally, when the processing process in the DPU stores the first message in the shared memory, a state configuration can also be performed to notify the second communication end to obtain the first message from the shared memory. For example, a bit can be used to identify whether there is a newly transmitted first message. In addition, the storage location of the first message and other information can also be identified. This is not limited here, and the above state can be updated after the second communication end completes the reading.
[0057] In another optional embodiment, the processing process in the DPU may also directly store the first information to be transmitted in the shared memory without being encapsulated into a second message, and the second communication end may directly obtain the first information to be transmitted from the shared memory.
[0058] It should be noted that, in this embodiment, the transmission through the shared memory is not limited to the data plane messages, and some control plane messages that require low latency and low performance jitter can also be transmitted through the shared memory.
[0059] Based on any of the above embodiments, the second communication terminal in the DPU also communicates with the first communication terminal in the host, and the specific process can be as follows:
[0060] Transmitting the second information to be transmitted to the processing process in the DPU through the second communication terminal, and the processing process in the DPU encapsulates the second information to be transmitted into a second message;
[0061] Through a preset transmission channel between the host and the DPU, the processing process in the DPU transmits the second message to the kernel module in the host, so that the kernel module in the host transmits the second message to the first communication end.
[0062] In this embodiment, when the second communication end in the DPU needs to send the second information to be transmitted to the first communication end in the host, the second communication end in the DPU can directly transmit the first information to be transmitted to the processing process in the DPU, and the processing process in the DPU encapsulates the second information to be transmitted into a second message; further, the processing process in the DPU transmits the second message to the kernel module in the host through a preset transmission channel between the host and the DPU, and the kernel module in the host transmits the second message to the first communication end. The process is the opposite of the communication process between the first communication end and the second communication end mentioned above, and will not be repeated here.
[0063] Similarly, different processing methods can be used for control plane information and data plane information, as follows:
[0064] If the second information to be transmitted is control plane information, the second information to be transmitted is transmitted to the processing process in the DPU by means of a local loopback through the second communication end.
[0065] In this embodiment, the second information to be transmitted is control plane information, which can be transmitted to the processing process of the DPU via a local loopback. The local loopback address can be configured for the second information to be transmitted to send it to the processing process of the DPU, and then encapsulated and processed by the processing process of the DPU.
[0066] If the second information to be transmitted is data plane information, the second information to be transmitted is stored in a shared memory in the DPU, and the processing process in the DPU obtains the second information to be transmitted from the shared memory.
[0067] In this embodiment, the data plane information of the second information to be transmitted can store the second information to be transmitted in the shared memory of the DPU, and the processing process in the DPU obtains the second information to be transmitted from the shared memory, and then the processing process of the DPU performs encapsulation processing. When the second information to be transmitted is stored in the shared memory of the DPU, a state configuration can be performed to notify the processing process in the DPU to obtain the second information to be transmitted from the shared memory. In addition, the storage location of the second information to be transmitted and other information can be identified, which is not limited here, and the above state can be updated after the processing process in the DPU completes the reading.
[0068] Although two sets of interfaces are used for the control plane and the data plane in the above embodiment, based on the same architecture, the two types of flows share the same underlying hardware channel design, while supporting multiple scenarios while maintaining low implementation complexity and operation and maintenance complexity.
[0069] On the basis of the above embodiment, before the first communication end communicates with the second communication end or before the second communication end communicates with the first communication end, a Socket connection channel between the first communication end and the second communication end can be established. Specifically, since the first communication end in the host can be the client of the application and the second communication end in the DPU can be the server of the application, or the first communication end in the host can be the server of the application and the second communication end in the DPU can be the client of the application, the connection can be initiated by the first communication end or the second communication end.
[0070] In an optional embodiment, if a connection is initiated by a first communication terminal in a host, the first communication terminal may send a connection request to a second communication terminal to a kernel module in the host, and the connection request may be sent to a processing process in the DPU through the kernel module in the host; and in the DPU, a corresponding first local port may be pre-configured for the second communication terminal, that is, the second communication terminal may be bound to the first local port, so that the second communication terminal may monitor the first local port; after receiving the connection request, the processing process in the DPU may send the connection request to the first local port, and then the processing process in the DPU may establish a connection with the first local port, thereby realizing a connection from the first communication terminal to the second communication terminal.
[0071] Optionally, the processing process in the DPU can also send the connection result to the kernel module in the host, and the kernel module in the host returns the connection result to the first communication end to notify the first communication end to complete the connection establishment, and then data can be sent and received to each other through Socket operations such as send, recv, read, write, sendmsg, recvmsg, etc. The kernel module in the host and the processing process in the DPU play a forwarding role in the process of sending and receiving data.
[0072] On the basis of any of the above embodiments, a (socket) interface identical to TCP AF_INET may be provided on the host side, wherein AF (Address Family) is used to specify the protocol family used by the Socket, and AF_INET is an address family used for the Ipv4 network protocol. The present implementation provides a custom socket address family, which may apply standard Socket interfaces such as Socket, connect, bind, accept, send, and recv. The custom socket address family may be pre-registered in the kernel module of the host, and related functions of custom Socket operations may be configured in the custom socket address family to implement the communication terminal mode from the first communication terminal in the host to the second communication terminal through the kernel module in the host and the processing process in the DPU in the above embodiments. Compared with the method in which the related functions of the standard Socket operations of the AF_INET address family are implemented through the two protocol stacks of the host and the DPU, the custom socket address family may implement the specific communication terminal mode disclosed herein.
[0073] Furthermore, when the first communication terminal in the host initiates a connection, if the socket address family is specified as a custom socket address family, it is equivalent to specifying that all subsequent Socket operations are processed by the kernel module in the host and the processing process in the DPU. Specifically, during the connection process, the kernel module in the host can send a connection request to the processing process in the DPU, and the processing process in the DPU performs a connection operation (connect) according to the connection request.
[0074] In specific implementation, a custom socket address family, such as AF_OSOCK, may be pre-registered in the kernel module in the host. If the first communication end specifies the custom socket address family AF_OSOCK when creating a Socket, subsequent Socket operations of the Socket will be processed by the kernel module in the host.
[0075] Other socket operations supported by AF_OSOCK are the same as those of AF_INET, and it also supports select, poll, and epoll event triggering.
[0076] In order to facilitate existing applications to use the communication methods of the embodiments of the present disclosure without modifying the code, a dynamic library can be provided, and the original network communication address family AF_INET in the Socket call can be dynamically replaced with the custom socket address family AF_OSOCK by using the environment variable LD_PRELOAD mechanism. For example, when a traffic test is performed between the host and the DPU using a network bandwidth performance test tool such as the iperf3 tool, the original network communication address family AF_INET in the Socket call in the iperf3 tool can be dynamically replaced with the custom socket address family AF_OSOCK by configuring the environment variable LD_PRELOAD on the host side.
[0077] In addition, except for general tools such as iperf3 and nc, the communication methods of the embodiments of the present disclosure can be used in this manner without modification.
[0078] Since the processing process in the DPU performs the Socket operation of the first communication end on behalf of the processing process, the second communication end in the DPU actually establishes a connection with the processing process and sends and receives data. The second communication end in the DPU communicates with the processing process through AF_INETSocket. In AF_INET address, the IP address is filled with the local loopback IP address, such as "127.0.0.1", and the Port is filled with the Port corresponding to the first communication end in the host.
[0079] For example, the first communication end in the host is the client of the application, and the second communication end in the DPU is the server of the application. The second communication end is configured to bind to the specified port in the DPU and listen to the specified port to wait for the connection of the first communication end in the host. The first communication end in the host dynamically replaces the original network communication address family AF_INET in the Socket call with the custom socket address family AF_OSOCK by configuring the environment variable LD_PRELOAD, thereby realizing the connection to the specified port through the processing process in the DPU.
[0080] For another example, the first communication end in the host is the server end of the application, and the second communication end in the DPU is the client end of the application. By configuring the first communication end and configuring the environment variable LD_PRELOAD, the original network communication address family AF_INET in the Socket call is dynamically replaced with the custom socket address family AF_OSOCK, thereby realizing binding with the designated port in the DPU through the processing process in the DPU, and listening to the designated port to wait for the connection of the second communication end in the DPU, and the second communication end in the DPU can be connected to the designated port.
[0081] In another optional embodiment, if the connection is initiated by the second communication terminal in the DPU, the first communication terminal may first send a port binding request to the kernel module in the host, and the kernel module in the host transmits it to the processing process in the DPU through a preset transmission channel between the host and the DPU. The processing process in the DPU binds the second local port in the DPU to the first communication terminal according to the port binding request, so that the first communication terminal can monitor the second local port in the DPU; and then when the second communication terminal initiates a connection, the second communication terminal may send a connection request to the first communication terminal, and establish a connection with the second local port through the processing process in the DPU, thereby realizing the establishment of a connection between the second communication terminal and the first communication terminal.
[0082] On the basis of any of the above embodiments, receiving first information to be transmitted sent by a first communication terminal in a host through a kernel module in the host includes:
[0083] Determine the socket address family of the first information to be transmitted. If the socket address family of the first information to be transmitted is an address family for network communication, receive the first information to be transmitted sent by the kernel module, wherein the address family for network communication of the first information to be transmitted is replaced with a custom socket address family, wherein the custom socket address family is used to instruct the kernel module to transmit the first transmission information to the processing process in the DPU for encapsulation.
[0084] In this embodiment, after the connection is established, when the first communication end sends the first information to be transmitted, the socket address family of the first information to be transmitted can be determined. If the socket address family of the first information to be transmitted is the address family AF_INET for network communication, it can be directly replaced with the custom socket address family AF_OSOCK. In this way, the same standard Socket interface as TCP can be used, so that the application can access it seamlessly. The host side socket supports synchronous and asynchronous (blocking, non-blocking) operations and event triggering (select, poll, epoll). The DPU side application directly uses the standard TCP Socket.
[0085] On the basis of any of the above embodiments, a cache unit is respectively configured in the host and the DPU, for example, a ring buffer (ring buffer unit); accordingly, receiving the first information to be transmitted sent by the first communication terminal in the host through the kernel module in the host through the preset transmission channel between the host and the data processor DPU, comprises:
[0086] The first information to be transmitted is obtained from the cache unit in the host through a preset transmission channel between the host and the DPU, and is stored in the cache unit in the DPU, so that the processing process in the DPU can obtain the first information to be transmitted from the cache unit in the DPU.
[0087] In this embodiment, after the first communication terminal in the host sends the first information to be transmitted to the kernel module in the host, the kernel module can cache the first information to be transmitted in the cache unit in the host, and then obtain the first information to be transmitted from the cache unit in the host through the preset transmission channel between the host and the DPU, and store it in the cache unit in the DPU. The processing process in the DPU obtains the first information to be transmitted from the cache unit in the DPU, and then performs subsequent encapsulation and forwarding. When the processing process in the DPU obtains the first information to be transmitted from the cache unit in the DPU, multiple first information to be transmitted can be merged, and then encapsulated and forwarded.
[0088] It should be noted that one DPU can correspond to multiple hosts, and a preset transmission channel can be pre-configured between each host and the DPU. Correspondingly, corresponding storage units are also configured respectively, so that the processing process in the DPU can poll different cache units in the DPU to perform corresponding encapsulation and forwarding.
[0089] Optionally, different cache units may be configured for uplink and downlink between the host and the DPU, respectively; accordingly, the second message is transmitted to the kernel module in the host by the processing process in the DPU through a preset transmission channel between the host and the DPU, including:
[0090] The second message is obtained from the cache unit in the DPU through a preset transmission channel between the host and the DPU, and is transmitted and stored in the cache unit in the host, so that the kernel module in the host can obtain the second message from the cache unit in the host.
[0091] In this embodiment, during the process of the processing process in the DPU transmitting the second message to the kernel module in the host, the second message can also be stored in the cache unit in the DPU, then moved to the cache unit of the host, and transmitted to the kernel module in the host.
[0092] In addition, for the uplink and downlink of control plane information and data plane information, different cache units can be configured in the host and DPU respectively, so as to achieve differentiated processing.
[0093] refer to Figure 3 , Figure 3A flow chart of a communication method of a data processor provided in an embodiment of the present disclosure. The method of this embodiment can be applied in a host, and the communication method of the data processor includes:
[0094] S301, sending first information to be transmitted to a kernel module in the host through a first communication terminal in the host, wherein the first information to be transmitted is information that the first communication terminal in the host needs to send to a second communication terminal in the DPU;
[0095] S302. The kernel module in the host sends the first information to be transmitted to the processing process in the DPU through a preset transmission channel between the host and the DPU, so that the processing process in the DPU encapsulates the first information to be transmitted into a first message and transmits the first message to the second communication end.
[0096] Optionally, sending the first information to be transmitted to the kernel module in the host through the first communication terminal in the host includes:
[0097] Determine the socket address family of the first information to be transmitted. If the socket address family of the first information to be transmitted is an address family for network communication, send the first information to be transmitted to the kernel module in the host through the first communication terminal in the host, wherein the address family for network communication of the first information to be transmitted is replaced with a custom socket address family, wherein the custom socket address family is used to instruct the kernel module to transmit the first transmission information to the processing process in the DPU for encapsulation.
[0098] Optionally, the method further includes:
[0099] receiving, through a preset transmission channel between the host and the DPU, a second message sent by the processing process in the DPU, wherein the second message is obtained by the second communication end transmitting the second information to be transmitted to the processing process in the DPU, and the processing process in the DPU encapsulating the second information to be transmitted;
[0100] The kernel module in the host transmits the second message to the first communication end.
[0101] Optionally, the method further includes:
[0102] Registering the custom socket address family in a kernel module in the host;
[0103] The environment variables are configured for the first communication terminal to load a custom dynamic library, wherein the custom socket address family is used in the custom dynamic library to replace the address family of the network communication.
[0104] This embodiment is a method embodiment of the host side corresponding to the above embodiment. Its principle and technical effects can be found in the above embodiment and will not be described in detail here.
[0105] The communication method of the data processor on the DPU side corresponding to the above embodiment, Figure 4 A block diagram of a communication device of a data processor provided in an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 4 The communication device 400 of the data processor includes: a communication unit 401 and a processing unit 402.
[0106] The communication unit is used to receive, through a preset transmission channel between the host and the data processor DPU, first information to be transmitted sent by the first communication end in the host through the kernel module in the host, wherein the first information to be transmitted is information that the first communication end in the host needs to send to the second communication end in the DPU;
[0107] A processing unit is used to encapsulate the first information to be transmitted into a first message through a processing process in the DPU, and transmit the first message to the second communication end.
[0108] In one or more embodiments of the present disclosure, when the processing unit encapsulates the first information to be transmitted into a first message through the processing process in the DPU and transmits the first message to the second communication end, it is used to:
[0109] If the first information to be transmitted is control plane information, encapsulating the first information to be transmitted into a first message through a processing process in the DPU, wherein the first message is a control plane message;
[0110] The first message is transmitted to the second communication end by a local loopback method through a processing process in the DPU.
[0111] In one or more embodiments of the present disclosure, when the processing unit encapsulates the first information to be transmitted into a first message through the processing process in the DPU and transmits the first message to the second communication end, it is used to:
[0112] If the first information to be transmitted is data plane information, encapsulating the first information to be transmitted into a first message through a processing process in the DPU, wherein the first message is a data plane message;
[0113] The first message is stored in a shared memory in the DPU so that the second communication end obtains the first message from the shared memory.
[0114] In one or more embodiments of the present disclosure, when receiving the first information to be transmitted sent by the first communication terminal in the host through the kernel module in the host, the communication unit is used to:
[0115] Determine the socket address family of the first information to be transmitted. If the socket address family of the first information to be transmitted is an address family for network communication, receive the first information to be transmitted sent by the kernel module, wherein the address family for network communication of the first information to be transmitted is replaced with a custom socket address family, wherein the custom socket address family is used to instruct the kernel module to transmit the first transmission information to the processing process in the DPU for encapsulation.
[0116] In one or more embodiments of the present disclosure, the processing unit is further configured to:
[0117] Transmitting the second information to be transmitted to the processing process in the DPU through the second communication terminal, and the processing process in the DPU encapsulates the second information to be transmitted into a second message;
[0118] Through a preset transmission channel between the host and the DPU, the processing process in the DPU transmits the second message to the kernel module in the host, so that the kernel module in the host transmits the second message to the first communication end.
[0119] In one or more embodiments of the present disclosure, when the processing unit transmits the second information to be transmitted to the processing process in the DPU through the second communication terminal, it is configured to:
[0120] If the second information to be transmitted is control plane information, the second information to be transmitted is transmitted to the processing process in the DPU by means of a local loopback through the second communication end; or
[0121] If the second information to be transmitted is data plane information, the second information to be transmitted is stored in a shared memory in the DPU, and the processing process in the DPU obtains the second information to be transmitted from the shared memory.
[0122] In one or more embodiments of the present disclosure, the host and the DPU are respectively configured with a cache unit; accordingly, when the communication unit receives the first information to be transmitted sent by the first communication end in the host through the kernel module in the host through the preset transmission channel between the host and the data processor DPU, the communication unit is used to:
[0123] The first information to be transmitted is obtained from the cache unit in the host through a preset transmission channel between the host and the DPU, and is stored in the cache unit in the DPU, so that the processing process in the DPU can obtain the first information to be transmitted from the cache unit in the DPU.
[0124] In one or more embodiments of the present disclosure, a cache unit is configured in the host and the DPU respectively; accordingly, when the processing process in the DPU transmits the second message to the kernel module in the host through a preset transmission channel between the host and the DPU, the communication unit is used to:
[0125] The second message is obtained from the cache unit in the DPU through a preset transmission channel between the host and the DPU, and is transmitted and stored in the cache unit in the host, so that the kernel module in the host can obtain the second message from the cache unit in the host.
[0126] In one or more embodiments of the present disclosure, the processing unit is further configured to:
[0127] receiving a connection request to a second communication end sent by the first communication end through a kernel module in the host, sending the connection request to a first local port corresponding to the second communication end in the DPU through a processing process in the DPU, and establishing a connection with the first local port; or
[0128] Receive a port binding request sent by the first communication end through the kernel module in the host, and bind the second local port in the DPU to the first communication end according to the port binding request through the processing process in the DPU; receive a connection request sent by the second communication end to the first communication end, and establish a connection with the second local port through the processing process in the DPU.
[0129] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0130] The communication method of the data processor on the host side corresponding to the above embodiment, Figure 5 A block diagram of a communication device of a data processor provided in an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 5 , the communication device 500 of the data processor includes: a processing unit 501 and a communication unit 502.
[0131] The processing unit is used to send first information to be transmitted to the kernel module in the host through the first communication terminal in the host, wherein the first information to be transmitted is information that the first communication terminal in the host needs to send to the second communication terminal in the DPU;
[0132] A communication unit is used to send the first information to be transmitted to the processing process in the DPU by the kernel module in the host through a preset transmission channel between the host and the DPU, so that the processing process in the DPU encapsulates the first information to be transmitted into a first message and transmits the first message to the second communication end.
[0133] In one or more embodiments of the present disclosure, when the processing unit sends the first information to be transmitted to the kernel module in the host through the first communication terminal in the host, it is used to:
[0134] Determine the socket address family of the first information to be transmitted. If the socket address family of the first information to be transmitted is an address family for network communication, send the first information to be transmitted to the kernel module in the host through the first communication terminal in the host, wherein the address family for network communication of the first information to be transmitted is replaced with a custom socket address family, wherein the custom socket address family is used to instruct the kernel module to transmit the first transmission information to the processing process in the DPU for encapsulation.
[0135] In one or more embodiments of the present disclosure, the communication unit is further configured to:
[0136] receiving, through a preset transmission channel between the host and the DPU, a second message sent by the processing process in the DPU, wherein the second message is obtained by the second communication end transmitting the second information to be transmitted to the processing process in the DPU, and the processing process in the DPU encapsulating the second information to be transmitted;
[0137] The kernel module in the host transmits the second message to the first communication end.
[0138] In one or more embodiments of the present disclosure, the processing unit is further configured to:
[0139] Registering the custom socket address family in a kernel module in the host;
[0140] The environment variables are configured for the first communication terminal to load a custom dynamic library, wherein the custom socket address family is used in the custom dynamic library to replace the address family of the network communication.
[0141] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0142] In order to implement the above embodiment, the embodiment of the present disclosure also provides an electronic device.
[0143] refer to Figure 6 , which shows a schematic diagram of the structure of an electronic device 600 suitable for implementing the embodiment of the present disclosure, and the electronic device 600 may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers, portable multimedia players (PMPs), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0144] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 to a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0145] Typically, the following devices may be connected to the I / O interface 605: input devices 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 608 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 609. The communication devices 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0146] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0147] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0148] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0149] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0150] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0151] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0152] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0153] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0154] In a first aspect, according to one or more embodiments of the present disclosure, a communication method of a data processor is provided, comprising:
[0155] Receiving, through a preset transmission channel between the host and the data processor DPU, first information to be transmitted sent by the first communication end in the host through the kernel module in the host, wherein the first information to be transmitted is information that the first communication end in the host needs to send to the second communication end in the DPU;
[0156] The first information to be transmitted is encapsulated into a first message through a processing process in the DPU, and the first message is transmitted to the second communication end.
[0157] According to one or more embodiments of the present disclosure, encapsulating the first information to be transmitted into a first message through a processing process in the DPU, and transmitting the first message to the second communication end includes:
[0158] If the first information to be transmitted is control plane information, encapsulating the first information to be transmitted into a first message through a processing process in the DPU, wherein the first message is a control plane message;
[0159] The first message is transmitted to the second communication end by a local loopback method through a processing process in the DPU.
[0160] According to one or more embodiments of the present disclosure, encapsulating the first information to be transmitted into a first message through a processing process in the DPU, and transmitting the first message to the second communication end includes:
[0161] If the first information to be transmitted is data plane information, encapsulating the first information to be transmitted into a first message through a processing process in the DPU, wherein the first message is a data plane message;
[0162] The first message is stored in a shared memory in the DPU so that the second communication end obtains the first message from the shared memory.
[0163] According to one or more embodiments of the present disclosure, the receiving first information to be transmitted sent by the first communication terminal in the host through the kernel module in the host includes:
[0164] Determine the socket address family of the first information to be transmitted. If the socket address family of the first information to be transmitted is an address family for network communication, receive the first information to be transmitted sent by the kernel module, wherein the address family for network communication of the first information to be transmitted is replaced with a custom socket address family, wherein the custom socket address family is used to instruct the kernel module to transmit the first transmission information to the processing process in the DPU for encapsulation.
[0165] According to one or more embodiments of the present disclosure, the method further includes:
[0166] Transmitting the second information to be transmitted to the processing process in the DPU through the second communication terminal, and the processing process in the DPU encapsulates the second information to be transmitted into a second message;
[0167] Through a preset transmission channel between the host and the DPU, the processing process in the DPU transmits the second message to the kernel module in the host, so that the kernel module in the host transmits the second message to the first communication end.
[0168] According to one or more embodiments of the present disclosure, transmitting the second information to be transmitted to the processing process in the DPU through the second communication terminal includes:
[0169] If the second information to be transmitted is control plane information, the second information to be transmitted is transmitted to the processing process in the DPU by means of a local loopback through the second communication end; or
[0170] If the second information to be transmitted is data plane information, the second information to be transmitted is stored in a shared memory in the DPU, and the processing process in the DPU obtains the second information to be transmitted from the shared memory.
[0171] According to one or more embodiments of the present disclosure, the host and the DPU are respectively configured with a cache unit; accordingly, receiving, through a preset transmission channel between the host and the data processor DPU, first information to be transmitted sent by a first communication terminal in the host through a kernel module in the host, includes:
[0172] The first information to be transmitted is obtained from the cache unit in the host through a preset transmission channel between the host and the DPU, and is stored in the cache unit in the DPU, so that the processing process in the DPU can obtain the first information to be transmitted from the cache unit in the DPU.
[0173] According to one or more embodiments of the present disclosure, the host and the DPU are respectively configured with a cache unit; accordingly, the second message is transmitted to the kernel module in the host by the processing process in the DPU through a preset transmission channel between the host and the DPU, including:
[0174] The second message is obtained from the cache unit in the DPU through a preset transmission channel between the host and the DPU, and is transmitted and stored in the cache unit in the host, so that the kernel module in the host can obtain the second message from the cache unit in the host.
[0175] According to one or more embodiments of the present disclosure, the method further includes:
[0176] receiving a connection request to a second communication end sent by the first communication end through a kernel module in the host, sending the connection request to a first local port corresponding to the second communication end in the DPU through a processing process in the DPU, and establishing a connection with the first local port; or
[0177] Receive a port binding request sent by the first communication end through the kernel module in the host, and bind the second local port in the DPU to the first communication end according to the port binding request through the processing process in the DPU; receive a connection request sent by the second communication end to the first communication end, and establish a connection with the second local port through the processing process in the DPU.
[0178] In a second aspect, according to one or more embodiments of the present disclosure, a communication method of a data processor is provided, comprising:
[0179] Sending first information to be transmitted to a kernel module in the host through a first communication terminal in the host, wherein the first information to be transmitted is information that the first communication terminal in the host needs to send to a second communication terminal in the DPU;
[0180] Through a preset transmission channel between the host and the DPU, the kernel module in the host sends the first information to be transmitted to the processing process in the DPU, so that the processing process in the DPU encapsulates the first information to be transmitted into a first message and transmits the first message to the second communication end.
[0181] According to one or more embodiments of the present disclosure, sending the first information to be transmitted to the kernel module in the host through the first communication terminal in the host includes:
[0182] Determine the socket address family of the first information to be transmitted. If the socket address family of the first information to be transmitted is an address family for network communication, send the first information to be transmitted to the kernel module in the host through the first communication terminal in the host, wherein the address family for network communication of the first information to be transmitted is replaced with a custom socket address family, wherein the custom socket address family is used to instruct the kernel module to transmit the first transmission information to the processing process in the DPU for encapsulation.
[0183] According to one or more embodiments of the present disclosure, the method further includes:
[0184] receiving, through a preset transmission channel between the host and the DPU, a second message sent by the processing process in the DPU, wherein the second message is obtained by the second communication end transmitting the second information to be transmitted to the processing process in the DPU, and the processing process in the DPU encapsulating the second information to be transmitted;
[0185] The kernel module in the host transmits the second message to the first communication end.
[0186] According to one or more embodiments of the present disclosure, the method further includes:
[0187] Registering the custom socket address family in a kernel module in the host;
[0188] The environment variables are configured for the first communication terminal to load a custom dynamic library, wherein the custom socket address family is used in the custom dynamic library to replace the address family of the network communication.
[0189] In a third aspect, according to one or more embodiments of the present disclosure, a communication device of a data processor is provided, including:
[0190] A communication unit, configured to receive, through a preset transmission channel between the host and the data processor DPU, first information to be transmitted sent by a first communication terminal in the host through a kernel module in the host, wherein the first information to be transmitted is information that the first communication terminal in the host needs to send to a second communication terminal in the DPU;
[0191] A processing unit is used to encapsulate the first information to be transmitted into a first message through a processing process in the DPU, and transmit the first message to the second communication end.
[0192] In one or more embodiments of the present disclosure, when the processing unit encapsulates the first information to be transmitted into a first message through the processing process in the DPU and transmits the first message to the second communication end, it is used to:
[0193] If the first information to be transmitted is control plane information, encapsulating the first information to be transmitted into a first message through a processing process in the DPU, wherein the first message is a control plane message;
[0194] The first message is transmitted to the second communication end by a local loopback method through a processing process in the DPU.
[0195] In one or more embodiments of the present disclosure, when the processing unit encapsulates the first information to be transmitted into a first message through the processing process in the DPU and transmits the first message to the second communication end, it is used to:
[0196] If the first information to be transmitted is data plane information, encapsulating the first information to be transmitted into a first message through a processing process in the DPU, wherein the first message is a data plane message;
[0197] The first message is stored in a shared memory in the DPU so that the second communication end obtains the first message from the shared memory.
[0198] In one or more embodiments of the present disclosure, when receiving the first information to be transmitted sent by the first communication terminal in the host through the kernel module in the host, the communication unit is used to:
[0199] Determine the socket address family of the first information to be transmitted. If the socket address family of the first information to be transmitted is an address family for network communication, receive the first information to be transmitted sent by the kernel module, wherein the address family for network communication of the first information to be transmitted is replaced with a custom socket address family, wherein the custom socket address family is used to instruct the kernel module to transmit the first transmission information to the processing process in the DPU for encapsulation.
[0200] In one or more embodiments of the present disclosure, the processing unit is further configured to:
[0201] Transmitting the second information to be transmitted to the processing process in the DPU through the second communication terminal, and the processing process in the DPU encapsulates the second information to be transmitted into a second message;
[0202] Through a preset transmission channel between the host and the DPU, the processing process in the DPU transmits the second message to the kernel module in the host, so that the kernel module in the host transmits the second message to the first communication end.
[0203] In one or more embodiments of the present disclosure, when the processing unit transmits the second information to be transmitted to the processing process in the DPU through the second communication terminal, it is configured to:
[0204] If the second information to be transmitted is control plane information, the second information to be transmitted is transmitted to the processing process in the DPU by means of a local loopback through the second communication end; or
[0205] If the second information to be transmitted is data plane information, the second information to be transmitted is stored in a shared memory in the DPU, and the processing process in the DPU obtains the second information to be transmitted from the shared memory.
[0206] In one or more embodiments of the present disclosure, the host and the DPU are respectively configured with a cache unit; accordingly, when the communication unit receives the first information to be transmitted sent by the first communication end in the host through the kernel module in the host through the preset transmission channel between the host and the data processor DPU, the communication unit is used to:
[0207] The first information to be transmitted is obtained from the cache unit in the host through a preset transmission channel between the host and the DPU, and is stored in the cache unit in the DPU, so that the processing process in the DPU can obtain the first information to be transmitted from the cache unit in the DPU.
[0208] In one or more embodiments of the present disclosure, a cache unit is configured in the host and the DPU respectively; accordingly, when the processing process in the DPU transmits the second message to the kernel module in the host through a preset transmission channel between the host and the DPU, the communication unit is used to:
[0209] The second message is obtained from the cache unit in the DPU through a preset transmission channel between the host and the DPU, and is transmitted and stored in the cache unit in the host, so that the kernel module in the host can obtain the second message from the cache unit in the host.
[0210] In one or more embodiments of the present disclosure, the processing unit is further configured to:
[0211] receiving a connection request to a second communication end sent by the first communication end through a kernel module in the host, sending the connection request to a first local port corresponding to the second communication end in the DPU through a processing process in the DPU, and establishing a connection with the first local port; or
[0212] Receive a port binding request sent by the first communication end through the kernel module in the host, and bind the second local port in the DPU to the first communication end according to the port binding request through the processing process in the DPU; receive a connection request sent by the second communication end to the first communication end, and establish a connection with the second local port through the processing process in the DPU.
[0213] In a fourth aspect, according to one or more embodiments of the present disclosure, a communication device of a data processor is provided, including:
[0214] A processing unit, configured to send first information to be transmitted to a kernel module in the host through a first communication terminal in the host, wherein the first information to be transmitted is information that the first communication terminal in the host needs to send to a second communication terminal in the DPU;
[0215] A communication unit is used to send the first information to be transmitted to the processing process in the DPU by the kernel module in the host through a preset transmission channel between the host and the DPU, so that the processing process in the DPU encapsulates the first information to be transmitted into a first message and transmits the first message to the second communication end.
[0216] In one or more embodiments of the present disclosure, when the processing unit sends the first information to be transmitted to the kernel module in the host through the first communication terminal in the host, it is used to:
[0217] Determine the socket address family of the first information to be transmitted. If the socket address family of the first information to be transmitted is an address family for network communication, send the first information to be transmitted to the kernel module in the host through the first communication terminal in the host, wherein the address family for network communication of the first information to be transmitted is replaced with a custom socket address family, wherein the custom socket address family is used to instruct the kernel module to transmit the first transmission information to the processing process in the DPU for encapsulation.
[0218] In one or more embodiments of the present disclosure, the communication unit is further configured to:
[0219] receiving, through a preset transmission channel between the host and the DPU, a second message sent by the processing process in the DPU, wherein the second message is obtained by the second communication end transmitting the second information to be transmitted to the processing process in the DPU, and the processing process in the DPU encapsulating the second information to be transmitted;
[0220] The kernel module in the host transmits the second message to the first communication end.
[0221] In one or more embodiments of the present disclosure, the processing unit is further configured to:
[0222] Registering the custom socket address family in a kernel module in the host;
[0223] The environment variables are configured for the first communication terminal to load a custom dynamic library, wherein the custom socket address family is used in the custom dynamic library to replace the address family of the network communication.
[0224] In a fifth aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;
[0225] The memory stores computer-executable instructions;
[0226] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the communication method of the data processor described in the first aspect and various possible designs of the first aspect, or the communication method of the data processor described in the second aspect and various possible designs of the second aspect.
[0227] In a sixth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer execution instructions. When the processor executes the computer execution instructions, the communication method of the data processor described in the first aspect and various possible designs of the first aspect, or the communication method of the data processor described in the second aspect and various possible designs of the second aspect is implemented.
[0228] In the seventh aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements the communication method of the data processor described in the first aspect and various possible designs of the first aspect, or the communication method of the data processor described in the second aspect and various possible designs of the second aspect.
[0229] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0230] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0231] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A communication method for a data processor, characterized in that: include: Receiving, through a preset transmission channel between the host and the data processor DPU, first information to be transmitted sent by the first communication end in the host through the kernel module in the host, wherein the first information to be transmitted is information that the first communication end in the host needs to send to the second communication end in the DPU; The first information to be transmitted is encapsulated into a first message through a processing process in the DPU, and the first message is transmitted to the second communication end.
2. The method according to claim 1, characterized in that The encapsulating the first information to be transmitted into a first message through the processing process in the DPU, and transmitting the first message to the second communication end, includes: If the first information to be transmitted is control plane information, encapsulating the first information to be transmitted into a first message through a processing process in the DPU, wherein the first message is a control plane message; The first message is transmitted to the second communication end by a local loopback method through a processing process in the DPU.
3. The method according to claim 1, characterized in that The encapsulating the first information to be transmitted into a first message through the processing process in the DPU, and transmitting the first message to the second communication end, includes: If the first information to be transmitted is data plane information, encapsulating the first information to be transmitted into a first message through a processing process in the DPU, wherein the first message is a data plane message; The first message is stored in a shared memory in the DPU so that the second communication end obtains the first message from the shared memory.
4. The method according to any one of claims 1 to 3, characterized in that: The first communication terminal in the receiving host sends the first information to be transmitted through the kernel module in the host, including: Determine the socket address family of the first information to be transmitted. If the socket address family of the first information to be transmitted is an address family for network communication, receive the first information to be transmitted sent by the kernel module, wherein the address family for network communication of the first information to be transmitted is replaced with a custom socket address family, wherein the custom socket address family is used to instruct the kernel module to transmit the first transmission information to the processing process in the DPU for encapsulation.
5. The method according to claim 1, characterized in that The method further comprises: Transmitting the second information to be transmitted to the processing process in the DPU through the second communication terminal, and the processing process in the DPU encapsulates the second information to be transmitted into a second message; Through a preset transmission channel between the host and the DPU, the processing process in the DPU transmits the second message to the kernel module in the host, so that the kernel module in the host transmits the second message to the first communication end.
6. The method according to claim 5, characterized in that The transmitting the second information to be transmitted to the processing process in the DPU through the second communication terminal includes: If the second information to be transmitted is control plane information, the second information to be transmitted is transmitted to the processing process in the DPU by means of a local loopback through the second communication end; or If the second information to be transmitted is data plane information, the second information to be transmitted is stored in a shared memory in the DPU, and the processing process in the DPU obtains the second information to be transmitted from the shared memory.
7. The method according to any one of claims 1 to 3, characterized in that: The host and the DPU are respectively configured with a cache unit; accordingly, the receiving, through a preset transmission channel between the host and the data processor DPU, first information to be transmitted sent by the first communication terminal in the host through the kernel module in the host, includes: The first information to be transmitted is obtained from the cache unit in the host through a preset transmission channel between the host and the DPU, and is stored in the cache unit in the DPU, so that the processing process in the DPU can obtain the first information to be transmitted from the cache unit in the DPU.
8. The method according to claim 5 or 6, characterized in that: The host and the DPU are respectively configured with a cache unit; accordingly, the second message is transmitted to the kernel module in the host by the processing process in the DPU through a preset transmission channel between the host and the DPU, including: The second message is obtained from the cache unit in the DPU through a preset transmission channel between the host and the DPU, and is transmitted and stored in the cache unit in the host, so that the kernel module in the host can obtain the second message from the cache unit in the host.
9. The method according to claim 1, characterized in that: The method further comprises: receiving a connection request to a second communication end sent by the first communication end through a kernel module in the host, sending the connection request to a first local port corresponding to the second communication end in the DPU through a processing process in the DPU, and establishing a connection with the first local port; or Receive a port binding request sent by the first communication end through the kernel module in the host, and bind the second local port in the DPU to the first communication end according to the port binding request through the processing process in the DPU; receive a connection request sent by the second communication end to the first communication end, and establish a connection with the second local port through the processing process in the DPU.
10. A communication method for a data processor, characterized in that: include: Sending first information to be transmitted to a kernel module in the host through a first communication terminal in the host, wherein the first information to be transmitted is information that the first communication terminal in the host needs to send to a second communication terminal in the data processor DPU; Through a preset transmission channel between the host and the DPU, the kernel module in the host sends the first information to be transmitted to the processing process in the DPU, so that the processing process in the DPU encapsulates the first information to be transmitted into a first message and transmits the first message to the second communication end.
11. The method according to claim 10, characterized in that The sending the first information to be transmitted to the kernel module in the host through the first communication terminal in the host comprises: Determine the socket address family of the first information to be transmitted. If the socket address family of the first information to be transmitted is an address family for network communication, send the first information to be transmitted to the kernel module in the host through the first communication terminal in the host, wherein the address family for network communication of the first information to be transmitted is replaced with a custom socket address family, wherein the custom socket address family is used to instruct the kernel module to transmit the first transmission information to the processing process in the DPU for encapsulation.
12. The method according to claim 10, characterized in that The method further comprises: receiving, through a preset transmission channel between the host and the DPU, a second message sent by the processing process in the DPU, wherein the second message is obtained by the second communication end transmitting the second information to be transmitted to the processing process in the DPU, and the processing process in the DPU encapsulating the second information to be transmitted; The kernel module in the host transmits the second message to the first communication end.
13. The method according to claim 11, characterized in that The method further comprises: Registering the custom socket address family in a kernel module in the host; The environment variables are configured for the first communication terminal to load a custom dynamic library, wherein the custom socket address family is used in the custom dynamic library to replace the address family of the network communication.
14. A communication device for a data processor, characterized in that: include: A communication unit, configured to receive, through a preset transmission channel between the host and the data processor DPU, first information to be transmitted sent by a first communication terminal in the host through a kernel module in the host, wherein the first information to be transmitted is information that the first communication terminal in the host needs to send to a second communication terminal in the DPU; A processing unit is used to encapsulate the first information to be transmitted into a first message through a processing process in the DPU, and transmit the first message to the second communication end.
15. A communication device for a data processor, characterized in that: include: A processing unit, configured to send first information to be transmitted to a kernel module in the host through a first communication terminal in the host, wherein the first information to be transmitted is information that the first communication terminal in the host needs to send to a second communication terminal in the DPU; A communication unit is used to send the first information to be transmitted to the processing process in the DPU by the kernel module in the host through a preset transmission channel between the host and the DPU, so that the processing process in the DPU encapsulates the first information to be transmitted into a first message and transmits the first message to the second communication end.
16. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 13.
17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1 to 13 is implemented.
18. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.
Citation Information
Patent Citations
Data communication method and device, computer equipment and storage medium
CN117615042A
Message processing method for data processing unit, computer equipment and medium
CN117909031A
Data transmission method and device, storage medium and electronic equipment
CN118175149A
Packet processing method and device
WO2017000593A1