WO2013170730A1 - Dma传输方法及*** - Google Patents

Dma传输方法及*** Download PDF

Info

Publication number
WO2013170730A1
WO2013170730A1 PCT/CN2013/075523 CN2013075523W WO2013170730A1 WO 2013170730 A1 WO2013170730 A1 WO 2013170730A1 CN 2013075523 W CN2013075523 W CN 2013075523W WO 2013170730 A1 WO2013170730 A1 WO 2013170730A1
Authority
WO
WIPO (PCT)
Prior art keywords
dma
address
storage unit
storage device
buffer memory
Prior art date
Application number
PCT/CN2013/075523
Other languages
English (en)
French (fr)
Inventor
路向峰
Original Assignee
北京忆恒创源科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京忆恒创源科技有限公司 filed Critical 北京忆恒创源科技有限公司
Priority to US14/400,475 priority Critical patent/US9734085B2/en
Priority to EP13790260.7A priority patent/EP2849076B1/en
Publication of WO2013170730A1 publication Critical patent/WO2013170730A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • G06F12/1081Address translation for peripheral access to main memory, e.g. direct memory access [DMA]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1041Resource optimization
    • G06F2212/1044Space efficiency improvement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7201Logical to physical mapping or translation of blocks or pages

Definitions

  • the present invention relates to a solid state storage device (SSD) and, more particularly, to a method and apparatus for writing data to a solid state storage device by DMA transfer.
  • SSD solid state storage device
  • Solid-state storage devices are also high-capacity, non-volatile storage devices for computer systems.
  • Solid-state storage devices generally use flash memory as a storage medium.
  • a solid state storage device as shown in Fig. 13 is disclosed in Chinese Patent Publication No. CN102043689A. As shown in Figure 13, it is a functional block diagram of the current general-purpose solid-state storage device.
  • the main components include a host system 1301 and a solid state storage device 1302.
  • the solid state storage device 1302 includes an interface module 1303, a solid state storage processor 1304, and a flash array 1306 composed of Flash particles 1305.
  • the interface module 1303 is mainly used to implement an interface protocol consistent with the host system, such as SATA (Serial Advanced Technology Attachment), USB (Universal Serial Bus), and PCIE (Peripheral Component Interconnect). Express, Quick Interconnect Component Interconnect), SCSI
  • the solid state storage processor 1304 is the control core of the entire storage device, and is mainly responsible for the control signal and data transmission between the interface module 1303 and the flash array 1306, the Flash management, the conversion or mapping of the host logical address to the Flash physical address, and the wear leveling ( Mapping logical addresses to different physical addresses to prevent a single Flash from being prematurely operated in an excessively centralized operation), bad block management, and the like.
  • Solid state storage processor 1304 can be implemented in a variety of ways, including software, hardware, firmware, or a combination thereof.
  • 1305 is a single Flash particle, and multiple Flash particles 1305 form a Flas h array 1306.
  • a random access memory such as DRAM or SRAM or other types of memory suitable for high-speed read/write operations can be set in the solid-state storage device as a high speed for reading and writing data with the flash memory.
  • Flash memory Flash memory.
  • the computer issues a SCSI (Small Computer System Interface) command to the storage device, and the storage device receives and processes the SCSI command to perform the corresponding storage medium read and write process according to the operation indicated by the SCSI command.
  • the S CSI command does not directly operate the cache. That is, the cache is "transparent" to the computer or user.
  • the allocation and management of the cache will be a burden on the controller on the solid state storage device.
  • the cache memory is fully occupied, if the solid state storage device receives a new access request from the host system, it is also necessary to perform a replacement operation on the cache memory. This increases the complexity of the controller and allows the host to experience bumps in read/write performance.
  • DMA Direct Memory Access
  • a method and apparatus for performing DMA transmission are disclosed in Chinese Patent Document CN101221544A.
  • a typical process for DMA transfers is the Scatter/Gather operation. In the scatter/gather operation, a plurality of data blocks to be transferred are stored in discrete address locations of the system (host) memory.
  • the processor does not need to program the DMA controller for each block of data that is to be moved from a source to a certain destination. Instead, the processor builds a descriptor table or descriptor link table in system memory. A set of descriptors is included in the descriptor table or descriptor link table.
  • Each descriptor describes the direction of movement of the block, the source address, the destination address, and the number of bytes that can be transferred.
  • the data of the agreed length can be transmitted by DMA.
  • a method of performing D MA transmission between an information processing device and a storage device the storage device including a buffer memory and a flash memory chip
  • the method comprising: receiving the first 10 requesting; allocating a first storage unit and a second storage unit to the first 10 request; transmitting the first DMA descriptor to the storage device, the first DMA descriptor including a DMA host address, for An address of the flash memory chip of the storage device, and an address for the first buffer memory and a second address for the buffer memory, wherein the address for the first buffer memory is the same as the first memory unit
  • the second address for the buffer memory corresponds to the second storage unit
  • DMA transmission is performed between the storage device and the information processing device according to the first DMA descriptor; a message of the storage device, the message indicating that the storage device has completed execution of the first DMA descriptor; releasing the first storage unit and the second storage Yuan.
  • the allocating the first storage unit and the second storage unit further comprises storing an address directed to the first storage unit in the second storage unit.
  • a method for performing D MA transmission between an information processing device and a storage device the storage device including a buffer memory and a flash memory chip
  • the method comprising: receiving the first 10 Requesting: assigning a first storage unit and a second storage unit to the first 10 request; transmitting the first DMA descriptor to the storage device, the first DMA descriptor including a first DMA descriptor command and a a DMA descriptor data, the first DMA descriptor command including an address of a flash memory chip for the storage device and an address for a buffer memory, the first DMA descriptor data including a DMA host address and a second address for buffering the memory; wherein the first address for the buffer memory corresponds to the first storage unit, and the second address for the buffer memory is the same as the second storage Corresponding to the unit; performing DMA transmission between the storage device and the information processing device according to the DMA host address and the second address for the buffer memory; Message received from the storage device, the message
  • the first 10 request indicates that data at the DMA host address is written to an address of a flash chip for the storage device.
  • the method further includes linking the free storage units together to form a pool of free storage unit resources, and when the first storage unit and the second storage unit are allocated, from the free storage unit resource pool Taking out the free storage unit, releasing the first storage unit and the second storage unit And inserting into the idle storage unit resource pool based on the first storage unit and the second storage unit.
  • the method further includes linking the idle storage units together to form a pool of free storage unit resources, and when the first storage unit and the second storage unit are allocated, if the free storage unit resource pool If it is empty, it waits for one or more storage units to be inserted into the free storage unit resource pool.
  • a method of performing D ⁇ transmission between an information processing device and a storage device the storage device including a buffer memory and a flash memory chip, the method comprising: receiving the first 10 requesting; allocating a first storage unit, a second storage unit, and a third storage unit to the first 10 request; transmitting the first DMA descriptor to the storage device, the first DMA descriptor including a first a DMA descriptor command, first DMA descriptor data, and second DMA descriptor data, an address of the first DM, the first DMA descriptor data including a first DMA host address and a second buffer memory Address, the second DMA descriptor data includes a second DMA host address and a third address for the buffer memory; wherein the first address for the buffer memory corresponds to the first storage unit, The second address for the buffer memory corresponds to the second storage unit, and the third address for the buffer memory corresponds to the third storage unit; DMA transmitting between the storage device and the information processing
  • the first 10 request indicates that the number at the first DMA host address and the data at the second DM A host address are written to a flash memory for the storage device The address of the chip.
  • the first storage unit, the second storage unit, and the third storage unit are allocated, the first storage unit, the second storage unit, and the third storage unit are linked as Circular linked list.
  • the message from the storage device includes content indicating one of the first storage unit, the second storage unit, and the third storage unit.
  • a pointer for identifying the first 10 request is stored in the first storage unit.
  • a method of data transmission between an information processing device and a storage device comprising a buffer memory and a flash memory chip, the method comprising: receiving a first write request The first write request includes data to be written and an address of a flash chip for the storage device; a first storage unit is allocated in the information processing device for the first write request; to the storage The device sends a first write command, where the first write command includes data, an address of a flash chip for the storage device, and an address for the buffer memory; wherein the address for the buffer memory Corresponding to the first storage unit; receiving a message from the storage device, the message indicating that the storage device has completed execution of the write command; releasing the first storage unit.
  • an apparatus for performing D MA transmission between an information processing device and a storage device comprising a buffer memory and a flash memory chip, the device comprising: a first 10 requesting module; a module for allocating a first storage unit and a second storage unit for the first 10 request; a module for transmitting the first DMA descriptor to the storage device, the a DM A descriptor includes a DMA host address, an address of a flash chip for the storage device, and an address for the first buffer memory and a second address for the buffer memory, wherein the first An address of the buffer memory corresponding to the first storage unit, the second address for the buffer memory corresponding to the second storage unit; for being used in the storage device and the information processing device
  • the method further includes, after allocating the first storage unit, the second storage unit, and the third storage unit, the first storage unit, the second storage unit, and the third The storage unit is linked as a device of the circular linked list.
  • the method further includes: means for linking the free memory cells together to form a pool of free memory cells; from the free memory cells when the first memory cells and the second memory cells are allocated The idle storage unit is taken out from the resource pool, and when the first storage unit and the second storage unit are released, the first storage unit and the second storage unit are inserted into the idle storage unit resource based on the first storage unit and the second storage unit. Pool.
  • the method further includes: means for linking the idle storage units together to form a pool of free storage unit resources, if the first storage unit and the second storage unit are allocated, if the free storage unit If the resource pool is empty, then one or more storage units are waiting to be inserted into the free storage unit resource pool.
  • a sixth embodiment of the present invention provides an apparatus for performing DMA transmission between an information processing device and a storage device, the storage device including a buffer memory and a flash memory chip, the device comprising: a module for allocating a first storage unit and a second storage unit to the first 10 request; a module for transmitting the first DMA descriptor to the storage device, the first DMA descriptor And including a first DMA descriptor command including an address of a flash chip for the storage device and an address for the buffer memory, the first DMA descriptor command
  • the DMA descriptor data includes a DMA host address and a second address for the buffer memory; wherein the first address for the buffer memory corresponds to the first storage unit, and the second is for buffering An address of the memory corresponding to the second storage unit; for serving between the storage device and the information processing device according to the DMA host address and the second a module for performing DMA transfer of the address of the flush memory; a module for receiving a message from the storage device, the message indicating that the storage device
  • a seventh embodiment of the present invention provides an apparatus for performing data transmission between an information processing device and a storage device, the storage device including a buffer memory and a flash memory chip, the device comprising: And the first write request includes data to be written and an address of a flash chip for the storage device; and a first storage unit is allocated to the information processing device for the first write request Means for transmitting a first write command to the storage device, where the first write command includes data, An address of a flash memory chip of the storage device and an address for the buffer memory; wherein the address for the buffer memory corresponds to the first storage unit; and for receiving from the storage device Means of the message, the message indicating that the storage device has completed execution of the write command; means for releasing the first storage unit.
  • the method further includes storing, in the first storage unit, the first 10 in the first storage unit after the first storage unit is allocated The device of the requested pointer.
  • FIG. 1 is a block diagram showing the structure of a storage device according to an embodiment of the present invention.
  • FIGS. 2A, 2B are schematic diagrams of write commands in accordance with an embodiment of the present invention.
  • FIG. 3 is a flowchart of a method for a storage device to execute a write command according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of a host according to an embodiment of the present invention
  • FIG. 5 is a flowchart of a host performing a write operation according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a second write command according to an embodiment of the present invention.
  • FIGS. 7A, 7B are flowcharts of a second write command executed by a memory device in accordance with an embodiment of the present invention
  • FIG. 7C is a block diagram showing hardware of a memory device for implementing the second write command of FIGS. 7A, 7B. ;
  • FIG. 8 is a software block diagram of a host in accordance with an embodiment of the present invention.
  • FIG. 9A is a flowchart of a host creating and executing a second write command according to an embodiment of the present invention
  • FIG. 9B is a flowchart of a host creating and executing a second write command according to another embodiment of the present invention
  • Figure 10B is a flow diagram of creating a linked list in a buffer memory of a storage device, in accordance with an embodiment of the present invention.
  • 10C is a flowchart of a memory device executing a DMA descriptor using a linked list created in a buffer memory, in accordance with an embodiment of the present invention
  • Figures 11A-11F show various states of the buffer memory associated with Figures 10B, 10C;
  • Figure 12 is a hardware block diagram of a memory device in accordance with yet another embodiment of the present invention.
  • Figure 13 is a block diagram of a memory device in accordance with the prior art.
  • FIG. 1 is a block diagram showing the structure of a memory device in accordance with an embodiment of the present invention.
  • the embodiment shown in FIG. 1 includes a host 101 and a storage device 102 coupled to the host 101.
  • the host 101 and the storage device 102 can be combined in various manners, including but not limited to connecting to the host 101 and storage through, for example, SATA, IDE, USB, PCIE, SCSI, Ethernet, Fibre Channel, wireless communication network, and the like.
  • the host 01 may be an information processing device capable of communicating with the storage device in the above manner, for example, personal computing Machines, tablets, servers, laptops, network switches, routers, cellular phones, personal digital assistants, etc.
  • the storage device 102 includes a host interface 103, a control circuit 104, one or more flash chips 105, and a buffer memory 106.
  • Host interface 103 can be adapted to exchange data with host 101 via, for example, SATA, IDE, USB, P CIE, SCSI, Ethernet, Fibre Channel, and the like.
  • Control circuitry 104 is used to control data transfers between host interface 103, flash chip 105, and buffer memory 106, as well as for flash management, host logical address to flash physical address mapping, erase equalization, bad block management, and the like.
  • Control circuit 104 can be implemented in a variety of ways, including software, hardware, firmware, or a combination thereof.
  • the control circuit 104 may be an FPGA (F ield-programmable gate array , a field programmable gate array bad 1 J), ASIC (Application Specific Integrated Circuit, application specific integrated circuit), or a combination thereof. Control circuitry 104 may also include a processor or controller.
  • FPGA Field-programmable gate array
  • ASIC Application Specific Integrated Circuit
  • Control circuitry 104 may also include a processor or controller.
  • host 101 issues a read command or a write command to storage device 102.
  • Control circuit 104 receives the read command or write command via host interface 103.
  • the first write command 200 as an example is described in detail in FIG.
  • the write command 200 includes fields 201, 202, 203, and 204.
  • Field 201 indicates that the command is a write command
  • field 202 is a flash address
  • field 203 is data
  • the write command 200 instructs storage device 102 to write data in data field 203 to the flash chip based on the flash address indicated by field 202.
  • the field 204 is a buffer memory address.
  • the storage device 102 When the storage device 102 receives the write command 200, the data in the data field 203 is first written to the buffer memory 106 based on the buffer memory address indicated by the field 204, and then the data is The data in field 203 is written to flash chip 105 based on the flash address indicated by field 202. In one example, storage device 102 reads the data in data field 203 from the buffer memory 106 based on the buffer memory address indicated by field 204, and then reads the data from buffer memory 106, which in turn The data is written to the flash chip 105.
  • field 204 may be the full address of buffer memory 106, while in another embodiment, field 204 is an offset value relative to a certain base address. In one embodiment, field 203 carries data to be written to flash memory 105.
  • the field 203 can carry a pointer to the data to be written to the storage device 102, and the data can be stored in the memory of the host 101. In this case, the storage device 10 2 This data is obtained from the host 101 by a subsequent DMA transfer process.
  • field 203 can carry a pointer to data to be written to storage device 102, and the data can be stored in a buffer memory of storage device 102.
  • Field 202 may be the physical address or logical address of flash chip 105 to which data is to be written.
  • Field 202 can also be a pointer to buffer memory 106 in which is stored a physical or logical address for flash chip 105. The conversion process from logical address to physical address can be implemented by looking up the address mapping table.
  • a write command can have a variety of specific encoding modes and field order.
  • field 214 indicating that the write command 210 is of a write operation may be at the end of write command 210 or elsewhere.
  • the field 211 carries the buffer memory address
  • the field 212 carries data or a pointer to the storage location of the data.
  • FIG. 3 is a flow chart of a method of a write operation performed by a memory device in accordance with an embodiment of the present invention.
  • storage device 102 receives a write command 200 from host 101.
  • the control circuit 104 of the storage device 102 extracts a field 201 included in the write command 200 for indicating that the operation type is a write operation for indicating the flash memory to be written.
  • step 302 in response to the write command 200, the control circuit 104 derives an address for the buffer memory 106 based on the field 204, and obtains data to be written based on the field 203, and writes the data to be written to the buffer. The location in memory 106 indicated by field 204.
  • the storage device 102 can send a message to the host to indicate that the execution of the write command 200 is complete, although the data is not actually written into the flash chip 105. In this manner, in the view of the host 101, after the execution of step 302 is completed, the write command 200 has been executed, thereby improving the performance of the storage device 102 executing the write command 200.
  • the message sent to the host may be included in the interrupt request sent by the storage device 102 to the host 101, or may be based on the coupling mode between the host 101 and the storage device 102 (SATA, IDE, U SB, PCIE, SCSI, Ethernet). , Fibre Channel, wireless communication networks, etc.) and choose the appropriate way to send other messages.
  • the data to be written is written to the buffer memory 106
  • the data to be written indicated by the field 203 is written to the flash memory chip based on the flash address indicated by the field 202 under the control of the control circuit 104. 105 (step 303).
  • the storage device 102 can also send a message to the host to indicate the completion of the execution of the write command 200, in particular, the host can now again specify to write the data in the write command 200.
  • This is used to indicate the address of the buffer memory 106 without causing data errors due to overwriting of data at the address.
  • the field 202 indicates a logical address for the flash chip 105
  • the logical address is converted to a physical address for the flash chip 105.
  • the manner in which logical addresses to physical addresses are translated is known to those skilled in the art.
  • the written data is retrieved from the buffer memory 106 and written to the flash memory chip 105.
  • control circuitry 104 under the control of control circuitry 104, the operation of writing data to buffer memory 106 in step 302, and the operation of writing data to flash memory 105 in step 303, may be performed in parallel. .
  • a plurality of write commands can be processed simultaneously in the storage device 102, wherein, at one time, based on a write command, the control circuit 104 writes the first data into the buffer memory 106; and based on the other write The control circuit 104 writes the second data present in the buffer memory 106 to the flash memory chip 105.
  • the buffer memory 106 may be a dual port memory such that the second data can be read from the buffer memory 106 from the second port while the first data is written to the buffer memory 106 via the first port.
  • Other embodiments of buffer memory 106 will be appreciated by those skilled in the art to support simultaneous read and/or write operations on multiple copies of data.
  • the operation of the maintenance buffer memory 106 is removed from the control circuit 104 by carrying a field 204 for indicating the address of the buffer memory 106 in the write command, and the host 101 has the ability to more flexibly control the storage device 102. .
  • FIG. 4 is a schematic diagram of a host in accordance with an embodiment of the present invention.
  • FIG. 4 is a block diagram showing the software composition of the host 400.
  • Host 400 can be a personal computer, a server computer, or other computing capable device.
  • Host 400 includes one or more user applications 401, 402, and 403, and an operating system 404.
  • the driver A buffer control block 406 is included in the program 405 for controlling the buffer memory 106 of the storage device 102 in the host 400.
  • the buffer control block 406 is composed of a plurality of memory cells (411, 412 ⁇ 41 ⁇ ), and each of the memory cells (411, 412 ⁇ 41 ⁇ ) in the buffer control block 406 corresponds to A memory cell in the buffer memory 106 records the operating state of the corresponding memory cell in the buffer memory 106.
  • each of the memory cells (411, 412 ... 41n) in buffer control block 406 whether the corresponding memory cell in record buffer memory 106 is free or already occupied.
  • a plurality of memory locations in the buffer memory such as two, are involved in a read/write command sent to the memory device 102.
  • the two storage units (411, 412) in the buffer control block 406 are associated together, and the association relationship between the storage units 411 and 412 is also recorded in the storage units 411, 412, for example.
  • One or more pointers to the storage unit 412 are recorded in the storage unit 411.
  • one or more pointers to memory unit 411 are also recorded in storage unit 412.
  • FIG. 5 is a flow chart of a host performing a write operation in accordance with an embodiment of the present invention.
  • An application or other program sends a write request when a user application or other program requests an operation to write data to the storage device.
  • the storage device driver 405 in FIG. 4 receives the write request (step 501), and the write request includes an address provided by the application or other program to be written for the storage device, and an address for the storage device. It can be a file path and an offset value and is further converted to a logical address for the storage device.
  • the logical address is a logical address for a flash chip on a storage device that writes data to the flash chip based on the logical address.
  • the storage device driver 504 allocates an idle buffer for the write request.
  • the buffer control block 406 is traversed to find a storage unit in which the idle state is, for example, the storage unit 411.
  • the storage unit 411 is in an idle state, indicating that the corresponding storage unit in the buffer memory 106 of the storage device 102 is in an idle state, and can receive the written data.
  • the storage device driver 405 sends a write command to the storage device 102, where the data to be written and the address for the storage device 102 are included in the write command, and the write command further includes the storage unit 411.
  • the address used to buffer memory 106 Those skilled in the art will appreciate that there are a number of ways to obtain a correspondence between memory cells 411 and corresponding memory cells in buffer memory 106.
  • the buffer control block 406 has n memory cells (411, 412 ... 41n), and the buffer memory 106 also includes n memory cells, and the memory cell 411 corresponds to the first one of the buffer memories 106.
  • the storage unit 412 corresponds to a second storage unit in the buffer memory 106
  • the storage unit 41n corresponds to the nth storage unit in the buffer memory 106, so that the buffer is based on the storage unit 411.
  • the location in the zone control block 406 can calculate the address of the corresponding memory location in the buffer memory 106.
  • the address of the corresponding memory location in the buffer memory 106 can also be stored in the memory locations (411, 412 ... 412).
  • the write command carries a sequence number indicating both the location of the memory location 411 in the buffer control block 406 and the location of the corresponding memory location in the buffer memory 106.
  • a message from storage device 102 is received.
  • the message is an interrupt request indicating that the write command sent in step 503 has been executed.
  • control circuitry 104 in storage device 102 writes data in a write command to buffer memory 106 (in particular, writes to buffer memory 106 and buffer control).
  • the storage device transmits a interrupt indicating that the write command execution is complete. in a
  • the control circuit 104 writes data to the flash chip 105
  • the storage device 102 sends an interrupt to the host 101.
  • the interrupt request further includes information indicating the location of the buffer control block 406 associated with the write command transmitted in step 503. The information may be the address of one or more of the memory cells (411, 412 ... 41n), the sequence number of one or more of the memory cells (411, 412 ... 41n).
  • the buffer control block 406 has memory cells (411, 412 ... 41n).
  • the memory cells are released (411, 412, ..., 41n).
  • the corresponding memory cells in the buffer memory 106 are set to be in an idle state in the memory cells (411, 412, ..., 41n).
  • the write command in step 503 involves two memory locations 4 11 and 412 of the buffer control block 406, and the pointers pointing to each other are recorded in the storage units 411 and 412, respectively, to represent the two stores.
  • Units 411, 412 are associated with the same write command.
  • the interrupt request received in step 504 either the storage unit 411 or the storage unit 412 may be indicated.
  • step 505 based on the pointer indicating one of the storage units 411 and 412, two storage units 411 and 412 are available and released.
  • three or more storage units (411, 412 ... 41n) can also be associated in a write command in this manner.
  • the second write command instructs the storage device 102 to obtain data from the host 101 in DMA mode and write it into the flash chip 105.
  • the second write command can be the DMA Descriptor 600.
  • the DMA Descriptor 600 includes a DMA command 610 and one or more DMA data (620, 630).
  • the DMA command 610 includes a field 611 for indicating the DMA mode, i.e., the operation indicated by the DMA descriptor 600, which may be a flash read, write, erase, or other operation.
  • Field 612 indicates the logical address of the storage device.
  • the field 613 indicates the length of the DMA descriptor 600, that is, the number of DMA data (620, 630) included in the D MA descriptor 600, which may be one or more.
  • Field 614 indicates the address of buffer memory 106.
  • the DMA data 620, 630 includes fields 621, 63 1 for indicating the host address in the DMA transfer, respectively.
  • the DMA data 620, 630 also includes fields 622, 632, respectively, for indicating the address of the buffer memory 106.
  • the logical address of the storage device of field 612 in DMA command 610 can be used for DMA data 620, 630.
  • the storage device 102 initiates a DMA transfer between the host 101 and the storage device 102 according to the host address indicated by the field 621 and the buffer memory address indicated by the field 622, and The received data is ultimately stored in the flash chip 105 indicated by field 612.
  • the DMA descriptor 600 includes DMA data 620 and 630
  • the data obtained by the storage device 102 from performing DMA transfer according to the DMA data 620 is finally stored in the flash chip 105 indicated by the field 612, and the storage device 102 also
  • the data resulting from the D MA transmission in accordance with the DMA data 630 is ultimately stored in the flash chip 105 indicated by the field 612 plus a predetermined offset value.
  • the DMA Descriptor 600 can indicate multiple DMA transfers between the host 101 and the storage device 102, each DMA transfer corresponding to one of the DMA data 620, 630, transmitting the same amount each time the D MA transfer Data (e.g., 4K bytes), and the logical address of the DMA transfer storage device corresponding to the DMA data 620 and the DMA data 630 is continuous (e.g., separated by a predetermined offset value, which may be transmitted with the DMA) The amount of data corresponds to).
  • the DMA transfer Data e.g., 4K bytes
  • the logical address of the DMA transfer storage device corresponding to the DMA data 620 and the DMA data 630 is continuous (e.g., separated by a predetermined offset value, which may be transmitted with the DMA)
  • the amount of data corresponds to).
  • only one storage device logical address (field 612) can be carried in DMA descriptor 600.
  • the data from the DMA host address indicated by the field 621 is written to the buffer memory 106 indicated by the field 622, and then written to the flash chip 105.
  • the data from the D MA host address indicated by the field 631 is written to the buffer memory 106 indicated by the field 632, and then written to the flash memory chip 105.
  • Field 614 is optional. At the buffer memory address corresponding to field 614, as an example, the length of the DMA descriptor 600 indicated by field 613 may be saved. Thus, it is possible to record how many DMA transfers corresponding to the DMA plurality of data 620, 630 have been executed, or how many have not yet been executed. For the DMA descriptor 600, after all the DMA transfers corresponding to the DMA data 620, 630 have been executed, for example, after the corresponding data is written into the flash chip 105, the storage device 102 sends an interrupt to the host 101. The completion of the execution of the DMA descriptor 600 is indicated. Thus, for the DMA Descriptor 600, although it corresponds to the 2 DMA transfer process, only an interrupt is sent to the host 101. Reducing the number of interrupt requests will help reduce the workload on the host 101.
  • FIG. 7A, 7B are flow diagrams of a memory device executing a second write command in accordance with an embodiment of the present invention.
  • the second write command may be the descriptor 600 as shown in FIG.
  • storage device 102 receives DMA descriptor 600. Addresses for the host (e.g., DMA host addresses 621, 631), addresses for the flash chip 105 (e.g., storage device logical address 612), and addresses for the buffer memory 106 are included in the DMA descriptor 600 (e.g., , buffer memory addresses 622, 632).
  • the DMA descriptor 600 in Fig. 6 includes the DMA command 610, DMA data 620, 630, this is for the purpose of clarity only.
  • the DMA command 610, DMA data 620, 630 can also be combined.
  • the storage device 102 extracts the address for the host from the DMA descriptor 600, the address for the flash chip 105, and the address for the buffer memory 106.
  • the storage device 102 writes data from the host 101 to the buffer memory 106 in a DMA transfer manner based on the address for the host and the address for the buffer memory.
  • the data written in the buffer memory in step 702 is written to the flash memory chip 105 based on the address for the flash memory and the buffer memory.
  • an interrupt is sent to the host 101 to indicate completion of execution of the DMA transfer. If only this DMA transfer is included in DMA Descriptor 600 (e.g., DMA description 600 includes only DMA command 610 and DMA data 620), then the interrupt also indicates completion of execution of DMA Descriptor 600. In one example, after the data is written to the flash chip 105 at step 703, an interrupt is sent to the host 101 to indicate completion of execution of the DMA transfer.
  • DMA Descriptor 60 0 containing a plurality of DMA data (620, 630) is shown.
  • storage device 102 receives DMA descriptor 600, which includes DMA command 610, DMA data 620, and DMA data 630.
  • DMA data 620 is converted to a first DMA microinstruction based on DMA descriptor 600, and DMA data 630 is converted to a second DMA microinstruction.
  • the first DMA microinstruction includes a DMA host address 621 and a buffer memory address 622. Based on the first DMA instruction, it can also be obtained The logical address 612 of the storage device, the DMA operation type, and the DMA descriptor length 613.
  • the logical address 612 and the DMA operation type of the storage device may be part of the first DMA instruction, or may be stored in the buffer memory 106 and accessed through an index in the first DMA microinstruction, and may also be passed through A DMA microinstruction is placed in a particular operational queue (read, write, erase, other) to identify the type of operation of the first DMA microinstruction.
  • a pointer stored in the buffer memory 106 is obtained based on the buffer memory address 622 and a predetermined offset value, based on which the logical address 612 and/or of the storage device are obtained. Or DMA descriptor length 613.
  • a pointer stored in the buffer memory 106 is obtained based on the buffer memory address 632 and a predetermined offset value, based on which the logical address 612 of the storage device is obtained and/or The DMA descriptor length is 613.
  • DMA descriptor length 613 is stored in buffer memory 106 based on buffer memory address 614, where the DMA descriptor length is equivalent to the number of DMA data in DMA descriptor 600 (or DMA description)
  • the total number of DMA commands and DMA data in the character 600, from which the number of DMA data can be obtained, and the DMA descriptor length 613 are accessed by the index in the first DMA.
  • the order of execution of the first DMA microinstruction and the second DMA microinstruction becomes unimportant.
  • the length of the DMA descriptor in the buffer memory 106 is decremented (for example, by 1 or less), and when the length of the DMA descriptor in the buffer memory 106 becomes 0, All DMA operations of DMA Descriptor 600 are all performed.
  • step 713 for the first DMA microinstruction, data is written to the corresponding buffer memory 106 in a DMA transfer manner based on the DMA host address 621 and the buffer memory address 622.
  • the corresponding data is written to the buffer memory 106 in a DMA transfer manner based on the DMA host address 631 and the buffer memory address 632.
  • an interrupt is sent to the host to indicate completion of the operation of the DMA Descriptor 600.
  • step 713 further comprising writing data written to the buffer memory 106 corresponding to the first DMA instruction to the flash memory chip 105 based on the memory device logical address 612.
  • step 714 also includes writing data written to buffer memory 106 corresponding to the second DMA microinstruction to the flash memory chip 105 based on the sum of the storage device logical address 612 plus the predetermined offset value.
  • the DMA stored in the buffer memory is also accessed based on the index in the first and second microinstructions.
  • the descriptor length is 613 and the DMA descriptor length 613 is decremented (eg, minus 1 or minus the unit length).
  • the DMA descriptor length 613 becomes 0, it means that the operation of the DMA descriptor 600 is completed.
  • multiple DMA descriptors 600 can be processed simultaneously in storage device 102, and the order of execution of the first DMA instructions and the second DMA instructions is also unimportant. Other methods can also be used to identify that multiple DMA data in the DMA Descriptor 600 are being executed.
  • a flag is provided for each DMA data of each DMA descriptor 600 in a buffer memory or a register, and a corresponding flag is set each time a DMA data (DMA microinstruction) is executed. It is also possible to sequentially execute each DMA data (DMA microinstruction) in the DMA descriptor 60 0, and when the last DMA data (DMA microinstruction) is executed, it means that the execution of the DMA descriptor 600 is completed.
  • an interrupt is sent to the host 101, and the host driver analyzes the execution of the DMA Descriptor 600. No completed.
  • the analysis method is similar to the process of identifying whether a plurality of DMA data in the DMA descriptor 600 are both executed in the storage device 102 described above.
  • FIG. 7C A hardware block diagram of a memory device for implementing the second write command of Figures 7A, 7B is shown in Figure 7C.
  • host 101 includes a PCIE controller 721 and a host memory 722.
  • the host memory 722 can be a random access memory (RAM), and the PCIE controller 721 is used to communicate with the storage device via the PCIE bus.
  • the storage device 102 includes a PCIE interface 731, a DMA command analyzer 732, a microinstruction FIFO (first in first out buffer) 733, a DMA write operation controller 734, a DMA write interface 735, a logical address to physical address conversion circuit 736, and a Flash.
  • the PCIE interface 731 receives the DMA descriptor 600 transmitted by the host 101 through the PCIE controller 721.
  • the connection between the host 101 and the storage device 102 is not limited to the PCIE mode, and the host 101 and the storage device 102 can also be connected through SATA, IDE, USB, PCIE, SCSI, Ethernet, Fibre Channel, and the like.
  • the DMA command parser 732 converts the DMA descriptor 600 received by the PCIE interface 731 into a DMA microinstruction.
  • the DMA instruction analyzer converts it into a first DMA ⁇ : instruction corresponding to the DMA data 620 and corresponds to the second DMA data.
  • the second DMA instruction of 630 The structure of the first DMA instruction and the second DMA instruction has been described in detail above.
  • the DMA command analyzer 732 also extracts the DMA descriptor length from the DMA command 610 of the DMA descriptor 600 and saves it, which can be stored in the buffer memory 106, a register or the like.
  • the DMA Descriptor Length indicates the number of D MA data included in the DMA Descriptor 600, and also indicates the number of DMA instructions obtained from the DMA Descriptor 600.
  • the D MA instruction analyzer 732 stores the first DMA instruction and the second DMA ⁇ : instruction in the ⁇ : instruction FIFO 7 33.
  • the microinstruction FIFO 733 is capable of buffering DMA microinstructions and providing DMA microinstructions to the DMA write operations controller 734 in a first in first out manner.
  • the write operation is taken as an example here, it is described that the DMA microinstruction corresponding to the DMA write operation is cached in the microinstruction FIF0733, and those skilled in the art will realize that the DMA instruction corresponding to the DMA read operation can be the same as the DMA write operation.
  • the corresponding DMA instruction is mixed in the instruction FIF0733.
  • the instruction FIF0733 can also be configured in two or more parts, one of which is dedicated to storing DMA microinstructions corresponding to DMA read operations and the other dedicated to storing DMA ⁇ : instructions corresponding to DMA write operations.
  • DMA write operation controller 734 performs D MA write operations based on these DMA microinstructions.
  • the first DMA ⁇ instruction includes a DMA host address 621 and a buffer memory address 622.
  • the DMA write operation controller 734 initiates a DMA write operation between the host 101 and the storage device 102 through the DMA write interface 735 using the DMA host address 621 and the buffer memory address 622, and transfers the data stored at the DMA host address 621 to the DMA.
  • the transmitted data may have a predetermined length (e.g., 4K bytes).
  • the DMA write operation controller 734 performs a similar operation to transfer the data stored at the DMA host address 631 to the location indicated by the buffer memory address 632.
  • a logical address for the respective storage device is available from the first DMA microinstruction and the second DMA microinstruction.
  • the logic of the storage device for each DMA microinstruction The address is converted to a physical address for the flash chip 105.
  • the Flash interface controller 737 writes the data written to the buffer memory 106 to the flash memory chip 105 based on the physical address provided by the physical address to physical address translation circuit 736.
  • the Flash interface controller 737 also extracts the DMA descriptor length from the saved DMA command 610 of the DMA descriptor 600 based on the index in the first and second microinstructions, and decrements the DMA descriptor (eg, subtracts 1 or minus the unit length). Thus, when the length of the DMA descriptor becomes 0, it means that the operation of the DMA descriptor 600 is completed. In turn, an interrupt can be sent to the host to indicate completion of the operation of the DMA Descriptor 600.
  • the DMA write operation controller also accesses the saved DMA descriptor length and determines whether all data corresponding to the DMA descriptor 600 has been written to the buffer memory 106 and sends an indication to the host. All data has been written to the interrupt of buffer memory 106.
  • Figure 8 is a software block diagram of a host in accordance with an embodiment of the present invention.
  • Figure 8 is a block diagram showing the software of the host 800, which is similar to the software block diagram of the host shown in Figure 4. The difference is that the buffer control block 406 in Fig. 8 further includes a 10 request list 801.
  • the request chain list 801 is a linked list composed of memory cells (411, 412, ..., ..., 41n) in the buffer control block 406.
  • the 10 request list 801 can be a singly linked list, a doubly linked list, or a circular linked list.
  • a corresponding 10 request linked list 801 is created, which includes the DMA command 610, the DMA data 620, and the DMA data 630, respectively.
  • step 901 the host device's storage device driver 405 receives 10 requests.
  • the 10 request indicates that a plurality of data blocks of different physical addresses dispersed in the host memory are written into the storage device 102, for which a scatter-collect DMA operation is performed between the host and the storage device.
  • the operation of the host to write data to the memory will be described below by way of example.
  • step 902 in conjunction with FIG. 8, an empty state storage unit, such as storage unit 411, is fetched from buffer control block 406.
  • a DMA command 610 of the DMA descriptor 600 is created, based on the content of the 10 request, populating the DMA mode field 611 in the DMA command 610 (in this example, a write operation), the storage device logical address field 612 (from 10) This information is available in the request), DMA Descriptor Length field 613 (this information is available from 10 requests), and Buffer Memory Address field 614 (corresponding to the memory location 411 assigned in step 902).
  • the created DMA command 610 is then sent to the storage device 102.
  • the storage unit 411 is taken as the starting node (for example, the storage unit 8 11 ) of the 10 request list 801 for the 10 request.
  • a 10 request chain table 801 is created for returning the occupied storage unit to the buffer control block 406 after the storage device 102 executes the DMA descriptor 600, and notifying the application software or other upper layer software about the execution completion of the 10 request. .
  • a pointer corresponding to the 10 request is also stored in the storage unit 411.
  • the remaining length of the DMA data portion can also be obtained. Before the first DMA data is generated, the remaining length of the DMA data portion is the number of DMA data (620, 630) in the DMA descriptor 600, which is an example of which the DMA descriptor length is decremented by one.
  • an empty state storage unit such as storage unit 412
  • the DMA data 620 of the DMA descriptor 600 is created, the DMA host address field 621 in the DMA data 620 is populated (this information is available from the 10 request), and the buffer memory address 622 (with the allocated memory unit) 412 corresponds to, for example, the offset value or sequence number of the storage unit 412 in the buffer control block 406).
  • the created DMA data 620 is then sent to the storage device 102.
  • the storage unit 412 is taken as a node (for example, the storage unit 812) for the 10 request linked list 801 of the 10 request.
  • the remaining length of the DMA data portion is decremented to obtain the number of DMA data that has not been sent to the storage device in the DMA descriptor 600.
  • step 909 if the remaining length of the DMA data portion is 0, it indicates that the generation of the DMA descriptor 600 has been completed, and in step 910, the storage device driver 405 will wait for the processing of the DMA descriptor 600 returned by the storage device 102 to be completed.
  • the interrupt is interrupted, and the corresponding I 0 request list 801 is found according to the interrupt, and the storage units (811, 812) in the 10 request list 801 are released.
  • the state of the memory cells (811, 812) in the 10 request list 801 is set to idle, so that the state of the memory cells 411, 412 can be learned to be free by the buffer control block 406.
  • the CPU speed associated with the DMA host address (621, 631) of the DMA descriptor 600 is also notified.
  • the buffer memory performs a coherency process to reflect that the data at the DMA host address (621, 631) may have changed due to a read DMA read operation.
  • the interrupt returned by the storage device 102 includes content indicating one of the plurality of storage units (811, 812) (or one of the buffer memory addresses 622, 632) in the request list 801, according to the content, The memory cells (8 11, 812 ) are released by the 10 request list 801.
  • step 909 if the remaining length of the DMA data portion is greater than 0, it indicates that the generation of the DMA descriptor 60 0 has not been completed, and one or more DMA data needs to be generated for the 10 request, then the process returns to step 906 and the steps are repeated. 906, 908 and 909.
  • Figure 9B is a flow diagram of a host creating and executing a second write command in accordance with another embodiment of the present invention.
  • the free memory locations in buffer control block 406 are further organized into free memory cell pools to facilitate the creation of DMA descriptors 600.
  • the pool of free memory cells is formed by organizing the memory cells (411, 412 ... 41n) whose states are free in the buffer control block 406 into a linked list.
  • the memory location can be fetched from the pool of free memory cells, thereby eliminating the overhead of looking up free memory locations in buffer control block 406.
  • step 921 the host device's storage device driver 405 receives 10 requests. Similar to Figure 9, the 10 request indicates that a plurality of data blocks dispersed at different physical addresses of the host memory are written to the storage device 102, for which a scatter-collect DMA operation is performed between the host and the storage device.
  • the length of the DM A descriptor (e.g., the number of DMA commands and the number of DMA data) corresponding to the same 10 request is calculated. It is noted that in the embodiment disclosed in FIG. 9A, the DMA descriptor length is obtained during the creation of the DM A command 610 in step 904, and those skilled in the art will appreciate that the various steps are not necessarily performed in the order disclosed in this embodiment. .
  • step 923 it is determined whether the free storage unit pool is empty. If the free storage unit pool is not empty, that is, there is a storage unit in the idle state in the buffer control block 406, proceed to step 924, and from idle A free storage unit (for example, storage unit 411) is taken out of the storage unit pool. If the free storage unit pool is empty, it means that there are no free storage units in the buffer control block 406. Then in step 925, the pool of idle memory cells is waited for to appear an empty memory location. When the execution of the DMA descriptor is completed, the associated memory cells are released, leaving free memory cells in the free memory cell pool. This will be described in detail later.
  • DMA Descriptor 600 includes a DMA command and one or more DM A data.
  • processing proceeds to step 927, and based on the contents of the 10 request, a DMA command 610 of the DMA descriptor 600 is created, and the fields (611, 612, 613, 614) in the DMA command 610 are filled.
  • a pointer corresponding to the 10 request is also stored in the storage unit 411 so that after the execution of the 10 request is completed, the 10 request can be identified and notified to the application software or other upper layer software.
  • the processing proceeds to step 928, and based on the contents of the 10 request, the DMA data 620 of the DMA descriptor 600 is created, and the fields (621, 622) of the DMA data 620 are filled.
  • step 929 the generated DMA command or DMA data is transmitted to the storage device 102.
  • the storage unit 411 obtained in step 924 is set in the 10 request list 801.
  • the first storage unit that enters the 10 request list 801 will serve as the head node of the 10 request list 8 01, but it will also be appreciated that when the 10 request list 801 is organized as a circular list, it does not exist. "Head node”.
  • the DMA descriptor length is also decremented.
  • the storage device driver 405 will wait for the processing of the D MA descriptor 600 returned by the storage device 102 to have completed.
  • Interrupt and find the corresponding 10 request list 801 according to the interrupt, and release the storage unit (811, 812) in the 10 request list 801.
  • the state of the memory cells (811, 812) in the 10 request list 801 is set to idle, so that the state of the memory cells 411, 412 can be learned to be free by the buffer control block 406, and the memory cell 411 is , 412 is placed in the pool of free storage units.
  • the interrupt returned by the storage device 102 includes content indicating one of the plurality of storage units (811, 812) in the request list 801, according to which the storage unit is accessed by the I0 request list 801. 812) Released.
  • step 931 if the DMA descriptor length is greater than 0, it indicates that the generation of the DMA descriptor 600 has not been completed, and one or more DMA data needs to be generated for the 10 request, then the process returns to step 9 23 and the step 923 is repeated. 931.
  • the generation process of the DMA descriptor 600 is described above in conjunction with Figs. 9A, 9B.
  • the DMA Descriptor 600 is used to describe a plurality of DMA operations to be performed in the Decentralized-Collected DMA, the data of which is derived from being stored in a continuous or unconnected storage space.
  • the manner in which the DM A descriptor 600 is generated includes, but is not limited to, the specific manners described above in Figures 9A, 9B.
  • FIG. 10A is a flow diagram of creating a linked list in a buffer memory of a storage device, in accordance with an embodiment of the present invention.
  • the DMA Descriptor 600 is converted to one or more microinstructions.
  • storage device 102 is responsive to DMA descriptors transmitted by host 101. 600, a linked list is also established in the buffer memory 106, which associates a plurality of microinstructions corresponding to the same DMA descriptor 600. As shown in FIG.
  • DMA Descriptor 600 includes DMA commands 610 and DMA data 620, 630.
  • An example of a process in which the host 101 transmits the DMA descriptor 600 to the storage device 102 has been described above in connection with FIGS. 9A and 9B.
  • creating a linked list in the buffer memory of the storage device will facilitate storage device execution of 10 operations, particularly concurrent/out-of-order execution of multiple 10 operations, multiple access operations may be accessed by The linked list is linked together. Such 10 operations that do not have an associated relationship can be executed concurrently in the storage device.
  • step 1004 it is determined whether the DMA command 610 or the DMA data 620, 630 is received. If the DMA command 610 is received, in step 1006, the buffer memory address for the DMA command 610 is extracted from the buffer memory address field 610 therein, and based on the buffer memory address, the DMA command 610 is slowed down. The storage space is allocated in the flush memory 106. Next, in step 1008, the buffer memory address assigned to the DMA command 610 is saved for use in allocating buffer memory addresses for the DMA data 620, 630.
  • step 1010 the buffer memory address for the DMA data 620 is extracted from the buffer memory address field 622 of the D MA data 620, and based on the The memory address is allocated for the DMA data 620 in the buffer memory 106.
  • step 1012 the buffer memory address of the DMA command 610 held in step 1008 is stored in the memory space of the buffer memory allocated for the DMA data 620.
  • the storage space allocated for the DMA command 610 and the DMA data 620 forms a linked list, wherein the storage space allocated for the DMA command 610 is the head node of the linked list, and the storage allocated for the DMA data 620. The space is connected to the head node of the linked list.
  • the storage space is allocated in the buffer memory 106 for the DMA data 630 based on the buffer memory address 632 in the DMA data 630 through the step 1010 and the step 1 012, and is
  • the buffer memory address of the DMA command 610 is stored in the memory space of the buffer memory allocated by the DMA data 630.
  • the buffer memory address for DMA data 620 may also be stored in the memory space of buffer memory 106 allocated for DMA data 630 to form a different type of linked list.
  • the memory space allocated to the DMA command 610, DMA data 620, 630 in the buffer memory 106 is created as a circular linked list or a two-way linked list.
  • the memory device 102 generates DMA instructions based on the DMA data (620, 630) and is stored in the instruction FIFO 733.
  • DMA Data (620, 630) The operation of generating a DMA instruction may occur after step 1012 and carry the buffer memory address assigned to the D MA data (620, 630) in the DMA instruction.
  • FIG. 10B is a flow diagram of creating a linked list in a buffer memory of a storage device, in accordance with an embodiment of the present invention.
  • information related to the processing or execution of the DMA descriptor is also stored in the created linked list.
  • 10C is a flow diagram of a memory device executing a DMA descriptor using a linked list created in a buffer memory, in accordance with an embodiment of the present invention.
  • Figures 11A-11F show various states of the buffer memory associated with Figures 10B and 10C.
  • 1100 indicates the storage space in the buffer memory 106.
  • host 101 transmits DMA descriptor 600 to storage device 102.
  • the buffer memory address is fetched from the buffer memory address field 610, and based on the buffer memory address, the memory space is allocated in the buffer memory 106 for the DMA command 610.
  • memory space 1101 is allocated for DMA command 610.
  • the DMA Descriptor Length field 613 is also extracted from the DMA command 610, and the length of the DMA data portion of the DMA Descriptor 600 (e.g., the DMA Descriptor Length minus 1) is obtained from the DMA Descriptor Length 6 13 .
  • the buffer memory address assigned to the DMA command 610 is saved for use in allocating buffer addresses for the DMA data 620, 630.
  • the length of the DMA data portion is recorded in the buffer memory allocated for the DMA command 610. Referring to Fig. 11A, the length of the DMA data portion is stored in the memory space 1101 (in this example, the length of the DMA data portion is 2).
  • step 1028 the buffer memory address for the DMA data 620 is extracted from the buffer memory address field 622 of the DMA data 620, and based on the buffer.
  • the memory address allocates storage space in the buffer memory 106 for the DMA data 620. Referring to Figure 11B, memory space 1112 is allocated for DMA data 620. And in step 103 0, the buffer memory address of the DMA command 610 held in step 1026 is stored in the storage space 1112 of the buffer memory allocated for the DMA data 620.
  • the storage spaces (1101 and 1112) allocated for the DMA command 610 and the DMA data 620 form a linked list, wherein the storage space 1101 allocated for the DMA command 610 is the head node of the linked list, which is the DMA.
  • the storage space 1112 allocated by the data 620 is connected to the head node of the linked list.
  • the DMA host address corresponding to the DMA data 620 is also stored in the storage space 1112.
  • the storage space 1123 is allocated in the buffer memory 106 for the DMA data 630 based on the buffer memory address 632 in the DMA data 630 through steps 1028 and 1030 (see FIG. 11C). And in the storage space 1123, the buffer memory address of the DM A command 610 is saved. And storing the DMA host address corresponding to the DMA data 630 in the storage space 1123.
  • a linked list corresponding to the DMA descriptor 600 is formed in the buffer memory 106, wherein the storage space 1101 is the head node of the linked list, and the storage spaces 1112 and 1123 are nodes of the linked list and point to the head node of the linked list.
  • the buffer memory address for DMA data 620 may also be stored in memory space 1123 of buffer memory 106 allocated for DMA data 630 to form a different type of linked list.
  • the memory space allocated by the buffer memory 106 for the DMA command 610, the DMA data 620, 630 is created as a circular linked list or a doubly linked list.
  • FIG. 10C is a flow diagram of a memory device executing a DMA descriptor using a linked list created in a buffer memory, in accordance with an embodiment of the present invention. It has been described above in connection with Figures 7A, 7B, 7C that the memory device 102 generates DMA microinstructions based on DMA data (620, 630) and is stored in the microinstruction FIFO 733.
  • a linked list in the buffer memory 106 is utilized.
  • a buffer memory address is obtained by which the storage in the buffer memory 106 allocated for the DMA data corresponding to the DMA microinstruction can be obtained.
  • the DMA host address corresponding to the DMA data and the DMA data portion length or the number of DMA data in the DMA descriptor corresponding to the DMA data can be obtained.
  • the DMA instruction corresponding to the DMA data 620 is indicated by the first DMA instruction
  • the DMA instruction corresponding to the DMA data 630 is indicated by the second DMA instruction.
  • the first DMA microinstruction is obtained from the microinstruction FIF0733.
  • step 1042 the address of the memory space 1112 of the buffer memory 106 allocated for the DMA data 620 is included in the first DMA instruction, and the DMA host address is obtained from the storage space 1112.
  • the DMA host address is provided by the DMA Host Address field 621 in DMA data 620.
  • DMA transfer is performed between the host 101 and the storage device 102, and data of a predetermined length (for example, 4 KB) at the DMA host address of the host 101 is transferred to the buffer of the storage device 102 in a DMA manner.
  • a predetermined length for example, 4 KB
  • a similar operation is performed to transfer the data at the DMA host address provided by the DMA host address field 632 of the DMA data 630 of the host 101 to the buffer memory of the storage device 102 in a DMA manner.
  • Fig. 11D the storage space 1112 and the storage space 1123 in which data transferred in the DMA mode is stored after the execution of the first DMA microinstruction and the second DMA microinstruction are shown.
  • step 1044 the execution of the first DM A microinstruction continues.
  • a predetermined length of data is fetched from the storage space by the address of the storage space 1112 in the first DMA microinstruction, and the data is transferred from the host 101 to the storage space 1112 of the buffer memory 106 by the DMA operation in step 1042.
  • the data is written to the flash chip 105 based on the address for the flash memory included in the first DMA microinstruction through a flash interface controller (e.g., the Flash interface controller 737 in FIG. 7C). This is used to perform the second DMA microinstruction in a similar manner.
  • a flash interface controller e.g., the Flash interface controller 737 in FIG. 7C
  • the address is written to the flash chip 105.
  • the address for the flash memory included in the second DMA instruction is a predetermined value added by the storage device logical address field 612 in the DMA command 6 10 (e.g., the length of the data corresponding to the DMA transfer, in this example, 4KB) obtained.
  • the storage device logical address in the DMA command 610 is translated to the physical address of the storage device and data is written to the flash chip 105 based on the physical address.
  • the mapping process from the logical address of the storage device to the physical address is well known to those skilled in the art.
  • the execution of the first DM A microinstruction continues.
  • the address of the storage space 1101 allocated for the DMA command 610 is obtained by the address of the storage space 1112 in the first DMA microinstruction, and the DMA data portion length is obtained in the storage space 1101, and the DMA data portion stored in the storage 1101 is stored.
  • the length is decremented (for example, minus 1 or minus the unit length).
  • Fig. 11E for the first DM A microinstruction, after the length of the DMA data portion in the memory space 1101 is decremented, its value is changed from 2 to 1. Moreover, the address of the storage space 1101 is no longer stored in the storage space 1112, indicating that the execution of the DMA data 620 has been completed.
  • the length of the DMA data portion is not 0, it means that the operation on the DM A descriptor 600 has not been completed because it also contains another DMA data 630, at which point no further processing is performed.
  • the memory in the second DMA microinstruction is passed.
  • the address of the storage space 1123 obtains the address of the storage space 1101 allocated for the DMA command 610, and obtains the DMA data partial length in the storage space 1101, and decrements the length of the DMA data portion stored in the storage 1101 (for example, minus 1 or Subtract the unit length).
  • Fig. 11F for the second DMA: instruction, after the length of the DMA data portion in the memory space 1101 is decremented, its value is changed from 1 to 0. Moreover, the address of the storage space 1101 is no longer stored in the storage space 1123, indicating that the execution of the DMA data 630 has been completed.
  • step 1048 since the length of the DMA data portion is 0, it means that the execution of the DMA descriptor 600 has been completed.
  • step 1050 an interrupt is sent to the host 101 to indicate that execution of the DMA description 600 has been completed.
  • the storage spaces 1112 and 1123 no longer hold the address of the storage space 1101.
  • the value of the length of the DMA data portion in the storage space 1101 is 0. In this case, it means that the execution of the DMA descriptor 600 has been completed, and the storage spaces 1101, 1112, and 1123 are no longer used, and these storage spaces can be freed for execution of other DMA descriptors.
  • the release and reuse of the corresponding storage space is controlled by host 101, which has been released in connection with the storage space in request list 801 in conjunction with Figures 9A and 9B. Since the memory cells (411, 412 ... 41n) in the buffer control block 406 correspond to the memory spaces in the buffer memory 106, the release of the memory space in the request list 801 for 10 means that the buffer memory is Release of storage spaces 1101, 1112, and 1123.
  • the scheme of storing the DMA host addresses corresponding to the first and second instructions in the buffer memory 106 is described above with reference to FIGS. 10B, 10C, 11A-11F, so that the DMA instruction does not have to carry the DMA host address and is reduced.
  • storage device logical addresses and/or DMA host addresses corresponding to the first and second microinstructions can also be stored in the buffer memory, thereby further reducing the length of the DMA microinstructions and their The occupation of resources.
  • FIG. 12 is a hardware block diagram of a memory device in accordance with yet another embodiment of the present invention.
  • the host 101 includes a PCIE controller 721 and a host memory 722.
  • the storage device 102 includes a PCIE interface 731, a DMA command analyzer 732, an instruction first in first out buffer (FIFO) 733, a D MA write operation controller 734, a DMA write interface 735, a logical address to physical address conversion circuit 736, and a buffer.
  • the memory 106 is flushed.
  • the storage device 102 further includes a DMA read/write system: an instruction determination circuit 1210, a DMA read interface 1212, flash controllers 1221, 1222, 1223, flash interfaces 1231, 1232, 1233, a completion control circuit 1242, a multiplexer 1241, and a plurality of Road sharer 1243. Flash memory interfaces 1231, 1232, 1 233 are coupled to flash memory chip 105.
  • the PCIE interface 731 receives the DMA descriptor 60 0 transmitted by the host 101 through the PCIE controller 721.
  • the connection between the host 101 and the storage device 102 is not limited to the PCIE mode.
  • the DMA command analyzer 732 converts the DMA descriptor 600 received by the PCIE interface 731 into a DMA microinstruction.
  • the DMA instruction analyzer converts it into a first DMA microinstruction corresponding to the DMA data 620 and a second DMA microinstruction corresponding to the DMA data 630.
  • the first and second DMA microinstructions respectively include a field indicating the microinstruction type (read/write/erase/other), and a field indicating the address of the storage unit in the buffer memory 106 corresponding thereto.
  • DMA command analyzer 732 also allocates memory locations in buffer memory 106 for DMA commands 610 and stores the length of the DMA data portion therein.
  • the DMA instruction parser also allocates memory locations in buffer memory 106 for DMA data 620, stores therein the address of the memory location allocated for DMA command 610, and stores the DMA host address in DMA data 620.
  • the DMA instruction parser also allocates memory locations in buffer memory 106 for DMA data 630, stores therein the address of the memory location allocated for DMA command 610, and stores the DMA host address in DMA data 630.
  • the DMA command analyzer 732 stores the first DMA instruction and the second DMA ⁇ : instruction in the ⁇ : instruction FIFO 733.
  • the instruction FIFO 733 is capable of buffering DMA 4 instructions and providing DMA instructions to the DMA read and write instruction decision circuit 1210 in a first in first out manner.
  • DMA write operation controller 734 performs DMA write operations based on these DMA microinstructions.
  • the DMA write operation controller 734 obtains the DMA host address from the buffer memory 106 using the field in the first DMA microinstruction indicating the address of the memory cell in its corresponding buffer memory 106, and is on the host through the DMA write interface 735.
  • a DMA write operation is initiated between the 101 and the storage device 102, and the data stored in the DMA host address is transferred to the storage unit of the buffer memory 106 corresponding to the first DMA microinstruction, and the transmitted data may have a predetermined schedule.
  • the length (for example 4K bytes).
  • the DMA write operation controller 734 obtains the DMA host address from the buffer memory 106 using the field of the address of the memory cell in its corresponding buffer memory 106, and is at the host 101 and the storage device 102.
  • a DMA write operation is initiated to transfer the data stored in the DMA host address to the memory location of the buffer memory 106 corresponding to the second DMA microinstruction.
  • the logical addresses for the respective storage devices are obtained from the fields of the first DMA microinstruction and the second DMA microinstruction indicating the logical address of the storage device.
  • the logical address of the storage device of each DMA microinstruction is converted to the physical address for the flash chip 105.
  • the Flash controllers 1221, 1222, 1223 write data written to the buffer memory 106 via the flash interfaces 1231, 1232, 1233 based on the physical address provided by the physical address to physical address translation circuit 736.
  • the flash controller 1221 is coupled to the flash interface 1231
  • the flash controller 1222 is coupled to the flash interface 1232
  • the flash controller 1223 is coupled to the flash interface 1233.
  • Flash interfaces 1231, 1232, 1233 are coupled to respective flash chips, respectively.
  • the physical address of the flash chip 105 derived from the logical address translation of the storage device in the DMA microinstruction
  • the physical address indicates a particular flash chip
  • the flash chip is associated with a particular one of the flash interfaces 1231, 1232, 1233 Coupling.
  • the flash interfaces 1231, 1232, 1233 are also coupled to the buffer memory by a multiplexer 1241. Based on the physical address, the multiplexer 1241 transfers data from the buffer memory 106 to a particular one of the flash interfaces 1231, 1232, 1233.
  • the completion control circuit 1242 is further based on the instructions in the first and second microinstructions corresponding to the buffer memory 106 therein.
  • a field of the address of the memory location accessing the buffer memory 106, and thereby accessing the memory location allocated to the DMA command 610 in the buffer memory, obtaining the length of the DMA data portion therefrom, and decrementing the length of the DMA data portion (eg, subtracting 1 or minus the unit length).
  • the length of the DMA data portion in the memory cell allocated for the DMA command 610 becomes 0, it means that the operation on the DMA descriptor 600 is completed.
  • an interrupt can be sent to the host to indicate completion of the operation of the DMA Descriptor 600.
  • Flash controllers 1221, 1222, 122 3 and three flash interfaces 1231, 1232, 1233 are shown by way of example in FIG. 12, those skilled in the art will recognize that a variety of different numbers can be used.
  • the flash controller interfaces with the flash memory to match the number of flash memory chips.
  • the DMA read/write ⁇ instruction judgment circuit 121 0 transfers it directly to the logical address to the physical address conversion circuit 736, and obtains the physical address for the flash chip 105.
  • Flash controllers 1221, 1222, 1223 read data from flash memory chip 105 via flash interfaces 1231, 1232, 1233 based on the physical address.
  • the flash interfaces 1231, 1232, 1233 are coupled to the DMA read interface 1212 via the multiplexer 1 243 such that data obtained from the flash interfaces 1231, 1232, 1233 can be transferred to the host RAM 722 via the DMA read interface 1212.
  • the completion control circuit 1242 After the flash interfaces 1231, 1232, 1 233 read data from the flash chip 105, the completion control circuit 1242 also accesses the buffer based on the field of the address of the memory location in the buffer memory 106 corresponding to the indication in the DMA microinstruction.
  • the memory 106 obtains the length of the DMA data portion and decrements the length of the DMA data portion (e.g., minus 1 or minus the unit length).
  • the length of the DMA data portion becomes 0, it means that the operation of the DM A descriptor is completed.
  • an interrupt can be sent to the host to indicate that the operation of the DMA descriptor is complete.
  • DMA data corresponding to one DMA descriptor 600 is associated by a linked list created in the buffer memory 106, so that the operation sequence of the plurality of DMA microinstructions becomes unimportant.
  • the storage device can also perform read operations from the present disclosure.
  • the flash chip address and the buffer memory address can be simultaneously specified in the read command, and the buffer memory can be utilized as a buffer for reading data.
  • the buffer memory address can also be described in the DMA descriptor associated with the read operation, and after the data is read from the flash chip, the buffer memory can be utilized as a buffer for reading the data.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Bus Control (AREA)

Abstract

提供了DMA传输方法及***。一种在信息处理设备和存储设备之间进行数据传输的方法,所述存储设备包括缓冲存储器和闪存芯片,所述方法包括:接收第一写请求,所述第一写请求包括要写入的数据和用于所述存储设备的闪存芯片的地址;为所述第一写请求在所述信息处理设备中分配第一存储单元;向所述存储设备发送第一写命令,所述第一写命令中包括数据、用于所述存储设备的闪存芯片的地址以及用于所述缓冲存储器的地址;其中,所述用于缓冲存储器的地址同所述第一存储单元相对应;接收来自所述存储设备的消息,所述消息指示所述存储设备对所述写命令已执行完成;释放所述第一存储单元。

Description

说 明 书
DMA传输方法及***
技术领域
本发明涉及固态存储设备( Solid Storage Device, SSD ) , 更具体地, 本发明 涉及将数据通过 DMA传输写入固态存储设备的方法及装置。
背景技术
同机械式硬盘相类似, 固态存储设备 (SSD ) 也是用于计算机***的大容量、 非易失性存储设备。 固态存储设备一般以闪存 (Flash ) 作为存储介质。 在中国专 利文献 CN102043689A中公开了如图 13所示的固态存储设备。 如图 13所示, 为目 前一般的固态存储设备的功能框图。其中主要包括主机*** 1301 和固态存储设备 1302。 其中, 固态存储设备 1302 包括接口模块 1303 , 固态存储处理器 1304 , 以 及以 Flash 颗粒 1305为单位组成的 Flash 阵列 1306。 其中, 接口模块 1303 主 要用于实现与主机***一致的接口协议, 例如 SATA ( Serial Advanced Technolog y Attachment, 串行高级技术附件)、 USB ( Universal Serial Bus , 通用串行总线)、 PCIE ( Peripheral Component Interconnect Express , 快速夕卜围组件互连) 、 SCSI
( Small Computer System Interface , 小型计算机***接口) 、 IDE ( Integrated Dr ive Electronics , 集成驱动器电子) 等。 通过接口模块 1303 , 固态存储设备呈现给 主机***的是一个拥有一定逻辑空间的标准存储设备。 固态存储处理器 1304是整 个存储设备的控制核心, 主要负责接口模块 1303 以及闪存阵列 1306之间的控制 信号及数据的传输、 Flash管理、 主机逻辑地址到 Flash 物理地址的转换或映射、 损耗均衡(将逻辑地址映射到不同的物理地址从而防止单个 Flash被过于集中地操 作而提前失效) 、 坏块管理等。 可由软件、 硬件、 固件或者其组合的多种方式实现 固态存储处理器 1304。 1305为单个 Flash 颗粒, 多个 Flash 颗粒 1305组成 Flas h 阵列 1306。
为提高固态存储设备的读、 写速度, 可以在固态存储设备中设置诸如 DRAM 或 SRAM的随机访问存储器或其他类型的适于高速读 /写操作的存储器, 作为同闪 存读写数据时的高速緩冲存储器。 在存储设备访问过程中, 作为一个例子, 计算机 向存储设备发出 SCSI (小型计算机***接口)命令, 存储设备接收并处理 SCSI命 令, 依据 SCSI命令所指示的操作执行相应的存储介质读写过程。 在这一过程中, S CSI命令并不直接操作高速緩冲存储器。 即, 高速緩冲存储器对计算机或者用户是 "透明" 的。 也有一些存储设备提供了高速緩冲存储器的 "清洗" 机制, 计算机或 用户可使用预定的命令强制存储设备将高速緩冲存储器中的数据写入到非易失性 存储介质 (例如, 磁盘或者闪存) 中。
然而, 对高速緩冲存储器的分配和管理将成为固态存储设备上的控制器的工 作负担。 而且当高速緩冲存储器被完全占用后, 如果固态存储设备接收到来自主机 ***的新的访问请求, 则还需要执行对高速緩冲存储器的替换操作。 这样既增加了 控制器的复杂度, 又会让主机经历在读 /写性能上的颠簸。
在主机与设备之间还可以进行 DMA ( Direct Memory Access , 直接存储器访 问)传输。在中国专利文献 CN101221544A中公开了执行 DMA传输的方法和设备。 DMA传输的一个典型过程是分散 /收集 ( Scatter/Gather ) 操作。 分散 /收集操作中, 待传输的多个数据块存储在***(主机)存储器的不连续的多个地址位置。 处理器 不需要为要从某一源移动到某一目的地的每个数据块对 DMA控制器进行编程的操 作。 而是, 处理器在***存储器中建立描述符表或描述符链接表。 描述符表或描述 符链接表中包括一组描述符。 每个描述符都描述了数据块移动方向、 源地址、 目的 地地址以及可选的传输的字节数。 在一个描述符中不包括传输字节数的情况下, 可 通过 DMA方式传输约定长度的数据。
发明内容
因而, 分担存储设备上的控制器的工作负担是有益的。 通过将与存储设备的 緩冲存储器有关的维护工作转移给主机, 既减轻了存储设备的控制器的负载, 也向 主机提供了更灵活控制存储设备的能力。
在本发明的第一实施例中,提供了一种在信息处理设备和存储设备之间进行 D MA传输的方法, 所述存储设备包括緩冲存储器和闪存芯片, 所述方法包括: 接收 第一 10请求; 为所述第一 10请求分配第一存储单元与第二存储单元; 向所述存储 设备发送所述第一 DMA描述符, 所述第一 DMA描述符包括 DMA主机地址、 用 于所述存储设备的闪存芯片的地址以及第一用于緩冲存储器的地址与第二用于緩 冲存储器的地址, 其中, 所述第一用于緩冲存储器的地址同所述第一存储单元相对 应, 所述第二用于緩冲存储器的地址同所述第二存储单元相对应; 在所述存储设备 和所述信息处理设备之间依据所述第一 DMA描述符进行 DMA传输; 接收来自所 述存储设备的消息, 所述消息指示所述存储设备对第一 DMA描述符已执行完成; 释放所述第一存储单元与所述第二存储单元。
根据本发明的第一实施例, 其中分配第一存储单元与第二存储单元进一步包 括, 在所述第二存储单元中存储指向所述第一存储单元的地址。
在本发明的第二实施例中提供了一种在信息处理设备和存储设备之间进行 D MA传输的方法, 所述存储设备包括緩冲存储器和闪存芯片, 所述方法包括: 接收 第一 10请求; 为所述第一 10请求分配第一存储单元与第二存储单元; 向所述存储 设备发送所述第一 DMA描述符, 所述第一 DMA描述符包括第一 DMA描述符命 令和第一 DMA描述符数据, 所述第一 DMA描述符命令包括用于所述存储设备的 闪存芯片的地址以及第一用于緩冲存储器的地址, 所述第一 DMA描述符数据包括 DMA主机地址以及第二用于緩冲存储器的地址; 其中, 所述第一用于緩冲存储器 的地址同所述第一存储单元相对应,所述第二用于緩冲存储器的地址同所述第二存 储单元相对应; 在所述存储设备和所述信息处理设备之间依据所述 DMA主机地址 和所述第二用于緩冲存储器的地址进行 DMA传输;接收来自所述存储设备的消息, 所述消息指示所述存储设备对第一 DMA描述符已执行完成; 释放所述第一存储单 元与所述第二存储单元。
根据本发明的第一或第二实施例, 其中, 所述第一 10请求指示将所述 DMA 主机地址处的数据写入到用于所述存储设备的闪存芯片的地址处。
根据本发明的第一或第二实施例, 还包括将空闲的存储单元链接在一起形成 空闲存储单元资源池, 在分配第一存储单元与第二存储单元时, 从所述空闲存储单 元资源池中取出空闲的存储单元, 在释放所述第一存储单元与所述第二存储单元 时,基于所述所述第一存储单元与所述第二存储单元***到所述空闲存储单元资源 池。
根据本发明的第一或第二实施例, 还包括将空闲的存储单元链接在一起形成 空闲存储单元资源池, 在分配第一存储单元与第二存储单元时, 若所述空闲存储单 元资源池为空, 则等待一个或多个存储单元被***到所述空闲存储单元资源池。
在本发明的第三实施例中,提供了一种在信息处理设备和存储设备之间进行 D ΜΑ传输的方法, 所述存储设备包括緩冲存储器和闪存芯片, 所述方法包括: 接收 第一 10请求; 为所述第一 10请求分配第一存储单元、 第二存储单元与第三存储单 元; 向所述存储设备发送所述第一 DMA描述符, 所述第一 DMA描述符包括第一 DMA描述符命令、 第一 DMA描述符数据和第二 DMA描述符数据, 所述第一 DM 的地址, 所述第一 DMA描述符数据包括第一 DMA主机地址以及第二用于緩冲存 储器的地址, 所述第二 DMA描述符数据包括第二 DMA主机地址以及第三用于緩 冲存储器的地址; 其中, 所述第一用于緩冲存储器的地址同所述第一存储单元相对 应, 所述第二用于緩冲存储器的地址同所述第二存储单元相对应, 所述第三用于緩 冲存储器的地址同所述第三存储单元相对应;在所述存储设备和所述信息处理设备 之间依据所述第一 DMA主机地址和所述第二用于緩冲存储器的地址进行 DMA传 输, 以及依据所述第二 DMA主机地址和所述第三用于緩冲存储器的地址进行 DM A传输; 接收来自所述存储设备的消息, 所述消息指示所述存储设备对第一 DMA 描述符已执行完成; 释放所述第一存储单元、 所述第二存储单元与所述第三存储单 元。
根据本发明的第三实施例, 所述第一 10请求指示将所述第一 DMA主机地址 处的数以及所述第二 DM A主机地址处的数据写入到用于所述存储设备的闪存芯片 的地址处。 根据本发明的第三实施例, 其中分配第一存储单元、 第二存储单元与第 三存储单元后, 将所述第一存储单元、 所述第二存储单元和所述第三存储单元链接 为循环链表。 根据本发明的第三实施例, 所述来自所述存储设备的消息中包括指示 所述第一存储单元、 所述第二存储单元和所述第三存储单元之一的内容。
根据本发明的第一、 第二和第三实施例, 其中分配所述第一存储单元后, 在 所说第一存储单元中存储用于标识所述第一 10请求的指针。
在本发明的第四实施例中提供了一种在信息处理设备和存储设备之间进行数 据传输的方法, 所述存储设备包括緩冲存储器和闪存芯片, 所述方法包括: 接收第 一写请求,所述第一写请求包括要写入的数据和用于所述存储设备的闪存芯片的地 址; 为所述第一写请求在所述信息处理设备中分配第一存储单元; 向所述存储设备 发送第一写命令, 所述第一写命令中包括数据、 用于所述存储设备的闪存芯片的地 址以及用于所述緩冲存储器的地址; 其中, 所述用于緩冲存储器的地址同所述第一 存储单元相对应; 接收来自所述存储设备的消息, 所述消息指示所述存储设备对所 述写命令已执行完成; 释放所述第一存储单元。
根据本发明的第四实施例, 其中还为所述第一写请求分配第二存储单元, 并 在所述第二存储单元中存储指向所述第一存储单元的指针; 基于所述消息, 释放所 述第一存储单元与所述第二存储单元。 在本发明的第五实施例中,提供了一种在信息处理设备和存储设备之间进行 D MA传输的装置, 所述存储设备包括緩冲存储器和闪存芯片, 所述装置包括: 用于 接收第一 10请求的模块;用于为所述第一 10请求分配第一存储单元与第二存储单 元的模块; 用于向所述存储设备发送所述第一 DMA描述符的模块, 所述第一 DM A描述符包括 DMA主机地址、 用于所述存储设备的闪存芯片的地址以及第一用于 緩冲存储器的地址与第二用于緩冲存储器的地址, 其中, 所述第一用于緩冲存储器 的地址同所述第一存储单元相对应,所述第二用于緩冲存储器的地址同所述第二存 储单元相对应; 用于在所述存储设备和所述信息处理设备之间依据所述第一 DMA 描述符进行 DMA传输的模块; 用于接收来自所述存储设备的消息的模块, 所述消 息指示所述存储设备对第一 DMA描述符已执行完成; 用于释放所述第一存储单元 与所述第二存储单元的模块。
根据本发明的第五实施例, 还包括用于在分配第一存储单元、 第二存储单元 与第三存储单元后, 将所述第一存储单元、 所述第二存储单元和所述第三存储单元 链接为循环链表的装置。
根据本发明的第五实施例, 还包括: 用于将空闲的存储单元链接在一起形成 空闲存储单元资源池的装置; 在分配第一存储单元与第二存储单元时, 从所述空闲 存储单元资源池中取出空闲的存储单元,在释放所述第一存储单元与所述第二存储 单元时,基于所述所述第一存储单元与所述第二存储单元***到所述空闲存储单元 资源池。 根据本发明的第五实施例, 还包括: 用于将空闲的存储单元链接在一起形 成空闲存储单元资源池的装置, 在分配第一存储单元与第二存储单元时, 若所述空 闲存储单元资源池为空,则等待一个或多个存储单元被***到所述空闲存储单元资 源池。
本发明的第六实施例提供了一种在信息处理设备和存储设备之间进行 DMA 传输的装置, 所述存储设备包括緩冲存储器和闪存芯片, 所述装置包括: 用于接收 第一 10请求的模块;用于为所述第一 10请求分配第一存储单元与第二存储单元的 模块; 用于向所述存储设备发送所述第一 DMA描述符的模块, 所述第一 DMA描 述符包括第一 DMA描述符命令和第一 DMA描述符数据, 所述第一 DMA描述符 命令包括用于所述存储设备的闪存芯片的地址以及第一用于緩冲存储器的地址,所 述第一 DMA描述符数据包括 DMA主机地址以及第二用于緩冲存储器的地址; 其 中, 所述第一用于緩冲存储器的地址同所述第一存储单元相对应, 所述第二用于緩 冲存储器的地址同所述第二存储单元相对应;用于在所述存储设备和所述信息处理 设备之间依据所述 DMA主机地址和所述第二用于緩冲存储器的地址进行 DMA传 输的模块; 用于接收来自所述存储设备的消息的模块, 所述消息指示所述存储设备 对第一 DMA描述符已执行完成; 用于释放所述第一存储单元与所述第二存储单元 的模块。
本发明的第七实施例提供了一种在信息处理设备和存储设备之间进行数据传 输的装置, 所述存储设备包括緩冲存储器和闪存芯片, 所述装置包括: 用于接收第 一写请求的装置,所述第一写请求包括要写入的数据和用于所述存储设备的闪存芯 片的地址; 用于为所述第一写请求在所述信息处理设备中分配第一存储单元的装 置; 用于向所述存储设备发送第一写命令的装置, 所述第一写命令中包括数据、 用 于所述存储设备的闪存芯片的地址以及用于所述緩冲存储器的地址; 其中, 所述用 于緩冲存储器的地址同所述第一存储单元相对应;用于接收来自所述存储设备的消 息的装置, 所述消息指示所述存储设备对所述写命令已执行完成; 用于释放所述第 一存储单元的装置。
根据第七实施例, 还包括用于为所述第一写请求分配第二存储单元, 并在所 述第二存储单元中存储指向所述第一存储单元的指针的装置; 以及用于基于所述消 息,释放所述第一存储单元与所述第二存储单元的装置。根据本发明的第五实施例、 第六实施例和第七实施例, 还包括用于在分配所述第一存储单元后, 在所说第一存 储单元中存储用于标识所述第一 10请求的指针的装置。
附图说明
当连同附图阅读时, 通过参考后面对示出性的实施例的详细描述, 将最佳地 理解本发明以及优选的使用模式和其进一步的目的和优点, 其中附图包括:
图 1是根据本发明实施例的存储设备的结构框图;
图 2A、 2B是根据本发明实施例的写入命令的示意图;
图 3是根据本发明实施例的存储设备执行写入命令的方法的流程图; 图 4是根据本发明实施例的主机的示意图;
图 5是根据本发明实施例的主机执行写入操作的流程图;
图 6是根据本发明实施例的第二写入命令的示意图;
图 7 A、 7B是根据本发明实施例的存储设备执行第二写入命令的流程图; 图 7C中展示了用于实施图 7A、 7B中的执行第二写入命令的存储设备的硬件 方框图;
图 8是根据本发明实施例的主机的软件方框图;
图 9 A是根据本发明实施例的主机创建并执行第二写入命令的流程图; 图 9B是根据本发明另一实施例的主机创建并执行第二写入命令的流程图; 图 10A是根据本发明的一实施例的在存储设备的緩冲存储器中创建链表的流 程图;
图 10B是根据本发明的一实施例的在存储设备的緩冲存储器中创建链表的流 程图;
图 10C是根据本发明的一实施例的存储设备利用在緩冲存储器中创建的链表 执行 DMA描述符的流程图;
图 11A-11F展示出了与图 10B、 图 10C相关联的緩冲存储器的多种状态; 图 12是根据本发明的又一实施例的存储设备的硬件方框图;
图 13是根据现有技术的存储设备的方框图。
具体实施方式
图 1是根据本发明实施例的存储设备的结构框图。 如图 1所示的实施例包括 主机 101以及同主机 101相耦合的存储设备 102。 主机 101同存储设备 102之间可 通过多种方式相耜合, 耦合方式包括但不限于通过例如 SATA、 IDE, USB、 PCIE、 SCSI, 以太网、 光纤通道、 无线通信网络等连接主机 101与存储设备 102。 主机 1 01可以是能够通过上述方式同存储设备相通信的信息处理设备, 例如, 个人计算 机、 平板电脑、 服务器、 便携式计算机、 网络交换机、 路由器、 蜂窝电话、 个人数 字助理等。 存储设备 102包括主机接口 103、 控制电路 104、 一个或多个闪存芯片 105以及緩冲存储器 106。 主机接口 103可适配于通过例如 SATA、 IDE, USB、 P CIE、 SCSI, 以太网、 光纤通道等方式与主机 101交换数据。 控制电路 104用于控 制在主机接口 103、 闪存芯片 105以及緩冲存储器 106之间的数据传输, 还用于闪 存管理、主机逻辑地址到闪存物理地址映射、擦除均衡、 坏块管理等。 可通过软件、 硬件、 固件或其组合的多种方式实现控制电路 104。 控制电路 104可以是 FPGA ( F ield-programmable gate array , 现场可编程门阵歹1 J ) 、 ASIC ( Application Specific Integrated Circuit, 应用专用集成电路) 或者其组合的形式。 控制电路 104也可以 包括处理器或者控制器。
根据本发明的一个实施例, 主机 101向存储设备 102发出读出命令或者写入 命令。 控制电路 104经由主机接口 103接收到该读出命令或写入命令。 在附图 2中 详细描述了作为例子的第一写入命令 200。
参看图 2A、 2B , 图 2A是根据本发明实施例的写入命令的示意图。 写入命令 200包括字段 201、 202、 203和 204。 字段 201指示该命令为写入命令, 字段 202 为闪存地址, 字段 203为数据, 该写入命令 200指示存储设备 102将数据字段 203 中的数据基于由字段 202所指示的闪存地址写入闪存芯片 105。 字段 204为緩冲存 储器地址, 存储设备 102接收到该写入命令 200时, 先将数据字段 203中的数据基 于写入由字段 204所指示緩冲存储器地址写入緩冲存储器 106 , 再将数据字段 203 中的数据基于由字段 202所指示的闪存地址写入闪存芯片 105。 在一个例子中, 存 储设备 102将数据字段 203中的数据基于写入由字段 204所指示緩冲存储器地址写 入緩冲存储器 106后, 再从緩冲存储器 106中读出该数据, 继而将该数据写入到闪 存芯片 105。 将数据写入到緩冲存储器 106的操作, 同将存储器 106中的另一数据 读出并写入到闪存芯片 105的操作可以并发执行, 从而使得主机 101向存储设备 1 02的写入操作的并发性能得到提升, 并且不会显著增加控制电路 104的复杂度, 因为控制电路 104无需处理緩冲存储器 106的空间分配任务。 在一个实施例中, 字 段 204中可以是緩冲存储器 106的完整地址, 而在另一个实施例中, 字段 204是相 对某一基地址的偏移值。在一个实施例中,字段 203中携带要写入闪存 105的数据。 而在另一个实施例中, 字段 203中可携带一个指针, 该指针指向要写入存储设备 1 02的数据, 而该数据可以存储在主机 101的存储器中, 在此情况下, 存储设备 10 2通过随后的 DMA传输过程从主机 101获得该数据。 在依然另一个实施例中, 字 段 203可携带一个指针, 该指针指向要写入存储设备 102的数据, 而该数据可以存 储在存储设备 102的緩冲存储器中。 字段 202可以是要将数据写入的闪存芯片 105 的物理地址或逻辑地址。 字段 202也可以是一个指针, 指向緩冲存储器 106 , 在其 中存储有用于闪存芯片 105的物理地址或逻辑地址。逻辑地址到物理地址的转换过 程, 可以通过查找地址映射表的方式实现。
所属领域技术人员将容易意识到, 写入命令可以具有多种具体编码方式和字 段顺序。 例如, 参看图 2B , 指示写入命令 210的类型是写操作的字段 214可以在 写入命令 210的末尾或者其他位置。 而在字段 211中携带緩冲存储器地址, 在字段 212中携带数据或指向数据的存放位置的指针。 在字段 213中存放闪存地址, 或者 指向存放闪存地址的指针, 闪存地址可以是逻辑地址或物理地址。
图 3是根据本发明实施例的存储设备执行写入命令的方法的流程图。在步骤 3 01 , 存储设备 102从主机 101接收到写入命令 200。 存储设备 102的控制电路 104 通过主机接口 103接收到写入命令 200后,提取出包含于写入命令 200中的用于指 示操作类型为写操作的字段 201 , 用于指示要写入的闪存的地址的字段 202, 用于 指示要写入的数据的字段 203 , 以及用于指示緩冲存储器 106的地址的字段 204。 在步骤 302, 响应于该写入命令 200 , 控制电路 104基于字段 204得到用于緩冲存 储器 106的地址, 并基于字段 203得到要写入的数据, 以及将要写入的数据写入到 緩冲存储器 106中由字段 204所指示的位置。当将数据写入到緩冲存储器 106中后, 存储设备 102可向主机发送消息以指示写入命令 200的执行完成, 虽然数据此时尚 未被实际写入到闪存芯片 105之中。 以此方式, 在主机 101看来, 在步骤 302执行 完成后, 写入命令 200已经执行完成, 从而提升了存储设备 102的执行写入命令 2 00的性能。 向主机发送的消息可以包含于存储设备 102向主机 101所发送的中断 请求之中, 也可以基于主机 101与存储设备 102之间的耦合方式( SATA、 IDE, U SB、 PCIE、 SCSI, 以太网、 光纤通道、 无线通信网络等) 而选择适当的其他消息 发送方式。 在将要写入的数据写入到緩冲存储器 106之后, 在控制电路 104的控制 下, 将由字段 203所指示的要写入的数据, 基于由字段 202所指示的闪存地址, 写 入到闪存芯片 105中 (步骤 303 ) 。 当将数据写入到闪存芯片 105中后, 存储设备 102也可向主机发送消息以指示写入命令 200的执行完成, 特别地, 此时主机可以 在写入命令 200中再次指定将数据写入该用于指示緩冲存储器 106的地址,而不会 因对该地址处的数据的重写而导致数据错误。 在一个例子中, 如果字段 202所指示 的是用于闪存芯片 105的逻辑地址,则将该逻辑地址转换为用于闪存芯片 105的物 理地址。 逻辑地址到物理地址的转换方式是所属领域技术人员所了解的。 在一个例 子中, 在步骤 303 , 从緩冲存储器 106中重新取得所写入的数据, 并将该数据写入 到闪存芯片 105。 所属领域技术人员将意识到, 在控制电路 104的控制下, 步骤 3 02中将数据写入到緩冲存储器 106的操作, 与步骤 303中将数据写入到闪存存储 器 105的操作, 可以并行执行。 这样, 在存储设备 102中可以同时处理多个写入命 令, 其中, 在一个时刻, 基于一个写入命令, 控制电路 104将第一数据写入到緩冲 存储器 106中; 而基于另一个写入命令, 控制电路 104将存在于緩冲存储器 106中 的第二数据写入到闪存芯片 105中。 緩冲存储器 106可以是双端口存储器, 使得在 经由第一端口向緩冲存储器 106写入第一数据的同时,可以从第二端口从緩冲存储 器 106读出第二数据。所属领域技术人员可意识到緩冲存储器 106的其他实施方式, 以支持对多份数据的同时读出和 /或写入操作。
通过在写入命令中携带用于指示緩冲存储器 106的地址的字段 204,将维护緩 冲存储器 106的工作从控制电路 104移除了,并且使主机 101拥有了更灵活控制存 储设备 102的能力。
图 4是根据本发明实施例的主机的示意图。 图 4是示出了主机 400的软件组 成的方框图。 主机 400可以是个人计算机、 服务器计算机或者其他具有计算能力的 设备。 主机 400包括一个或多个用户应用程序 401、 402和 403 , 以及操作*** 40 4。 操作*** 404中具有存储设备驱动程序 405。 在根据本发明的实施例中, 驱动 程序 405中包括緩冲区控制块 406 , 用以在主机 400中控制存储设备 102的緩冲存 储器 106。 緩冲区控制块 406由多个存储单元 (411、 412 ··· ··· 41η ) 组成, 緩冲区 控制块 406中的每个存储单元 (411、 412 ··· ··· 41η ) 对应于緩冲存储器 106中的一 个存储单元, 并记录緩冲存储器 106中的对应存储单元的工作状态。 在一个实施例 中, 緩冲区控制块 406中的存储单元 (411、 412…… 41η ) 的每一个, 记录緩冲存 储器 106中的对应存储单元是空闲的还是已经被占用。 在进一步的一个实施例中, 在发送给存储设备 102的一个读 /写命令中涉及緩冲存储器中的多个存储单元, 例 如 2个。 在此情况下, 将緩冲区控制块 406中的 2个存储单元(411、 412 ) 关联在 一起, 在存储单元 411、 412中还记录存储单元 411与 412之间的这种关联关系, 例如, 在存储单元 411中记录指向存储单元 412的一个或多个指针。 在依然进一步 的实施例中, 在存储单元 412中还记录指向存储单元 411的一个或多个指针。
图 5是根据本发明实施例的主机执行写入操作的流程图。 当用户应用程序或 者其他程序请求执行将数据写入到存储设备的操作时,应用程序或其他程序会发送 写请求。 图 4中的存储设备驱动程序 405接收该写请求 (步骤 501 ) , 该写请求中 包括应用程序或其他程序所提供的要写入的数据已经用于存储设备的地址,用于存 储设备的地址可以是文件路径及偏移值,并进一步被转换为用于存储设备的逻辑地 址。 在一个例子中, 该逻辑地址是用于存储设备上的闪存芯片的逻辑地址, 该写请 求要将数据基于该逻辑地址写入到闪存芯片中。 在步骤 502, 存储设备驱动程序 4 05为该写请求分配空闲的緩冲存储器。 具体地, 遍历緩冲区控制块 406, 找到其中 为空闲状态的存储单元, 例如, 存储单元 411。 存储单元 411为空闲状态, 表示在 存储设备 102的緩冲存储器 106中的对应存储单元为空闲状态,可以接收写入的数 据。
在步骤 503中, 存储设备驱动程序 405向存储设备 102发送写命令, 在写命 令中包括要写入的数据以及用于存储设备 102的地址,在该写命令中还包括同存储 单元 411相对应的用于緩冲存储器 106的地址。 所属领域技术人员将意识到, 有多 种方式获得存储单元 411与緩冲存储器 106中的对应存储单元的对应关系。 例如, 緩冲区控制块 406中有 η个存储单元 (411、 412…… 41η ) , 而緩冲存储器 106中 也包括 η个存储单元, 存储单元 411对应于緩冲存储器 106中的第一个存储单元, 而存储单元 412对应于緩冲存储器 106中的第二个存储单元, 以及类似地, 存储单 元 41η对应于緩冲存储器 106中的第 η个存储单元,使得基于存储单元 411在緩冲 区控制块 406中的位置可计算出緩冲存储器 106中的对应存储单元的地址。依然作 为一个例子, 还可以在存储单元 (411、 412…… 412 ) 中存储緩冲存储器 106中的 对应存储单元的地址。 在依然另一个例子中, 在写命令中携带一个序号, 该序号既 指示存储单元 411在緩冲区控制块 406中的位置,又指示在緩冲存储器 106中的对 应存储单元的位置。
在步骤 504, 接收到来自存储设备 102的消息。 在一个例子中, 该消息是中断 请求, 该中断请求指示在步骤 503中发送的写命令已经执行完毕。 如前面所述的, 在一个例子中,存储设备 102中的控制电路 104在将写命令中的数据写入到緩冲存 储器 106 (特别地, 写入到緩冲存储器 106中与緩冲区控制块 406的存储单元 411 相对应的存储单元)之后, 存储设备即发送中断, 指示该写命令执行完成。 在一个 例子中, 控制电路 104将数据写入到闪存芯片 105之后, 存储设备 102向主机 101 发送中断。 在一个例子中, 该中断请求中还包括指示步骤 503中发送的写命令相关 的緩冲区控制块 406的存储单元的信息。 该信息可以是一个或多个存储单元(411、 412…… 41η ) 的地址, 一个或多个存储单元 (411、 412…… 41η ) 的序号。
在步骤 505 , 响应于在步骤 504中接收到的该中断请求, 并基于该中断请求中 所指示的与该写命令相关的緩冲区控制块 406的存储单元的信息,释放与该写命令 相关的緩冲区控制块 406的存储单元 (411、 412…… 41η ) 。 释放存储单元 (411、 412 ··· ··· 41η ) 具体可以是在存储单元 (411、 412 ··· ··· 41η ) 中设置緩冲存储器 106 中的对应存储单元是空闲状态。
在一个例子中,步骤 503中的写命令涉及緩冲区控制块 406的两个存储单元 4 11与 412, 并且, 存储单元 411与 412中分别记录了指向彼此的指针, 以表示这两 个存储单元 411、 412关联于同一个写命令。 在步骤 504中接收到的中断请求中, 既可以指示存储单元 411也可以指示存储单元 412。 在步骤 505中, 基于指示存储 单元 411与 412之一的指针, 可获得两个存储单元 411与 412, 并将其释放。 类似 地,所属领域技术人员可意识到以此方式还可以在写命令中关联三个或更多的存储 单元 (411、 412…… 41η ) 。
图 6是根据本发明实施例的第二写入命令的示意图。 第二写入命令指示存储 设备 102以 DMA方式从主机 101获得数据并写入到闪存芯片 105中。 第二写入命 令可以是 DMA描述符 600。 DMA描述符 600包括 DMA命令 610以及一个或多个 DMA数据 ( 620、 630 ) 。 DMA命令 610包括字段 611 , 用于指示 DMA方式, 即 该 DMA描述符 600指示的操作, 其可以为闪存读、 写、 擦除或者其他操作。 字段 612指示存储设备的逻辑地址。 字段 613指示该 DMA描述符 600的长度, 即该 D MA描述符 600所包括的 DMA数据 ( 620、 630 ) 的个数, 其可以为 1个或多个。 字段 614指示緩冲存储器 106的地址。 DMA数据 620、 630分别包括字段 621、 63 1 , 用于指示 DMA传输中的主机地址。 DMA数据 620、 630还分别包括字段 622、 632, 用于指示緩冲存储器 106的地址。
DMA命令 610中的字段 612的存储设备的逻辑地址可用于 DMA数据 620、 6 30。 在 DMA描述符 600中仅包括一个 DMA数据 620的情况下, 存储设备 102根 据字段 621指示的主机地址和字段 622指示的緩冲存储器地址,在主机 101和存储 设备 102之间发起 DMA传输, 并最终将接收到的数据存储到由字段 612所指示的 闪存芯片 105中。 在 DMA描述符 600包括 DMA数据 620与 630的情况下, 存储 设备 102将根据 DMA数据 620而执行 DMA传输所得的数据, 最终存储在由字段 612所指示的闪存芯片 105中, 而存储设备 102还将根据 DMA数据 630而执行 D MA传输所得的数据, 最终存储在由字段 612加上一预定偏移值所指示的闪存芯片 105中。 换句话说, DMA描述符 600可以指示在主机 101和存储设备 102之间的 多次 DMA传输, 每次 DMA传输同 DMA数据 620、 630中的一个相对应, 每次 D MA传输中传输相同数量的数据(例如 4K字节), 并且 DMA数据 620与 DMA数 据 630所对应的 DMA传输的存储设备的逻辑地址是连续的 (例如, 相距预定的偏 移值, 该偏移值可以与 DMA传输的数据量相对应) 。 这样, 可以在 DMA描述符 600中仅携带一个存储设备逻辑地址(字段 612 )。 而 DMA数据 620与 DMA数据 630所对应的 DMA传输的两个 DMA主机地址(字段 621、 631 )可以是不连续的, 这样可以支持分散 -收集 (Scatter-Gather ) 方式的 DMA传输。
在对应于 DMA数据 620的 DMA传输中, 将来自字段 621所指示的 DMA主 机地址的数据, 写入到字段 622所指示的緩冲存储器 106中, 继而再写入到闪存芯 片 105中。 在对应于 DMA数据 630的 DMA传输中, 将来自字段 631所指示的 D MA主机地址的数据, 写入到字段 632所指示的緩冲存储器 106中, 继而再写入到 闪存芯片 105中。
字段 614是可选的。 在字段 614所对应的緩冲存储器地址处, 作为一个例子, 可保存字段 613所指示的 DMA描述符 600的长度。 从而可以记录 DMA多个数据 620、 630所对应的 DMA传输有多少已经得到执行, 或者有多少尚未被执行。 对于 DMA描述符 600, 当其全部 DMA数据 620、 630所对应的 DMA传输均已执行完 毕后, 例如, 所对应的数据均写入到闪存芯片 105中后, 存储设备 102向主机 101 发送中断, 以指示对 DMA描述符 600的执行完成。 这样, 对于 DMA描述符 600 , 虽然其对应于 2次 DMA传输过程, 但仅向主机 101发送一次中断。 减少中断请求 次数, 将有助于降低主机 101的工作负荷。
图 7A、 7B是根据本发明实施例的存储设备执行第二写入命令的流程图。 第二 写入命令可以是如图 6所示的描述符 600。 参看图 7A, 在步骤 701 , 存储设备 102 接收 DMA描述符 600。 在 DMA描述符 600中包括用于主机的地址 (例如, DMA 主机地址 621、 631 ) , 用于闪存芯片 105的地址 (例如, 存储设备逻辑地址 612 ) 以及用于緩冲存储器 106的地址(例如, 緩冲存储器地址 622、 632 ) 。 虽然在图 6 中的 DMA描述符 600包括 DMA命令 610、 DMA数据 620、 630 , 但这仅是为了清 楚表达的目的。 DMA命令 610、 DMA数据 620、 630也可以组合在一起。 存储设 备 102从 DMA描述符 600中提取出用于主机的地址, 用于闪存芯片 105的地址以 及用于緩冲存储器 106的地址。
在步骤 702, 存储设备 102基于用于主机的地址和用于緩冲存储器的地址, 以 DMA传输方式从主机 101将数据写入到緩冲存储器 106。 在步骤 703 , 基于用于闪 存存储器的地址和用于緩冲存储器, 将在步骤 702中写入到緩冲存储器中的数据, 写入到闪存芯片 105。
在一个例子中, 在步骤 702, 将数据写入到緩冲存储器 106之后, 向主机 101 发送中断, 以指示对 DMA传输的执行完成。 如果 DMA描述符 600中仅包括这一 次 DMA传输 (例如, DMA描述 600仅包括 DMA命令 610与 DMA数据 620 ) , 则该中断也表示对 DMA描述符 600的执行完成。 在一个例子中, 在步骤 703 , 将 数据写入到闪存芯片 105之后, 向主机 101发送中断, 以指示对 DMA传输的执行 完成。
参看图 7B , 其示出了对包含多个 DMA数据 ( 620、 630 ) 的 DMA描述符 60 0的更详细的处理过程。 在步骤 711 , 存储设备 102接收 DMA描述符 600 , DMA 描述符 600包括 DMA命令 610、 DMA数据 620以及 DMA数据 630。
在步骤 712, 基于 DMA描述符 600 , 将 DMA数据 620变换为第一 DMA微指 令, 将 DMA数据 630变换为第二 DMA微指令。 第一 DMA微指令中包括 DMA主 机地址 621和緩冲存储器地址 622。 基于第一 DMA 指令, 还可以获得与其对应 的存储设备的逻辑地址 612、 DMA操作类型以及 DMA描述符长度 613。 该存储设 备的逻辑地址 612和 DMA操作类型可以是第一 DMA 指令的一部分, 也可以是 存储在緩冲存储器 106中, 并通过在第一 DMA微指令中的索引来访问, 还可以通 过将第一 DMA微指令放置在特定的操作队列 (读、 写、 擦除、 其他) 中, 以标识 第一 DMA微指令的操作类型。
作为依然另一个例子, 对于第一 DMA微指令, 根据緩冲存储器地址 622与一 预定的偏移值得到存储在緩冲存储器 106中的指针, 基于该指针, 获得存储设备的 逻辑地址 612和 /或 DMA描述符长度 613。 通过类似的方式, 对于第二 DMA ^敫指 令,根据緩冲存储器地址 632与一预定偏移值得到存储在緩冲存储器 106中的指针, 基于该指针, 获得存储设备的逻辑地址 612和 /或 DMA描述符长度 613。
在优选的实施例中, 基于緩冲存储器地址 614, 将 DMA描述符长度 613存储 在緩冲存储器 106中, 其中 DMA描述符长度等同于 DMA描述符 600中的 DMA 数据的个数 (或者 DMA描述符 600中的 DMA命令与 DMA数据的总计个数, 从 中可以得到 DMA数据的个数), 并通过在第一 DMA ^敫指令中的索引来访问 DMA 描述符长度 613。 这样, 第一 DMA微指令与第二 DMA微指令的执行顺序变得不 重要。每执行一个 DMA微指令,将緩冲存储器 106中的 DMA描述符长度递减(例 如, 减 1或减去单位长度) , 当緩冲存储器 106中的 DMA描述符长度变为 0时, 表示对该 DMA描述符 600的所有 DMA操作全都执行完成。
在步骤 713 , 对于第一 DMA微指令, 基于 DMA主机地址 621和緩冲存储器 地址 622, 以 DMA传输方式将数据写入到相应緩冲存储器 106中。
在步骤 714, 对于第二 DMA微指令, 基于 DMA主机地址 631和緩冲存储器 地址 632, 以 DMA传输方式将相应数据写入到緩冲存储器 106中。
在步骤 715 , 向主机发送中断, 以指示对 DMA描述符 600的操作完成。
在一个例子中, 步骤 713 , 还包括将同第一 DMA 指令相对应的写入到緩冲 存储器 106中的数据, 基于存储设备逻辑地址 612, 写入到闪存芯片 105中。 步骤 714还包括将同第二 DMA微指令相对应的写入到緩冲存储器 106中的数据, 基于 存储设备逻辑地址 612加上预定偏移值的和, 写入到闪存芯片 105中。
在优选的实施例中, 在步骤 713、 714中, 将相应数据写入到緩冲存储器 106 中之后, 还基于在第一、 第二微指令中的索引, 访问存储在緩冲存储器中的 DMA 描述符长度 613 , 并将 DMA描述符长度 613递减(例如, 减 1或减去单位长度) 。 这样, 当该 DMA描述符长度 613变为 0时, 意味着对 DMA描述符 600的操作完 成。 以此方式, 可以在存储设备 102中同时处理多个 DMA描述符 600 , 并且第一 DMA 指令与第二 DMA 指令的执行顺序也是不重要的。 还可以釆用其他方式 来识别 DMA描述符 600中的多个 DMA数据均被执行。 例如, 在緩冲存储器或寄 存器中为每个 DMA描述符 600的每个 DMA数据提供标志, 每当一个 DMA数据 ( DMA微指令) 被执行后, 将相应的标志置位。 还可以顺序执行 DMA描述符 60 0中的每个 DMA数据 ( DMA微指令) , 当最后一个 DMA数据 ( DMA微指令) 被执行后, 意味着对该 DMA描述符 600的执行完成。
在依然另一个实施例中, 当 DMA描述符 600中的每一个 DMA 指令被执行 后, 向主机 101发送中断, 并由主机驱动程序来分析对 DMA描述符 600的执行是 否已完成。 分析方法同上面所描述的存储设备 102中识别 DMA描述符 600中的多 个 DMA数据是否均被执行的过程相类似。
图 7C中展示了用于实施图 7A、 7B中的执行第二写入命令的存储设备的硬件 方框图。 图 7C中, 主机 101包括 PCIE控制器 721和主机存储器 722。 主机存储器 722可以是随机访问存储器 ( RAM ) , PCIE控制器 721用于同存储设备经由 PCIE 总线进行通信。 存储设备 102中包括 PCIE接口 731、 DMA指令分析器 732、 微指 令 FIFO (先进先出緩冲器) 733、 DMA写操作控制器 734、 DMA写接口 735、 逻 辑地址到物理地址转换电路 736、 Flash接口控制器 737、 闪存芯片 105以及緩冲存 储器 106。
PCIE接口 731接收主机 101通过 PCIE控制器 721发送的 DMA描述符 600。 主机 101与存储设备 102之间的连接不限于 PCIE方式, 还可以通过 SATA、 IDE, USB、 PCIE, SCSI, 以太网、 光纤通道等连接主机 101与存储设备 102。 DMA指 令分析器 732将 PCIE接口 731接收到的 DMA描述符 600变换为 DMA微指令。对 于如图 6所示的 DMA描述符 600 , 其中包括 DMA数据 620和 DMA数据 630, 则 DMA指令分析器将其变换为对应于 DMA数据 620的第一 DMA ^:指令和对应于第 二 DMA数据 630的第二 DMA 指令。第一 DMA 指令与第二 DMA 指令的结 构已在上文中详细介绍。 DMA指令分析器 732还从 DMA描述符 600的 DMA命令 610中提取出 DMA描述符长度, 并对其加以保存, 可以保存在緩冲存储器 106、 一个寄存器或者类似物中。 DMA描述符长度指示了 DMA描述符 600所包括的 D MA数据的数量, 也指示了从该 DMA描述符 600所得到的 DMA 指令的个数。 D MA指令分析器 732将第一 DMA 指令与第二 DMA ^:指令存储在^:指令 FIFO 7 33中。
微指令 FIFO 733能够緩存 DMA微指令, 并按照先进先出的方式向 DMA写 操作控制器 734提供 DMA微指令。 虽然这里仅以写操作为例, 描述了将与 DMA 写操作对应的 DMA微指令緩存在微指令 FIF0733中, 所属领域技术人员将意识到 可以将与 DMA读操作对应的 DMA 指令同与 DMA写操作对应的 DMA 指令混 合緩存在 指令 FIF0733。 还可以将 指令 FIF0733配置为两部分或多个部分, 其 中一部分专用于存储与 DMA读操作对应的 DMA微指令, 而将另一部分专用于存 储与 DMA写操作对应的 DMA ^:指令。
对于与 DMA写操作对应的 DMA微指令, 例如, 前面所提到的第一 DMA微 指令与第二 DMA微指令, DMA写操作控制器 734基于这些 DMA微指令来执行 D MA写操作。 如同前面所提到的, 第一 DMA ^敫指令中包括, DMA主机地址 621 和緩冲存储器地址 622。 DMA写操作控制器 734利用 DMA主机地址 621和緩冲存 储器地址 622, 通过 DMA写接口 735在主机 101和存储设备 102之间发起 DMA 写操作, 将存储在 DMA主机地址 621处的数据, 传输到緩冲存储器地址 622所指 示的位置, 所传输的数据可以具有预定的长度 (例如 4K字节) 。 对于第二 DMA 指令, DMA写操作控制器 734执行类似的操作, 将存储在 DMA主机地址 631 处的数据, 传输到緩冲存储器地址 632所指示的位置。
从第一 DMA微指令和第二 DMA微指令可获得用于各自的存储设备的逻辑地 址。 在逻辑地址到物理地址转换电路 736, 为每条 DMA微指令的存储设备的逻辑 地址转换为用于闪存芯片 105的物理地址。 对于每一条 DMA微指令, Flash接口 控制器 737将写入到緩冲存储器 106的数据, 基于逻辑地址到物理地址转换电路 7 36所提供的物理地址, 写入到闪存芯片 105中。
Flash接口控制器 737还基于在第一、 第二微指令中的索引, 访问所保存的从 DMA描述符 600的 DMA命令 610中提取出 DMA描述符长度, 并将 DMA描述符 递减 (例如, 减 1或减去单位长度) 。 这样, 当该 DMA描述符长度变为 0时, 意 味着对 DMA描述符 600的操作完成。 继而, 可向主机发送中断, 以指示对 DMA 描述符 600的操作完成。在一个例子中, DMA写操作控制器也访问所保存的 DMA 描述符长度, 并确定是否已将与 DMA描述符 600相对应的所有数据均写入到緩冲 存储器 106中, 并向主机发送指示所有数据已写入到緩冲存储器 106的中断。
图 8是根据本发明实施例的主机的软件方框图。 图 8是示出了主机 800的软 件的方框图, 其同图 4中展示的主机的软件方框图相类似。 不同之处在于, 图 8中 的緩冲区控制块 406中还包括 10请求链表 801。 10请求链表 801是利用緩冲区控 制块 406中的存储单元 ( 411、 412 ··· ··· 41η ) 组成的链表。 10请求链表 801可以是 单向链表、 双向链表或循环链表。 在生成如图 6所示的 DMA描述符 600时, 对于 一个 DMA描述符 600, 创建一个与之相对应的 10请求链表 801 , 其中包括分别与 DMA命令 610、 DMA数据 620、 DMA数据 630分别相对应的存储单元 ( 811、 81 2、 813 ) 。 需要指出的是, 存储单元 (811、 812、 813 ) 是緩冲区控制块 406的存 储单元 (411、 412 ··· ··· 41η ) 中的三个存储单元, 并通过设置相应的指针, 形成 10 请求链表 801。 在图 8中, 将存储单元( 811、 812、 813 )与存储单元( 411、 412…… 41η ) 分开展示, 仅仅是为了清楚地描述的需要。
图 9 Α是根据本发明实施例的主机创建并执行第二写入命令的流程图。在一个 实施例中, 步骤 901 , 由主机的存储设备驱动程序 405接收 10请求。 该 10请求指 示将分散在主机存储器的不同物理地址的多个数据块写入到存储设备 102中,为此 将在主机与存储设备之间执行分散 -收集 DMA操作。下面将以举例的方式描述主机 向存储器写入数据的操作过程。
在步骤 902,结合图 8 ,从緩冲区控制块 406中取出一个空闲状态的存储单元, 例如存储单元 411。
在步骤 904, 根据 10请求的内容, 创建 DMA描述符 600的 DMA命令 610 , 填充 DMA命令 610中的 DMA方式字段 611 (在该例子中, 是写操作) 、 存储设 备逻辑地址字段 612 (从 10请求中可获得该信息)、 DMA描述符长度字段 613 (从 10请求中可获得该信息)以及緩冲存储器地址字段 614 (与步骤 902中所分配的存 储单元 411相对应) 。 继而将所创建的 DMA命令 610发送给存储设备 102。 并将 存储单元 411作为用于该 10请求的 10请求链表 801的起始节点(例如存储单元 8 11 ) 。 创建 10请求链表 801 , 用于在存储设备 102执行完 DMA描述符 600之后, 将所占用的存储单元归还给緩冲区控制块 406, 并就该 10请求的执行完成通知应 用软件或其他上层软件。 为此目的, 在一个例子中, 还在存储单元 411中存储对应 于该 10请求的指针。基于 DMA描述符长度,还可获得 DMA数据部分的剩余长度。 在生成第一个 DMA数据之前, DMA数据部分的剩余长度是 DMA描述符 600中的 DMA数据 ( 620、 630 ) 的个数, 作为一个例子, 其为 DMA描述符长度减 1。 在步骤 906, 从緩冲区控制块 406中取出一个空闲状态的存储单元, 例如, 存 储单元 412。 根据 10请求的内容, 创建 DMA描述符 600的 DMA数据 620 , 填充 DMA数据 620中的 DMA主机地址字段 621 (从 10请求中可获得该信息) 以及緩 冲存储器地址 622 (与所分配的存储单元 412相对应, 例如, 存储单元 412在緩冲 区控制块 406中的偏移值或序号) 。 继而将所创建的 DMA数据 620发送给存储设 备 102。 并将存储单元 412作为用于该 10请求的 10请求链表 801的节点 (例如存 储单元 812 ) 。
在步骤 908 , 将 DMA数据部分剩余长度递减, 得到 DMA描述符 600中尚未 发送给存储设备的 DMA数据的个数。
在步骤 909, 如果 DMA数据部分的剩余长度为 0 , 则表示 DMA描述符 600 的生成已经完成,进而在步骤 910存储设备驱动程序 405将等待存储设备 102返回 的表示 DMA描述符 600的处理已经完成的中断, 并依据该中断找到与之对应的 I 0请求链表 801 , 以及将 10请求链表 801中的存储单元 ( 811、 812 ) 释放。 换句 话说, 将由 10请求链表 801中的存储单元 (811、 812 ) 的状态设置为空闲, 从而 使得通过緩冲区控制块 406可以获知存储单元 411、 412的状态为空闲。 在一个例 子中, 在 DMA描述符 600指示读操作, 且主机 101的 CPU包括高速緩冲存储器 的情况下, 还通知同 DMA描述符 600的 DMA主机地址 ( 621、 631 ) 相关联的 C PU高速緩冲存储器执行一致性处理, 以反映出 DMA主机地址 (621、 631 ) 处的 数据可能因读 DMA读操作而发生变化。 在一个例子中, 存储设备 102返回的中断 中包括指示 10请求链表 801中的多个存储单元 (811、 812 ) 之一 (或者緩冲存储 器地址 622、 632之一)的内容, 依据该内容, 通过 10请求链表 801将存储单元( 8 11、 812 ) 释放。
在步骤 909, 如果 DMA数据部分的剩余长度大于 0 , 则表示 DMA描述符 60 0的生成尚未完成, 还需要为 10请求生成一个或多个 DMA数据, 那么处理将返回 到步骤 906并重复执行步骤 906、 908和 909。
图 9B是根据本发明另一实施例的主机创建并执行第二写入命令的流程图。在 该实施例中, 将緩冲区控制块 406中的空闲存储单元进一步组织为空闲存储单元 池, 以有助于 DMA描述符 600的创建过程。 通过将緩冲区控制块 406中状态为空 闲的存储单元 (411、 412…… 41η ) 组织成链表来形成空闲存储单元池。 当需要从 緩冲区控制块 406中获得空闲存储单元时, 可以从空闲存储单元池中取出存储单 元, 从而省去了在緩冲区控制块 406中查找空闲存储单元的开销。
在一个实施例中, 步骤 921 , 由主机的存储设备驱动程序 405接收 10请求。 同图 9Α相类似, 该 10请求指示将分散在主机存储器的不同物理地址的多个数据 块写入到存储设备 102中,为此将在主机与存储设备之间执行分散 -收集 DMA操作。
在步骤 922, 根据 10请求的内容, 计算出用于与相同该 10请求相对应的 DM A描述符的长度(例如, DMA命令以及 DMA数据的个数) 。 注意到在图 9A公开 的实施例中, 是在步骤 904创建 DM A命令 610的过程中获得 DMA描述符长度, 所属领域技术人员将意识到各个步骤并非必然以本实施例中所公开的顺序执行。
在步骤 923 , 判断空闲存储单元池中是否为空。 如果空闲存储单元池非空, 即 緩冲区控制块 406中存在处于空闲状态的存储单元, 则进行到步骤 924, 并从空闲 存储单元池中取出一个空闲存储单元 (例如存储单元 411 ) 。 如果空闲存储单元池 为空, 意味着緩冲区控制块 406中没有空闲的存储单元。 则在步骤 925 , 等待空闲 存储单元池被更新, 以出现空闲的存储单元。 当 DMA描述符的执行完成后, 与之 相关的存储单元会被释放, 从而在空闲存储单元池中出现空闲的存储单元。 后面对 此会详细介绍。
在步骤 926, 确定当前要生成用于 DMA描述符 600的 DMA命令字段还是 D MA数据字段。 一般而言, DMA描述符 600包括一个 DMA命令和一个或多个 DM A数据。 当要生成 DMA命令时, 处理转向步骤 927 , 并根据 10请求的内容, 创建 DMA描述符 600的 DMA命令 610 , 填充 DMA命令 610中的各个字段( 611、 612、 613、 614 ) 。 在一个例子中, 还在存储单元 411中存储对应于该 10请求的指针, 以便在该 10请求的执行完成后,可识别该 10请求并通知应用软件或其他上层软件。 当要生成 DMA数据时, 处理转向步骤 928 , 并根据 10请求的内容, 创建 DMA描 述符 600的 DMA数据 620 , 填充 DMA数据 620的各个字段 ( 621、 622 ) 。
接下来, 在步骤 929, 将所生成的 DMA命令或 DMA数据发送给存储设备 10 2。并在步骤 930,将在步骤 924中获得的存储单元 411设置在 10请求链表 801中。 作为一个例子, 第一个进入到 10请求链表 801的存储单元, 将作为 10请求链表 8 01的头节点, 但是, 也将意识到当 10请求链表 801被组织为环形链表时, 其中并 不存在 "头节点" 。 在步骤 930, 还将 DMA描述符长度递减。
在步骤 931 , 如果 DMA描述符长度为 0 , 意味着 DMA描述符 600的生成已 经完成,进而在步骤 932存储设备驱动程序 405将等待存储设备 102返回的表示 D MA描述符 600的处理已经完成的中断, 并依据该中断找到与之对应的 10请求链 表 801 , 以及将 10请求链表 801中的存储单元 ( 811、 812 ) 释放。 换句话说, 将 由 10请求链表 801中的存储单元 (811、 812 ) 的状态设置为空闲, 从而使得通过 緩冲区控制块 406可以获知存储单元 411、 412的状态为空闲, 并将存储单元 411、 412放入空闲存储单元池中。 在一个例子中, 存储设备 102返回的中断中包括指示 10请求链表 801中的多个存储单元 ( 811、 812 )之一的内容, 依据该内容, 通过 I 0请求链表 801将存储单元 (811、 812 ) 释放。
在步骤 931 , 如果 DMA描述符长度大于 0 , 则表示 DMA描述符 600的生成 尚未完成, 还需要为 10请求生成一个或多个 DMA数据, 那么处理将返回到步骤 9 23并重复执行步骤 923-931。
上面结合图 9A、 9B描述了 DMA描述符 600的生成过程。 DMA描述符 600 用于在分散-收集 DMA中描述要执行的多个 DMA操作, 该多个 DMA操作的数据 来源于存储在连续或不联系的存储空间中。 所属领域技术人员将容易意识到, DM A描述符 600的生成方式包括但不限于上面图 9A、 9B中描述的具体方式。
图 10A是根据本发明的实施例的在存储设备的緩冲存储器中创建链表的流程 图。 在如图 7A-7C所公开的存储设备处理 DMA描述符 600的过程中, 将 DMA描 述符 600转换为一个或多个微指令。 在进一步的实施例中, 为了有效处理一个或多 个微指令之间的关联关系 (例如, 这些微指令均同 DMA描述符 600相关联) , 存 储设备 102响应于主机 101所传输的 DMA描述符 600, 还在緩冲存储器 106中建 立链表, 该链表将对应于同一 DMA描述符 600的多个微指令关联起来。 如图 10A所示, 在步骤 1002, 主机 101向存储设备 102发送 DMA描述符 60 0。 DMA描述符 600包括 DMA命令 610与 DMA数据 620、 630。 前面已经结合图 9 A与图 9B而描述了主机 101向存储设备 102发送 DMA描述符 600的过程的例子。 还应当意识到, 在存储设备的緩冲存储器中创建链表, 将有助于存储设备对 10操 作的执行, 特别是对多个 10操作的并发 /乱序执行, 多个 10操作可通过访问各自 的链表而关联在一起。这样不具备关联关系的 10操作可以在存储设备中并发执行。 因而, 还可以响应除 DMA命令之外的其他类型的 10命令或其他命令, 以在存储 设备中创建链表。
在步骤 1004, 判断所接收到的是 DMA命令 610还是 DMA数据 620、 630。 如果接收到 DMA命令 610, 在步骤 1006, 从其中的緩冲存储器地址字段 610 中提取出用于该 DMA命令 610的緩冲存储器地址, 并基于该緩冲存储器地址, 为 该 DMA命令 610在緩冲存储器 106中分配存储空间。 接下来, 在步骤 1008 , 保存 为该 DMA命令 610所分配的緩冲存储器地址, 用来在为 DMA数据 620、 630分配 緩冲存储器地址时使用。
如果在步骤 1004判断出所接收到的是 DMA数据 620, 则在步骤 1010, 从 D MA数据 620的緩冲存储器地址字段 622从提取出用于该 DMA数据 620的緩冲存 储器地址, 并基于该緩冲存储器地址, 为该 DMA数据 620在緩冲存储器 106中分 配存储空间。 并在步骤 1012中, 在为该 DMA数据 620所分配的緩冲存储器的存 储空间中, 存储在步骤 1008中保存的 DMA命令 610的緩冲存储器地址。 这样, 在緩冲存储器 106中, 为 DMA命令 610和 DMA数据 620所分配的存储空间形成 了链表, 其中为 DMA命令 610所分配的存储空间是链表的头节点, 为 DMA数据 620所分配的存储空间连接到链表的头节点。
在 DMA描述符 600还包括 DMA数据 630的情况下,通过步骤 1010和步骤 1 012,基于 DMA数据 630中的緩冲存储器地址 632为 DMA数据 630在緩冲存储器 106中分配存储空间, 并在为 DMA数据 630所分配的緩冲存储器的存储空间中, 保存 DMA命令 610的緩冲存储器地址。 所属领域技术人员将意识到, 也可以在为 DMA数据 630所分配的緩冲存储器 106的存储空间中, 保存用于 DMA数据 620 的緩冲存储器地址, 从而形成不同类型的链表。 在其他例子中, 将緩冲存储器 106 中为 DMA命令 610、 DMA数据 620、 630所分配的存储空间创建为循环链表或双 向链表。
上面结合图 7A、 7B、 7C已经描述了存储设备 102基于 DMA数据 ( 620、 630 ) 生成 DMA 指令, 并保存在 指令 FIFO 733中。 DMA数据 ( 620、 630 ) 生成 DMA 指令的操作可以发生于步骤 1012之后,并在 DMA 指令中携带为 D MA数据 ( 620、 630 ) 所分配的緩冲存储器地址。
图 10B是根据本发明的一实施例的在存储设备的緩冲存储器中创建链表 的流程图。 同图 10A所提供的实施例相比, 图 10B的实施例中, 还将与 DMA描述 符的处理或执行相关的信息存储在所创建的链表中。图 10C是根据本发明的一实施 例的存储设备利用在緩冲存储器中创建的链表执行 DMA描述符的流程图。 图 11 A -11F展示出了与图 10B与图 10C相关联的緩冲存储器的多种状态。 在图 11A-11F 中, 1100指示緩冲存储器 106中的存储空间。 具体地, 在步骤 1020, 主机 101向存储设备 102发送 DMA描述符 600。 在步骤 1022, 判断所接收到的是 DMA命令 610还是 DMA数据 620、 63
0。
如果接收到 DMA命令 610 , 在步骤 1024, 从緩冲存储器地址字段 610中 提取出緩冲存储器地址, 并基于该緩冲存储器地址, 为该 DMA命令 610在緩冲存 储器 106中分配存储空间。 参看图 11A, 为 DMA命令 610分配存储空间 1101。 以 及还从 DMA命令 610中提取出 DMA描述符长度字段 613 , 从 DMA描述符长度 6 13可以得到该 DMA描述符 600的 DMA数据部分的长度 (例如, DMA描述符长 度减 1 ) 。 接下来, 在步骤 1026, 保存为该 DMA命令 610所分配的緩冲存储器地 址, 用来在为 DMA数据 620、 630分配緩冲地址时使用。 并且, 将 DMA数据部分 的长度记录在为该 DMA命令 610所分配的緩冲存储器中。 参看图 11A, 在存储空 间 1101中保存了 DMA数据部分的长度(在这个例子中, DMA数据部分的长度为 2 ) 。
如果在步骤 1022判断出所接收到的是 DMA数据 620 , 则在步骤 1028 ,从 DMA数据 620的緩冲存储器地址字段 622从提取出用于该 DMA数据 620的緩冲 存储器地址, 并基于该緩冲存储器地址, 为该 DMA数据 620在緩冲存储器 106中 分配存储空间。 参看图 11B , 为 DMA数据 620分配存储空间 1112。 并在步骤 103 0中, 在为该 DMA数据 620所分配的緩冲存储器的存储空间 1112中, 存储在步骤 1026中保存的 DMA命令 610的緩冲存储器地址。 这样, 在緩冲存储器 106中, 为 DMA命令 610和 DMA数据 620所分配的存储空间 ( 1101与 1112 ) 形成了链表, 其中为 DMA命令 610所分配的存储空间 1101是链表的头节点, 为 DMA数据 620 所分配的存储空间 1112连接到链表的头节点。 还在存储空间 1112中存储同 DMA 数据 620相对应的 DMA主机地址。
在 DMA描述符 600还包括 DMA数据 630的情况下,通过步骤 1028和步 骤 1030 , 基于 DMA数据 630中的緩冲存储器地址 632为 DMA数据 630在緩冲存 储器 106中分配存储空间 1123 (参看图 11C ) , 并在存储空间 1123中, 保存 DM A命令 610的緩冲存储器地址。 以及还在存储空间 1123中存储同 DMA数据 630 相对应的 DMA主机地址。
因而, 在緩冲存储器 106中形成了同 DMA描述符 600相对应的链表, 其 中存储空间 1101是链表的头节点, 存储空间 1112和 1123是链表的节点, 并指向 该链表的头节点。 所属领域技术人员将意识到, 也可以在为 DMA数据 630所分配 的緩冲存储器 106的存储空间 1123中, 保存用于 DMA数据 620的緩冲存储器地 址, 从而形成不同类型的链表。 在其他例子中, 将緩冲存储器 106中为 DMA命令 610、 DMA数据 620、 630所分配的存储空间创建为循环链表或双向链表。
图 10C是根据本发明的一实施例的存储设备利用在緩冲存储器中创建的 链表执行 DMA描述符的流程图。 上面结合图 7 A、 7B、 7C已经描述了存储设备 1 02基于 DMA数据( 620、 630 )生成 DMA微指令, 并保存在微指令 FIFO 733中。 在存储设备 102对 DMA微指令的执行中, 在一个例子中, 利用在緩冲存储器 106 中的链表。 在 DMA微指令中, 包括緩冲存储器地址, 通过该緩冲存储器地址, 可 以获得为同该 DMA微指令相对应的 DMA数据所分配的緩冲存储器 106中的存储 空间, 进而可以获得与该 DMA数据所对应的 DMA主机地址以及与该 DMA数据 所对应的 DMA描述符中的 DMA数据部分长度或 DMA数据的个数。
在下面的描述中, 将对应于 DMA数据 620的 DMA 指令用第一 DMA 指令指示, 将对应于 DMA数据 630的 DMA 指令用第二 DMA 指令指示。
在步骤 1040, 从微指令 FIF0733中获得将第一 DMA微指令。
在步骤 1042, 第一 DMA 指令中包括为 DMA数据 620所分配的緩冲存 储器 106的存储空间 1112的地址, 并从存储空间 1112中获得 DMA主机地址。 该 DMA主机地址是由 DMA数据 620中的 DMA主机地址字段 621所提供的。基于 D MA主机地址, 在主机 101和存储设备 102之间进行 DMA传输, 将主机 101的该 DMA主机地址处的预定长度 (例如, 4KB )的数据, 以 DMA方式传输到存储设备 102的緩冲存储器中。 对于第二 DMA微指令, 执行类似的操作, 将主机 101的由 DMA数据 630的 DMA主机地址字段 632所提供的 DMA主机地址处的数据,以 D MA方式传输到存储设备 102的緩冲存储器的为 DMA数据 632所分配的存储空间 1123处。 在图 11D中, 示出了执行完第一 DMA微指令与第二 DMA微指令后, 存 储了以 DMA方式传输的数据的存储空间 1112和存储空间 1123。
在步骤 1044 , 继续对第一 DM A微指令加以执行。 通过第一 DMA微指令 中的存储空间 1112的地址, 从存储空间中取出预定长度的数据, 该数据是在步骤 1042中, 通过 DMA操作从主机 101传输到緩冲存储器 106的存储空间 1112的。 并通过闪存接口控制器(例如, 图 7C中的 Flash接口控制器 737 )将该数据基于第 一 DMA微指令中所包括的用于闪存存储器的地址, 写入到闪存芯片 105。 该用于 对第二 DMA微指令以类似的方式加以执行。 通过第二 DMA微指令中包括的存储 空间 1123的地址, 从存储空间中取出预定长度的数据, 并将该数据通过闪存接口 控制器, 基于第二 DMA微指令中所包括的用于闪存存储器的地址, 写入到闪存芯 片 105。 第二 DMA 指令中所包括的用于闪存存储器的地址, 是通过 DMA命令 6 10中的存储设备逻辑地址字段 612加上预定值(例如对应于 DMA传输的数据的长 度, 在该例子中, 是 4KB ) 所得到的。 在一个例子中, 将 DMA命令 610中的存储 设备逻辑地址转换为存储设备的物理地址,并基于该物理地址将数据写入到闪存芯 片 105中。 从存储设备的逻辑地址到物理地址的映射过程, 是所属领域技术人员所 熟知的。
在步骤 1046 , 继续对第一 DM A微指令加以执行。 通过第一 DMA微指令 中的存储空间 1112的地址,获得为 DMA命令 610所分配的存储空间 1101的地址, 并在存储空间 1101中获得 DMA数据部分长度, 以及将存储 1101中存储的 DMA 数据部分长度递减 (例如, 减 1或者减去单位长度) 。 参看图 11E, 对于第一 DM A微指令, 将存储空间 1101中的 DMA数据部分长度递减后, 其值由 2变为 1。 并 且, 存储空间 1112中不再保存存储空间 1101的地址, 用于表明对 DMA数据 620 的执行已经完成。 在步骤 1048 , 由于 DMA数据部分的长度不为 0, 意味着对 DM A描述符 600的操作尚未完成, 因为其还包含另一个 DMA数据 630, 此时, 不进 行进一步的处理。
当第二 DMA微指令在步骤 1046被执行时,通过第二 DMA微指令中的存 储空间 1123的地址, 获得为 DMA命令 610所分配的存储空间 1101的地址, 并在 存储空间 1101中获得 DMA数据部分长度, 以及将存储 1101中存储的 DMA数据 部分长度递减 (例如, 减 1或者减去单位长度) 。 参看图 11F, 对于第二 DMA : 指令, 将存储空间 1101中的 DMA数据部分长度递减后, 其值由 1变为 0。 并且, 存储空间 1123中不再保存存储空间 1101的地址, 用于表明对 DMA数据 630的执 行已经完成。
此时, 当第二 DMA描述符在步骤 1048被执行时, 由于 DMA数据部分的 长度为 0, 意味着对 DMA描述符 600的执行已经完成。 接下来, 在步骤 1050 , 向 主机 101发送中断, 以指示对 DMA描述 600的执行已经完成。
再次参看图 11F,存储空间 1112与 1123均不再保存存储空间 1101的地址。 存储空间 1101中的 DMA数据部分长度的值为 0。 在此情况下, 意味着对 DMA描 述符 600的执行已经完成, 对存储空间 1101、 1112与 1123均不会再加以使用, 这 些存储空间可以被释放以用于对其他 DMA描述符的执行。 在一个例子中, 由主机 101控制对相应存储空间的释放和再利用, 在上面已结合图 9A与图 9B对 10请求 链表 801中的存储空间的释放。由于緩冲区控制块 406中的存储单元(411、 412…… 41η )与緩冲存储器 106中的存储空间相对应, 因而对 10请求链表 801中的存储空 间的释放, 意味着对緩冲存储器中的存储空间 1101、 1112与 1123的释放。
上面结合图 10B、 10C、 11A-11F而描述了在緩冲存储器 106中存储对应 于第一与第二^:指令的 DMA主机地址的方案, 从而使得 DMA 指令中不必携带 DMA主机地址而减少了对电路资源的占用, 并通过緩冲存储器 106将对应于同一 DMA描述符 600的第一、 第二 DMA ^敫指令关联在一起的方案。 所属领域技术人 员将意识到,还可以将对应于第一与第二微指令的存储设备逻辑地址和 /或 DMA主 机地址存储在緩冲存储器中, 从而进一步减少 DMA微指令的长度及其对电路资源 的占用。
图 12是根据本发明的又一实施例的存储设备的硬件方框图。与图 7C中公 开的相似, 主机 101包括 PCIE控制器 721和主机存储器 722。 存储设备 102中包 括 PCIE接口 731、 DMA指令分析器 732、 指令先进先出緩冲器(FIFO ) 733、 D MA写操作控制器 734、 DMA写接口 735、 逻辑地址到物理地址转换电路 736以及 緩冲存储器 106。 存储设备 102中还包括 DMA读写^:指令判断电路 1210 , DMA 读接口 1212, 闪存控制器 1221、 1222、 1223 , 闪存接口 1231、 1232、 1233 , 完成 控制电路 1242、 多路选择器 1241以及多路共享器 1243。 闪存接口 1231、 1232、 1 233耦合于闪存芯片 105。
PCIE接口 731接收主机 101通过 PCIE控制器 721发送的 DMA描述符 60 0。 主机 101与存储设备 102之间的连接不限于 PCIE方式。 DMA指令分析器 732 将 PCIE接口 731接收到的 DMA描述符 600变换为 DMA微指令。对于如图 6所示 的 DMA描述符 600,则 DMA指令分析器将其变换为对应于 DMA数据 620的第一 DMA微指令和对应于 DMA数据 630的第二 DMA微指令。在一个例子中, 第一与 第二 DMA微指令中分别包括指示该微指令类型 (读 /写 /擦除 /其他) 的字段、 指示 与其对应的緩冲存储器 106中的存储单元的地址的字段、指示存储设备的逻辑地址 的字段。 参看图 10B与图 11C, DMA指令分析器 732还针对 DMA命令 610, 在緩 冲存储器 106中分配存储单元, 并在其中存储 DMA数据部分的长度。 DMA指令 分析器还针对 DMA数据 620, 在緩冲存储器 106中分配存储单元, 并在其中存储 为 DMA命令 610所分配的存储单元的地址, 以及存储 DMA数据 620中的 DMA 主机地址。 DMA指令分析器还针对 DMA数据 630, 在緩冲存储器 106中分配存储 单元, 并在其中存储为 DMA命令 610所分配的存储单元的地址, 以及存储 DMA 数据 630中的 DMA主机地址。
DMA指令分析器 732将第一 DMA 指令与第二 DMA ^:指令存储在^:指 令 FIFO 733中。
指令 FIFO 733能够緩存 DMA 4敫指令, 并按照先进先出的方式向 DMA 读写 指令判断电路 1210提供 DMA 指令。
在 DMA读写^:指令判断电路 1210, 判断所获得的 DMA 指令的类型。 对于与 DMA写操作对应的 DMA微指令, 例如, 前面所提到的第一 DMA微指令 与第二 DMA微指令, DMA写操作控制器 734基于这些 DMA微指令来执行 DMA 写操作。 DMA写操作控制器 734利用第一 DMA微指令中的指示与其对应的緩冲 存储器 106中的存储单元的地址的字段,从緩冲存储器 106中获得 DMA主机地址, 并通过 DMA写接口 735在主机 101和存储设备 102之间发起 DMA写操作, 将存 储在 DMA主机地址中的数据, 传输到与第一 DMA微指令相对应的緩冲存储器 10 6的存储单元中, 所传输的数据可以具有预定的长度 (例如 4K字节) 。 对于第二 DMA微指令, DMA写操作控制器 734利用与其对应的緩冲存储器 106中的存储单 元的地址的字段, 从緩冲存储器 106中获得 DMA主机地址, 并在主机 101和存储 设备 102之间发起 DMA写操作, 将存储在 DMA主机地址中的数据, 传输到与第 二 DMA微指令相对应的緩冲存储器 106的存储单元中。
从第一 DMA微指令和第二 DMA微指令的指示存储设备的逻辑地址的字 段获得用于各自的存储设备的逻辑地址。 在逻辑地址到物理地址转换电路 736 , 将 每条 DMA微指令的存储设备的逻辑地址转换为用于闪存芯片 105的物理地址。 对 于每一条 DMA微指令, Flash控制器 1221、 1222、 1223基于逻辑地址到物理地址 转换电路 736所提供的物理地址, 通过闪存接口 1231、 1232、 1233将写入到緩冲 存储器 106的数据, 写入到闪存芯片 105中, 其中, Flash控制器 1221同闪存接口 1231相 禺合, Flash控制器 1222同闪存接口 1232相耦合, Flash控制器 1223同闪 存接口 1233相耦合。 而闪存接口 1231、 1232、 1233分别耦合到各自的闪存芯片。 因而对于从 DMA微指令中的存储设备的逻辑地址转换得到的用于闪存芯片 105的 物理地址, 该物理地址指示了特定的闪存芯片, 并且该闪存芯片与闪存接口 1231、 1232、 1233的特定一个相耦合。 因而, 基于该物理地址, 可以确定使用闪存接口 1 231、 1232、 1233中的哪一个将数据写入闪存芯片, 也可以确定使用 Flash控制器 1 221、 1222、 1223中的哪一个。 闪存接口 1231、 1232、 1233还通过多路选择器 12 41与緩冲存储器相耦合。 基于该物理地址, 多路选择器 1241将数据从緩冲存储器 106传送给闪存接口 1231、 1232、 1233中的特定一个。
闪存接口 1231、 1232、 1233将数据写入到闪存芯片 105中之后, 完成控 制电路 1242还基于在第一、 第二微指令中的指示与其对应的緩冲存储器 106中的 存储单元的地址的字段, 访问緩冲存储器 106, 并进而访问緩冲存储器中为 DMA 命令 610所分配的存储单元, 从中获得 DMA数据部分的长度, 并将 DMA数据部 分的长度递减 (例如, 减 1或减去单位长度) 。 这样, 当为 DMA命令 610所分配 的存储单元中的该 DMA数据部分的长度变为 0时, 意味着对 DMA描述符 600的 操作完成。 继而, 可向主机发送中断, 以指示对 DMA描述符 600的操作完成。
虽然图 12中以举例的方式展示了包括三个 Flash控制器 1221、 1222、 122 3以及三个闪存接口 1231、 1232、 1233的实施例, 所属领域技术人员将意识到可 以使用多种不同数量的 Flash控制器与闪存接口, 以同闪存芯片的数量相适应。
对于与 DMA读操作对应的 DMA ^:指令, DMA读写^:指令判断电路 121 0将其直接传送给逻辑地址到物理地址转换电路 736 , 并得到用于闪存芯片 105的 物理地址。 Flash控制器 1221、 1222、 1223基于该物理地址, 通过闪存接口 1231、 1232、 1233将从闪存芯片 105中读出数据。 并基于 DMA ^敫指令中的指示与其对应 的緩冲存储器 106中的存储单元的地址的字段, 从緩冲存储器 106中获得与该 DM A 4敫指令相对应的 DMA主机地址,以及经由 DMA读接口 1212在主机 101与存储 设备 102之间发起 DMA传输, 将读出数据传输到主机 101的主机 RAM 722中由 该 DMA主机地址所指示的位置处。 闪存接口 1231、 1232、 1233经由多路共享器 1 243与 DMA读接口 1212相耦合, 使得从闪存接口 1231、 1232、 1233获得的数据 均可以通过 DMA读接口 1212传输到主机 RAM 722。 当闪存接口 1231、 1232、 1 233从闪存芯片 105读出数据后,完成控制电路 1242也基于在 DMA微指令中的指 示与其对应的緩冲存储器 106中的存储单元的地址的字段, 访问緩冲存储器 106 , 并进而获得 DMA数据部分的长度, 并将 DMA数据部分的长度递减 (例如, 减 1 或减去单位长度) 。 这样, 当该 DMA数据部分的长度变为 0时, 意味着对该 DM A描述符的操作完成。 继而, 可向主机发送中断, 以指示对该 DMA描述符的操作 完成。
在图 12所公开的存储设备中,可以支持对多个 DMA描述符 600的并发操 作。 对于多个 DMA描述符 600的每一个, 通过在緩冲存储器 106中创建的链表, 将与一个 DMA描述符 600相对应的 DMA数据关联在一起, 使得对多个 DMA微 指令的操作顺序变得不重要。
上面已经详细描述了存储设备执行数据写入操作或与写操作相关的 DM A 描述符的执行。 显然, 存储设备执行读操作也可以从本发明公开中获益。 例如, 可 以在读取命令中同时指定闪存芯片地址和緩冲存储器地址,并利用緩冲存储器作为 读出数据的緩冲。 也可以在与读操作相关的 DMA描述符中描述緩冲存储器地址, 在将数据从闪存芯片中读出后, 可利用緩冲存储器作为读出数据的緩存。
已经为了示出和描述的目的而展现了对本发明的描述, 并且不旨在以所公 开的形式穷尽或限制本发明。对所属领域技术人员,许多调整和变化是显而易见的。

Claims

权 利 要 求 书
1. 一种在信息处理设备和存储设备之间进行 DMA传输的方法, 所述存储设备包括緩 冲存储器和闪存芯片, 所述方法包括:
接收第一 10请求;
为所述第一 10请求分配第一存储单元与第二存储单元;
向所述存储设备发送所述第一 DMA描述符, 所述第一 DMA描述符包括用于信息处 理设备的地址、用于所述存储设备的闪存芯片的地址以及第一用于緩冲存储器的地址 与第二用于緩冲存储器的地址, 其中, 所述第一用于緩冲存储器的地址同所述第一存 储单元相对应, 所述第二用于緩冲存储器的地址同所述第二存储单元相对应; 在所述存储设备和所述信息处理设备之间依据所述第一 DMA描述符进行 DMA传输; 接收来自所述存储设备的消息, 所述消息指示所述存储设备对第一 DMA描述符已执 行完成;
释放所述第一存储单元与所述第二存储单元。
2. 根据权利要求 1所述的方法, 其中分配第一存储单元与第二存储单元进一步包括, 在所述第二存储单元中存储指向所述第一存储单元的地址。
3. 一种在信息处理设备和存储设备之间进行 DMA传输的方法, 所述存储设备包括緩 冲存储器和闪存芯片, 所述方法包括:
接收第一 10请求;
为所述第一 10请求分配第一存储单元与第二存储单元;
向所述存储设备发送所述第一 DMA描述符, 所述第一 DMA描述符包括第一 DMA 描述符命令和第一 DMA描述符数据, 所述第一 DMA描述符命令包括用于所述存储 设备的闪存芯片的地址以及第一用于緩冲存储器的地址, 所述第一 DMA描述符数据 包括用于信息处理设备的地址以及第二用于緩冲存储器的地址; 其中, 所述第一用于 緩冲存储器的地址同所述第一存储单元相对应, 所述第二用于緩冲存储器的地址同所 述第二存储单元相对应;
在所述存储设备和所述信息处理设备之间依据所述用于信息处理设备的地址和所述 第二用于緩冲存储器的地址进行 DMA传输;
接收来自所述存储设备的消息, 所述消息指示所述存储设备对第一 DMA描述符已执 行完成;
释放所述第一存储单元与所述第二存储单元。
4. 根据权利要求 1-3之一所述的方法, 其中, 所述第一 10请求指示将所述用于信息 处理设备的地址处的数据写入到用于所述存储设备的闪存芯片的地址处。
5. 根据权利要求 1-3之一所述的方法, 还包括将空闲的存储单元链接在一起形成空 闲存储单元池, 在分配第一存储单元与第二存储单元时, 从所述空闲存储单元池中取 出空闲的存储单元, 在释放所述第一存储单元与所述第二存储单元时, 将所述所述第 一存储单元与所述第二存储单元***到所述空闲存储单元池。
6. 根据权利要求 1-5之一所述的方法, 还包括将空闲的存储单元链接在一起形成空 闲存储单元池,在分配第一存储单元与第二存储单元时,若所述空闲存储单元池为空, 则等待一个或多个存储单元被***到所述空闲存储单元池。
7. 一种在信息处理设备和存储设备之间进行 DMA传输的方法, 所述存储设备包括緩 冲存储器和闪存芯片, 所述方法包括:
接收第一 10请求;
为所述第一 10请求分配第一存储单元、 第二存储单元与第三存储单元;
向所述存储设备发送所述第一 DMA描述符, 所述第一 DMA描述符包括第一 DMA 描述符命令、 第一 DMA描述符数据和第二 DMA描述符数据, 所述第一 DMA描述 符命令包括用于所述存储设备的闪存芯片的地址以及第一用于緩冲存储器的地址, 所 述第一 DMA描述符数据包括第一用于信息处理设备的地址以及第二用于緩冲存储器 的地址, 所述第二 DMA描述符数据包括第二用于信息处理设备的地址以及第三用于 緩冲存储器的地址; 其中, 所述第一用于緩冲存储器的地址同所述第一存储单元相对 应, 所述第二用于緩冲存储器的地址同所述第二存储单元相对应, 所述第三用于緩冲 存储器的地址同所述第三存储单元相对应;
在所述存储设备和所述信息处理设备之间依据所述第一用于信息处理设备的地址和 所述第二用于緩冲存储器的地址进行 DMA传输, 以及依据所述第二用于信息处理设 备的地址和所述第三用于緩冲存储器的地址进行 DMA传输;
接收来自所述存储设备的消息, 所述消息指示所述存储设备对第一 DMA描述符已执 行完成;
释放所述第一存储单元、 所述第二存储单元与所述第三存储单元。
8. 根据权利要求 7所述的方法, 所述第一 10请求指示将所述第一用于信息处理设备 的地址处的数据以及所述第二用于信息处理设备的地址处的数据写入到用于所述存 储设备的闪存芯片的地址处。
9. 根据权利要求 7、 8中的方法, 其中分配第一存储单元、 第二存储单元与第三存储 单元后, 将所述第一存储单元、 所述第二存储单元和所述第三存储单元链接为循环链 表。
10. 根据权利要求 9之一的方法, 所述来自所述存储设备的消息中包括指示所述第一 存储单元、 所述第二存储单元和所述第三存储单元之一的内容。
11. 根据权利要求 1、 3、 7之一的方法, 其中分配所述第一存储单元后, 在所说第一 存储单元中存储用于标识所述第一 10请求的指针。
12. 一种在信息处理设备和存储设备之间进行数据传输的方法, 所述存储设备包括緩 冲存储器和闪存芯片, 所述方法包括:
接收第一写请求, 所述第一写请求包括要写入的数据和用于所述存储设备的闪存芯片 的地址;
为所述第一写请求在所述信息处理设备中分配第一存储单元;
向所述存储设备发送第一写命令, 所述第一写命令中包括数据、 用于所述存储设备的 闪存芯片的地址以及用于所述緩冲存储器的地址; 其中, 所述用于緩冲存储器的地址 同所述第一存储单元相对应;
接收来自所述存储设备的消息, 所述消息指示所述存储设备对所述写命令已执行完 成;
释放所述第一存储单元。
13. 跟据权利要求 12所述的方法, 其中还为所述第一写请求分配第二存储单元, 并 在所述第二存储单元中存储指向所述第一存储单元的指针;
基于所述消息, 释放所述第一存储单元与所述第二存储单元。
14. 一种在信息处理设备和存储设备之间进行 DMA传输的装置, 所述存储设备包括 緩冲存储器和闪存芯片, 所述装置包括:
用于接收第一 10请求的模块;
用于为所述第一 10请求分配第一存储单元与第二存储单元的模块;
用于向所述存储设备发送所述第一 DMA描述符的模块, 所述第一 DMA描述符包括 用于信息处理设备的地址、用于所述存储设备的闪存芯片的地址以及第一用于緩冲存 储器的地址与第二用于緩冲存储器的地址, 其中, 所述第一用于緩冲存储器的地址同 所述第一存储单元相对应, 所述第二用于緩冲存储器的地址同所述第二存储单元相对 应;
用于在所述存储设备和所述信息处理设备之间依据所述第一 DMA描述符进行 DMA 传输的模块; 用于接收来自所述存储设备的消息的模块, 所述消息指示所述存储设备对第一 DMA 描述符已执行完成;
用于释放所述第一存储单元与所述第二存储单元的模块。
15. 一种在信息处理设备和存储设备之间进行 DMA传输的装置, 所述存储设备包括 緩冲存储器和闪存芯片, 所述装置包括:
用于接收第一 10请求的模块;
用于为所述第一 10请求分配第一存储单元与第二存储单元的模块;
用于向所述存储设备发送所述第一 DMA描述符的模块, 所述第一 DMA描述符包括 第一 DMA描述符命令和第一 DMA描述符数据, 所述第一 DMA描述符命令包括用 于所述存储设备的闪存芯片的地址以及第一用于緩冲存储器的地址, 所述第一 DMA 描述符数据包括用于信息处理设备的地址以及第二用于緩冲存储器的地址; 其中, 所 述第一用于緩冲存储器的地址同所述第一存储单元相对应, 所述第二用于緩冲存储器 的地址同所述第二存储单元相对应;
用于在所述存储设备和所述信息处理设备之间依据所述用于信息处理设备的地址和 所述第二用于緩冲存储器的地址进行 DMA传输的模块;
用于接收来自所述存储设备的消息的模块, 所述消息指示所述存储设备对第一 DMA 描述符已执行完成;
用于释放所述第一存储单元与所述第二存储单元的模块。
16. 一种在信息处理设备和存储设备之间进行数据传输的装置, 所述存储设备包括緩 冲存储器和闪存芯片, 所述装置包括: 用于接收第一写请求的装置, 所述第一写请求 包括要写入的数据和用于所述存储设备的闪存芯片的地址; 用于为所述第一写请求在 所述信息处理设备中分配第一存储单元的装置; 用于向所述存储设备发送第一写命令 的装置, 所述第一写命令中包括数据、 用于所述存储设备的闪存芯片的地址以及用于 所述緩冲存储器的地址; 其中, 所述用于緩冲存储器的地址同所述第一存储单元相对 应; 用于接收来自所述存储设备的消息的装置, 所述消息指示所述存储设备对所述写 命令已执行完成; 用于释放所述第一存储单元的装置。
PCT/CN2013/075523 2012-05-12 2013-05-11 Dma传输方法及*** WO2013170730A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US14/400,475 US9734085B2 (en) 2012-05-12 2013-05-11 DMA transmission method and system thereof
EP13790260.7A EP2849076B1 (en) 2012-05-12 2013-05-11 Dma transmission method and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210147619.6A CN102693198B (zh) 2012-05-12 2012-05-12 Dma传输方法及***
CN201210147619.6 2012-05-12

Publications (1)

Publication Number Publication Date
WO2013170730A1 true WO2013170730A1 (zh) 2013-11-21

Family

ID=46858661

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/075523 WO2013170730A1 (zh) 2012-05-12 2013-05-11 Dma传输方法及***

Country Status (4)

Country Link
US (1) US9734085B2 (zh)
EP (1) EP2849076B1 (zh)
CN (1) CN102693198B (zh)
WO (1) WO2013170730A1 (zh)

Families Citing this family (39)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102693198B (zh) * 2012-05-12 2015-03-25 北京忆恒创源科技有限公司 Dma传输方法及***
US9098491B2 (en) * 2012-11-23 2015-08-04 Hong Kong Applied Science and Technology Research Institute Company Limited Method and system for performing data transfer with a flash storage medium
FR3019339B1 (fr) * 2014-03-25 2016-04-01 Commissariat Energie Atomique Procede de transfert de donnees entre taches temps reel utilisant un controleur memoire dma
CN103853676B (zh) * 2014-03-28 2016-08-17 苏州科达科技股份有限公司 基于PCIe总线的信道分配、释放、数据传输方法和***
US10339079B2 (en) * 2014-06-02 2019-07-02 Western Digital Technologies, Inc. System and method of interleaving data retrieved from first and second buffers
CN106469126B (zh) * 2015-08-12 2020-07-07 北京忆恒创源科技有限公司 处理io请求的方法及其存储控制器
US20170116117A1 (en) * 2015-10-26 2017-04-27 Sandisk Technologies Inc. Identifying storage descriptors based on a metric
FR3043814B1 (fr) 2015-11-18 2020-01-10 Bull Sas Procede de generation d'un ensemble de donnees definissant un message pour une application contrainte
US10126981B1 (en) 2015-12-14 2018-11-13 Western Digital Technologies, Inc. Tiered storage using storage class memory
CN106776404B (zh) * 2016-12-19 2020-04-07 湖南国科微电子股份有限公司 SSD主控Buffer、SSD主控及SSD非对齐写数据传输控制方法
CN106775477B (zh) * 2016-12-19 2021-01-01 湖南国科微电子股份有限公司 Ssd主控数据传输管理装置及方法
CN106713450A (zh) * 2016-12-21 2017-05-24 广州优视网络科技有限公司 基于读写分离模式的下载提速方法及装置
CN108664212B (zh) * 2017-03-31 2024-01-19 北京忆恒创源科技股份有限公司 固态存储设备的分布式缓存
CN107370578B (zh) * 2017-06-15 2020-11-06 西安微电子技术研究所 一种基于硬件快速自主切换的多冗余以太网控制器
CN109491587B (zh) * 2017-09-11 2021-03-23 华为技术有限公司 数据访问的方法及装置
CN109697077B (zh) * 2017-10-24 2021-09-17 华为技术有限公司 硬盘固件启动方法、装置及设备
CN107832240B (zh) * 2017-10-27 2020-06-09 北京腾凌科技有限公司 一种基于信息记录结构体的dma数据交互方法和装置
US10732871B2 (en) 2017-11-01 2020-08-04 Western Digital Technologies, Inc. Storage device and method for adaptive sleep mode transitions
US10489072B2 (en) 2017-11-01 2019-11-26 Western Digital Technologies, Inc. Activity based device initiated state transitions
CN108536475B (zh) * 2017-12-27 2023-08-15 贵阳忆芯科技有限公司 完整编程命令处理方法与装置
CN110321057A (zh) * 2018-03-28 2019-10-11 北京忆恒创源科技有限公司 具有增强io性能确定性的缓存的存储设备
CN110865952B (zh) * 2018-08-28 2022-07-29 上海忆芯实业有限公司 利用缓存优化dma传输
US10956071B2 (en) 2018-10-01 2021-03-23 Western Digital Technologies, Inc. Container key value store for data storage devices
US10769062B2 (en) 2018-10-01 2020-09-08 Western Digital Technologies, Inc. Fine granularity translation layer for data storage devices
US10740231B2 (en) 2018-11-20 2020-08-11 Western Digital Technologies, Inc. Data access in data storage device including storage class memory
CN111258491B (zh) * 2018-11-30 2021-10-15 北京忆芯科技有限公司 降低读命令处理延迟的方法与装置
CN110399322B (zh) * 2019-06-28 2021-03-09 苏州浪潮智能科技有限公司 一种数据传输方法及乒乓dma架构
CN110377548B (zh) * 2019-06-28 2021-10-22 苏州浪潮智能科技有限公司 一种地址空间复用方法、装置及多路复用器
CN111045817B (zh) * 2019-11-08 2023-09-26 瑞芯微电子股份有限公司 一种PCIe传输管理方法、***和装置
US11016905B1 (en) 2019-11-13 2021-05-25 Western Digital Technologies, Inc. Storage class memory access
CN112988623B (zh) * 2019-12-17 2021-12-21 北京忆芯科技有限公司 加速sgl处理的方法与存储设备
US11687471B2 (en) * 2020-03-27 2023-06-27 Sk Hynix Nand Product Solutions Corp. Solid state drive with external software execution to effect internal solid-state drive operations
US11249921B2 (en) 2020-05-06 2022-02-15 Western Digital Technologies, Inc. Page modification encoding and caching
CN112765053B (zh) * 2021-01-04 2022-11-29 潍柴动力股份有限公司 数据处理方法及装置
US11922034B2 (en) 2021-09-02 2024-03-05 Samsung Electronics Co., Ltd. Dual mode storage device
US20240103731A1 (en) * 2022-09-28 2024-03-28 Kioxia Corporation Non-volatile storage device offloading of host tasks
CN115617722B (zh) * 2022-12-05 2023-03-07 成都博宇利华科技有限公司 实现多pcie设备共享dma链表的***及方法
CN115840620B (zh) * 2023-02-27 2023-05-16 珠海星云智联科技有限公司 一种数据通路构建方法、设备及介质
CN117991995B (zh) * 2024-03-26 2024-06-07 中国人民解放军海军潜艇学院 一种sd卡文件连续读或写控制方法、***及存储设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1527210A (zh) * 1999-04-05 2004-09-08 M-ϵͳ�����̿����߹�˾ 基于通用串行总线的pc闪存盘的体系结构
CN101221544A (zh) 2007-01-10 2008-07-16 国际商业机器公司 用于执行dma块移动的方法及dma设备
CN101354906A (zh) * 2008-08-11 2009-01-28 湖南源科创新科技股份有限公司 应用于固态硬盘的闪存控制器
CN102043689A (zh) 2010-12-28 2011-05-04 武汉固捷联讯科技有限公司 一种用于固态存储设备的容错设计方法
CN102150131A (zh) * 2008-09-15 2011-08-10 微软公司 管理高速缓存数据和元数据
CN102693198A (zh) * 2012-05-12 2012-09-26 北京忆恒创源科技有限公司 Dma传输方法及***

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6526451B2 (en) * 1998-09-30 2003-02-25 Stmicroelectronics, Inc. Method and network device for creating circular queue structures in shared memory
JP3636160B2 (ja) * 2002-04-26 2005-04-06 セイコーエプソン株式会社 データ転送制御装置、電子機器及びデータ転送制御方法
US7287101B2 (en) * 2003-08-05 2007-10-23 Intel Corporation Direct memory access using memory descriptor list
CN101192204A (zh) * 2006-11-28 2008-06-04 英业达股份有限公司 数据存取方法
US8136042B2 (en) * 2007-05-11 2012-03-13 Raritan Americas, Inc. Local port browser interface
US7873774B2 (en) * 2008-02-01 2011-01-18 Telefonaktiebolaget Lm Ericsson (Publ) Connections and dynamic configuration of interfaces for mobile phones and multifunctional devices
US20090249371A1 (en) * 2008-03-28 2009-10-01 Omar Cardona Buffer allocation for network subsystem
CN101290605B (zh) * 2008-05-26 2011-11-02 华为技术有限公司 数据处理方法及通讯***以及相关设备
TWI385516B (zh) * 2008-08-12 2013-02-11 Phison Electronics Corp 快閃記憶體儲存系統及其資料寫入方法
US8352689B2 (en) * 2009-11-30 2013-01-08 Lsi Corporation Command tag checking in a multi-initiator media controller architecture
CN101963891A (zh) * 2010-09-25 2011-02-02 成都市华为赛门铁克科技有限公司 数据存储处理方法与装置、固态硬盘***与数据处理***
WO2012116369A2 (en) * 2011-02-25 2012-08-30 Fusion-Io, Inc. Apparatus, system, and method for managing contents of a cache
KR20130032155A (ko) * 2011-09-22 2013-04-01 삼성전자주식회사 데이터 저장 장치 및 그것의 데이터 관리 방법
US9026712B2 (en) * 2012-06-25 2015-05-05 Intel Corporation USB device control using endpoint type detection during enumeration
US9329991B2 (en) * 2013-01-22 2016-05-03 Seagate Technology Llc Translation layer partitioned between host and controller
US20150095696A1 (en) * 2013-09-27 2015-04-02 Datadirect Networks, Inc. Second-level raid cache splicing

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1527210A (zh) * 1999-04-05 2004-09-08 M-ϵͳ�����̿����߹�˾ 基于通用串行总线的pc闪存盘的体系结构
CN101221544A (zh) 2007-01-10 2008-07-16 国际商业机器公司 用于执行dma块移动的方法及dma设备
CN101354906A (zh) * 2008-08-11 2009-01-28 湖南源科创新科技股份有限公司 应用于固态硬盘的闪存控制器
CN102150131A (zh) * 2008-09-15 2011-08-10 微软公司 管理高速缓存数据和元数据
CN102043689A (zh) 2010-12-28 2011-05-04 武汉固捷联讯科技有限公司 一种用于固态存储设备的容错设计方法
CN102693198A (zh) * 2012-05-12 2012-09-26 北京忆恒创源科技有限公司 Dma传输方法及***

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2849076A4

Also Published As

Publication number Publication date
EP2849076A4 (en) 2015-12-09
US9734085B2 (en) 2017-08-15
CN102693198B (zh) 2015-03-25
CN102693198A (zh) 2012-09-26
EP2849076A1 (en) 2015-03-18
EP2849076B1 (en) 2017-09-27
US20150142996A1 (en) 2015-05-21

Similar Documents

Publication Publication Date Title
WO2013170730A1 (zh) Dma传输方法及***
WO2013170731A1 (zh) 将数据写入存储设备的方法与存储设备
US10838665B2 (en) Method, device, and system for buffering data for read/write commands in NVME over fabric architecture
US9696942B2 (en) Accessing remote storage devices using a local bus protocol
US9785545B2 (en) Method and apparatus for providing dual memory access to non-volatile memory
US9727503B2 (en) Storage system and server
WO2013185636A1 (zh) 控制数据传输过程中的中断的方法
WO2013185637A1 (zh) 存储设备及其中断控制方法
EP3647932B1 (en) Storage device processing stream data, system including the same, and operation method thereof
US11379374B2 (en) Systems and methods for streaming storage device content
JP7191967B2 (ja) NVMeベースのデータ読み取り方法、装置及びシステム
WO2020000485A1 (zh) 一种基于NVMe的数据写入方法、装置及***
TW201135469A (en) Opportunistic improvement of MMIO request handling based on target reporting of space requirements
JP2021501941A (ja) メモリブロックリクレーム方法およびメモリブロックリクレーム装置
CN113485643B (zh) 用于数据存取的方法及数据写入的控制器
CN102819511B (zh) 存储设备以及在该存储设备中创建链表的方法
CN113515234B (zh) 一种用于控制数据读出到主机的方法及控制器
US12050537B2 (en) Systems and methods for streaming storage device content
US20240168876A1 (en) Solving submission queue entry overflow using metadata or data pointers
CN117369721A (zh) 一种数据读写处理***和方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13790260

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14400475

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

REEP Request for entry into the european phase

Ref document number: 2013790260

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2013790260

Country of ref document: EP