CN-121705219-B - Data transmission device, method, chip, system, storage medium and program product
Abstract
The present application relates to a data transmission device, a method, a chip, a system, a storage medium and a program product. The device comprises a routing module, an SOC module, a DMA module, a SOC module and a DMA module, wherein the routing module is used for receiving and analyzing a notification sent by a host, obtaining notification information and routing the notification information to the SOC module, the SOC module is used for generating a first command descriptor according to the notification information, the DMA module is used for reading target data from the host according to the first command descriptor and writing the target data into the SOC module according to the first command descriptor, the SOC module is also used for responding to the target data and writing the target data into the SOC module, the DMA module is also used for reading the second command descriptor and sending the second command descriptor to the host so as to inform the host that the target data are written into the first cache unit. The flexibility of the data transmission device can be improved by adopting the device.
Inventors
- ZHANG XUELI
- WANG JIANDONG
- MA QIANG
Assignees
- 深圳云豹智能股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260213
Claims (14)
- 1. A data transmission device in communication with a host, the device comprising: The routing module is used for receiving and analyzing the notification sent by the host, obtaining notification information and routing the notification information to the SOC module; the SOC module is used for generating a first command descriptor according to the notification information; the DMA module is used for reading the first command descriptor, reading target data from the host according to the first command descriptor, and writing the target data into the SOC module according to the first command descriptor; The SOC module is further used for responding to the target data and writing the target data into the SOC module to generate a second command descriptor; The DMA module is also used for reading the second command descriptor and sending the second command descriptor to the host so as to inform the host that the target data is written into the SOC module.
- 2. The apparatus of claim 1, wherein the notification information includes a device identifier of the target device, the data transmission apparatus further includes VIRTIO backend hardware devices and an IMU, and the routing module is specifically configured to: And routing the notification information to the SOC module according to a routing table when the equipment identifier is a first preset value, routing the notification information to the VIRTIO back-end hardware equipment according to the routing table when the equipment identifier is a second preset value, and routing the notification information to the IMU according to the routing table when the equipment identifier is a third preset value.
- 3. The apparatus of claim 2, wherein the DMA module is further configured to generate a third command descriptor after writing the target data to the SOC module; the SOC module is further configured to read and parse the third command descriptor, release a corresponding cache space according to the parsing result, and generate the second command descriptor.
- 4. The apparatus of claim 3, wherein the SOC module comprises a first cache unit, a third cache unit, and a target data cache unit; the first command descriptor at least comprises the following information, namely a command identifier corresponding to the first command descriptor, a host memory address, a host memory length, a memory address of the target data cache unit and a memory length of the target data cache unit; The DMA module is also used for reading the first command descriptor from the first cache unit, reading descriptor table information according to the first command descriptor, reading the target data from the host according to the descriptor table information, writing the target data into the target data cache unit, generating a third command descriptor, and writing the third command descriptor into the third cache unit.
- 5. The apparatus according to any one of claims 1 to 4, wherein the SOC module includes a notification information receiving unit, a first record table buffering unit, a second record table buffering unit, and a VBE unit; the first record table caching unit is used for caching a first record table, and the first record table is cached with a corresponding relation between a function identifier corresponding to notification information, a queue identifier and a global queue number; the second record table caching unit is used for caching a second record table, the second record table is cached with the corresponding relation between the global queue number and a corresponding target index, and the target index comprises an available ring table index and/or a descriptor table index; the notification information receiving unit is used for receiving notification information routed to the SOC module, inquiring the first record table according to the function identification and the queue identification in the notification information to obtain a corresponding global queue number, and updating a target index corresponding to the inquired global queue number in the second record table by using the target index in the notification information; the VBE unit is used for polling the second record table in the second record table caching unit, obtaining the target index, and generating the first command descriptor according to the target index.
- 6. A data transmission method, applied to a data transmission device, where the data transmission device communicates with a host, the data transmission device includes a routing module, an SOC module, and a DMA module, the method includes: the routing module receives and analyzes the notification sent by the host, obtains notification information, and routes the notification information to the SOC module; The SOC module generates a first command descriptor according to the notification information; The DMA module reads the first command descriptor, reads target data from the host according to the first command descriptor, and writes the target data into the SOC module according to the first command descriptor; the SOC module responds to the target data and writes the target data into the SOC module to generate a second command descriptor; the DMA module reads the second command descriptor and sends the second command descriptor to the host to inform the host that the target data has been written into the SOC module.
- 7. The method of claim 6, wherein the notification information includes a device identification of the target device, wherein the data transmission apparatus further includes VIRTIO backend hardware devices and an IMU, wherein the routing the notification information to the SOC module includes: the routing module routes the notification information to the SOC module according to a routing table under the condition that the equipment identifier is a first preset value; the routing module routes the notification information to the VIRTIO back-end hardware device according to the routing table when the device identifier is a second preset value; And the routing module routes the notification information to the IMU according to the routing table under the condition that the equipment identifier is a third preset value.
- 8. The method of claim 7, wherein the method further comprises: The DMA module generates a third command descriptor through the DMA module after writing the target data into the SOC module; And the SOC module reads and analyzes the third command descriptor, releases the corresponding cache space according to the analysis result, and generates the second command descriptor.
- 9. The method of claim 8, wherein the SOC module comprises a first cache unit, a third cache unit and a target data cache unit, wherein the first command descriptor at least comprises a command identifier, a host memory address, a host memory length, a memory address of the target data cache unit and a memory length of the target data cache unit corresponding to the first command descriptor; The method further comprises the steps of: the DMA module reads the first command descriptor from the first cache unit; the DMA module reads descriptor table information according to the first command descriptor; the DMA module reads the target data from the host according to the descriptor table information; writing the target data into the target data caching unit; The DMA module generates a third command descriptor and writes the third command descriptor into a third cache unit.
- 10. The method according to any one of claims 6-9, wherein the SOC module includes a notification information receiving unit, a first record table buffering unit, a second record table buffering unit and a VBE unit, the first record table buffering unit is configured to buffer a first record table, where the first record table is buffered with a corresponding relation between a function identifier corresponding to the notification information, a queue identifier and a global queue number, the second record table buffering unit is configured to buffer a second record table, where the second record table is buffered with a corresponding relation between the global queue number and a corresponding target index, and the target index includes an available ring table index and/or a descriptor table index; The notification information receiving unit receives notification information routed to the SOC module, queries the first record table according to the function identifier and the queue identifier in the notification information to obtain a corresponding global queue number, and updates a target index corresponding to the queried global queue number in the second record table by using the target index in the notification information; And the VBE unit polls a second record table in the second record table caching unit to obtain the target index, and generates the first command descriptor according to the target index.
- 11. A chip comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 6 to 10 when the computer program is executed.
- 12. A VIRTIO system comprising the chip and host of claim 11.
- 13. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 6 to 10.
- 14. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the method of any of claims 6 to 10.
Description
Data transmission device, method, chip, system, storage medium and program product Technical Field The present application relates to the field of chip technologies, and in particular, to a data transmission device, a data transmission method, a data transmission chip, a data transmission system, a data transmission medium, and a data transmission program. Background In order to enable multiple guest operating systems to run on the same hardware independent of the host operating system, cloud computing virtualization technology may be implemented by adding a virtualization layer virtual machine monitor (Virtual Machine Monitor, VMM). Machine emulation and virtualization software (Machine Emulator and Virtualizer, QEMU) provides a fully virtualized environment as a VMM. In a fully virtualized environment, the guest operating system does not perceive itself to be a virtual machine nor does the guest operating system need to be modified. However, since all operations in the fully virtualized environment require software simulation, frequent trapping occurs during Device access, which brings about serious performance problems, a virtualized I/O Device (VIRTIO) technology for paravirtualization has developed. In the related art VIRTIO is a generic paravirtualized framework, and the VMM emulates a series of virtualized devices through VIRTIO. In order to improve performance, VIRTIO technology is continuously evolving, and a hardware offloading technology of VIRTIO data plane is presented, that is, the data plane is implemented by hardware logic, and a virtual machine is directly connected with underlying hardware. Specifically, the hardware portion virtualizes a Single PCIe controller into multiple Virtual Function (VF) devices through Single Root input/output virtualization (SRIOV) technology. The functions of the VIRTIO back-end devices are implemented in each VF device using hardware logic, and the VF devices are passed through to the guest virtual machine. However, for VIRTIO backend devices, the data plane, when implemented by hardware logic, can achieve very high performance, but once designed, the logic behavior cannot be altered at will, resulting in poor flexibility for VIRTIO backend devices. Disclosure of Invention In view of the foregoing, it is desirable to provide a data transmission device, a method, a chip, a system, a storage medium, and a program product that can improve flexibility of a data transmission apparatus. In a first aspect, the present application provides a data transmission apparatus in communication with a host, the apparatus comprising: The routing module is used for receiving and analyzing the notification sent by the host, obtaining notification information and routing the notification information to the SOC module; the SOC module is used for generating a first command descriptor according to the notification information; the DMA module is used for reading the first command descriptor, reading target data from the host according to the first command descriptor, and writing the target data into the SOC module according to the first command descriptor; The SOC module is further used for responding to the target data and writing the target data into the SOC module to generate a second command descriptor; The DMA module is also used for reading the second command descriptor and sending the second command descriptor to the host so as to inform the host that the target data is written into the SOC module. In one embodiment, the notification information includes a device identifier of the target device, the data transmission apparatus further includes VIRTIO backend hardware devices and an IMU, and the routing module is specifically configured to: And routing the notification information to the SOC module according to a routing table when the equipment identifier is a first preset value, routing the notification information to the VIRTIO back-end hardware equipment according to the routing table when the equipment identifier is a second preset value, and routing the notification information to the IMU according to the routing table when the equipment identifier is a third preset value. In one embodiment, the DMA module is further configured to generate a third command descriptor after writing the target data to the SOC module; the SOC module is further configured to read and parse the third command descriptor, release a corresponding cache space according to the parsing result, and generate the second command descriptor. In one embodiment, the SOC module includes a first cache unit, a third cache unit and a target data cache unit, The first command descriptor at least comprises the following information, namely a command identifier corresponding to the first command descriptor, a host memory address, a host memory length, a memory address of the target data cache unit and a memory length of the target data cache unit; The DMA module is also used for reading the first command descriptor