PCIe device, electronic component and electronic device

By judging and storing data blocks on the Host side to the PCIe device side, generating DMA commands, and directly obtaining linked list data blocks, it solves the problem of small data blocks affecting bandwidth in traditional data transfer, and improves the transmission efficiency of the PCIe link.

CN118363901BActive Publication Date: 2024-10-18BEIJING XIANGDIXIAN COMPUTING TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410788350.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-18
Publication Date
2024-10-18
Estimated Expiration
2044-06-18

AI Technical Summary

Technical Problem

In the traditional PCIe data transfer process, the small amount of data blocks causes intermittent data transmission, which affects the transmission bandwidth of the link.

Method used

The Host determines whether the data volume of each data block to be assembled into a linked list data structure exceeds the preset data volume. If it does not exceed the preset data volume, it stores the data block to the PCIe device, generates a DMA command, and notifies the Device through the doorbell mechanism. The Device side directly obtains the linked list data blocks from the storage space to reduce latency overhead.

Benefits of technology

The transmission bandwidth of the PCIe link is increased, and system latency is reduced by storing and processing data blocks at once.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118363901B_ABST
    Figure CN118363901B_ABST
Patent Text Reader

Abstract

The present disclosure provides a PCIe device, an electronic component and an electronic device, which are suitable for transferring data from a host to a device through a PCIe bus. The host determines the data volume of each data block to be assembled into a linked list data structure. If the data volume is less than the predetermined data volume, the linked list corresponding to the data block is stored in the device storage space. A DMA command is generated, bound to a data processing task command and notified to the device through a doorbell. The device receives the doorbell notification, checks whether there is a new data processing task command, executes it if there is, and checks whether the new data processing task command is associated with a DMA command, and sends the DMA command to the DMA if there is. The DMA determines whether it is a linked list type DMA command. If so, the DMA obtains and parses the linked list from the corresponding address of the device's storage space, which can save a certain delay overhead compared to directly accessing the linked list in the host's storage space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a PCIe device, an electronic component, and an electronic device. Background Art

[0002] Direct Memory Access (DMA) is usually used for data transfer between memories. A typical data transfer scenario is to transfer data from the Host to the Device via the PCIe bus. The traditional transfer process is as follows: the Host creates a linked list of data to be transferred and a DMA command in the local storage space, and the Device receives the DMA command and transfers data according to the DMA command. Specifically, the Device reads the data block corresponding to a node in the linked list from the Host's storage space each time, completes the transfer of one data block, and then transfers the next data block. When the amount of data in the data block corresponding to a node in the linked list is small, data transmission will occur intermittently, which will affect the transmission bandwidth of the entire link. Summary of the invention

[0003] The purpose of the present disclosure is to provide a PCIe device, an electronic component and an electronic device to improve the link transmission bandwidth.

[0004] According to one aspect of the present disclosure, an electronic component is provided, which includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program stored in the memory to implement the following processing process: judging whether the data amount of each data block to be assembled into a linked list data structure exceeds a preset data amount; when the data amount of each data block does not exceed the preset data amount, storing the linked list corresponding to each data block in the storage space of the PCIe device end; generating a DMA command, the DMA command carrying command type information and the storage address of the linked list on the PCIe device end, the command type information being used to indicate whether the command type of the DMA command is a linked list command type; associating the DMA command with a data processing task command; writing the data processing task command into the ring buffer on the PCIe device end, and sending a command notification to the PCIe device through a doorbell mechanism.

[0005] Optionally, before generating a DMA command, the processor executes a computer program stored in the memory to implement the following processing steps: determining whether the length of the linked list corresponding to each data block exceeds a preset linked list length. When the amount of data of each data block does not exceed the preset data amount, storing the linked list corresponding to each data block in the storage space of the PCIe device side includes: when the amount of data of each data block does not exceed the preset data amount and the length of the linked list does not exceed the preset linked list length, establishing the linked list in the storage space of the PCIe device side; when the amount of data of each data block does not exceed the preset data amount but the length of the linked list exceeds the preset linked list length, establishing the linked list in the storage space of the local side, and copying the linked list to the storage space of the PCIe device side through the synchronous DMA of the local side.

[0006] Optionally, the preset data volume is 1K, and the preset linked list length is 16 nodes.

[0007] Optionally, when the data amount of each data block does not exceed a preset data amount, the processor executes a computer program stored in the memory to implement the following processing steps: embedding each data block into a corresponding node in the linked list.

[0008] According to another aspect of the present disclosure, the present disclosure provides a PCIe device, which includes a memory, a processor and a DMA, the memory storing a computer program, and the processor executing the computer program stored in the memory to implement the following process: after receiving a command notification sent through a doorbell mechanism, searching whether there is a new data processing task command in the ring buffer; if a new data processing task command is found, judging whether the data processing task command is associated with a DMA command; if the data processing task command is associated with a DMA command, sending the DMA command to the DMA; the DMA is configured to: judge whether the command type of the DMA command is a linked list command type according to the command type information carried in the DMA command; if the command type of the DMA command is a linked list command type, obtaining the linked list according to the storage address of the linked list carried by the DMA command at the PCIe device end, and obtaining each data block assembled into a linked list data structure according to the linked list.

[0009] Optionally, in order to obtain the data blocks assembled into the linked list data structure according to the linked list, the DMA is configured to: obtain the data blocks assembled into the linked list data structure from the nodes of the linked list.

[0010] Optionally, the data volume of each data block does not exceed a preset data volume, and the linked list length of the linked list does not exceed a preset linked list length.

[0011] Optionally, the preset data volume is 1K, and the preset linked list length is 16 nodes.

[0012] According to another aspect of the present disclosure, an electronic component is provided, comprising the PCIe device described in any one of the above embodiments.

[0013] According to another aspect of the present disclosure, an electronic device is provided, comprising the electronic component described in any one of the above embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 A schematic diagram of a data transmission process provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0015] Before introducing the embodiments of the present disclosure, it should be noted that:

[0016] Some embodiments of the present disclosure are described as processing flows. Although the various operation steps of the flow may be given sequential step numbers, the operation steps therein may be implemented in parallel, concurrently or simultaneously.

[0017] In the embodiments of the present disclosure, the terms "first", "second", etc. may be used to describe various features, but these features should not be limited by these terms. These terms are used only to distinguish one feature from another.

[0018] The term “and / or” may be used in embodiments of the present disclosure. “And / or” includes any and all combinations of one or more of the associated features listed.

[0019] It should be understood that when describing the connection or communication relationship between two components, unless it is explicitly stated that the two components are directly connected or directly communicating, the connection or communication between the two components can be understood as direct connection or communication, or as indirect connection or communication through an intermediate component.

[0020] In order to make the technical solutions and advantages of the embodiments of the present disclosure more clearly understood, the exemplary embodiments of the present disclosure are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0021] The purpose of the present disclosure is to provide a data transfer solution, which is suitable for transferring data from the Host to the Device through the PCIe bus, aiming to improve the transmission bandwidth of the link. Specifically, the Host determines the data volume of each data block to be assembled into a linked list data structure during the process of assembling the linked list (LinkList). If the data volume of each data block is less than the predetermined data volume, the linked list corresponding to the data block is stored in the storage space of the Device. Generate a DMA command, bind the DMA command to the data processing task command and notify the Device through the doorbell. When the Device receives the doorbell notification from the Host, it will check whether there is a new data processing task command. If so, it will execute the new data processing task command and check whether the new data processing task command is associated with a DMA command. If so, the DMA command is sent to the DMA. The DMA determines whether it is a linked list type DMA command. If so, the DMA will directly obtain and parse the linked list from the corresponding address of the storage space of the Device, which can save a certain delay (Latterncy) overhead compared to directly accessing the linked list in the storage space of the Host.

[0022] The embodiment of the present disclosure provides an electronic component, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program stored in the memory to implement the following processing process: determining whether the data amount of each data block to be assembled into a linked list data structure exceeds a preset data amount; when the data amount of each data block does not exceed the preset data amount, storing the linked list corresponding to each data block in the storage space of a PCIe device end; generating a DMA command, wherein the DMA command carries command type information and a storage address of the linked list on the PCIe device end, and the command type information is used to indicate whether the command type of the DMA command is a linked list command type; associating the DMA command with a data processing task command; writing the data processing task command into a ring buffer on the PCIe device end, and sending a command notification to the PCIe device through a doorbell mechanism.

[0023] In the embodiments of the present disclosure, there are multiple ways to associate a DMA command with a data processing task command. For example, identification information of the DMA command may be carried in the data processing task command, or the DMA command may be embedded in the data processing task command.

[0024] In the disclosed embodiment, there are also multiple implementations of storing the linked list in the storage space of the PCIe device. In a feasible implementation, a linked list is created in the storage space of the local end, and then the linked list is copied to the storage space of the PCIe device. In another feasible implementation, a linked list is created in the storage space of the local end, and then the synchronous DMA of the local end is called to copy the linked list to the storage space of the PCIe device. In another feasible implementation, a linked list is created in the storage space of the PCIe device. In another feasible implementation, before generating a DMA command, it is determined whether the linked list length of the linked list corresponding to each data block exceeds the preset linked list length; when the data amount of each data block does not exceed the preset data amount and the linked list length does not exceed the preset linked list length, a linked list is established in the storage space of the PCIe device; when the data amount of each data block does not exceed the preset data amount but the linked list length exceeds the preset linked list length, a linked list is established in the storage space of the local end, and the linked list is copied to the storage space of the PCIe device through the synchronous DMA of the local end. In another feasible implementation method, before generating a DMA command, determine whether the linked list length corresponding to each data block exceeds the preset linked list length; when the data amount of each data block does not exceed the preset data amount and the linked list length does not exceed the preset linked list length, establish a linked list in the local storage space and copy the linked list to the storage space of the PCIe device end; when the data amount of each data block does not exceed the preset data amount but the linked list length exceeds the preset linked list length, establish a linked list in the local storage space and copy the linked list to the storage space of the PCIe device end through the synchronous DMA of the local end.

[0025] The local storage space may be, but is not limited to, a memory. The storage space on the PCIe device may be, but is not limited to, a storage space on a PCIe device. The PCIe device does not need to go through a PCIe bus to access the storage space, so the system delay is small.

[0026] The embodiment of the present disclosure does not limit the specific value of the preset data volume, nor does it limit the specific value of the preset linked list length. In actual applications, it can be determined according to actual conditions and needs. As an example but not limitation, the preset data volume is 1K and the preset linked list length is 16 nodes.

[0027] When the data volume of each data block does not exceed the preset data volume, the data block can also be carried in the linked list, so that all data blocks can be stored in the storage space of the PCIe device at one time to further reduce system latency. That is, each data block is embedded in the corresponding node in the linked list.

[0028] The electronic component provided in the above-mentioned embodiment of the present disclosure is Host, and its product form can be but is not limited to a mainboard including a CPU and a memory.

[0029] Accordingly, the present disclosure provides a PCIe device, which includes a memory, a processor and a DMA, the memory stores a computer program, and the processor executes the computer program stored in the memory to implement the following process: after receiving a command notification sent through a doorbell mechanism, search whether there is a new data processing task command in the ring buffer; if a new data processing task command is found, determine whether the data processing task command is associated with a DMA command; if the data processing task command is associated with a DMA command, send the DMA command to the DMA; the DMA is configured to: determine whether the command type of the DMA command is a linked list command type according to the command type information carried in the DMA command; if the command type of the DMA command is a linked list command type, obtain the linked list according to the storage address of the linked list carried by the DMA command at the PCIe device end, and obtain each data block assembled into a linked list data structure according to the linked list.

[0030] The data volume of each of the above data blocks does not exceed the preset data volume, and the linked list length of the linked list does not exceed the preset linked list length.

[0031] As described above, if each data block is carried in a linked list, then the DMA obtains each data block assembled into a linked list data structure from each node of the linked list.

[0032] As an example but not limitation, the preset data volume is 1K and the preset linked list length is 16 nodes.

[0033] The above-mentioned PCIe device is the Device end.

[0034] The embodiment of the present disclosure also provides an electronic component, including the PCIe device described in any of the above embodiments. The product form of the electronic component can be, but is not limited to, a graphics card.

[0035] The embodiment of the present disclosure also provides an electronic device. In one implementation, the electronic device may include an electronic component as a host end. In another implementation, the electronic device may include a PCIe device as a device end (or include an electronic component of the device). In yet another implementation, the electronic device includes both an electronic component of a host end and a PCIe device as a device end (or include an electronic component of the device).

[0036] The technical solution provided by the embodiment of the present disclosure utilizes synchronous DMA or the host-side CPU to store the linked list in the storage space of the device side at one time, thereby saving the long lattercy overhead caused by DMA directly accessing the linked list in the host-side storage space and improving efficiency.

[0037] The following uses data transfer in a graphics processing process as an example to describe in detail the technical solution provided by the embodiments of the present disclosure.

[0038] The specific implementation process is as follows Figure 1 As shown, including:

[0039] Step S101: The client driver of the host generates source data such as Render / Compute, and sends the source data to the KM layer.

[0040] In this embodiment, the KM layer is a Kernel Driver.

[0041] Step S102: After receiving the source data, the KM layer at the Host side determines whether the data volume of each data block in the source data exceeds 1K, and whether the length of the linked list to be generated exceeds 16 nodes.

[0042] The length of the linked list can be determined according to the number of data blocks of the source data. Assuming that the source data includes 10 data blocks, the length of the linked list is 10 nodes, and each node corresponds to a data block.

[0043] The linked list is composed of a number of linked list nodes, each of which corresponds to a data block. The linked list node includes a descriptor of the corresponding data block and also includes index information of the next node.

[0044] If the data volume of each data block is less than 1K and the length of the linked list does not exceed 16 nodes, step S103 is executed, and the KM layer at the Host end establishes a linked list in the storage space at the Device end.

[0045] If the data volume of each data block is less than 1K and the length of the linked list is greater than 16 nodes, execute step S104, the KM layer on the Host side creates a linked list in the storage space on the Host side, and then copies the linked list to the storage space on the Device side through synchronous DMA.

[0046] The present disclosure does not limit the process of establishing the linked list, and it can be implemented with reference to the existing implementation method. In the embodiment of the present disclosure, when the data volume of each data block is less than 1K, the data block can be optionally embedded in the linked list. That is, the descriptor of the data block of each node is the data block itself.

[0047] Step S105: The KM layer at the Host side generates a DMA command and embeds the DMA command into the corresponding graphics rendering command. The DMA command carries the storage address of the linked list at the Device side and the DMA command type.

[0048] Step S106: After the KM layer on the Host side completes the assembly of the graphics rendering command, it writes the graphics rendering command into the ring buffer on the Device side and notifies the CPU on the Device side through the Doorbell command.

[0049] Step S107: After receiving the doorbell command of the graphics rendering command, the CPU of the device checks whether there is a new command in the ring buffer.

[0050] In this embodiment, the read pointer and the write pointer may be compared to determine whether there is a new command.

[0051] If the data volume of a data block is not less than 1K, the KM layer of the Host side creates a linked list in the storage space of the Host side. The subsequent processing process is the same as the prior art and will not be repeated here.

[0052] If there is a new command to be processed, step S108 is executed, the CPU at the device end reads the new command for processing, and if a DMA command is embedded in the command, the DMA command is sent to the DMA at the device end.

[0053] Step S109, the DMA on the Device side determines that the DMA command is a linked list type DMA command based on the command type in the DMA command, and then reads a linked list node from the storage space on the Device side according to the linked list storage address carried in the DMA command, and reads the next node of the linked list after parsing and processing, until all nodes of the linked list are processed.

[0054] Processing the node may include: reading a corresponding data block according to the descriptor.

[0055] After processing a command in the ring buffer, the CPU on the device side will notify the KICK GPU that there are new commands to be processed. In addition, the CPU on the device side will cyclically determine whether there are new commands in the ring buffer to be processed until all the commands in the ring buffer are processed.

[0056] Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is also intended to include these modifications and variations.

Claims

1. An electronic component, as a host end, comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program stored in the memory to implement the following processing: Determine whether the data amount of each data block to be assembled into the linked list data structure exceeds a preset data amount; Determine whether the length of the linked list corresponding to each data block exceeds a preset linked list length; When the data amount of each data block does not exceed the preset data amount and the length of the linked list does not exceed the preset linked list length, the linked list is established in the storage space of the PCIe device end; when the data amount of each data block does not exceed the preset data amount but the length of the linked list exceeds the preset linked list length, the linked list is established in the local storage space, and the linked list is copied to the storage space of the PCIe device end through the synchronous DMA of the local end; Generate a DMA command, wherein the DMA command carries command type information and a storage address of the linked list at the PCIe device end, wherein the command type information is used to indicate whether the command type of the DMA command is a linked list command type; Associating the DMA command with a data processing task command; The data processing task command is written into the ring buffer of the PCIe device end, and a command notification is sent to the PCIe device through a doorbell mechanism. 2 . The electronic component according to claim 1 , wherein the preset data volume is 1K, and the preset linked list length is 16 nodes.

3. According to the electronic component of claim 1, when the data amount of each data block does not exceed the preset data amount, the processor executes the computer program stored in the memory to implement the following processing steps: embedding each data block into a corresponding node in the linked list.

4. A PCIe device, comprising a memory, a processor and a DMA, wherein the memory stores a computer program, and the processor executes the computer program stored in the memory to implement the following process: After receiving the command notification sent through the doorbell mechanism, check whether there is a new data processing task command in the ring buffer; If a new data processing task command is found, determining whether the data processing task command is associated with a DMA command; If a DMA command is associated, sending the DMA command to the DMA; The DMA is configured as: Determining whether the command type of the DMA command is a linked list command type according to the command type information carried in the DMA command; If the command type of the DMA command is a linked list command type, the linked list is obtained according to the storage address of the linked list carried by the DMA command on the PCIe device side, and the various data blocks assembled into a linked list data structure are obtained according to the linked list, the data amount of each data block does not exceed the preset data amount, and the linked list length of the linked list does not exceed the preset linked list length.

5. The PCIe device according to claim 4, in order to obtain the data blocks assembled into the linked list data structure according to the linked list, the DMA is configured as follows: Each data block assembled into a linked list data structure is obtained from each node of the linked list.

6. The PCIe device according to claim 4, wherein the preset data volume is 1K, and the preset linked list length is 16 nodes.

7. An electronic component comprising the PCIe device according to any one of claims 4 to 6.

8. An electronic device, comprising the electronic component according to any one of claims 1 to 3 and / or the electronic component according to claim 7.

Citation Information

Patent Citations

  • Data processing method and device, electronic equipment and storage medium

    CN114428589A

  • Efficient PCIE DMA data transmission method based on FPGA

    CN115729870A