Communication system of TAP virtual network card based on AMP multi-core heterogeneous

By using the AMP multi -core heterogeneous communication system based on AMP multi -core heterogeneous network in the multi -core heterogenesis system, using shared memory and mailboxes to achieve inter -intercourse communication, solving nuclear inter -communication problems, and realized high -efficiency network data parallel computing and real -time real -time real -time calculations and real -time real -time in -time The exchange of network data packets has given full play to the performance advantages of multi -core heterogeneous platforms.

CN119336695APending Publication Date: 2025-01-21SUZHOU XINSHINUO SEMICON EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411385177.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

In multi-core heterogeneous processor systems, it is necessary to solve the problem of mutual communication between cores, especially combining with TAP virtual network cards, to give full play to the performance advantages of multi-core heterogeneous platforms.

Method used

A communication system based on the AMP multi-core heterogeneous TAP virtual network card is adopted, and IPC communication is carried out through the shared memory and mailbox between the first core and the second core to realize data sharing and event notification between cores. The first core directly accesses the external network through the physical network card, and the second core communicates with the first core through the virtual network card, shared memory and mailbox to indirectly access the external network.

Benefits of technology

The efficient network data parallel computing and real -time network data packet exchange are realized, and the performance advantages of multi -nuclear heterogeneous platforms are fully played, thereby achieving the function of the entire SOC processor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336695A_ABST
    Figure CN119336695A_ABST
Patent Text Reader

Abstract

The invention provides a communication system based on an AMP multi-core heterogeneous TAP virtual network card, a first core of the communication system is internally provided with a physical network card and a first virtual network card which are communicated with each other, a second core of the communication system is internally provided with a second virtual network card, the first core directly accesses an external network through the physical network card, and the second core passes through the second virtual network card. And a shared memory and a mailbox of the communication system communicate with the first virtual network card and further communicate with the physical network card to indirectly access an external network. According to the IPC communication based on the shared memory, different software components can communicate with one another and work cooperatively, so that the purposes of data sharing, event notification, state synchronization and system expansion are achieved, and efficient network data parallel computing and real-time network data packet exchange are achieved by effectively combining a TAP virtual network card.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of SoC processors, and in particular to a communication system based on an AMP multi-core heterogeneous TAP virtual network card. Background Art

[0002] In computer networks, TUN and TAP are virtual network devices in the operating system kernel. Unlike ordinary devices implemented by hardware network cards, these virtual network devices are all implemented by software and provide the same functions as hardware network devices to the software running on the operating system. TAP is equivalent to an Ethernet device, which operates layer 2 data packets such as Ethernet data frames. TUN simulates a network layer device and operates layer 3 data packets such as IP data packets. The operating system sends data to the user space program bound to the device through the TUN / TAP device. Conversely, the user space program can also send data through the TUN / TAP device like operating a hardware network device. In the latter case, the TUN / TAP device delivers (or "injects") data packets to the operating system's network stack, thereby simulating the process of receiving data from the outside. Compared with the physical network card, which is responsible for data transmission between the kernel network protocol stack and the external network, the two ends of the virtual network card are the kernel network protocol stack and the user space, and it is responsible for transmitting data between the kernel network protocol stack and the user space program. The data sent to the virtual network card comes from the user space and is then read by the kernel into the network protocol stack; the kernel writes to the virtual network card and prepares to send data through the network card to the user space. SoC processors are also called system-on-chips, or system-on-chips, which include at least one core (processor). With the development of technology and the needs of applications, SoC processors have begun to adopt multi-core heterogeneous architectures. However, in multi-core heterogeneous processor systems, it is necessary to solve the problem of inter-core communication, especially in combination with TAP virtual network cards, to give full play to the performance advantages of multi-core heterogeneous platforms, thereby realizing the functions of the entire SoC processor. Summary of the invention

[0003] The purpose of the present invention is to provide a communication system based on AMP multi-core heterogeneous TAP virtual network card, which can well solve the problem of inter-core communication.

[0004] To achieve the above object, the present invention provides the following technical solutions: The present invention provides a communication system based on an AMP multi-core heterogeneous TAP virtual network card. The communication system comprises a first core, a second core, a shared memory and a mailbox. The first core has a physical network card and a first virtual network card that communicate with each other. The second core has a second virtual network card. The first core directly accesses an external network through the physical network card. The second core communicates with the first virtual network card through the second virtual network card, the shared memory and the mailbox, and then communicates with the physical network card to indirectly access the external network. The first core is an A core, and an rpmsg-char session module that communicates with the first virtual network card is also provided therein. The first virtual network card is a TAP virtual network card. The second core is an M core. The second virtual network card is a VETH virtual network card. The first virtual network card communicates with the shared memory and the mailbox through the rpmsg-char session module and then communicates with the second virtual network card.

[0005] In one embodiment, the first core includes a network device application layer, a network protocol stack interface layer, a network device interface layer, a device driver function layer, and a network device media layer which are connected in series.

[0006] In one embodiment, the network device application layer includes the first virtual network card, which provides an original virtual network card device for user-mode socket access operations to meet the network data transmission requirements of conventional Ethernet devices, and the network data transmission includes network data packet sending and network data packet receiving.

[0007] In one embodiment, the network protocol stack interface layer is below the kernel network protocol stack, and has a universal interface for receiving and sending network data packets, thereby achieving seamless connection between the network device interface layer and the kernel network protocol stack.

[0008] In one implementation, the network device interface layer is mounted on the rpmsg bus on a structure to implement data packet sending and data packet receiving.

[0009] In one embodiment, the device driver function layer is composed of an rpmsg message layer and a virtio virtual IO layer. The rpmsg message layer is responsible for defining the data message format and building a transceiver interface. The virtio virtual IO layer is composed of three parts: virtio, virtqueue, and vring.

[0010] In one embodiment, the network device media layer is composed of the shared memory and the mailbox, the shared memory serves as a payload entity for data stream transmission, and the mailbox implements a notification mechanism when sending and receiving data between the first core and the second core in the form of hardware interrupts.

[0011] In one embodiment, the communication system also includes an rpmsg bus and a virtio bus. The first virtual network card sends and receives data with the second virtual network card via the rpmsg bus, the virtio bus, the shared memory, the virtio bus, and the rpmsg bus in sequence. The first virtual network card transmits notifications of sending and receiving data with the second virtual network card via the mailbox.

[0012] Compared with the prior art, the technical solution of the present invention has the following beneficial effects: The communication system of the TAP virtual network card based on AMP multi-core heterogeneous described in the present invention enables different software components to communicate with each other and work together based on IPC communication with shared memory to achieve the purpose of data sharing, event notification, state synchronization, and system expansion. Based on the virtual network card, efficient parallel computing of network data and real-time network data packet exchange are realized to give full play to the performance advantages of the multi-core heterogeneous platform, thereby realizing the functions of the entire SOC processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0014] Figure 1 A schematic diagram of the structure of a communication system based on AMP multi-core heterogeneous TAP virtual network card provided by the first embodiment of the present invention; Figure 2 for Figure 1 Schematic diagram of the structure inside the first core. DETAILED DESCRIPTION

[0015] The technical solutions in the embodiments of the present invention will be described clearly and completely below. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by those skilled in the art without creative work belong to the scope of protection of the present invention. It should be noted that the description order of the following embodiments is not used as a limitation on the preferred order of the embodiments of the present invention. In the following embodiments, the description of each embodiment has its own emphasis. For the parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0016] See also Figure 1As shown, the first embodiment of the present invention provides a communication system based on AMP multi-core heterogeneous TAP virtual network card, the communication system includes a first core Process1, a second core Process2, a shared memory sharedmemory and a mailbox mailbox, the first core Process1 has a physical network card phy-eth and a first virtual network card tap that communicate with each other, the second core Process2 has a second virtual network card veth, the first core Process1 directly accesses the external network Internet through the physical network card phy-eth, the second core Process2 communicates with the first virtual network card tap through the second virtual network card veth, the shared memory sharedmemory and the mailbox mailbox, and then communicates with the physical network card phy-eth to indirectly access the external network Internet.

[0017] In one embodiment, the communication system also includes an rpmsg bus and a virtio bus. The first virtual network card tap sends and receives data to and from the second virtual network card veth via the rpmsg bus, the virtio bus, the shared memory sharedmemory, the virtio bus, and the rpmsg bus in sequence. The first virtual network card tap transmits notifications of sending and receiving data to and from the second virtual network card veth via the mailbox mailbox.

[0018] In one embodiment, the first core Process1 is an A core, the full name is Cortex-A core, the present invention is referred to as A core in the whole text, in one embodiment, the model is A53, and runs the LINUX system; the second core Process2 is an M core, the full name is Cortex-M core, the present invention is referred to as M core in the whole text, in one embodiment, the model is M7, and runs the RTOS system. The first core Process1 is also provided with an rpmsg-char session module for communicating with the first virtual network card tap, the first virtual network card tap is a TAP virtual network card, the second virtual network card veth is a VETH virtual network card, the first virtual network card tap communicates with the shared memory sharedmemory and the mailbox mailbox through the rpmsg-char session module, and then communicates with the second virtual network card veth. Specifically, the first virtual network card tap sends and receives data Data to and from the second virtual network card veth via the rpmsg-char session module, the rpmsg bus, the virtio bus, the shared memory sharedmemory, the virtio bus, the rpmsg bus in sequence, and the first virtual network card tap transmits notification notify of sending and receiving data to and from the second virtual network card veth via the rpmsg-char session module, the mailbox mailbox.

[0019] In one embodiment, the first core Process1 is a master core (Master), the second core Process2 is a slave core (Slave), the first core Process1 controls the second core Process2 to start and stop running (Remoteproc S / T), and the program file of the second core is stored in TCM or DDR.

[0020] In one embodiment, the first core Process1 includes a network device application layer, a data stream transfer layer, a cdev device interface layer, a cdev device driver function layer, and a network device media layer which are serially connected in sequence.

[0021] In one embodiment, the network device application layer includes the first virtual network card tap, which provides a network virtual Layer 2 switching device for socket access operations and performs conventional network data transmission. The network data transmission includes network data packet sending sendto and network data packet receiving recvfrom, and also implements control of Layer 2 data flow and isolates the Linux kernel network protocol stack.

[0022] In one embodiment, the data flow transfer layer implements the exchange of user space and kernel space data by the application program, implements the read and write detection of multiple IOs through the select mechanism, avoids read and write blocking and improves the running efficiency of the program. In a specific embodiment, the data forwarding trans_app implements the direct access between the Linux kernel network protocol stack and the cdev device driver function layer by accessing the character device / dev / net / tun node, sends or receives the original data packet of the data link layer in the form of data packet sending write and data packet receiving read, and reads and writes the character device of the rpmsg_char session module through the data packet buffer to implement the forwarding and switching of the second layer data flow.

[0023] In one embodiment, the cdev device interface layer implements the application, registration, creation, and deletion functions of the rpmsg_char session module character device in the form of driver_device in the kernel, and simultaneously connects to the message data of the rpmsg message layer through kernel-mode read and write methods (including rpmsg_write and rpmsg_read).

[0024] In one embodiment, the cdev device driver function layer is composed of an rpmsg message layer and a virtio virtual IO layer. The rpmsg message layer is responsible for defining the data message format and building the spmsg_send and rx_callback transceiver interfaces. The virtio virtual IO layer is composed of three parts: virtio, virtqueue, and vring. The virtio virtual IO layer is used for virtio-svq (a queue for registering a buffer for sending) and virtio-rvq (a queue for registering a buffer for receiving), which perfectly solves the problem of how to achieve synchronization and mutually exclusive access to resources when two CPU cores access a shared memory at the same time.

[0025] In one embodiment, the network device media layer is composed of the shared memory sharedmemory and the mailbox mailbox. The shared memory sharedmemory serves as a payload entity for data stream transmission, and the mailbox mailbox implements a notification mechanism when sending and receiving data between the first core Process1 and the second core Process2 in a hardware interrupt manner.

[0026] The present invention perfectly realizes network data interaction with the M core from the network device application layer, data flow transfer layer, cdev device interface layer, cdev device driver function layer to the network device media layer on the A core. In this way, not only can the M core access the resources of the A core in the form of an Ethernet device, but it can also access the external network with the help of the physical network card of the A core. At the same time, the A core can also send and receive data packets in the user state, so as to achieve the purpose of the first virtual network card tap to realize the control of the M core resources and IO control.

[0027] Compared with the prior art, the technical solution of the present invention has the following beneficial effects: The communication system of the TAP virtual network card based on AMP multi-core heterogeneous described in the present invention enables different software components to communicate with each other and work together based on IPC communication with shared memory to achieve the purpose of data sharing, event notification, state synchronization, and system expansion. Based on the virtual network card, efficient parallel computing of network data and real-time network data packet exchange are realized to give full play to the performance advantages of the multi-core heterogeneous platform, thereby realizing the functions of the entire SOC processor.

[0028] The virtual network card technology based on shared memory and virtio of the present invention is used in industrial control in the field of OHT, which not only solves the inter-core network communication problem faced by the multi-core, multi-system, and multi-task scenarios of multi-core heterogeneous AMP processors, but also satisfies the physical network card sharing between multi-cores in the form of master and slave. Based on the virtio bus mechanism, by building a virtual network card of the TAP solution between the A core and the M core, the M core-A core can achieve basic network communication with the help of the virtual network card, which can not only send and receive data packets at the data link layer in the user state, but also the M core can access the A core file system through the NFS mechanism, and of course it can also be connected to the physical network card of the A core through bridging or NAT to achieve access to the external network, which greatly improves the communication efficiency and system performance.

[0029] The present invention solves the network communication problem between the M core and the A core in a multi-core heterogeneous scenario, so that the M core can not only access the file resources of the A core (main core) through the NFS mechanism, but also access the external network with the help of the A core. When the A core linux kernel sends a data packet to the first virtual network card tap, the data packet is stored in a queue until the data forwarding trans_app program opens the tun device for reading, and the data packet is copied to the buffer of the user space, which is equivalent to the data packet being sent directly to the user space. The principle and effect of sending data by write are similar to this. Finally, the exchange of network data with the M core is realized by reading and writing the rpmsg_char session module device. In this way, a network device platform is built for the scenario of frequent transmission of large amounts of data, and the needs of the M core to access external networks and inter-core networks are met.

[0030] The above is only a specific implementation of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims. In addition, the specification uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. The content of this specification should not be understood as a limitation on the present invention.

Claims

1. A communication system based on AMP multi-core heterogeneous TAP virtual network card, characterized in that: The communication system includes a first core, a second core, a shared memory and a mailbox. The first core has a physical network card and a first virtual network card that communicate with each other. The second core has a second virtual network card. The first core directly accesses the external network through the physical network card. The second core communicates with the first virtual network card through the second virtual network card, the shared memory and the mailbox, and then communicates with the physical network card to indirectly access the external network. The first core is an A core, and is also provided with an rpmsg-char session module that communicates with the first virtual network card. The first virtual network card is a TAP virtual network card. The second core is an M core. The second virtual network card is a VETH virtual network card. The first virtual network card communicates with the shared memory and the mailbox through the rpmsg-char session module and then communicates with the second virtual network card.

2. The communication system based on AMP multi-core heterogeneous TAP virtual network card according to claim 1 is characterized in that: The first core is a master core, the second core is a slave core, and the first core controls the second core to start and stop running.

3. The communication system based on AMP multi-core heterogeneous TAP virtual network card according to claim 2 is characterized in that: The first core includes a network device application layer, a data stream transfer layer, a cdev device interface layer, a cdev device driver function layer, and a network device media layer which are connected in series in sequence.

4. The communication system based on AMP multi-core heterogeneous TAP virtual network card according to claim 3 is characterized in that: The network device application layer includes the first virtual network card, which provides a network virtual layer 2 switching device for socket access operations and performs conventional network data transmission. The network data transmission includes network data packet sending and network data packet receiving, and also implements layer 2 data flow control and isolates the Linux kernel network protocol stack.

5. The communication system based on AMP multi-core heterogeneous TAP virtual network card according to claim 3 is characterized in that: The data flow transfer layer implements the exchange of user space and kernel space data by the application program, implements the read and write detection of multiple IOs through the select mechanism, implements the direct access between the Linux kernel network protocol stack and the cdev device driver function layer by accessing the character device node, sends or receives the original data packet of the data link layer in the form of data packet sending and data packet receiving, performs read and write access to the rpmsg_char session module character device through the data packet buffer, and realizes the forwarding and switching of the second layer data flow.

6. The communication system based on AMP multi-core heterogeneous TAP virtual network card according to claim 3, characterized in that: The cdev device interface layer implements the application, registration, creation and deletion functions of the rpmsg_char session module character device in the form of driver_device in the kernel, and simultaneously connects the message data of the rpmsg message layer through the kernel state reading and writing method.

7. The communication system based on AMP multi-core heterogeneous TAP virtual network card according to claim 3, characterized in that: The cdev device driver function layer is composed of an rpmsg message layer and a virtio virtual IO layer. The rpmsg message layer is responsible for defining the data message format and building a transceiver interface. The virtio virtual IO layer is composed of three parts: virtio, virtqueue, and vring.

8. The communication system based on AMP multi-core heterogeneous TAP virtual network card according to claim 3, characterized in that: The network device media layer is composed of the shared memory and the mailbox. The shared memory serves as a load entity for data stream transmission, and the mailbox implements a notification mechanism when sending and receiving data between the first core and the second core in the form of hardware interrupts.

9. The communication system based on AMP multi-core heterogeneous TAP virtual network card according to claim 1, characterized in that: The communication system also includes an rpmsg bus and a virtio bus. The first virtual network card sends and receives data to and from the second virtual network card via the rpmsg bus, the virtio bus, the shared memory, the virtio bus, and the rpmsg bus in sequence. The first virtual network card transmits notifications of sending and receiving data to and from the second virtual network card via the mailbox.