Method and system for implementing CPU-based ethernet and SRIO data exchange
By implementing Ethernet and SRIO data exchange through a CPU-based software solution, and employing modular design and multi-threaded processing, the complexity of Ethernet and SRIO protocol conversion in sonar signal processing systems is solved, improving the system's real-time performance and flexibility, and adapting to different system requirements.
Patent Information
- Application Number
- CN202610478640.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-13
- Publication Date
- 2026-06-23
AI Technical Summary
In existing sonar signal processing systems, the conversion between Ethernet and SRIO protocols relies on sonar application processing software, resulting in a cumbersome and complex processing flow, increasing development difficulty and maintenance costs. Furthermore, FPGA solutions have poor flexibility and scalability, making it difficult to adapt to changes in system scale and diverse needs.
A CPU-based software solution is adopted, which realizes bidirectional protocol conversion and forwarding between Ethernet and SRIO data through modular design and multi-threaded concurrent processing. This includes Ethernet to SRIO modules and SRIO to Ethernet modules. Message queues and mapping tables are used for data transmission, which simplifies the data forwarding process and improves the real-time performance of the system.
It reduces application development complexity, improves system real-time performance and flexibility, adapts to dynamic changes in system scale and diverse application needs, and simplifies the protocol conversion process.
Smart Images

Figure CN122268830A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication link conversion technology, and more specifically, to a CPU-based method and system for implementing Ethernet and SRIO data exchange. Background Technology
[0002] In high-performance computing systems such as sonar signal processing, Ethernet and SRIO data transmission technologies are widely used due to their high reliability and performance. Ethernet features long transmission distance, good versatility, and high transmission bandwidth (such as 10G and 40G Ethernet), and is often used for long-distance data transmission between devices or systems, such as data interaction between a sonar array and a sonar signal processor. SRIO, on the other hand, features low latency and high reliability, but has a shorter transmission distance and is often used for short-distance high-speed data transmission between modules within a device, such as data communication between computing units within a sonar signal processor.
[0003] In practical applications, sonar signal processors typically receive raw data collected by the sonar array via Ethernet, then distribute the data to internal computing units for real-time processing via the SRIO bus, and finally send the processing results back to the combat system via Ethernet. In this process, the data distribution and protocol conversion between Ethernet and SRIO currently rely primarily on the sonar application processing software. This means the sonar application processing software not only needs to handle complex real-time sonar processing algorithms but also must manage the underlying communication logic such as data distribution and protocol conversion, making the processing flow cumbersome and complex. This increases the development difficulty and maintenance cost of the application software, while also reducing the real-time performance of the system.
[0004] To address the aforementioned issues, existing technologies include solutions that use FPGAs to implement Ethernet and SRIO protocol conversion. However, FPGA solutions typically suffer from poor flexibility and scalability. For instance, when it is necessary to expand the number of Ethernet or SRIO interfaces, modify IP addresses, or change port configurations, it is often necessary to redesign and recompile the hardware logic, making it difficult to adapt to dynamic changes in system scale and diverse application requirements. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides a CPU-based method and system for Ethernet and SRIO data exchange. Implemented using a software solution on a CPU platform, it achieves bidirectional protocol conversion and forwarding between Ethernet and SRIO data through modular design and multi-threaded concurrent processing. This frees up computing units and sonar signal processing software, reduces application development complexity, and improves system real-time performance. Furthermore, the CPU platform enhances system flexibility and reliability, adapting to dynamic changes in system scale and diverse application requirements.
[0006] The technical solution adopted in this invention is: A CPU-based method for Ethernet and SRIO data exchange is disclosed. This method employs a software solution based on a CPU platform, utilizing modular design and multi-threaded concurrent processing to achieve bidirectional protocol conversion and forwarding between Ethernet and SRIO data. The method comprises two parts: an Ethernet-to-SRIO module and an SRIO-to-Ethernet module. The Ethernet-to-SRIO module is configured to create multiple Ethernet receiving threads, each listening to Ethernet data on a different port. Based on the port number of the received data, the target SRIO device ID is obtained according to a preset mapping relationship. The Ethernet receiving thread passes the received data buffer address to the SRIO sending thread through a message queue. The SRIO sending thread then sends the data to the corresponding target SRIO device via the SRIO bus based on the information in the message queue.
[0007] The SRIO to Ethernet module is configured to receive data from the SRIO bus via an SRIO receive thread; based on the target Ethernet device ID in the data, it queries a pre-established mapping table of device IDs, Ethernet IP addresses, and port numbers to obtain the IP address and port number of the target Ethernet device; based on the obtained information, it creates corresponding UDP or TCP send threads and passes the data buffer address to these send threads through a message queue; the send threads then send the data to the target Ethernet device via Ethernet.
[0008] Furthermore, in the Ethernet-to-SRIO module, the multiple Ethernet receiving threads include multiple UDP receiving threads and multiple TCP receiving threads, and the SRIO sending thread is one. The specific implementation process is as follows: 1) Initialization: In the UDP / TCP receive thread, the corresponding SRIO device ID is calculated based on the configured port number; a socket is created according to the UDP / TCP communication protocol and bound to the specified IP address and port number; when using the TCP protocol, this end acts as the server and listens for connection requests. 2) Message reception: Receive a control message from the Ethernet transmitter. This message contains information about the total frame length and total number of frames of the data to be transmitted. 3) Data reception and forwarding: Allocate a data buffer according to the frame length in the control message; then, receive data packets in a loop according to the total number of frames; after receiving 4MByte of data, encapsulate the current data offset address, the target SRIO device ID, and the receive buffer address on the target SRIO device into a message and put it into the message queue; 4) SRIO Send: The SRIO send thread continuously reads messages from the message queue; after obtaining the source data address, destination address and target SRIO device ID from the message, it performs direct memory access (DMA) transfer through the SRIO bus to send the data to the target SRIO device; 5) Transmission completion notification: After all data fragments have been sent, the SRIO sending thread sends a special doorbell message to notify the target SRIO device that the transmission has been completed; at the same time, it releases a semaphore to notify the corresponding UDP / TCP receiving thread. 6) Acknowledgment: After receiving the SRIO transmission completion signal, the UDP / TCP receive thread sends a transmission completion acknowledgment packet to the Ethernet sender to confirm the end of the entire data exchange process.
[0009] Furthermore, in the Ethernet-to-SRIO module, the port number monitored by the Ethernet receiving thread and the SRIO device ID are linearly mapped, and the port number is equal to the sum of a preset reference constant and the target SRIO device ID.
[0010] 4. A CPU-based Ethernet and SRIO data exchange system according to claim 2, characterized in that the Ethernet-to-SRIO module configures corresponding Ethernet ports according to the number of SRIO devices and their corresponding SRIO device IDs in the current system, each SRIO device corresponds to one UDP port and one TCP port, and different UDP / TCP receiving threads are created, with each port corresponding to an independent receiving thread; wherein the correspondence between SRIO devices and UDP and TCP ports is as follows: UDP port = 8000 + SRIO device ID and TCP port = 9000 + SRIO device ID.
[0011] Furthermore, in the SRIO-to-Ethernet module, there is one SRIO receiving thread, and the UDP / TCP sending thread is dynamically created by the SRIO receiving thread based on the received doorbell information. The SRIO receiving thread transmits data with the UDP / TCP sending thread through independent message queues. The specific implementation process is as follows: 1) Initialization and thread creation: When the SRIO receiving thread receives the first doorbell message from the SRIO sending end, it parses out the device ID of the target Ethernet receiving end and the UDP / TCP communication protocol to be used; based on this information, it dynamically creates the corresponding UDP / TCP sending thread; 2) Target Address Acquisition: The SRIO receiving thread queries the srio2net static mapping table based on the parsed target device ID to obtain the IP address and port number of the target Ethernet receiver; it then encapsulates this information into a message and sends it to the created UDP / TCP sending thread. 3) Sending thread preparation: The UDP / TCP sending thread retrieves a message containing the target IP address and port number from the message queue and creates a socket accordingly; when using the TCP protocol, the Ethernet receiving end acts as the server and the local end acts as the client to initiate the connection. 4) Data reception and forwarding: Each time the SRIO receiving thread receives a doorbell message indicating that a frame of SRIO data has been received, it encapsulates the offset address of the current data, the data length, and a sending completion flag into a message and puts it into the message queue shared with the UDP / TCP sending thread. 5) Ethernet data transmission: The UDP / TCP sending thread continuously reads messages from the message queue; it checks the transmission completion flag in the message: if the flag indicates that the data has not been completely sent, the corresponding data is retrieved from the specified address, sent to the target Ethernet device via the created socket using the UDP or TCP protocol, and continues to read the next message; if the flag indicates that all data has been sent, the thread enters a waiting state, waiting for the completion ACK response packet returned from the Ethernet receiver. 6) Transmission completion confirmation: After receiving the ACK response packet, the UDP / TCP sending thread releases the completion semaphore to notify the SRIO receiving thread; after receiving the semaphore, the SRIO receiving thread sends a doorbell message to the original SRIO sending end to notify the other party that the data transmission has been completed.
[0012] Furthermore, the srio2net static mapping table in the SRIO to Ethernet module is established based on the Ethernet receiving device ID, IP address, and port; the SRIO receiving thread obtains the UDP or TCP communication protocol, IP address, and port of the Ethernet receiving end by looking up the table, and then creates the corresponding UDP / TCP sending thread.
[0013] Furthermore, during UDP protocol transmission, the receiver sends an ACK response packet to the sender after successfully receiving each data frame to achieve data frame-level synchronization and prevent data loss due to inconsistent sending and receiving performance.
[0014] Furthermore, during SRIO bus data transmission, the SRIO data window is divided into two equal segments. The SRIO sender transmits data using a ping-pong operation: when performing a ping operation, data is sent to the first data window segment, and the receiver simultaneously reads the data in the second data window segment; when performing a pong operation, data is sent to the second data window segment, and the receiver simultaneously reads the data in the first data window segment, to prevent SRIO data from being overwritten.
[0015] Another technical solution adopted by the present invention is: A CPU-based Ethernet and SRIO data exchange system is deployed on a CPU platform that supports Ethernet and SRIO interfaces, including an Ethernet-to-SRIO module, an SRIO-to-Ethernet module, and a message queue module. The message queue module is configured with at least three independent message queues, namely the first message queue, the second message queue, and the third message queue; The Ethernet-to-SRIO module includes several UDP receive thread units, several TCP receive thread units, and an SRIO send thread unit; wherein each of the UDP receive thread units and TCP receive thread units interacts with the SRIO send thread unit through a first message queue. The SRIO to Ethernet module includes an SRIO receive thread unit, several UDP send thread units, and several TCP send thread units; wherein, the SRIO receive thread unit interacts with each of the UDP send thread units through a second message queue, and the SRIO receive thread unit interacts with each of the TCP send thread units through a third message queue.
[0016] Furthermore, it also includes: The mapping configuration module is used to establish and store a fixed mapping relationship between Ethernet port numbers and SRIO device IDs, and a static mapping table between SRIO device IDs and Ethernet IP addresses and port numbers; The data transmission guarantee module is used to implement the response synchronization mechanism and the data window management mechanism for ping-pong operations.
[0017] Compared with the prior art, the present invention has the following advantages: In this invention, the Ethernet-to-SRIO module receives Ethernet data from various ports through different Ethernet receiving threads, calculates the SRIO device ID based on the port, and then sends it to the corresponding SRIO device via the SRIO bus. The Ethernet receiving thread and the SRIO sending thread exchange data through a message queue, thereby realizing data exchange between Ethernet and SRIO. The SRIO-to-Ethernet module receives data transmitted via the SRIO bus through the SRIO receiving thread, queries the local SRIO ID-Ethernet IP address-port mapping table based on the target SRIO device ID, and then sends the data to the target device through the Ethernet sending thread. The SRIO receiving thread and the Ethernet sending thread exchange data through a message queue, thereby realizing data exchange between SRIO and Ethernet. Attached Figure Description
[0018] The present invention will be further described below with reference to the accompanying drawings and specific embodiments: Figure 1 This is an overall architecture block diagram of a CPU-based Ethernet and SRIO data exchange implementation method according to the present invention; Figure 2 This is a data flow diagram of the Ethernet to SRIO module and the SRIO to Ethernet module in this invention; Figure 3 This is a flowchart illustrating the implementation of the Ethernet-to-SRIO module in this invention. Figure 4 This is a flowchart illustrating the implementation of the SRIO-to-Ethernet module in this invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it.
[0020] This invention provides a CPU-based method for Ethernet and SRIO data exchange, based on a CPU platform that simultaneously supports both Ethernet and SRIO interfaces. The platform interconnects with external Ethernet devices via the Ethernet interface and accesses the internal SRIO switching network via the SRIO interface, thereby interconnecting with internal computing units, i.e., SRIO devices. In terms of software functionality, this method utilizes a collaborative process between an Ethernet-to-SRIO module and an SRIO-to-Ethernet module to complete the data exchange.
[0021] I. System Overall Architecture like Figure 1As shown, external Ethernet devices send data via Ethernet, which enters the CPU platform via an Ethernet switch. The Ethernet-to-SRIO module inside the CPU platform receives and processes the Ethernet data, converts it into SRIO protocol format, and then sends it out via the SRIO bus, before reaching the designated target SRIO device via an SRIO switch. Conversely, when an SRIO device sends data via the SRIO bus, the data enters the CPU platform via an SRIO switch. The SRIO-to-Ethernet module inside the CPU platform receives and processes this SRIO data, converts it into Ethernet protocol format, sends it out via Ethernet, and then reaches the designated target Ethernet device via an Ethernet switch.
[0022] II. Ethernet to SRIO Module like Figure 2 As shown above, the Ethernet-to-SRIO module configures the corresponding Ethernet ports based on the number of SRIO devices and their corresponding SRIO device IDs in the current system. In this embodiment, each SRIO device is pre-configured with one port for UDP communication and one port for TCP communication, with the mapping relationship as follows: UDP port number = 8000 + SRIO device ID, TCP port number = 9000 + SRIO device ID. The module creates an independent receive thread for each configured port, i.e., multiple UDP receive threads and multiple TCP receive threads.
[0023] After receiving data, the Ethernet-to-SRIO module can quickly reverse-calculate the target SRIO device ID based on the port number where the data arrived, using the aforementioned mapping relationship. Subsequently, the UDP / TCP receive thread encapsulates the received data buffer address, the target SRIO device ID, and the receive buffer address on the target SRIO device into a message and places it in a message queue shared with the SRIO send thread. The SRIO send thread retrieves the message from the message queue and sends the data to the corresponding target SRIO device via the SRIO bus according to the message content. In this embodiment, efficient data exchange from Ethernet to SRIO is achieved in this way.
[0024] like Figure 3 As shown, the Ethernet to SRIO module includes a UDP / TCP receive thread and an SRIO send thread. The specific implementation process is as follows: 1) Initialization: In the UDP / TCP receive thread, the corresponding SRIO device ID is calculated based on the configured port number; a socket is created according to the communication protocol (UDP / TCP) and bound to the specified IP address and port number; when using the TCP protocol, this end acts as the server and listens for connection requests; 2) Message reception: Receive a control message from the Ethernet transmitter. This message contains information about the total frame length and total number of frames of the data to be transmitted. 3) Data reception and forwarding: Allocate a data buffer according to the frame length in the control message; then, receive data packets in a loop according to the total number of frames; after receiving 4MByte of data, encapsulate the current data offset address, the target SRIO device ID, and the receive buffer address on the target SRIO device into a message and put it into the message queue; 4) SRIO Send: The SRIO send thread continuously reads messages from the message queue; after obtaining the source data address, destination address and target SRIO device ID from the message, it performs direct memory access (DMA) transfer through the SRIO bus to send the data to the target SRIO device; 5) Transmission completion notification: After all data fragments have been sent, the SRIO sending thread sends a special doorbell message (e.g., the doorbell message value is 0xbeef) to notify the target SRIO device that the transmission has been completed; at the same time, it releases a semaphore to notify the corresponding UDP / TCP receiving thread. 6) Acknowledgment: After receiving the SRIO transmission completion signal, the UDP / TCP receive thread sends a transmission completion acknowledgment packet to the Ethernet sender to confirm the end of the entire data exchange process.
[0025] III. SRIO to Ethernet Module like Figure 2 As shown in the lower section, the SRIO-to-Ethernet module first establishes a static mapping table, srio2net, to store the correspondence between SRIO device IDs and communication parameters of Ethernet receiving devices. These communication parameters include the communication protocol (UDP / TCP), IP address, and port number. The module contains an SRIO receiving thread, as well as UDP and TCP sending threads dynamically created and managed by this thread.
[0026] When the SRIO receiving thread receives SRIO data, it obtains the target Ethernet device ID based on the SRIO device ID in the data. Then, by querying the srio2net static mapping table, it retrieves the communication protocol, IP address, and port number corresponding to the target device. Next, the SRIO receiving thread creates a corresponding UDP / TCP sending thread based on the obtained information and passes the received data buffer address to the corresponding UDP / TCP sending thread via a message queue. These threads then complete the final transmission of the Ethernet data. In this embodiment, efficient data exchange from SRIO to Ethernet is achieved in this way.
[0027] like Figure 4As shown, the SRIO to Ethernet module includes an SRIO receive thread and a UDP / TCP send thread. The specific implementation process is as follows: 1) Initialization and thread creation: When the SRIO receiving thread receives the first doorbell message from the SRIO sending end, it parses out the device ID of the target Ethernet receiving end and the communication protocol to be used (UDP / TCP); based on this information, it dynamically creates the corresponding UDP sending thread or TCP sending thread; 2) Target Address Acquisition: The SRIO receiving thread queries the pre-configured srio2net mapping table based on the parsed target device ID to obtain the IP address and port number of the target Ethernet receiver; it then encapsulates this information into a message and sends it to the created UDP / TCP sending thread. 3) Sending thread preparation: The UDP / TCP sending thread retrieves a message containing the target IP address and port number from the message queue and creates a socket accordingly; when using the TCP protocol, the Ethernet receiving end acts as the server and the local end acts as the client to initiate the connection. 4) Data reception and forwarding: Each time the SRIO receiving thread receives a doorbell message indicating "one frame of SRIO data received", it encapsulates the offset address of the current data, the data length, and a "sending completion flag" into a message and puts it into the message queue shared with the UDP / TCP sending thread. 5) Ethernet data transmission: The UDP / TCP sending thread continuously reads messages from the message queue; it checks the "transmission completion flag" in the message: if the flag indicates that the data has not been completely sent, the corresponding data is retrieved from the specified address, sent to the target Ethernet device via the created socket using the UDP or TCP protocol, and continues to read the next message; if the flag indicates that all data has been sent, the thread enters a waiting state, waiting for the completion ACK response packet returned from the Ethernet receiver; 6) Transmission completion confirmation: After receiving the ACK response packet, the UDP / TCP sending thread releases the completion semaphore to notify the SRIO receiving thread; after receiving the semaphore, the SRIO receiving thread sends a doorbell message to the original SRIO sending end to notify the other party that the data transmission has been completed.
[0028] This invention is implemented using a software solution based on a CPU platform. The CPU platform supports both Ethernet and SRIO interfaces. The Ethernet interface interconnects with external devices, while the SRIO interface connects to the internal SRIO switching network and interconnects with the internal computing unit. In terms of software functionality, it consists of two parts: an Ethernet-to-SRIO module and an SRIO-to-Ethernet module. The Ethernet-to-SRIO module receives Ethernet data from various ports through different Ethernet receiving threads, calculates the SRIO device ID based on the port, and then sends it to the corresponding SRIO device via the SRIO bus. Data is transferred between the Ethernet receiving thread and the SRIO sending thread through a message queue, thus achieving Ethernet-to-SRIO data conversion. The SRIO-to-Ethernet module receives data transmitted via the SRIO bus through the SRIO receiving thread, queries the local SRIO ID-Ethernet IP address-port mapping table based on the target SRIO device ID, and then sends the data to the target device through the Ethernet sending thread. Data is transferred between the SRIO receiving thread and the Ethernet sending thread through a message queue, thus achieving SRIO-to-Ethernet data conversion. This solution is implemented using software, and customization and modification are simple and convenient. It can flexibly configure the number of Ethernet and SRIO ports, Ethernet IP addresses and ports, SRIO device IDs, etc., according to the system scale to meet the diverse needs of different systems.
[0029] In the specific implementation of this invention, if UDP packet loss and SRIO data overwriting occur, the following steps are taken to resolve the issue: 1) Regarding UDP packet loss: In UDP protocol transmission, the receiver (the CPU platform of this invention) needs to perform data parsing and forwarding, and its processing speed may be slower than that of the sender, leading to packet loss. To address this, an ACK response synchronization mechanism is introduced. After successfully receiving each data frame, the receiver replies with an ACK packet to the sender; the sender only sends the next data frame after receiving the ACK for the previous frame. This frame-by-frame acknowledgment method effectively solves the UDP packet loss problem caused by the mismatch between sender and receiver performance, ensuring the reliability of data transmission. 2) Regarding the SRIO data overwriting issue: On CPU platforms, the SRIO bus is typically implemented using a PCIe-to-SRIO bridge. The SRIO receiver receives data through a configured data window, but the data window has limited memory, usually no more than 8 Mbytes. After each received data, it needs to be copied to a larger buffer. If the SRIO sender continuously sends data and the receiver cannot copy the data in time, data overwriting will occur. To solve this problem, this invention adopts a ping-pong operation mechanism: the SRIO data window is divided into two segments, each 4 Mbytes in size. During the "ping" operation, the SRIO sender sends data to the first data window, and the receiver reads the data from the second data window; during the "pong" operation, data is sent to the second data window, and the receiver reads the data from the first data window. By alternately using the two data windows, the receiver is given sufficient time to copy the data, fundamentally avoiding the risk of data overwriting.
[0030] In summary, this invention employs a modular, multi-threaded software solution to achieve protocol conversion, improving flexibility and scalability; simplifies the data forwarding process by mapping port numbers to SRIO IDs; establishes a mapping table between device IDs, IP addresses, and ports to achieve efficient forwarding from SRIO to Ethernet; introduces an ACK response mechanism to solve the UDP packet loss problem; and uses ping-pong operation and data window segmentation mechanisms to solve the SRIO data overlay problem.
[0031] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made by those skilled in the art to the technical solutions of the present invention without departing from the principles and essence of the present invention should fall within the protection scope defined by the claims of the present invention.
Claims
1. A CPU-based method for implementing Ethernet and SRIO data exchange, characterized in that, The method is implemented in software based on a CPU platform, including: an Ethernet to SRIO module and an SRIO to Ethernet module; The Ethernet-to-SRIO module is configured to create multiple Ethernet receiving threads to receive data from different Ethernet ports; determine the target SRIO device ID based on the Ethernet port number of the received data; and pass the data cache address to the SRIO sending thread through a message queue, which then sends the data to the corresponding target SRIO device through the SRIO bus. The SRIO-to-Ethernet module is configured to receive data from the SRIO bus via an SRIO receiving thread; based on the SRIO device ID in the data, it queries a pre-established mapping table of SRIO device IDs and Ethernet IP addresses and port numbers to obtain the Ethernet IP address and port number; based on the obtained information, it creates a corresponding UDP or TCP sending thread and passes the data cache address to the sending thread through a message queue, and the sending thread sends the data to the target Ethernet device via Ethernet.
2. The method for implementing CPU-based Ethernet and SRIO data exchange according to claim 1, characterized in that, In the Ethernet-to-SRIO module, the multiple Ethernet receiving threads include multiple UDP receiving threads and multiple TCP receiving threads, and the SRIO sending thread is one. The specific implementation process is as follows: 1) Initialization: In the UDP / TCP receive thread, the corresponding SRIO device ID is calculated based on the configured port number; a socket is created according to the UDP / TCP communication protocol and bound to the specified IP address and port number; when using the TCP protocol, this end acts as the server and listens for connection requests. 2) Message reception: Receive a control message from the Ethernet transmitter. This message contains information about the total frame length and total number of frames of the data to be transmitted. 3) Data reception and forwarding: Allocate data buffers according to the frame length in the control message; Then, data packets are received cyclically according to the total number of frames; after receiving 4MByte of data, the offset address of the current data, the target SRIO device ID, and the receive buffer address on the target SRIO device are encapsulated into a message and placed in the message queue; 4) SRIO Send: The SRIO send thread continuously reads messages from the message queue; after obtaining the source data address, destination address and target SRIO device ID from the message, it performs direct memory access (DMA) transfer through the SRIO bus to send the data to the target SRIO device; 5) Transmission completion notification: After all data fragments have been sent, the SRIO sending thread sends a special doorbell message to notify the target SRIO device that the transmission has been completed; at the same time, it releases a semaphore to notify the corresponding UDP / TCP receiving thread. 6) Acknowledgment: After receiving the SRIO transmission completion signal, the UDP / TCP receive thread sends a transmission completion acknowledgment packet to the Ethernet sender to confirm the end of the entire data exchange process.
3. The CPU-based Ethernet and SRIO data exchange system according to claim 2, characterized in that, In the Ethernet-to-SRIO module, the port number monitored by the Ethernet receiving thread and the SRIO device ID are linearly mapped. The port number is equal to the sum of a preset reference constant and the target SRIO device ID.
4. The CPU-based Ethernet and SRIO data exchange system according to claim 2, characterized in that, The Ethernet-to-SRIO module configures corresponding Ethernet ports based on the number of SRIO devices and their corresponding SRIO device IDs in the current system. Each SRIO device corresponds to one UDP port and one TCP port, and different UDP / TCP receiving threads are created, with each port corresponding to an independent receiving thread. The correspondence between SRIO devices and UDP and TCP ports is as follows: UDP port = 8000 + SRIO device ID and TCP port = 9000 + SRIO device ID.
5. The method for implementing CPU-based Ethernet and SRIO data exchange according to claim 1, characterized in that, In the SRIO-to-Ethernet module, there is one SRIO receiving thread, and the UDP / TCP sending thread is dynamically created by the SRIO receiving thread based on the received doorbell information. The SRIO receiving thread transmits data with the UDP / TCP sending thread through independent message queues. The specific implementation process is as follows: 1) Initialization and thread creation: When the SRIO receiving thread receives the first doorbell message from the SRIO sending end, it parses out the device ID of the target Ethernet receiving end and the UDP / TCP communication protocol to be used; based on this information, it dynamically creates the corresponding UDP / TCP sending thread; 2) Target address acquisition: The SRIO receiving thread queries the srio2net static mapping table based on the parsed target device ID to obtain the IP address and port number of the target Ethernet receiver; Encapsulate this information into a message and send it to the created UDP / TCP sending thread; 3) Sending thread preparation: The UDP / TCP sending thread retrieves a message containing the target IP address and port number from the message queue and creates a socket accordingly; when using the TCP protocol, the Ethernet receiving end acts as the server and the local end acts as the client to initiate the connection. 4) Data reception and forwarding: Each time the SRIO receiving thread receives a doorbell message indicating that a frame of SRIO data has been received, it encapsulates the offset address of the current data, the data length, and a sending completion flag into a message and puts it into the message queue shared with the UDP / TCP sending thread. 5) Ethernet data transmission: The UDP / TCP sending thread continuously reads messages from the message queue; it checks the transmission completion flag in the message: if the flag indicates that the data has not been completely sent, it retrieves the corresponding data from the specified address, sends it to the target Ethernet device via the created socket using the UDP or TCP protocol, and continues to read the next message; If the flag indicates that all data has been sent, the thread enters a waiting state, waiting for a completion ACK response packet to be returned from the Ethernet receiver; 6) Transmission completion confirmation: After receiving the ACK response packet, the UDP / TCP sending thread releases the completion semaphore and notifies the SRIO receiving thread; After receiving the semaphore, the SRIO receiving thread sends a doorbell message to the original SRIO sending end to notify that the data transmission has been completed.
6. The method for implementing CPU-based Ethernet and SRIO data exchange according to claim 5, characterized in that, In the SRIO to Ethernet module, the srio2net static mapping table is established based on the Ethernet receiving device ID, IP address, and port. The SRIO receiving thread obtains the UDP or TCP communication protocol, IP address, and port of the Ethernet receiving end by looking up the table, and then creates the corresponding UDP / TCP sending thread.
7. The method for implementing CPU-based Ethernet and SRIO data exchange according to claim 1, characterized in that, During UDP protocol transmission, the receiver sends an ACK response packet to the sender after successfully receiving each data frame to achieve data frame-level synchronization and prevent data loss due to inconsistent sending and receiving performance.
8. The method for implementing CPU-based Ethernet and SRIO data exchange according to claim 1, characterized in that, During SRIO bus data transmission, the SRIO data window is divided into two equal segments. The SRIO sender uses a ping-pong operation to send data: when performing a ping operation, data is sent to the first data window segment, and the receiver simultaneously reads the data in the second data window segment; when performing a pong operation, data is sent to the second data window segment, and the receiver simultaneously reads the data in the first data window segment, to prevent SRIO data from being overwritten.
9. A CPU-based Ethernet and SRIO data exchange implementation system, characterized in that, Deployed on CPU platforms that support Ethernet and SRIO interfaces, including Ethernet to SRIO modules, SRIO to Ethernet modules, and message queue modules; The message queue module is configured with at least three independent message queues, namely the first message queue, the second message queue, and the third message queue; The Ethernet-to-SRIO module includes several UDP receive thread units, several TCP receive thread units, and an SRIO send thread unit; wherein each of the UDP receive thread units and TCP receive thread units interacts with the SRIO send thread unit through a first message queue. The SRIO to Ethernet module includes an SRIO receive thread unit, several UDP send thread units, and several TCP send thread units; wherein, the SRIO receive thread unit interacts with each of the UDP send thread units through a second message queue, and the SRIO receive thread unit interacts with each of the TCP send thread units through a third message queue.
10. A CPU-based Ethernet and SRIO data exchange system according to claim 9, characterized in that, Also includes: The mapping configuration module is used to establish and store a fixed mapping relationship between Ethernet port numbers and SRIO device IDs, and a static mapping table between SRIO device IDs and Ethernet IP addresses and port numbers; The data transmission guarantee module is used to implement the response synchronization mechanism and the data window management mechanism for ping-pong operations.