A method, apparatus and medium for controllable EP transmission data
By acquiring the configuration information and memory address of the controllable EP device, direct data transmission and verification are achieved, solving the problems of high latency and difficulty in error location in traditional inter-GPU data transmission, thus improving user experience and CPU efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
- Filing Date
- 2021-12-28
- Publication Date
- 2026-06-26
AI Technical Summary
Traditional data transfer between GPUs requires CPU buffering, resulting in high data latency and low CPU utilization. Furthermore, the packaged EP device cannot be controlled, making it difficult to locate error information and affecting user experience.
By acquiring the configuration information and memory address of the controllable EP device, direct data transmission is achieved, and verification is performed during the transmission process, including time and data consistency checks, to ensure the controllability and accuracy of data transmission.
It enables monitoring of the data transmission process and location of error information, improving user experience and reducing data latency and CPU resource consumption.
Smart Images

Figure CN114443558B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of chip design technology, and in particular to a method, apparatus and medium for controllable EP data transmission. Background Technology
[0002] With the development and application of big data and artificial intelligence, Graphics Processing Units (GPUs) are widely used in high-performance computing and deep learning acceleration. In practical work scenarios, traditional data transmission paths require data buffering through the Central Processing Unit (CPU), and GPUs cannot directly interact with each other. As data volume and computing tasks increase, large amounts of data need to be processed and transmitted. Traditional data transmission paths consume CPU resources and uplink bandwidth, resulting in high data latency and low CPU utilization efficiency.
[0003] To address this issue, a GPU Direct P2P solution was proposed. The GPU directly accesses the target GPU's video memory via PCIe, avoiding copying to the CPU as an intermediary, reducing data interaction latency, and improving PCIe bandwidth utilization efficiency. However, GPU Direct P2P technology is implemented in a packaged form, and its endpoint (EP) device is uncontrollable due to the package. Users can only call the corresponding application program interface (API). If an error occurs during the call and execution, the specific data volume and EP transmission cannot be known, making it impossible to locate the error information and affecting the user experience.
[0004] Therefore, finding a controllable method for EP data transmission is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] The purpose of this invention is to provide a method, apparatus, and medium for controllable EP data transmission, enabling error information location and improving the user experience.
[0006] To solve the above-mentioned technical problems, the present invention provides a method for controllable EP data transmission, comprising:
[0007] Obtain raw test data and configuration information for each controllable EP device;
[0008] Obtain the memory address of each controllable EP device based on the configuration information in order to store the original test data;
[0009] The original test data is sent to the memory address of the first controllable EP device in the controllable EP device group so that the first controllable EP device can write the original test data into the second controllable EP device to obtain new test data;
[0010] Receive new test data sent by the second controllable EP device;
[0011] Verify the new test data.
[0012] Preferably, verifying the new test data includes:
[0013] Determine whether to write new test data within the preset time;
[0014] If no new test data is written within the preset time, the verification result is determined to be a failure.
[0015] If new test data is written within a preset time, then determine whether the new test data is the original test data.
[0016] If the new test data is the same as the original test data, then the verification result is considered successful.
[0017] If the new test data is not the same as the original test data, the verification result is determined to be a failure.
[0018] Preferably, before acquiring test data and configuration information of each controllable EP device, the process further includes:
[0019] Count the number of each controllable EP device and determine if the number is less than two;
[0020] If there are two or more, proceed to the step of obtaining test data and configuration information of each controllable EP device.
[0021] Preferably, after verifying and determining the new test data, the method further includes:
[0022] Uninstall the drivers for each controllable EP device so that the drivers can be installed the next time data is transferred.
[0023] Preferably, after verifying the new test data, the method further includes:
[0024] The output verification results include:
[0025] If the verification result is determined to be a failure, then output a message indicating that the verification result failed.
[0026] If the verification result is successful, a message indicating successful verification will be output.
[0027] Preferably, after verifying the new test data, the method further includes:
[0028] If the verification result is unsuccessful, a prompt message will be output.
[0029] Preferably, the configuration information includes the verification value of the test data, the address information of each controllable EP device, the address offset, the length of the test data, and the control parameters of each controllable EP device.
[0030] To address the aforementioned technical problems, the present invention also provides a device for controllable EP data transmission, comprising:
[0031] The first acquisition module is used to acquire raw test data and configuration information of each controllable EP device;
[0032] The second acquisition module is used to obtain the memory address of each controllable EP device according to the configuration information so as to store the original test data;
[0033] The sending module is used to send the original test data to the memory address of the first controllable EP device in the controllable EP device group so that the first controllable EP device can write the original test data into the second controllable EP device to obtain new test data;
[0034] The receiving module is used to receive new test data sent by the second controllable EP device;
[0035] The verification module is used to verify new test data.
[0036] To solve the above-mentioned technical problems, the present invention provides a device for controllable EP data transmission, comprising:
[0037] Memory, used to store computer programs;
[0038] A processor is used to implement the steps of the above-described method for controlling EP data transmission when executing a computer program.
[0039] To address the aforementioned technical problems, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the controllable EP data transmission method described above.
[0040] This invention provides a method for controlling EP (Electronic Power Adapter) data transmission. The method involves acquiring raw test data and configuration information for each controllable EP device; obtaining the memory address of each controllable EP device based on the configuration information to store the raw test data; sending the raw test data to the memory address of a first controllable EP device in a group of controllable EP devices so that the first controllable EP device can write the raw test data into a second controllable EP device to obtain new test data; receiving new test data sent by the second controllable EP device; and verifying the new test data. This method, by configuring controllable EP devices to transmit data, with the CPU transmitting data to the controllable EP devices and the controllable EP devices transmitting data to each other, finally transmits the data to the CPU. It monitors the data transmission process; if the data transmitted to the CPU fails to be verified, it indicates an error occurred during transmission. The location of the failure information is determined by printing the verification result, improving the user experience.
[0041] In addition, the present invention also provides a device and medium for controllable EP data transmission, which have the same beneficial effects as the above-described method for controllable EP data transmission. Attached Figure Description
[0042] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in 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 effort.
[0043] Figure 1 A flowchart illustrating a method for controllable EP data transmission provided in an embodiment of the present invention;
[0044] Figure 2 A structural diagram of a controllable EP data transmission device provided in an embodiment of the present invention;
[0045] Figure 3 A structural diagram of another controllable EP data transmission device provided in an embodiment of the present invention;
[0046] Figure 4 This is an application diagram illustrating another method for controllable EP data transmission provided in an embodiment of the present invention;
[0047] Figure 5 A flowchart of another method for controllable EP device transmission provided in an embodiment of the present invention. Detailed Implementation
[0048] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0049] The core of this invention is to provide a method, apparatus, and medium for controllable EP data transmission, enabling error information location and improving the user experience.
[0050] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0051] It should be noted that this invention proposes a method for controlling EP (Electronic Component Interconnect) data transmission based on a controllable EP device. This controllable EP device is an autonomously controlled EP device, typically referring to a programmable logic device with a PCIe interface. The PCIe interface is a bus interface, employing a point-to-point serial connection, which can increase the data transmission rate to a very high frequency, thereby providing higher bandwidth. The PCIe interface can be further divided into X1, X4, X8, and X16 depending on the bus width; this invention does not impose a specific limitation. The controllable EP device can be a Field-Programmable Gate Array (FPGA), or other boards or devices with EP functionality that can be debugged by modifying code, such as PowerPC, SOC devices, etc. Controllable EP data transmission can realize high-speed serial computer extended bus standard point-to-point technology (peripheral component interconnect express peer-to-peer, PCIe P2P), that is, one EP device directly accesses another EP device. Its PCIe is a high-speed serial point-to-point dual-channel high-bandwidth transmission, with each connected device allocated its own dedicated channel bandwidth and not sharing the bus bandwidth. By calling a self-designed driver through a user-level program, a controllable EP can be accessed to perform PCIe data transfer. This allows for data transfer from the CPU to the EP, as well as from the EP to the EP, and is applicable to multiple versions of Linux system platforms.
[0052] Figure 1 A flowchart of a method for controllable EP data transmission provided in an embodiment of the present invention is shown below. Figure 1 As shown, the method includes:
[0053] S11: Obtain raw test data and configuration information of each controllable EP device.
[0054] Understandably, controlled EP transmission is performed by calling data from memory as raw test data. Hardware resources are initialized to obtain configuration information for each controlled EP device. This initialization process resets the controlled EP devices, using methods such as hot reset and cold reset. The kernel driver is installed on the controlled EP device, its BAR space is acquired, a data buffer for Direct Memory Access (DMA) transfer is allocated, and the test program for the controlled EP device and the CPU (host side) is downloaded. This includes allocating memory for cached data, writing test data to the controlled EP device via the PCIe bus, and recording execution log information.
[0055] The configuration information includes the checksum of the test data, the address information and address offset of each controllable EP device, the length of the test data, the control parameters of each controllable EP device, and the space occupied by the test data, but these are not specifically limited. It should be noted that the number of controllable EP devices is greater than or equal to two, and they appear in groups. For example, if there are four controllable EP devices (A, B, C, D), the controllable EP device groups can be AB, CD, or groups of two devices each, to facilitate subsequent P2P mode data transmission.
[0056] S12: Obtain the memory address of each controllable EP device according to the configuration information in order to store the original test data.
[0057] The memory address of each controllable EP device is obtained based on its configuration information. This memory address is the address information of the BAR space of the controllable EP device. The BAR register stores the base address of the controllable EP device in the PCIE address space. The mmap function is called to map the address in the BAR address space. When reading or writing data in the PCIE device memory, the PCIE device address can be directly mapped to the memory address. When accessing the memory of the controllable EP device, the corresponding memory address needs to be mapped to the BAR space. In this invention, two BAR spaces are mainly used (EP control area and data buffer area).
[0058] The EP control area corresponds to the BAR0 space in the EP, primarily used for configuring PCIe IP-related registers, as well as configuring and controlling other registers of the controllable EP device. The PCIe IP implements the PCIe protocol (including the transaction layer, data link layer, and physical layer), and is used for calling the controllable EP's runtime program, facilitating data exchange between the EP and the host. The data buffer area corresponds to the BAR2 space in the EP, serving as the data buffer for the controllable EP device. It is used for data exchange between the host and EP ends, as well as P2P data exchange within the EP. It obtains the memory addresses of each controllable EP device to store raw test data during transmission.
[0059] S13: Send the original test data to the memory address of the first controllable EP device in the controllable EP device group so that the first controllable EP device can write the original test data into the second controllable EP device to obtain new test data.
[0060] The raw test data is sent to the memory address of the first controllable EP device in the controllable EP device group. Specifically, the transmission of instructions and acknowledgment status is performed via a serial port. The serial communication interface (usually referring to the COM interface) is an extended interface that uses serial communication, and data is transmitted bit by bit sequentially. The communication line is simple, requiring only one pair of transmission lines to achieve bidirectional communication. This invention is used for communication between the controllable EP device and the host. For large-capacity data transmission, DMA transmission is selected. Before the advent of DMA, data transmission between the CPU and peripherals included program and interrupt transmission methods. The advent of DMA allows direct data exchange with system memory. In this embodiment, the transmission of raw test data is based on DMA transmission.
[0061] The controllable EP device group exists in pairs. First, the raw test data is sent to the first controllable EP device in the group. Specifically, the controllable EP device group includes a first controllable EP device and a second controllable EP device. For example, if the controllable EP device group has A and B, the first controllable EP device can be either A or B. Correspondingly, the second controllable EP device can also be either A or B. When the first controllable EP device is A, then the second controllable EP device is B. The raw test data is sent to the first controllable EP device so that the first controllable EP device can then send the raw test data to the second controllable EP device.
[0062] Specifically, the first controllable EP device sends the original test data to the second controllable EP device via DMA to achieve P2P mode transmission. Before data transmission between the controllable EP device groups, step S12 obtains the memory address of each controllable EP device according to the configuration information. This includes the fact that the sending end of the two controllable EP devices in the controllable device group needs to know the memory address of the receiving end. Thus, the first controllable EP device initiates DMA to directly write the original test data to the memory address of the second controllable EP device via the PCIe bus in P2P mode to obtain new test data. Before each controllable EP device transmits the original test data, it needs to verify the sent original test data. If the verification passes, the transmission proceeds.
[0063] S14: Receive new test data sent by the second controllable EP device.
[0064] The CPU receives new test data sent by the second controllable EP device, which then uploads the new test data via DMA. The new test data is then written into memory.
[0065] S15: Verify the new test data.
[0066] The received new test data is verified. Verification can be achieved by comparing the verification value with the original test data. If they differ, the verification fails. The data is generally a binary sequence, and the sum of these values can be compared with the sum of the original test data. If they differ, the verification fails. Alternatively, verification can be performed by checking if the data is written within a preset time. If not written, the verification fails. The verification method is not specifically limited, as long as the verification result is obtained promptly. Failures are identified through CPU monitoring, allowing for the adjustment of the controllable EP device's control parameters.
[0067] This invention provides a method for controlling EP (Electronic Power Adapter) data transmission. The method involves acquiring raw test data and configuration information for each controllable EP device; obtaining the memory address of each controllable EP device based on the configuration information to store the raw test data; sending the raw test data to the memory address of a first controllable EP device in a group of controllable EP devices so that the first controllable EP device can write the raw test data into a second controllable EP device to obtain new test data; receiving new test data sent by the second controllable EP device; and verifying the new test data. This method, by configuring controllable EP devices to transmit data, with the CPU transmitting data to the controllable EP devices and the controllable EP devices transmitting data to each other, finally transmits the data to the CPU. It monitors the data transmission process; if the data transmitted to the CPU fails to be verified, it indicates an error occurred during transmission. The location of the failure information is determined by printing the verification result, improving the user experience.
[0068] Based on the above embodiments, step S15, verifying the new test data, specifically includes:
[0069] Determine whether to write new test data within the preset time;
[0070] If no new test data is written within the preset time, the verification result is determined to be a failure.
[0071] If new test data is written within a preset time, then determine whether the new test data is the original test data.
[0072] If the new test data is the same as the original test data, then the verification result is considered successful.
[0073] If the new test data is not the same as the original test data, the verification result is determined to be a failure.
[0074] The system checks whether new test data is written within a preset time. If it is not written within the preset time, it indicates a timeout and the verification result fails. If new test data is written within the preset time, the system continues to check whether the new test data is the original test data. If it is the original test data, the verification result is successful; otherwise, the verification result fails.
[0075] It should be noted that this invention verifies new test data based on a preset time. If the newly written test data times out, the verification result fails. This requires fast data transmission with low latency to ensure real-time data reception. Whether the new test data is the original test data is determined by the summation method, or by comparing the numbers of each flag bit in the data. There are no specific limitations; the comparison is performed according to the actual situation. If high data comparison efficiency is required, the summation method is faster and is considered a preferred embodiment.
[0076] This embodiment provides a method for verifying new test data based on a preset time, ensuring real-time data writing and improving verification efficiency.
[0077] Specifically, before obtaining the test data and configuration information of each controllable EP device in step S11, the following steps are also included:
[0078] Count the number of each controllable EP device and determine if the number is less than two;
[0079] If there are two or more, proceed to the step of obtaining test data and configuration information of each controllable EP device.
[0080] The system detects whether there are at least two controllable EP devices on the PCIe bus. This involves counting the number of controllable EP devices and determining whether the number is less than two. If the number is greater than or equal to two, the system proceeds to step S11. If the number is less than two, then data transmission between controllable EP devices in the P2P mode of this invention cannot be achieved. Only data transmission from the Host end to the EP end can be achieved. This invention is based on the ability to achieve both data transmission from the Host end to the EP end and data transmission in the P2P mode between controllable EP devices.
[0081] This embodiment provides a method to count the number of controllable EP devices and determine whether the number is less than two. If the number is greater than or equal to two, the process proceeds to the step of obtaining test data and configuration information of each controllable EP device, providing initialization operations and configuration processing for subsequent data transmission, thereby improving data transmission efficiency.
[0082] Based on the above embodiments, after verifying the new test data in step S15, the method further includes:
[0083] Uninstall the drivers for each controllable EP device so that the drivers can be installed the next time data is transferred.
[0084] After verifying the new test data, the program exits, uninstalls the drivers for each controllable EP device, and releases related hardware and software resources. These drivers refer to the PCIe devices, i.e., the drivers for the controllable EP devices. The drivers initialize the device's hardware resources, acquire the target EP's BAR space, allocate data buffers for DMA transfers, etc., to facilitate user-level program access to the PCIe devices. Each time data is transferred, an initialization operation is required to install the driver.
[0085] This embodiment provides that after verifying new test data, it is necessary to uninstall the drivers of each controllable EP device in order to restore the system state before data transmission, and prevent other applications from accessing the controllable EP device and causing the device to be occupied and unusable due to the driver not being uninstalled, thus affecting the processes of other applications.
[0086] Based on the above embodiments, after verifying the new test data in step S15, the method further includes:
[0087] The output verification results include:
[0088] If the verification result is determined to be a failure, then output a message indicating that the verification result failed.
[0089] If the verification result is successful, a message indicating successful verification will be output.
[0090] It should be noted that when verifying new test data, if the verification fails, a failure message will be output; if the verification succeeds, a success message will be output. The output verification result includes all status information and log information throughout the entire transmission process for user convenience. Based on the verification result, users can locate success and error messages and control the EP device by adjusting its control parameters.
[0091] The output verification results provided in this embodiment make it convenient for users to view various status information, so as to facilitate subsequent control and adjustment and realize the controllability of the controllable EP device.
[0092] Based on the above embodiments, after verifying the new test data in step S15, the method further includes:
[0093] If the verification result is unsuccessful, a prompt message will be output.
[0094] When the verification result fails, a prompt message is output to remind the user of the error information and make adjustments. The failure of the verification result has been described in detail in the above embodiments. There are two reasons for the failure: one is that new test data is not written within the preset time, and the other is that new test data is written within the preset time, but the new test data is different from the original test data. Different prompt messages are set for different failure methods.
[0095] The notification message can be displayed on the page or when an error occurs during program execution. There are no specific limitations; the message can be set according to the actual situation.
[0096] This embodiment provides an error message when the verification result fails, promptly alerting the user to the occurrence of the error. This allows the user to view the failure information and log information in a timely manner, and adjust the control parameters of the controllable EP device accordingly to ensure the correctness of data transmission.
[0097] Based on the above embodiments, the configuration information specifically includes: the verification value of the test data, the address information of each controllable EP device, the address offset, the length of the test data, and the control parameters of each controllable EP device.
[0098] Before transmitting data, it is necessary to calculate the data checksum. The test data is sent to the first controllable EP device in memory-initiated DMA mode. The data checksum, the address information and address offset of the second controllable EP device, the length of the test data and the parameters of the controllable EP device are sent to the first controllable EP device via serial port. Similarly, the data checksum, the address memory requested by the host, the address offset, the length of the test data and the parameters of the controllable EP device are sent to the second controllable EP device via serial port to facilitate subsequent data transmission.
[0099] It should be noted that the configuration information is obtained after the initialization operation, and can also be the space occupied by the original test data, the address space requested by the controllable EP device for the occupied space, etc., without specific limitations. The specific content of the configuration information provided by this invention is only a preferred embodiment.
[0100] The configuration information provided by this invention includes the verification value of the test data, the address information of each controllable EP device, the address offset, the length of the test data, and the control parameters of each controllable EP device. This facilitates the transmission of raw test data, ensures smooth data transmission, and improves data transmission efficiency.
[0101] The foregoing has described in detail various embodiments of the method for controllable EP data transmission. Based on this, the present invention also discloses an apparatus for controllable EP data transmission corresponding to the above method. Figure 2This is a structural diagram of a controllable EP data transmission device provided in an embodiment of the present invention. Figure 2 As shown, the device for controllable EP data transmission includes:
[0102] The first acquisition module 11 is used to acquire raw test data and configuration information of each controllable EP device;
[0103] The second acquisition module 12 is used to acquire the memory address of each controllable EP device according to the configuration information so as to store the original test data;
[0104] The sending module 13 is used to send the original test data to the memory address of the first controllable EP device in the controllable EP device group so that the first controllable EP device can write the original test data into the second controllable EP device to obtain new test data;
[0105] The receiving module 14 is used to receive new test data sent by the second controllable EP device;
[0106] Verification module 15 is used to verify new test data.
[0107] Since the embodiments of the device part correspond to the embodiments described above, please refer to the description of the embodiments of the device part described above for the embodiments of the device part, and will not be repeated here.
[0108] This invention provides a device for controlling EP (Electronic Power Adapter) data transmission. It acquires raw test data and configuration information of each controllable EP device; obtains the memory address of each controllable EP device based on the configuration information to store the raw test data; sends the raw test data to the memory address of a first controllable EP device in a group of controllable EP devices so that the first controllable EP device can write the raw test data into a second controllable EP device to obtain new test data; receives new test data sent by the second controllable EP device; and verifies the new test data. This device monitors the data transmission process by configuring controllable EP devices to transmit data, with the CPU transmitting data to the controllable EP devices, and the controllable EP devices transmitting data to each other, finally transmitting to the CPU. If the data transmitted to the CPU fails to be verified, it indicates an error occurred during transmission. The location of the failure information is determined by printing the verification result, improving the user experience.
[0109] Please refer to Figure 3 A structural diagram of another controllable EP data transmission device provided in an embodiment of the present invention is shown below. Figure 3 As shown, the device includes:
[0110] Memory 21 is used to store computer programs;
[0111] Processor 22, for executing computer programs, steps of a method for implementing controllable EP data transmission.
[0112] The device for controlling EP data transmission provided in this embodiment may include, but is not limited to, smartphones, tablets, laptops, or desktop computers.
[0113] The processor 22 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 22 may be implemented using at least one hardware form selected from Digital Signal Processors (DSPs), FPGAs, and Programmable Logic Arrays (PLAs). The processor 22 may also include a main processor and a coprocessor. The main processor, also known as a CPU, is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 22 may be a GPU, which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 22 may also include an Artificial Intelligence (AI) processor, which handles computational operations related to machine learning.
[0114] The memory 21 may include one or more computer-readable storage media, which may be non-transitory. The memory 21 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 21 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 22, is capable of implementing the relevant steps of the controllable EP data transmission method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 21 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the controllable EP data transmission method, etc.
[0115] In some embodiments, the device for controlling EP data transmission may further include a display screen 23, an input / output interface 24, a communication interface 25, a power supply 26, and a communication bus 27.
[0116] Those skilled in the field can understand, Figure 3 This is a structural diagram of another controllable EP data transmission device provided in an embodiment of the present invention. Figure 3 The structure shown does not constitute a limitation on the device for controllable EP data transmission and may include more or fewer components than shown.
[0117] The processor 22 implements the method for controlling EP data transmission provided in any of the above embodiments by calling instructions stored in the memory 21.
[0118] This invention provides a device for controlling EP (Electronic Power Adapter) data transmission. It acquires raw test data and configuration information of each controllable EP device; obtains the memory address of each controllable EP device based on the configuration information to store the raw test data; sends the raw test data to the memory address of a first controllable EP device in a group of controllable EP devices so that the first controllable EP device can write the raw test data into a second controllable EP device to obtain new test data; receives new test data sent by the second controllable EP device; and verifies the new test data. This device monitors the data transmission process by configuring controllable EP devices to transmit data, with the CPU transmitting data to the controllable EP devices, and the controllable EP devices transmitting data to each other, finally transmitting to the CPU. If the data transmitted to the CPU fails to be verified, it indicates an error occurred during transmission. The location of the failure information is determined by printing the verification result, improving the user experience.
[0119] Furthermore, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by processor 22, implements the steps of the method for controlling EP data transmission as described above.
[0120] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0121] For an introduction to the computer-readable storage medium provided by the present invention, please refer to the above method embodiments. The present invention will not be described in detail here, but it has the same beneficial effects as the above-described method for controllable EP data transmission.
[0122] To enable those skilled in the art to better understand the technical solutions of the present invention, the following detailed description is provided in conjunction with the accompanying drawings and embodiments of the present invention regarding the method, apparatus, and medium for controllable EP data transmission.
[0123] Figure 4 This is an application diagram illustrating another method for controllable EP data transmission provided in an embodiment of the present invention, such as... Figure 4 As shown, the application diagram includes:
[0124] The controllable EP device is connected to a PCIe switch via a PCIe interface. The host (or embedded SOC) acts as a PCIe RC, connected to the PCIe switch. The controllable EP is additionally connected to the host via a serial port for command and data exchange. The CPU transfers data to EP0, initiating DMA mode to write the raw test data into EP0's memory space. Simultaneously, the CPU sends the controllable EP device's configuration information (BAR space address, CRC checksum of the transmitted data, offset address of the data cache, and control parameters of the EP execution program) to the controllable EP device via the serial port. EP0 runs the test program, receives data and commands from the host, completes the verification and inspection of the raw test data, and initiates DMA mode to write the raw test data to the memory address of EP1 via the PCIe bus in P2P mode. EPs access each other; EP1 detects the raw test data written by EP0, obtains new test data, and initiates DMA mode to upload the new test data to the host. The CPU waits for new test data from EP1 and sends the test program results back to the host via serial port. The host displays the program execution process and results, verifies the new test data, and prints the test results. If the program times out and does not receive new test data, the test result fails, the program exits, the driver is uninstalled, and related hardware and software resources are released.
[0125] It should be noted that only one set of controllable EP devices was selected in this embodiment, but it is also applicable to multiple sets of controllable EP devices operating simultaneously.
[0126] The above describes another method for controlling EP data transmission provided by an embodiment of the present invention, which has the same beneficial effects as the method for controlling EP data transmission mentioned above.
[0127] Figure 5 A flowchart of another method for controllable EP device transmission provided by an embodiment of the present invention is shown below. Figure 5 As shown, the flowchart includes:
[0128] S21: Count the number of controllable EP devices;
[0129] S22: Determine whether the number of controllable EP devices is greater than 1. If yes, proceed to step S23; otherwise, end.
[0130] S23: Perform a thermal reset operation on the controllable EP device;
[0131] S24: Install the driver for the controllable EP device;
[0132] S25: Obtain raw test data and download the test data program for the controllable EP device;
[0133] S26: Execute the test program on the Host side so that after EP0 receives the instruction, it can send the original test data to EP1 in P2P mode via DMA to obtain new test data;
[0134] S27: Receive new test data sent by EP1 via DMA;
[0135] S28: Determine whether new test data has been written within the preset time. If yes, proceed to step S29; otherwise, proceed to step S30.
[0136] S29: Determine whether the new test data is the original test data. If yes, proceed to step S31; otherwise, proceed to step S30.
[0137] S30: Verification failed; output the verification result.
[0138] S31: Verification result successful; output verification result.
[0139] S32: Exit the program and release resources.
[0140] It should be noted that only one set of controllable EP devices was selected in this embodiment, but it is also applicable to multiple sets of controllable EP devices operating simultaneously.
[0141] The above describes another method for controlling EP data transmission provided by an embodiment of the present invention, which has the same beneficial effects as the method for controlling EP data transmission mentioned above.
[0142] The foregoing has provided a detailed description of a method, apparatus, and medium for controllable EP data transmission provided by the present invention. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make various improvements and modifications to the present invention without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
[0143] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A method for controllable EP data transmission, characterized in that, include: Obtain raw test data and configuration information for each controllable EP device; The memory addresses of each controllable EP device are obtained according to the configuration information to store the original test data; wherein, the memory address is the address information of the BAR space of the controllable EP device; the EP control area corresponds to the BAR0 space in the EP, and uses the configuration of PCIE IP-related registers, as well as the configuration and control of other registers of the controllable EP device; the PCIE IP implements the PCIE protocol, calls the controllable EP running program, and is used for data interaction between the EP and the Host; the data buffer area corresponds to the BAR2 space in the EP, and is the data buffer area of the controllable EP device, used for data interaction between the Host and the EP end, as well as P2P data interaction on the EP end, to obtain the memory addresses of each controllable EP device to store the original test data during the transmission process; The original test data is sent to the memory address of the first controllable EP device in the controllable EP device group so that the first controllable EP device can write the original test data into the second controllable EP device to obtain new test data; Receive the new test data sent by the second controllable EP device; Verify the new test data; Correspondingly, before obtaining test data and configuration information of each controllable EP device, the following steps are also included: Count the number of each controllable EP device and determine whether the number is less than two; If there are two or more, proceed to the step of obtaining test data and configuration information of each controllable EP device; wherein, the controllable EP devices appear in the form of a group to realize data transmission in P2P mode.
2. The method for controllable EP data transmission according to claim 1, characterized in that, The verification of the new test data includes: Determine whether the new test data should be written within a preset time period; If the new test data is not written within the preset time, the verification result is determined to be a failure. If the new test data is written within the preset time period, then it is determined whether the new test data is the original test data; If the new test data is the same as the original test data, then the verification result is determined to be successful; If the new test data is not the original test data, then the verification result is determined to be a failure.
3. The method for controllable EP data transmission according to claim 1, characterized in that, After verifying the new test data, the following is also included: Uninstall the drivers for each of the controllable EP devices so that the drivers can be installed the next time data is transmitted.
4. The method for controllable EP data transmission according to claim 1, characterized in that, After verifying the new test data, the following is also included: The output verification results include: When the verification result is determined to be a failure, the message indicating that the verification result failed is output. When the verification result is determined to be successful, a message indicating that the verification result is successful is output.
5. The method for controllable EP data transmission according to claim 4, characterized in that, After verifying the new test data, the following is also included: If the verification result is a failure, a prompt message will be output.
6. The method for controllable EP data transmission according to claim 1, characterized in that, The configuration information includes the verification value of the test data, the address information of each controllable EP device, the address offset, the length of the test data, and the control parameters of each controllable EP device.
7. A device for controllable EP data transmission, characterized in that, include: The first acquisition module is used to acquire raw test data and configuration information of each controllable EP device; The second acquisition module is used to acquire the memory address of each controllable EP device according to the configuration information in order to store the original test data; wherein, the memory address is the address information of the BAR space of the controllable EP device; the EP control area corresponds to the BAR0 space in the EP, and uses the configuration of PCIE IP related registers, as well as the configuration and control of other registers of the controllable EP device; the PCIE IP implements the PCIE protocol, calls the controllable EP running program, and is used for data interaction between the EP and the Host; the data buffer area corresponds to the BAR2 space in the EP, and is the data buffer area of the controllable EP device, used for data interaction between the Host and the EP end, as well as P2P data interaction on the EP end, and acquires the memory address of each controllable EP device to store the original test data during the transmission process; The sending module is used to send the original test data to the memory address of the first controllable EP device in the controllable EP device group so that the first controllable EP device can write the original test data into the second controllable EP device to obtain new test data; A receiving module is used to receive the new test data sent by the second controllable EP device; The verification module is used to verify the new test data; Correspondingly, before obtaining test data and configuration information of each controllable EP device, the following steps are also included: Count the number of each controllable EP device and determine whether the number is less than two; If there are two or more, proceed to the step of obtaining test data and configuration information of each controllable EP device; wherein, the controllable EP devices appear in the form of a group to realize data transmission in P2P mode.
8. A device for controllable EP data transmission, characterized in that, include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the method for controlling EP data transmission as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method for controlling EP data transmission as described in any one of claims 1 to 6.