A method, device, equipment and system for data transmission
By using only the DMA controller of the storage medium for data transmission in the converged infrastructure, the problems of high data transmission delay and low efficiency in the existing technology are solved, and more efficient data transmission is achieved.
Patent Information
- Application Number
- CN202010599638.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2017-01-26
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2037-01-26
AI Technical Summary
When transmitting data in the existing converged infrastructure, two DMA moves are required, resulting in high latency and low transmission efficiency.
Obtain the first address and operation type of the storage medium through the SoC, convert it into the memory address managed by the SoC, and only use the DMA controller of the storage medium for data transmission, avoiding the participation of the SoC's DMA controller, and realizing a DMA move.
It improves data transmission efficiency, reduces latency, and improves SoC’s computing resource utilization.
Smart Images

Figure CN111897751B_ABST
Abstract
Description
[0001] This application is a divisional application entitled “A method, device, equipment and system for data transmission”, with patent application number 201710061693.9 and application date January 26, 2017. Technical Field
[0002] Embodiments of the present invention relate to the field of storage, and in particular to a method, apparatus, device and system for data transmission. Background Art
[0003] With the emergence of new applications such as cloud computing, big data, distributed systems, machine learning, cognitive computing, augmented reality (AR), and virtual reality (VR), the demand for computing systems is increasing. Various new types of converged infrastructure are constantly emerging, which puts higher requirements on the performance and data interaction of converged infrastructure. Converged infrastructure refers to the basic elements of data centers such as servers, storage devices, network devices, and virtualization software in a pre-integrated manner to provide users with computing resources (such as CPU, memory), storage resources (such as disks), and network resources (such as network cards) to meet users' business needs.
[0004] At present, the data interaction mode of converged infrastructure adopts direct memory access (DMA) transmission mode, such as Figure 1 As shown, in Figure 1 In the data transmission scheme shown in the figure, take the case where the processor needs to write the data to be written into the storage medium as an example: first, the processor sends a control instruction to the system on chip (SoC) to instruct the SoC to move the data to be written to the SoC; then, the DMA controller of the SoC moves the data to be written from the processor's double data rate synchronous dynamic random access memory (DDR) to the DDR of the SoC according to the control instruction; secondly, the SoC sends a write data instruction to the storage medium, wherein, Figure 1 The storage medium shown in the figure can be a non-volatile memory express (NVMe) SSD, and then the DMA controller of the SSD moves the data to be written from the DDR of the SoC to the storage medium (such as the SSD). The process of the processor reading the data to be read from the storage medium is similar to the process of the processor writing the data to be written to the storage medium, and one read operation process also requires two DMA processes.
[0005] like Figure 1In the described scheme, during the data transmission process between the processor and the storage medium, two DMA moves are required. Therefore, when there are multiple storage media, the SoC needs to process the DMA relocation requests of multiple storage media at the same time, resulting in more CPU computing resources and storage (Memory) resources of the SoC being consumed to participate in the DMA move, resulting in low data transmission efficiency and high latency. Summary of the invention
[0006] The present application provides a method, apparatus, device and system for data transmission, which are used to solve the problem of high latency and low transmission efficiency caused by two DMA moves of SoC and storage medium for one data transmission in the existing converged infrastructure data interaction scenario.
[0007] In order to achieve the above objectives, this application adopts the following technical solutions:
[0008] In a first aspect, the present application provides a method for data transmission, which is applied to a storage system, wherein the storage system includes a processor, a system on chip SoC and a storage medium, wherein the processor, the SoC and the storage medium communicate through an extended peripheral component interconnect high-speed PCIe bus, and the storage medium includes a direct memory access DMA controller, and the method includes: the SoC obtains a first request message including a first address of a storage medium where data to be operated is located and an operation type, wherein the operation type includes a read operation or a write operation, and the first address is an address allocated by the processor to the storage medium in the memory address managed by the processor; the SoC determines a second address allocated by the storage medium in the memory address managed by the SoC according to the first address according to a preset address mapping relationship; the SoC then sends a first control instruction to the DMA controller of the storage medium, and the first control instruction is used to instruct the DMA controller to obtain a second request message carrying a second address and an operation type; when the operation type is a read operation, the SoC receives the first data sent by the DMA controller, and the first data is obtained by the DMA controller according to the second address; then, the SoC sends the first data to the processor; when the operation type is a write operation, the SoC receives the second data sent by the processor, and sends the second data to the DMA controller, triggering the DMA controller to write the second data into the storage medium according to the second address.
[0009] The present application provides a method for data transmission, in which the SoC obtains a first request message from the processor through a first control instruction, converts the first address carried in the first request message into a second address, and then sends a second request message for obtaining a second control instruction to the target storage medium, wherein the second control instruction carries a second address and an operation type. Therefore, in the process of transmitting the target data from the processor to the target storage medium, the SoC is responsible for converting the first address into the second address, and forwarding the first data to be read or the second data to be written between the processor and the storage medium. The data transmission process only requires the participation of the DMA controller of the storage medium, and does not require the participation of the DMA controller of the SoC. Therefore, the embodiment of the present invention only moves the first data or the second data between the processor and the storage medium through the DMA controller of the storage medium, which can avoid the problems of high delay and low transmission efficiency caused by the need to forward through the DMA controller of the SoC during data transmission.
[0010] In a possible implementation of the first aspect, before the SoC obtains the first request message, the method provided in the present application also includes: the SoC receives a second control instruction sent by the processor, the second control instruction carries an identifier for uniquely identifying the first request message; and obtains the first request message according to the identifier of the first request message.
[0011] In a possible implementation of the first aspect, the SoC determines the second address according to the first address, including: acquiring the second address corresponding to the first address from a preset address mapping table according to the first address, wherein the preset address mapping table includes a mapping relationship between an address allocated to the storage medium in a memory address managed by the processor and an address allocated to the storage medium in a memory address managed by the SoC; and determining the address corresponding to the first address as the second address of the storage medium. .
[0012] In a possible implementation of the first aspect, when the operation type is a read operation, the SoC receives the first data sent by the DMA controller; and sends the first data to the processor, including: the SoC receives the first data sent by the DMA controller; maps the second address of the storage medium to the first address according to a preset address mapping table; and forwards the first data to the processor according to the first address.
[0013] In a possible implementation of the first aspect, the SoC receives a first interrupt sent by a DMA controller, and the first interrupt is used to indicate that the DMA controller has successfully transferred the first data to the SoC; when the SoC determines that the SoC has successfully transferred the first data to the processor according to the first address, the SoC sends a second interrupt to the processor, and the second interrupt is used to indicate that the SoC has successfully forwarded the first data to the processor.
[0014] In a possible implementation of the first aspect, when the operation type is a write operation request, the SoC receives the second data sent by the processor and sends the second data to the DMA controller, triggering the DMA controller to write the second data to the storage medium according to the second address, including: the SoC receives the second data sent by the processor; maps the first address of the storage medium to the second address; and sends the second data to the DMA controller according to the second address.
[0015] In a possible implementation of the first aspect, before the SoC receives the second data sent by the processor, the SoC receives a read request message sent by the DMA controller, wherein the read request message carries the second address; the second address in the read request message is mapped to the first address, and a third request message is generated, wherein the third request message is used to instruct the processor to send the data to be written to the SoC; and the third request message is sent to the processor.
[0016] In a second aspect, an embodiment of the present application provides a storage system, which includes a processor, a system on chip SoC and a storage medium, wherein the processor, the SoC and the storage medium communicate with each other via an extended peripheral component interconnect high-speed PCIe bus, and the storage medium includes a direct memory access DMA controller; the processor is used to send a first control instruction for obtaining a first request message to the SoC, and the first control instruction carries an identifier for uniquely identifying the first request message; the first request message includes a first address and an operation type of the storage medium; the first address is an address allocated to the storage medium in the memory address managed by the processor; the SoC is used to receive the first control instruction sent by the processor, and obtain the first request message according to the first control instruction; determine a second address according to the first address, and generate a second request message, the second address is an address allocated to the storage medium in the memory address managed by the SoC, and the second request message carries the second address and the operation type; according to the second address A first control instruction is sent to the DMA controller of the storage medium, wherein the first control instruction is used to instruct the DMA controller to obtain a second request message; when the operation type is a read operation, the first data sent by the DMA controller is received, and the first data is obtained by the DMA controller according to the second address; the first data is sent to the processor; when the operation type is a write operation, the second data sent by the processor is received, and the second data is sent to the DMA controller, triggering the DMA controller to write the second data to the storage medium according to the second address; the DMA controller of the storage medium is used to receive a second control instruction, wherein the second control instruction carries an identifier for uniquely identifying the first request message; obtain the second request message according to the second control instruction; when the operation type is a read operation, obtain the first data according to the second address; send the first data to the SoC; when the operation type is a write operation, the second data sent by the SoC is received, and the second data is written to the storage medium according to the second address.
[0017] In a third aspect, the present application provides a system on chip (SoC), which includes various modules for executing the fault handling method in the first aspect or any possible implementation of the first aspect.
[0018] In a fourth aspect, the present application provides a system on chip (SoC), which includes a processor, a memory, a communication interface, and a bus. The processor, the memory, and the communication interface are connected via a bus and communicate with each other. The memory is used to store computer execution instructions. When the SoC is running, the processor executes the computer execution instructions in the memory to utilize the hardware resources in the SoC to perform the data transmission method described in the first aspect and any possible implementation method of the first aspect.
[0019] In a fifth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the computer executes the methods described in the above aspects.
[0020] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for describing the embodiments are briefly introduced below.
[0022] Figure 1 A data transmission schematic diagram provided by the prior art;
[0023] Figure 2a An architecture diagram of a storage system provided by an embodiment of the present invention;
[0024] Figure 2b An architectural diagram of another storage system provided by an embodiment of the present invention;
[0025] Figure 3 A schematic diagram of a data transmission method provided by an embodiment of the present invention;
[0026] Figure 4 A schematic diagram of the process of another data transmission method provided by an embodiment of the present invention;
[0027] Figure 5 A schematic diagram of the process of another data transmission method provided by an embodiment of the present invention;
[0028] Figure 6 A structural schematic diagram of another data transmission method for a read operation request provided by an embodiment of the present invention;
[0029] Figure 7 A structural schematic diagram of another data transmission method for a write operation request provided by an embodiment of the present invention;
[0030] Figure 8a A schematic diagram of the structure of a storage system provided by an embodiment of the present invention;
[0031] Figure 8b A schematic diagram of the structure of another storage system provided by an embodiment of the present invention;
[0032] Figure 9a A schematic diagram of the structure of a system on a chip provided by an embodiment of the present invention;
[0033] Figure 9b A schematic diagram of the structure of another system on chip provided by an embodiment of the present invention;
[0034] Fig.9c A schematic diagram of the structure of another system on chip provided by an embodiment of the present invention;
[0035] Figure 9d A schematic diagram of the hardware structure of a system on a chip provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In order to facilitate the clear description of the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, the words "first", "second" and the like are used to distinguish the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order.
[0037] like Figure 2a As shown, Figure 2a FIG. 1 shows an architecture diagram of a storage system used in a data transmission method provided by an embodiment of the present invention. Figure 2a As shown, the storage system includes a processor 201, a system on chip (SoC) 202 and a storage medium 203, wherein the processor and the SoC are both configured with a double data rate synchronous dynamic random access memory (Double Data Rate, DDR), Figure 2a Not shown, the processor 201, the system on chip 202, the DDR 204 and the storage medium 203 are connected through an extended peripheral component interconnect express (PCIe) bus. The processor 201 includes a root complex (RC), which is a management module for managing access devices in the PCIe bus. The root complex is connected to the SoC through a root port (RP). The SoC is an end point (EP) of the processor 201 and is connected to the PCIe bus structure. A redundant array of independent disks (RAID) controller runs in the SoC to manage the storage medium 203. The storage medium 203 is used to store data to be read or written.
[0038] It is worth mentioning that Figure 2a The number of processors 201 may be one or more, and the number of storage media 203 may also be one or more.
[0039] It should be understood by those skilled in the art that in the PCIe bus standard, each device in the PCIe bus needs a unique bus number identification, and each PCIe structure is subject to limited resources. For example, the PCIe bus structure supports a maximum of 256 bus numbers. In the PCIe structure, an endpoint root complex can be established in an endpoint device (for example, SoC). The endpoint root complex is a management module for managing access devices that access the extended PCIe structure in the extended PCIe structure. The SoC connects the storage medium 203 through the RP of the endpoint root complex. Each storage medium 203 is connected to the PCIe bus as an endpoint device in the extended PCIe structure, thereby expanding the number of endpoint devices in the PCIe structure. In addition, the storage medium 203 can be a non-volatile high-speed transmission bus (non-volatile memory express, NVMe) solid state disk (solid state disk, SSD), or other types of storage media. A direct memory access (direct memory access, DMA) controller runs in each storage medium 203, and the DMA controller is used to directly relocate the data to be read from the storage medium to the DDR corresponding to the processor without the participation of the processor 201.
[0040] The root complex of the processor 201 also maps various connected devices (including storage locations of the devices, such as registers and storage locations) to the PCIe storage space, that is, to the system memory. These types of mapping and storage spaces are called memory mapped input / output (MMIO) spaces. Similarly, the endpoint root complex in the SoC also maps its connected devices (such as registers, storage media) to the PCIe storage space. Among them, the memory space managed by the root complex of the processor 201 and the memory space managed by the endpoint root complex of the SoC are independent of each other, and there is a preset address mapping relationship between the two, which is stored in the SoC. When the processor receives a read operation request message or a write operation request message, the root complex of the processor can determine the storage location of the storage medium according to the address information carried in the request message, and then the endpoint root complex of the SoC determines the address information of the storage medium in the memory it manages according to the preset address mapping relationship, that is, the storage location of the storage medium in the PCIe structure of the endpoint root complex of the SoC; finally, the DMA controller of the storage medium performs data processing.
[0041] Exemplarily, the memory space managed by processor 201 is 8TB, and the address of the memory space is 00000000000-7ffffffffff (equivalent to 0TB-8TB). The memory size allocated by processor 201 to SoC202 in the memory space managed by processor 201 is 4TB, and the address of the 4TB memory allocated by processor 201 to SoC202 is 3ffffffffff-7ffffffffff (equivalent to from 4TB-8TB). The memory space managed by SoC202 is 6TB, and the address of the memory space managed by SoC is 00000000000-5ffffffffff (equivalent to 0TB-6TB). The memory size allocated to storage medium 203 in the memory space of SoC202 is also 4TB, and the address is 1ffffffffff-5ffffffffff (equivalent to from 2TB-6TB). Therefore, if the 4TB of storage medium 203 in SoC202 is to be mapped to the 4TB of processor 201 , an address mapping conversion is required, such as address 1ffffffffff of SoC202 is mapped to address 3ffffffffff of processor 201 .
[0042] In addition, a submission queue (SQ) and a completion queue (CQ) are stored in the processor 201, the SoC 202 and the storage medium 203. The submission queue is used to store pending read operation request messages or write operation request messages, and the CQ is used to store completed read operation request messages or write operation request messages.
[0043] Specifically, the SQ of processor 201 stores a read operation request message or a write operation request message to be processed by processor 201, and the CQ stores a read operation request message or a write operation request message that has been completed by processor 201. Moreover, the read operation request message or the write operation request message stored in the SQ and CQ of processor 201 both carry a first address, which is an address allocated in the memory address managed by the processor for the storage medium storing the data to be read or written; the SQ in SoC202 stores a read operation request message or a write operation request message to be processed by SoC202. The SQ in the storage medium 203 stores the read operation request message or the write operation request message to be processed by the storage medium 203, and the CQ stores the read operation request message or the write operation request message completed by the storage medium 203. The read operation request message or the write operation request message stored in the SQ and CQ of the SoC both carry a second address, which is the address allocated to the storage medium storing the data to be read or written in the memory address managed by the SoC; the SQ in the storage medium 203 stores the read operation request message or the write operation request message to be processed by the storage medium 203, and the CQ stores the read operation request message or the write operation request completed by the storage medium 203.
[0044] Figure 2b FIG. 4 shows an architecture diagram of a storage system to which a data transmission method provided by another embodiment of the present invention is applied. Figure 2b As shown, in Figure 2b and Figure 2a The functions of the processor 201, SoC 202 and storage medium 203 are the same and will not be described in detail in this application. Figure 2b and Figure 2a The difference is that Figure 2a In the embodiment, each storage medium 203 is used as an EP and is directly connected to the PCIe bus through an RP in the SoC. Figure 2b In the embodiment, SoC202 is connected to storage medium 203 through PCIe switch chip 204. Specifically, the PCIe switch chip 204 includes at least one uplink port and at least one downlink port. The uplink port of the PCIe switch chip 204 is used to connect to the RP in SoC202, and the downlink port is used to connect to storage medium 203. The uplink port is a port pointing to the root complex, and the downlink port is a port away from the root complex. Figure 2b It is only shown that the root complex includes one root port. It can be understood that in actual use, the root complex includes multiple root ports (for example, between four and six root ports).
[0045] It is worth mentioning that Figure 2a The number of processors 201 may be one or more, and the number of storage media 203 may also be one or more.
[0046] Optionally, the storage architecture used in the embodiment of the present invention Figure 2b In addition to connecting the storage medium through the PCIe switching chip 204, other storage media can also be connected through an interface card. Figure 2b The storage architecture shown may be applied to a network-based non-volatile memory (NVMe of fabric, NoF) storage system.
[0047] In the embodiment of the present invention Figure 2a and Figure 2b The storage system architecture shown can be a storage array, wherein the storage array includes a controller and a hard disk frame, the controller runs in the processor 201, the storage medium 203 can be a hard disk device in the same physical device as the controller of the storage array, or can be a storage array connected to the physical device where the controller is located in the form of a hard disk frame; the storage array also includes a RAID controller, the RAID controller runs in the SoC202, and the RAID controller is used to manage the RAID relationship of the storage medium in the storage array.
[0048] Optionally, in the embodiment of the present invention Figure 2a and Figure 2b The storage system architecture shown may also be a server, which includes a processor 201 , a SoC 202 , and a storage medium 203 .
[0049] Combination Figure 2a and Figure 2b , any storage medium 203 in the embodiment of the present invention can receive the read operation request message or write operation request message sent by one or more processors 201 through SoC202, and store the data to be written in the write operation request message sent by one or more processors 201 in the storage medium 203. At the same time, any storage medium 203 can also return the data to be read from the storage medium 203 to the processor 201 according to the read operation request message sent by the processor 201, and store it in the DDR20 of the processor 201.
[0050] Next, combine Figure 3 A data transmission method provided by an embodiment of the present invention is further described. The method is applied to Figure 2a or Figure 2b In the storage system shown, Figure 3 As shown, the method provided by the embodiment of the present invention includes:
[0051] S301: The processor sends a second control instruction to the SoC.
[0052] Specifically, the second control instruction is used to instruct the SoC to obtain a first request message from the request queue of the processor, the first request message including a first address of a storage medium and an operation type, the storage medium being used to store data to be read or written, the first address being an address allocated to the storage medium in a memory address managed by the processor, and the operation type including a read operation or a write operation.
[0053] Optionally, the second control instruction includes a first identifier, and the first identifier is used to uniquely identify a first request message.
[0054] It can be understood that the request queue stored in the processor includes at least one request message, each request message indicates a read operation request message or a write operation request message to be processed by the processor, and each request message corresponds to an identifier. As shown in Table 1, the unique identifier of the first request message 1 is 1001, the unique identifier of the first request message 2 is 1002, and the unique identifier of the first request message 3 is 1003.
[0055] Table 1 Example of the correspondence between the first request message and the first identifier in the processor
[0056] First logo First request message 1001 First request message 1 1002 First request message 2 1003 First request message 3
[0057] Exemplarily, for example, if the first request message is the first request message 1, and the unique identifier of the first request message 1 is 1001, the SoC obtains the request message 1 corresponding to 1001 from the request queue of the processor according to the identifier.
[0058] S302: The SoC receives a second control instruction sent by the processor.
[0059] S303. The SoC obtains a first request message from a request queue of the processor according to the second control instruction.
[0060] Specifically, the second control instruction carries the first identifier of the first request message, and the SoC obtains the first request message corresponding to the first identifier from the request queue of the processor according to the first identifier of the first request message.
[0061] It is understandable that there are multiple storage locations in the SQ queue of the processor, and one storage location is used to store a first request message. When the SoC obtains the first request message corresponding to the first identifier from the SQ queue according to the first identifier, the storage space at the storage location where the first request message is located will be vacated. When the processor generates a new first request message, the processor can store the newly generated first request message in the above-mentioned emptied storage location.
[0062] S304. The SoC determines a second address of the storage medium according to the first address, and generates a second request message.
[0063] Specifically, the second address is an address allocated to the storage medium in the memory address managed by the SoC.
[0064] In addition, the second request message carries a second address and an operation type, and the second request message corresponds to a second identifier, and the second request message is used to indicate that the DMA controller of the storage medium will perform a read operation or a write operation on the storage medium corresponding to the second address according to the operation type. The operation type carried in the second request message is consistent with the operation type carried in the first request message. For example, if the operation type carried in the first request message is a write operation, the operation type carried in the second request message is also a write operation. If the operation type carried in the first request message is a read operation, the operation type carried in the second request message is also a read operation.
[0065] Optionally, step S304 in the embodiment of the present invention may be implemented in the following manner:
[0066] S3041. The SoC obtains, according to the first address, from a preset address mapping table a second address that corresponds to the first address.
[0067] The preset address mapping table includes a mapping relationship between the first address and the second address.
[0068] Exemplarily, a preset address mapping table is stored in the SoC, in which a specific mapping rule between a first address and a second address is established. The SoC can determine a second address that has a mapping relationship with the first address through the mapping rule, wherein the first address is an address assigned to the storage medium in the memory address managed by the processor, and the second address is an address assigned to the storage medium to be operated in the memory address managed by the SoC.
[0069] Table 2 Preset address mapping table
[0070] First Address Second address 100001 2000002 100011 200011 100012 200013
[0071] In Table 2, the address obtained by the SoC from the request queue of the processor in the first request message is recorded as the first address. If the first address carried in the first request message is 100001, the SoC can determine through the preset address mapping table that the second address that has a mapping relationship with the first address 100001 is 2000002.
[0072] S305: The SoC stores the second request message in a request queue of the SoC.
[0073] S306. The SoC sends a first control instruction to the DMA controller of the storage medium, where the first control instruction is used to instruct the DMA controller of the storage medium to obtain a second request message from the request queue of the SoC.
[0074] Optionally, the first control instruction carries a second identifier, and the second identifier is used to uniquely identify a second request message stored in the request queue of the SoC.
[0075] The second identifier in the embodiment of the present invention may be any identifier such as letters or numbers that can uniquely identify a second request message, and the embodiment of the present invention is not limited to this.
[0076] It can be understood that the request queue of the SoC includes one or more storage locations, each of which is used to store a second request message, that is, the request queue of the SoC stores one or more second request messages, each of which carries a second address and an operation type, and each second request message corresponds to a second identifier that uniquely identifies the second request message. As shown in Table 3, the unique identifier of the second request message 1 is 101, the unique identifier of the second request message 2 is 102, and the unique identifier of the second request message 3 is 103.
[0077] Table 3 Example of the correspondence between the second request message and the identifier in the request queue of SoC
[0078] Second mark Second request message 101 Second request message 1 102 Second request message 2 103 Second request message 3
[0079] Exemplarily, when the second identifier carried in the first control instruction is 101, the second control instruction is used to instruct the DMA controller of the storage medium to obtain a second request message 1 corresponding to the second identifier 101 from the request queue of the SoC.
[0080] It can be understood that when the DMA controller of the storage medium obtains the second request message from the request queue of the SoC according to the above-mentioned first control instruction, the storage space at the storage location where the second request message is located will be vacated, and the SoC can store the new second request message in the vacated storage location.
[0081] S307: The DMA controller of the storage medium obtains a second request message according to the first control instruction, and processes data according to an operation type carried in the second request message.
[0082] Specifically, the DMA controller of the storage medium obtains the second request message corresponding to the second identifier from the request queue of the SoC according to the second identifier carried in the first control instruction.
[0083] Since the operation type of the second request message can be a read operation or a write operation, but different operation types have differences in the specific implementation process, the specific implementation process of step S307 will be described in detail below in combination with the two cases where the operation type is a read operation request and the operation type is a write operation request:
[0084] On the one hand, when the operation type of the second request message is a read operation, combined with Figure 3 Optionally, step S307 can be implemented in the following manner:
[0085] S3071A. The DMA controller of the storage medium obtains first data stored in the storage medium corresponding to the second address, wherein the first data is data to be read and stored in the storage medium.
[0086] S3072A: The DMA controller of the storage medium sends the first data to the SoC in a DMA memory access mode, and then executes S3081.
[0087] On the other hand, when the operation type of the second request message is a write operation, the processor writes the data to be written into the storage medium, but for the storage medium, the data to be written is read according to the request from the processor. Figure 3 , step S307 can be implemented in the following manner:
[0088] S3071B, after obtaining the second request message, the DMA controller of the storage medium sends a read request message to the SoC, wherein the read request message carries a second address and is used to instruct the acquisition of second data, wherein the second data is data to be written into the storage medium.
[0089] S3072B: The DMA controller of the storage medium obtains the second data from the processor in a DMA memory access manner, and then executes S3082.
[0090] After step S307, the method further includes:
[0091] S3081. When the operation type is a read operation, the SoC sends the first data to the processor.
[0092] S3082: When the operation type is a write operation, the SoC forwards the first data sent by the processor to the DMA controller of the storage medium.
[0093] An embodiment of the present invention provides a method for data transmission, in which the SoC obtains a first request message from a processor through a first control instruction, converts a first address carried in the first request message, and then sends a second control instruction to a target storage medium, so that the target storage medium obtains a second request message according to the second control instruction. Therefore, in the process of transmitting the first data or the second data from the processor to the storage medium, the SoC is responsible for converting the first address into the second address, forwarding the first data or the second data between the processor and the storage medium, and the movement of the first data or the second data from the processor to the storage medium only requires the participation of the DMA controller of the storage medium, and does not require the participation of the DMA controller of the SoC. Therefore, the embodiment of the present invention only moves the first data or the second data between the processor and the storage medium through the DMA controller of the storage medium, which can avoid the problems of high delay and low transmission efficiency caused by the need to forward through the DMA controller of the SoC during data transmission.
[0094] Since the operation type of the first request message obtained by the SoC from the SQ of the processor may be a read operation or a write operation, request messages of different operation types have differences in the specific implementation process. Therefore, the following will respectively describe in detail the interaction between the SoC and the processor and the target storage medium when the operation type is a read operation request or a write operation request.
[0095] In order to avoid the delay and low transmission efficiency caused by the participation of the DMA controller of the SoC in the transfer of target data between the processor and the storage medium, when the operation type is a read operation, the first data to be read is moved from the storage medium to the processor only through the DMA controller of the storage medium; when the operation type is a write operation, the second data to be written is moved from the processor to the storage medium only through the DMA controller of the storage medium. When the second data is transmitted from the storage medium to the processor, the second data is transmitted only through the internal bus of the SoC, and the DMA controller of the SoC is not required to participate in the transfer. Therefore, delay can be avoided.
[0096] As a possible embodiment, combining Figure 3 ,like Figure 4 As shown, Figure 4 One operation type provided by the present invention is a data transmission process during a read operation. Figure 4 and Figure 3 The difference is that after executing S301-S307, the steps in the embodiment of the present invention further include: S307a. Figure 4 The data transmission process of step S308 is described in detail in the text of FIG. 1 , wherein the processing process of steps S301 to S307 can be referred to in the text of FIG. Figure 3 The embodiments of the present invention will not be described in detail here. Figure 4 As shown, the method provided by the embodiment of the present invention includes:
[0097] S307a: The DMA controller of the storage medium sends the first data to the SoC in a DMA memory access manner.
[0098] Optional, such as Figure 4 As shown, step S3081 may also include:
[0099] S3081a. The SoC receives first data sent by the DMA controller of the storage medium in a DMA memory access manner.
[0100] S3082a. The SoC maps the second address of the storage medium to the first address.
[0101] Specifically, the SoC may map the address of the target data from the second address to the first address through a preset address mapping table as shown in Table 2.
[0102] S3083a. The SoC forwards the first data to the processor.
[0103] Optionally, during the execution of step S3081, the method provided by the embodiment of the present invention further includes:
[0104] S3083a1. The SoC receives a first interrupt sent by a DMA controller of the storage medium, where the first interrupt is used to indicate that the DMA controller has successfully transferred the first data to the SoC.
[0105] Specifically, the method for the DMA controller of the storage medium to determine that the first data is successfully forwarded to the processor can be understood as follows: the amount of data sent by the SoC to the processor is equal to the size of the first data. That is, if the size of the first data is A, then if the SoC determines that the size of the first data forwarded to the processor is also A, it is determined that the target data is successfully forwarded.
[0106] Optionally, the DMA controller of the storage medium may also record the size and check value of the first data, record and transmit the location information of the first data by means of a pointer, and calculate the check value of the sent first data. When the calculated check value of the sent first data is equal to the recorded check value, it is determined that the first data transmission is successful.
[0107] S3083a2: When the SoC determines that the SoC has successfully transmitted the first data to the processor, a second interrupt is sent to the processor, where the second interrupt is used to instruct the SoC to successfully forward the first data to the processor.
[0108] Among them, the method for SoC to determine whether the first data is successful can be found in the description of S3083a1, which will not be repeated here.
[0109] The DMA controller of the storage medium sends the first data to the memory of the SoC in a DMA memory access mode, and the SoC sends the first data to the processor through the PCIe bus.
[0110] As another possible embodiment, combining Figure 3 ,like Figure 5 As shown, Figure 5 The present invention provides a data transmission process when an operation type is a write operation request. Figure 5 and Figure 3 The difference is that Figure 5 The specific implementation process of step S308 when the operation request is a write operation request is specifically introduced in detail, wherein the processing process of steps S301-S307 can be referred to Figure 3 The embodiments of the present invention will not be described in detail here. Figure 5 As shown, the method provided by the embodiment of the present invention includes:
[0111] S307b: The DMA controller of the storage medium sends a read request message to the SoC, where the read request message carries the second address.
[0112] Specifically, the read request message is used to instruct the processor to send the second data to be written to the SoC.
[0113] S3081b. The SoC receives a read request message sent by the DMA controller of the storage medium.
[0114] S3082b. The SoC maps the second address in the read request message to the first address and generates a third request message, where the third request message is used to instruct the processor to send the second data.
[0115] S3083b. The SoC sends the third request message to the processor.
[0116] S3084b. The processor sends the second data to the SoC according to the third request message.
[0117] S3085b. The SoC receives the second data sent by the processor.
[0118] S3086b, the SoC converts the address of the target data from the first address to the second address.
[0119] Specifically, the SoC may convert the address of the target data from the first address to the second address through the preset address mapping table shown in Table 2 above.
[0120] S3087b, the SoC sends the second data to the DMA controller of the storage medium according to the second address, triggers the DMA controller of the storage medium to obtain the second data in a DMA memory access mode, and stores the second data in the storage medium.
[0121] Specifically, after the SoC receives a read request message and maps the second address in the read request message to the first address, it generates a third request message and sends the third request message to the processor. After the processor receives the third request message, it obtains the second data from the processor's memory and sends the second data to the SoC. Then, the SoC maps the address of the storage medium where the second data is to be stored from the first address to the second address. Finally, the DMA controller of the storage medium moves the second data from the SoC to the storage medium in a DMA memory access manner.
[0122] Combine the following Figure 6 and Figure 7 The data transmission method provided by the embodiment of the present invention is further described.
[0123] like Figure 6 As shown, Figure 6 The present invention provides a flow chart of data transmission in a read operation request scenario, wherein the SoC includes a processor for processing the read operation or write operation of the processor of the storage system, and the SoC also includes a memory address management unit and a redirection unit. The memory address management unit and the redirection unit are computer programs running on the processor. The memory address management unit is used to map the address of the data to be read or written, and the redirection unit is used to implement the sorting function for the processing process of the read operation request, so as to achieve the consistency of the storage system. Figure 6 As shown, the data transmission method includes:
[0124] S701. The processor sends a second control instruction to the SoC, where the second control instruction is used to instruct the SoC to obtain a read operation instruction carrying a first address (ie, the first request message described in the above embodiment) from a request queue of the processor.
[0125] S702. According to the second control instruction, the SoC obtains a read operation instruction carrying the first address from the request queue of the processor, and maps the first address in the read operation instruction to the second address to generate a second request message carrying the second address and the read operation instruction, and stores the second request message in the request queue of the SoC.
[0126] S703: The SoC sends a first control instruction to the storage medium, where the first control instruction is used to instruct a DMA controller of the storage medium from which data is to be read or written to obtain a second request message from a request queue of the SoC.
[0127] S704: The DMA controller of the storage medium reads first data from the storage medium according to the second address, wherein the first data is data to be read and stored in the storage medium.
[0128] S705: The DMA controller of the storage medium sends the first data to the SoC via a transmission link in a DMA memory access manner.
[0129] S706: The DMA controller of the storage medium writes a read operation instruction of the second address that has been completed into the CQ of the SoC, and sends a first interrupt to the CPU of the SoC.
[0130] S707 . After receiving the first interrupt, the SoC obtains the completed first data read operation instruction from the completion queue of the SoC.
[0131] It should be noted that in the embodiment of the present invention, only after the SoC determines that the first data is completely forwarded to the processor, the SoC processes the first interrupt received and sends the second interrupt to the processor. This ensures that when the processor reads the first data in the storage medium, the first data must arrive at the processor earlier than the second interrupt. Specifically, this step can be implemented by a redirection unit running in the SoC. If the redirection unit is not running in the SoC, the SoC will immediately send the second interrupt to the processor after receiving the first interrupt, that is, Figure 6 In step 707a, the second interrupt may return to the processor earlier than the target data, so that the consistency of the processor side cannot be guaranteed and data loss cannot be avoided.
[0132] S708. After mapping the address of the storage medium from the second address to the first address, the SoC forwards the first data to the processor through the PCIe bus.
[0133] S709. The SoC maps the second address to the first address, and obtains a new write-back instruction, where the new write-back instruction is used to indicate that the read operation instruction of the first data has been completed.
[0134] S710: When the SoC determines that the first data has been completely forwarded to the processor, the SoC writes the completed read operation instruction of the first address into a completion queue of the processor and sends a second interrupt to the processor.
[0135] S711. After receiving the second interrupt, the processor reads the completed read operation instruction of the first address from the completion queue of the processor, thereby determining that the first data has been successfully read from the storage medium.
[0136] like Figure 7 As shown, Figure 7 FIG. 4 shows a data transmission architecture diagram in a scenario where an operation type is a write operation request provided by an embodiment of the present invention. Figure 7 As shown, the data transmission method includes:
[0137] S801. The processor sends a second control instruction to the SoC, where the second control instruction is used to instruct the SoC to obtain a write operation instruction from a request queue of the processor, where the write operation instruction is used to instruct to write second data in the processor memory into the storage medium.
[0138] S802, the SoC obtains a write operation instruction from the request queue of the processor, maps the first address of the storage medium of the data to be written in the write operation instruction to a second address, and generates a second request message carrying the second address and the operation type in the request queue of the SoC.
[0139] S803. The SoC sends a first control instruction to the DMA controller of the storage medium, where the first control instruction is used to instruct the DMA controller of the storage medium to obtain a second request message carrying a second address and an operation type from a request queue of the SoC.
[0140] S804: The DMA controller of the storage medium obtains a second request message carrying a second address and an operation type from a request queue of the SoC according to the first control instruction.
[0141] Specifically, the storage medium processes the second request message carrying the second address and operation type obtained from the request queue of the SoC, and generates a read request message, which includes the second address and operation type, and stores the read request message in the request queue of the storage medium.
[0142] S805: The DMA controller of the storage medium sends a read request message carrying the second address and the operation type to the SoC.
[0143] S806. The SoC maps the second address in the read request message carrying the second address and the operation type to the first address.
[0144] S807. The SoC sends the read request message carrying the first address to the processor via the PCIe bus.
[0145] S808: After receiving the read request message carrying the first address, the processor sends the second data and the first address to the SoC.
[0146] S809: The SoC maps the first address to a second address, and then sends second data to a DMA controller of the storage medium according to the second address.
[0147] S810: The DMA controller of the storage medium moves second data from the SoC to the storage medium.
[0148] S811. The DMA controller of the storage medium writes an instruction to write the second data into the storage medium into the CQ of the SoC, and sends a first interrupt to the SoC.
[0149] S812: After receiving the first interrupt, the SoC obtains an instruction for writing the second data into the storage medium from the CQ of the SoC.
[0150] S813. The SoC maps the second address to the first address to obtain a new CQ write-back instruction.
[0151] S814. The SoC writes a new CQ write-back instruction into the CQ of the processor and sends a second interrupt to the processor.
[0152] It can be understood that, in the embodiment of the present invention, when the operation type is writing, steps S811-S814 can be omitted.
[0153] When the data transmission method provided by the embodiment of the present invention is applied to Figure 2a or Figure 2b In the architecture shown, the processor reads data from the storage medium or writes data to the storage medium through the SoC, uninstalls functions such as RAID, and the data exchange between the processor and the storage medium is direct (that is, the processor is directly connected to the storage device). The data no longer needs to be copied to the DDR mounted on the SoC, but is directly moved to the storage medium. The following takes the processing process when the storage medium is an SSD as an example for further explanation:
[0154] 1) In RAID0 mode, the processor only needs one DMA operation to read / write the target data. The data is directly passed between the processor and the SSD without any calculation, which is pure data copy.
[0155] 2) In RAID1 mode, the processor only needs one DMA operation to read / write the target data, and the data is directly passed between the processor and the SSD.
[0156] 3) In RAID10 mode, the processor only needs one DMA operation to read / write the target data, and the data is directly passed between the HOST and the SSD.
[0157] 4) In RAID5 mode, when the processor reads the target data from the SSD, only one DMA operation is required, and the data is directly moved from the SSD to the processor through the SSD's DMA controller; when the processor writes the target data to the SSD, the write operation requires calculation of the data and then writing it to the hard disk. At the same time, verification information needs to be written to the hard disk, so the data must enter the SoC.
[0158] 5) In RAID6 mode, when the processor reads the target data from the SSD, only one DMA operation is required, and the data is directly copied from the SSD to the processor. When the processor writes the target data to the SSD, it needs to perform operations on the data, and the data must enter the SoC.
[0159] The data transmission method provided by the embodiment of the present invention can be used in a RAID mode (not limited to the aforementioned cases) without the participation of SoC in calculation. The SoC only needs to map the first address in the read or write operation request sent by the processor to the second address, or map the second address to the first address, so that the DMA controller of the storage medium can recognize it. Therefore, in the transmission between the storage medium and the processor, the SoC only completes the processing, forwarding and address mapping of the request. The data is moved from the processor to the storage medium or from the storage medium to the processor. It is only executed by the DMA controller of the storage medium, and the DMA controller of the SoC does not need to participate in the movement. This improves the bandwidth utilization, and the SoC does not participate in the DMA movement. In this way, it avoids causing SoC performance bottlenecks. Furthermore, the IOPS (input / output per second) capacity can be stacked linearly by SSDs, so that the performance of the storage system is significantly improved.
[0160] Figure 8a A schematic diagram of the structure of a storage system provided by an embodiment of the present invention is shown. Figure 8a The storage system shown is a storage array. Figure 8a As shown, the storage system 20 may include a processor 201, a system on chip 202, a storage medium 203, a communication interface 206, and a memory 207, wherein the processor 201, the system on chip 202, the storage medium 203, the communication interface 206, and the memory 207 are connected via a communication bus 204. The processor 201 includes a controller, the system on chip 202 includes a RAID controller, the storage medium 203 includes a DMA controller, and the memory 207 includes a DMA controller. Figure 8a In the storage system shown, the storage medium 203 may be one or more storage media in the same physical device as the processor 201 , or may be one or more storage media connected to the physical device where the controller is located through the hard disk enclosure 205 .
[0161] The processor is used to send a first control instruction for obtaining a first request message to the SoC, wherein the first control instruction carries an identifier for uniquely identifying the first request message; the first request message includes a first address of the storage medium and an operation type; the first address is an address allocated by the processor to the storage medium in the managed memory address.
[0162] The SoC is used to receive the first control instruction sent by the processor, and obtain the first request message according to the first control instruction; determine the second address according to the first address, and generate a second request message, the second address is the address allocated by the SoC to the storage medium in the memory address managed by the SoC, and the second request message carries the second address and the operation type; send the first control instruction to the DMA controller of the storage medium according to the second address, and the first control instruction is used to instruct the DMA controller to obtain the second request message; when the operation type is a read operation, receive the first data sent by the DMA controller, the first data is obtained by the DMA controller according to the second address; send the first data to the processor; when the operation type is a write operation, receive the second data sent by the processor, and send the second data to the DMA controller, triggering the DMA controller to write the second data to the storage medium according to the second address.
[0163] The DMA controller of the storage medium is used to receive a second control instruction, which carries an identifier for uniquely identifying the first request message; obtain a second request message according to the second control instruction; when the operation type is a read operation, obtain the first data according to the second address; send the first data to the SoC; when the operation type is a write operation, receive the second data sent by the SoC, and write the second data to the storage medium according to the second address.
[0164] The communication interface 206 is used for communication between the storage system and other devices.
[0165] The memory 207 is used to store the program. The memory 206 may include a high-speed RAM memory, and may also include a non-volatile memory (English name: non-volatile memory), for example, at least one disk memory. It is understandable that the memory can be a random-access memory (RAM), a hard disk, an optical disk, an SSD or a non-volatile memory, etc., which are non-transitory machine-readable media that can store program codes.
[0166] The processor 201 may be a CPU, or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The processor is used to execute the above-mentioned embodiments. Figures 3 to 7 The processor is the operation step performed by the execution subject.
[0167] The DMA controller of the storage medium is used to execute the above-mentioned embodiment. Figures 3 to 7 The DMA controller of the storage medium is the operating step of the execution subject.
[0168] It is worth mentioning that Figure 8a The number of processors in the system may be one or more, and the number of storage media may also be one or more.
[0169] Figure 8b FIG. 2 shows a schematic diagram of the structure of another storage system 20 provided in an embodiment of the present invention. Figure 8b The storage system shown is a storage device, such as a server. Figure 8b and Figure 8a The difference is that in Figure 8b In the example, there is no controller in the processor 201, and there is no RAID controller in the SoC. Specifically, Figure 8b The functions of each hardware structure shown are the same as Figure 8a The hardware structures shown have the same functions, and the embodiments of the present invention will not be described in detail here.
[0170] Figure 8a The storage system shown is Figure 2a The architecture of the storage system shown is a schematic diagram of the structure of a storage array. Figure 8b The storage system shown is Figure 2a The structure of the storage system shown is a schematic diagram of the structure of a storage device.
[0171] The above mainly introduces the solution provided by the embodiment of the present invention from the perspective of SoC. It can be understood that in order to realize the above functions, SoC, etc. include hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0172] The embodiment of the present invention can divide the functional modules of SoC etc. according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0173] In the case of dividing each functional module into corresponding functional modules, Figure 9a A possible structural diagram of the SoC involved in the above embodiment is shown, where SoC1 includes: an acquisition unit 10, an address management unit 11, and a sending unit 12.
[0174] Among them, the acquisition unit 10 is used to obtain a first request message, the first request message includes a first address of the storage medium and an operation type, the operation type includes a read operation or a write operation, the first address is the address allocated by the processor to the storage medium in the managed memory address; when the operation type is a read operation, the SoC receives the first data sent by the DAM controller, the first data is obtained by the DMA controller according to the second address; when the operation type is a write operation, the second data sent by the processor is received.
[0175] The address management unit 11 is used to determine the second address of the storage medium based on the first address and generate a second request message, where the second address is the address allocated by the SoC to the storage medium in the managed memory address, and the second request message carries the second address and the operation type.
[0176] A sending unit 12 is used to send a first control instruction to the DMA controller of the storage medium according to the second address, wherein the first control instruction is used to instruct the DMA controller to obtain a second request message; send the first data to the processor; and send the second data to the DMA controller to trigger the DMA controller to write the second data to the storage medium according to the second address.
[0177] Optional, such as Figure 9b As shown, the SoC in the embodiment of the present invention also includes a receiving unit 13, which is used to receive a second control instruction sent by the processor, and the second control instruction carries an identifier for uniquely identifying the first request message; and obtain the first request message according to the identifier of the first request message.
[0178] Optionally, the address management unit 11 in the SoC in the embodiment of the present invention determines the second address according to the first address, including:
[0179] According to the first address, a second address corresponding to the first address is obtained from a preset address mapping table, wherein the preset address mapping table includes at least a mapping relationship between an address allocated to the storage medium in a memory address managed by the processor and an address allocated to the storage medium in a memory address managed by the SoC; and the address corresponding to the first address is determined as the second address of the storage medium.
[0180] Optionally, the receiving unit 13 in the SoC in the embodiment of the present invention is also used to receive the first data sent by the DMA controller when the operation type is a read operation request;.
[0181] The address management unit 11 is further configured to map the second address of the storage medium to the first address according to a preset address mapping table.
[0182] The sending unit 12 is further configured to forward the first data to the processor according to the first address.
[0183] Optional, such as Fig.9c The SoC in the illustrated embodiment of the present invention further includes a redirection unit 14;
[0184] The receiving unit 13 is further configured to receive a first interrupt sent by the DMA controller, where the first interrupt is used to indicate that the DMA controller has successfully transmitted the first data to the SoC.
[0185] The redirection unit 14 is used to send a second interrupt to the processor when the SoC determines that the SoC successfully transmits the first data to the processor according to the first address, and the second interrupt is used to instruct the SoC to successfully forward the first data to the processor.
[0186] Optionally, the receiving unit 13 in the embodiment of the present invention is further configured to send the second data by the processor when the operation type is a write operation request.
[0187] The address management unit 11 is further configured to map the first address of the storage medium to the second address.
[0188] The sending unit 12 is further specifically configured to send the second data to the DMA controller according to the second address.
[0189] Optionally, the receiving unit 13 is further used to receive a read request message sent by the DMA controller before receiving the second data sent by the processor, wherein the read request message carries the second address.
[0190] The address management unit 11 is further used to map the second address in the read request message to the first address, and generate a third request message, wherein the third request message is used to instruct the processor to send the second data to the SoC.
[0191] The sending unit 12 is further configured to send the third request message to the processor.
[0192] According to an embodiment of the present invention Figure 9a The SoC1 may correspond to executing the method described in the embodiment of the present invention, and the above and other operations and / or functions of each unit in the SoC1 are respectively to implement Figures 3 to 7 The corresponding processes in each method in which SoC is the execution subject will not be repeated here for the sake of brevity.
[0193] 9d is a schematic diagram of the hardware structure of a SoC according to an embodiment of the present invention, such as Fig.9c As shown, the SoC includes a processor 901, a memory 902, a communication interface 903, and a bus 904. The processor 901, the memory 902, and the communication interface 903 are connected through the bus 904 and communicate with each other. The memory 902 is used to store computer execution instructions. When the SoC is running, the processor 901 executes the computer execution instructions in the memory 902 to use the hardware resources in the SoC to perform the following steps:
[0194] Obtaining a first request message, where the first request message includes a first address of the storage medium and an operation type, where the operation type includes a read operation or a write operation, and the first address is an address allocated by the processor to the storage medium in the managed memory address;
[0195] Determine a second address of the storage medium according to the first address, and generate a second request message, where the second address is an address allocated by the SoC to the storage medium in the managed memory address, and the second request message carries the second address and the operation type;
[0196] Sending a first control instruction to the DMA controller of the storage medium according to the second address, where the first control instruction is used to instruct the DMA controller to obtain a second request message;
[0197] When the operation type is a read operation, receiving first data sent by the DMA controller, the first data being acquired by the DMA controller according to the second address; and sending the first data to the processor;
[0198] When the operation type is a write operation, the second data sent by the processor is received, and the second data is sent to the DMA controller, triggering the DMA controller to write the second data into the storage medium according to the second address.
[0199] The processor 901 may be, for example, a central processing unit (CPU), a general purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0200] The bus 904 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 9d Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0201] It should be understood that the SoC according to the embodiment of the present invention corresponds to the Figure 9b The functional device of the SoC is used to implement Figures 3 to 7 For the sake of brevity, the corresponding process of the method shown in is not repeated here.
[0202] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0203] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive SSD), etc.
[0204] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units.
[0205] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0206] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0207] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for data transmission, characterized in that: The method is performed by a system on chip (SoC), and the method includes: Obtaining a first request message, the first request message including a first address of a storage medium and an operation type, the SoC, the processor, and the storage medium being connected via an extended peripheral component interconnect high-speed (PCIe) bus, and the first address being an address allocated by the processor to the storage medium in a managed memory address; Determine a second address of the storage medium according to the first address, where the second address is an address allocated by the SoC to the storage medium in the memory address managed by the SoC; generating a second request message, wherein the second request message includes the second address and the operation type; A first control instruction is sent to a direct memory access (DMA) controller of the storage medium, where the first control instruction is used to instruct the DMA controller to obtain a second request message.
2. The method according to claim 1, characterized in that When the operation type is a read operation, the method includes: receiving first data sent by a DMA controller, where the first data is obtained by the DMA controller according to the second address; The first data is sent to the processor.
3. The method according to claim 1, characterized in that When the operation type is a write operation, the method includes: receiving second data sent by the processor; The second data is sent to the DMA controller to trigger the DMA controller to write the second data into the storage medium according to the second address.
4. The method according to any one of claims 1 to 3, characterized in that: Before obtaining the first request message, the method further includes: receiving a second control instruction sent by the processor, where the second control instruction carries an identifier identifying the first request message; Then the obtaining of the first request message includes: The first request message is acquired according to the identifier of the first request message.
5. The method according to claim 1, characterized in that: Determining a second address of the storage medium according to the first address includes: Acquire an address corresponding to the first address from a preset address mapping table according to the first address, wherein the preset address mapping table includes a mapping relationship between an address allocated to the storage medium in the memory address managed by the processor and the address allocated to the storage medium; An address corresponding to the first address is determined as a second address of the storage medium.
6. The method according to claim 2, characterized in that: Before sending the first data to the processor, the method includes: Mapping the second address of the storage medium to the first address according to a preset address mapping table; The first data is forwarded to the processor according to the first address.
7. The method according to claim 6, characterized in that: The method further comprises: receiving a first interrupt sent by the DMA controller, where the first interrupt is used to indicate that the DMA controller has transmitted the first data to the SoC; When it is determined that the SoC transmits the first data to the processor according to the first address, a second interrupt is sent to the processor, where the second interrupt is used to indicate that the SoC successfully forwards the first data to the processor.
8. The method according to claim 3, characterized in that: Before sending the second data to the DMA controller, the method includes: Mapping the first address of the storage medium to the second address; The second data is sent to the DMA controller according to the second address.
9. The method according to claim 3, before receiving the second data sent by the processor, the method further comprises: receiving a read request message sent by the DMA controller, wherein the read request message carries the second address; Mapping the second address in the read request message to the first address, generating a third request message, wherein the third request message is used to instruct the processor to send the second data to the SoC; The third request message is sent to the processor.
10. A system on chip (SoC), characterized in that: The SoC includes an acquisition unit, an address management unit and a sending unit; The acquisition unit is used to acquire a first request message, wherein the first request message includes a first address of a storage medium and an operation type, the SoC, the processor, and the storage medium are connected via an extended peripheral component interconnect high-speed PCIe bus, and the first address is an address allocated by the processor to the storage medium in a managed memory address; The address management unit is used to determine a second address of the storage medium according to the first address, where the second address is an address allocated by the SoC to the storage medium in the memory address managed by the SoC; generating a second request message, wherein the second request message includes the second address and the operation type; The sending unit is used to send a first control instruction to a direct memory access (DMA) controller of the storage medium, where the first control instruction is used to instruct the DMA controller to obtain a second request message.
11. The SoC according to claim 10, characterized in that: The acquisition unit is further configured to receive first data sent by the DMA controller when the operation type is a read operation, where the first data is obtained by the DMA controller according to the second address; The sending unit is further configured to send the first data to the processor.
12. The SoC according to claim 10, characterized in that: The acquisition unit is further configured to receive second data sent by the processor when the operation type is a write operation; The sending unit is further used to send the second data to the DMA controller to trigger the DMA controller to write the second data into the storage medium according to the second address.
13. The SoC according to claim 12, characterized in that: Also includes: a receiving unit, configured to receive a second control instruction sent by the processor, where the second control instruction carries an identifier identifying the first request message; And, obtaining the first request message according to the identifier of the first request message.
14. The SoC according to claim 10, characterized in that: The address management unit is used to obtain the address corresponding to the first address from a preset address mapping table according to the first address, and the preset address mapping table includes a mapping relationship between the address assigned to the storage medium in the memory address managed by the processor and the address assigned to the storage medium; and determine the address corresponding to the first address as the second address of the storage medium.
15. The SoC according to claim 11, characterized in that: The acquisition unit is further used to receive a first interrupt sent by the DMA controller, where the first interrupt is used to indicate that the DMA controller has transmitted the first data to the SoC; The SoC further includes a redirection unit for sending a second interrupt to the processor when it is determined that the SoC transmits the first data to the processor according to the first address, wherein the second interrupt is used to indicate that the SoC successfully forwards the first data to the processor.
16. The SoC according to claim 13, characterized in that: The receiving unit is further configured to receive a read request message sent by the DMA controller, wherein the read request message carries the second address; The address management unit is further used to map the second address in the read request message to the first address, and generate a third request message, wherein the third request message is used to instruct the processor to send the second data to the SoC; The sending unit is further configured to send the third request message to the processor.
17. A storage system, comprising a processor, a system on chip (SoC) and a storage medium, wherein the processor, SoC and storage medium communicate with each other via an extended peripheral component interconnect (PCIe) high-speed bus, wherein the SoC is used to implement the operating steps of the method executed by the SoC in the method described in any one of claims 1 to 9; the processor is used to implement the operating steps of the method executed by the processor in the method described in any one of claims 1 to 9; and the storage medium is used to implement the operating steps of the method executed by the storage medium or the direct memory access (DMA) controller of the storage medium in the method described in any one of claims 1 to 9.
18. A system on chip (SoC), characterized in that: The SoC includes a processor and a memory, wherein the memory is used to store computer-executable instructions, and the processor executes the computer-executable instructions to implement the operating steps of the method performed by the processor in the method described in any one of claims 1 to 9.
Citation Information
Patent Citations
Storage device and interrupt control method thereof
CN102799392A
