Command processing method and related equipment for solid state drive based on NVMe

By adopting a command processing method based on the NVMe protocol in the SSD main control chip and using the dual memory structure of SRAM and CSRAM to process NVMe commands, the problem of inefficient SSD performance in the existing technology is solved and the processing of the SSD main control chip is significantly improved. efficiency.

CN112416250BActive Publication Date: 2024-09-20SHENZHEN ELECTRICAL APPLIANCES CO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011318258.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-19
Publication Date
2024-09-20
Estimated Expiration
2040-11-19

AI Technical Summary

Technical Problem

Existing SSD main control chips have poor performance and low efficiency, mainly because they use SATA or PCIe interfaces based on the AHCI protocol, resulting in low command processing efficiency.

Method used

Using the command processing method based on the NVMe protocol, by updating the command queue entries and write pointers, reading the command table entries from SRAM, saving them to the CSRM arbiter, and performing arbitration processing in the CSRM, the command in the updated SRAM is completed Queue to improve the processing efficiency of NVMe commands.

Benefits of technology

It improves the performance and efficiency of the SSD main control chip, realizes efficient processing of NVMe commands, and improves overall performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112416250B
    Figure CN112416250B
Patent Text Reader

Abstract

The present application provides a command processing method and related equipment for a solid-state drive based on NVMe. The method includes: updating a command queue entry and a command queue write pointer; reading a command from a static random access memory SRAM to obtain a command table entry, wherein the command table entry includes a command buffer address; according to the command table entry, obtaining a command from the SRAM and saving it to a command static random access memory CSRAM arbiter; processing the command and updating the command completion queue in the SRAM. The above method can improve the performance and efficiency of the SSD master control chip, and can use the NVMe protocol to achieve efficient processing of commands.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a command processing method for a solid-state drive based on NVMe and related equipment. Background Art

[0002] A solid state disk (SSD) is a hard disk made of an array of solid-state electronic memory chips. The interface specification of an SSD can be a serial advanced technology attachment (SATA) interface or a high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCIe) interface.

[0003] Currently, the storage chip designs of SSDs using SATA or PCIe interfaces are all based on the Advanced Host Controller Interface (AHCI) protocol, and some even use Field Programmable Gate Arrays (FPGAs) for implementation, resulting in poor SSD performance and low efficiency.

[0004] Therefore, how to improve the performance and efficiency of the SSD's main control chip is an urgent problem to be solved. Summary of the Invention

[0005] The embodiments of the present invention disclose a command processing implementation method, system and related equipment for a solid-state drive based on NVMe, which can improve the performance and efficiency of the SSD master control chip and can use the NVMe protocol to achieve efficient command processing.

[0006] In the first aspect, the present application provides a command processing implementation method for an NVMe-based solid-state drive, including: updating command queue entries and command queue write pointers; reading command table entries from a static random access memory (SRAM), wherein the command table entries include command buffer addresses; according to the command table entries, obtaining commands from the SRAM and saving them to a command static random access memory (CSRAM) arbiter; processing the commands and updating the command completion queue in the SRAM.

[0007] In the solution provided in this application, the NVMe command is first read from the SRAM to the CSRAM, and then the CSRAM arbitrator arbitrates the access to the relevant CSRAM, and finally the NVMe command is processed, and then the command completion queue in the SRAM is updated. This can also improve the efficient processing of NVMe commands and improve the performance and efficiency of the SSD master chip.

[0008] In combination with the first aspect, in a possible implementation of the first aspect, the NVMe command processing system searches for a slot from the CSRAM and saves the command to the slot; updates the command tag table and the write command link list.

[0009] In combination with the first aspect, in a possible implementation of the first aspect, the NVMe command processing system updates the command queue read pointer after obtaining the command from the SRAM and saving it to the command static random access memory CSRAM.

[0010] In combination with the first aspect, in a possible implementation of the first aspect, if the command is a write command and the write command link list is not empty, read the CSRAM to obtain a new write command; determine the last data unit DU transmission and release the slot.

[0011] In combination with the first aspect, in a possible implementation of the first aspect, if the command is a read command, the slot is released after the last DU is sent to the host.

[0012] In combination with the first aspect, in a possible implementation of the first aspect, the NVMe command processing system receives a command tag, which is used to terminate the command corresponding to the command tag; according to the command tag, the corresponding flag bit in the completion queue entry is set to 1 to terminate the command.

[0013] In the second aspect, the present application provides an NVMe command processing system, including: an update unit for updating command queue entries and command queue write pointers; a reading unit for reading command table entries from a static random access memory SRAM, wherein the command table entries include command buffer addresses; a processing unit for obtaining commands from the SRAM according to the command table entries and saving them to a command static random access memory CSRAM, processing the commands and updating the command completion queue in the SRAM.

[0014] In combination with the second aspect, in a possible implementation of the second aspect, the processing unit is specifically used to: search for a slot from the CSRAM and save the command to the slot; and update a command tag table and a write command link list.

[0015] In combination with the second aspect, in a possible implementation of the second aspect, the processing unit is further used to update the command queue read pointer.

[0016] In combination with the second aspect, in a possible implementation of the second aspect, the processing unit is specifically used to: if the command is a write command and the write command link list is not empty, read the CSRAM to obtain a new write command; determine the last data unit DU transmission and release the slot.

[0017] In combination with the second aspect, in a possible implementation of the second aspect, the processing unit is specifically configured to: if the command is a read command, release the slot after sending the last DU to the host.

[0018] In combination with the second aspect, in a possible implementation of the second aspect, the system also includes a receiving unit, which is used to receive a command tag, and the command tag is used to terminate the command corresponding to the command tag; the processing unit is also used to set the corresponding flag bit in the completion queue entry to 1 to terminate the command according to the command tag.

[0019] In a third aspect, the present application provides a computing device comprising a processor and a memory, wherein the processor and the memory are connected via an internal bus, and instructions are stored in the memory. The processor calls the instructions in the memory to execute the data access method provided in the first aspect and in combination with any one of the implementation methods of the first aspect.

[0020] In a fourth aspect, the present application provides a computer storage medium storing a computer program. When the computer program is executed by a processor, the process of the data access method provided in the first aspect and in combination with any one of the implementation methods of the first aspect can be implemented.

[0021] In a fifth aspect, the present application provides a computer program product, which includes instructions. When the computer program is executed by a computer, the computer can execute the process of the data access method provided in the above-mentioned first aspect and in combination with any one of the implementation methods of the above-mentioned first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0023] Figure 1 This is a schematic diagram of an NVMe multi-queue provided in an embodiment of the present application;

[0024] Figure 2 This is a schematic diagram of a system architecture provided by an embodiment of the present application;

[0025] Figure 3 This is a flowchart of a command processing method for an NVMe-based solid-state drive provided in an embodiment of the present application;

[0026] Figure 4 is a schematic diagram of a command table entry format provided in an embodiment of the present application;

[0027] Figure 5 Schematic diagram of the location of a command in SRAM provided by an embodiment of the present application;

[0028] Figure 6 is a schematic diagram of a command label table provided in an embodiment of the present application;

[0029] Figure 7 is a schematic diagram of a completion queue entry format provided by an embodiment of the present application;

[0030] Figure 8 This is a structural diagram of an NVMe command processing system provided in an embodiment of the present application;

[0031] Figure 9 It is a structural diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The technical solutions in the embodiments of the present application are clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0033] First, some of the terms and related technologies involved in this application are explained in conjunction with the accompanying drawings to facilitate understanding by those skilled in the art.

[0034] Non-Volatile memory express (NVMe) is a scalable host controller interface designed for enterprise and client systems using PCIe solid-state drives, which includes an optimized register interface and command set. Fundamentally, NVMe is an optimized queue interface. The host submits commands to the queue, and the queue completes the reading or writing of data, not in the order in which the host commands are submitted. In addition, it has a component dedicated to managing queues to complete queue creation, deletion, command termination, security and other operations. The NVMe protocol supports multiple parallel command queues, with a maximum of 64k command queues, each queue has 64k commands, and queue information needs to be saved for each command queue. Therefore, when implementing the NVMe protocol, a space needs to be allocated for each queue. For example Figure 1 The figure shows a schematic diagram of NVMe multi-queues. The host and NVMe device (also known as the controller) interact through shared memory queues and support the MSI-X interrupt mechanism. There are two queues in the host memory, namely the management queue (the queue on the far left) and the normal queue (command queue). There is only one management queue, and there can be up to 65535 command queues. The number and mode of command queues are set by the management queue. Each command queue is actually a queue pair, including two queues, namely the command submission queue and the command completion queue. The command submission queue is used by the host to send NVMe commands to the NVMe device, and the command completion queue is used by the NVMe device to feedback the command execution status to the host. Each command queue corresponds to a CPU core, which can perform command read, write, and refresh operations. In order to adapt to the high bandwidth and low latency interface of PCIe SSD, its interface form is designed as a multi-path or multi-IO channel mode. A path or IO channel consists of one or more command submission queues and a corresponding command completion queue. The command submission queue and command completion queue can be created in pairs dynamically. If multiple command queues share an IO channel, their priorities can be determined through an arbitration mechanism, thereby determining the order in which the IO channels are used.

[0035] The host memory buffer (HMB) allows the host to make unused memory resources available to the SSD via the NVMe protocol. It is suitable for solid-state drives without external caches and can leverage host memory to access the flash translation layer (FTL) mapping table, accelerating performance. The method and system provided in this application can utilize HMB technology to implement the design of SSD storage control chips.

[0036] Currently, when designing storage chips, SSDs based on SATA or PCIe interfaces are implemented using the AHCI protocol or FPGA, which results in poor performance and low efficiency of the SSD master control chip. This application provides a design scheme and command processing method for an SSD storage control chip based on the NVMe protocol and HMB technology. The design independently designs NVMe command processing, further optimizes the design based on the implementation of the NVMe protocol, and improves the performance and efficiency of the SSD master control chip.

[0037] Based on the above, the present application provides a command processing method for an NVMe-based solid-state drive, which processes NVMe commands through an independently designed NVMe command processing architecture, thereby improving the performance and efficiency of the SSD master control chip.

[0038] The technical solutions of the embodiments of the present application can be applied to any system involving command processing of an SSD control chip, especially to scenarios where SSDs use the NVMe protocol.

[0039] Figure 2 A schematic diagram of a system architecture of an embodiment of the present application is shown. Figure 2As shown, the system 200 includes: a microprocessor 210, a register 220, a command fetch state machine 230, an advanced extensible interface (AXI) master station 240, a command static random access memory arbiter 250, a command completion state machine 260, and a static random access memory 270. The microprocessor 210 sends the received IO command to the register 220. The register 220 includes a command queue base address and pointer register 221, a command abort register 222, a completion queue base address and pointer register 223, an interrupt status and mask register 224, and a data format register 225. The microprocessor 210 uses the command queue to issue read and write commands. The command queue is in the static random access memory 270 or BTCM, and notifies the command fetch state machine 230. The command fetch state machine 230 reads the command from the static random access memory 270 through the AXI master station 240 according to the address and pointer stored in the register 220 (such as the command queue base address and pointer register 221), and then requests the command static random access memory to complete. The command SRAM arbiter 250 is used to obtain the command slot. The command SRAM arbiter 250 includes a command SRAM 251, a command tag array 252 and a write command linked list 253. The command SRAM arbiter 250 saves the command in the command SRAM 251 and updates the command tag table in the command tag array 252 and the write command linked list in the write command linked list 253. It should be noted that the initial command context is also stored in the command SRAM 251. After the command processing is completed, the command completion state machine 260 requests the command SRAM arbiter 250 to release the command slot and updates the command completion queue in the SRAM 270 through the AXI master station 240.

[0040] In the embodiment of the present application, each part involved in the NVMe command processing system is independently designed to better implement the processing of NVMe commands and can be deployed in a server or chip.

[0041] It can be seen that compared with the existing technical solutions, Figure 2 The system shown performs NVMe command processing, which can effectively improve command processing efficiency and SSD main control chip performance.

[0042] Combine Figure 2 The schematic diagram of the system architecture shown in FIG. 1 is used to describe the command processing method of the solid-state drive based on NVMe provided by the embodiment of the present application. Figure 3 As shown, the method flow includes:

[0043] S301: Update the command queue entry and the command queue write pointer.

[0044] Specifically, the firmware uses the command queue to issue read or write commands to the command processing system. For each command, the firmware needs to write a new command queue entry, and then the firmware updates the command queue write pointer to push the command into the hardware. Each 32-bit command queue entry points to a 64-byte NVMe command buffer. The base address of the command queue is controlled by the low-order 21 bits (for example, RC0033018h[20:0]), the size of the command queue is controlled by the high-order 8 bits (for example, RC0033018h[31:24]), and the position of the command queue and command buffer is controlled by the middle two bits (for example, RC0033018h[23:22]).

[0045] It should be noted that for unmapped read commands, the data read is not from NAND. The buffer manager will provide dummy data for the unmapped read command. The firmware needs to issue a read command to CMD_PORC and program the register (e.g., register RC0033048h) to implement unmapped read command control. For example, RC0033048h

[16] is set to 1 to enable the unmapped read command data tag, and RC0033048h[9:0] is used for the special data tag of the unmapped read command (this tag must match the special data tag in the buffer manager). When RC0033048h

[16] is 1 and the incoming data tag matches RC0033048h[9:0], it can be determined that this data tag is for the unmapped read command. If PI is enabled, the PI result will be ignored and PI will be inserted for each sector.

[0046] After updating the command queue entry and the command queue write pointer, the system 200 may begin processing new commands.

[0047] S302: Read a command table entry from a static random access memory (SRAM), where the command table entry includes a command buffer address.

[0048] Specifically, when the command queue is not empty and the command slot is not full, CMD_FETCH_SM reads the SRAM to obtain a command table entry, which includes SQ_ID, HW_AUO_CMPL, CMD_TYPE, and CMD_BUF_ADDR information, so that the command buffer address can be determined.

[0049] For example, Figure 4The figure shows a schematic diagram of the command table entry format. The command table entry format has 32 bits, which are divided into 6 parts. Each part represents a different meaning. For example, the low-order 8 bits represent CMD_TAG, which is used to describe the internal command tag. The high-order 16 bits represent CMD_BUF_ADDR. The 16th bit represents CMD_TYPE_1, which is used to describe the command type.

[0050] S303: According to the command table entry, obtain a command from the SRAM and save it to a command static random access memory (CSRAM) arbiter.

[0051] Specifically, after reading the command table entry, CMD_FETCH_SM reads the SRAM to obtain the command, then calculates the command context and saves it to CMD DW1-DW3, then requests CSRAM to obtain the command slot, writes the command to the corresponding CSRAM entry, and then updates the command tag table and write command link list. When the command slot is full, it will stop reading new commands, and each time after reading a command, it needs to update the command queue read pointer (for example, RC003301Ch[15:8]).

[0052] For example, Figure 5 As shown, Figure 5 It is a schematic diagram of the location of commands in SRAM. The base address and data read pointer in the command table both point to scattered 64-byte NVMe commands.

[0053] It should be noted that when the command state machine requests to store a new command, the command tag is required as input, and then the CSRAM arbiter allocates the command queue position and saves the command, and then updates the command tag table. The function of the command tag table is to save the command slot and command tag mapping table, such as Figure 6 shown.

[0054] In addition, the CSRAM arbiter will also handle other arbitrations related to CSRAM access, such as DATA_XFER write DMA request to obtain a new write command, the CSRAM arbiter returns the new write command and its position queue number, and updates the write command link list; when DATA_XFER reads DMA request to obtain command information, it takes the command tag as input, the CSRAM arbiter finds the queue number, returns the command information, and updates the remaining data length of this command; when DATA_XFER reads _PRP_CTRL request to obtain command information, it takes the command slot as input, and the CSRAM arbiter returns the command information; when DATA_XFER requests to save error information, it takes the command slot as input, and the CSRAM arbiter saves the error information to the corresponding command static random access memory; DATA_XFER When requesting NCB_INDI_CTRL to obtain command information, the command tag is used as input. The CSRAM arbiter finds the slot and returns the command information. When requesting a command abort, the command tag is used as input. The CSRAM arbiter finds the slot and immediately aborts the read command, or sets the WCMD_ABORT bit in the command static random access memory to 1 for a write command. When requesting a command completion, the command tag is used as input. The CSRAM arbiter releases the command slot and clears the valid bit. It should be understood that for a read command, the CSRAM arbiter also requests READ_PRP_CTRL to clear all read PRP entries related to this command.

[0055] It is easy to understand that the commands are stored in CSRAM. CRSAM can store 64 commands, each command has 64 bytes. For write commands, DATA_XFER determines the last DU transmission and requests CMPL FSM to release the command slot; for read command requests, CSRAM returns last_du with command information to DATA_XFER of the last DU. After the data is sent to the host, DATA_XFER requests CMPL FSM to release the command slot.

[0056] S304: Process the command and update the command completion queue in the SRAM.

[0057] Specifically, after the CSRAM arbiter completes the relevant processing of the command, the command completion state machine updates the command completion queue in the SRAM. The command completion state machine processes the DATA_XFER completion request and the FW command abort request, and requests the CSRAM to release the command slot or save the WCMD_ABORT status bit as a write command, updates the command completion queue in the SRAM, and if the hardware auto-completion function is enabled and the command is completed correctly, NVMe_CTRL updates the host CQ. If the command is aborted, the request NVMe_CTRL is prohibited.

[0058] For example, Figure 7 As shown, Figure 7 It is a schematic diagram of the completion queue entry format. The completion queue entry format has 64 bits, and each bit represents a different field. For example, the first bit represents CMD_GOOD, which is used to describe that the command is completed without error. The 7th bit represents PCIe_READ_TMOUT, which is used to describe PCIe read timeout. The 17th to 25th bits represent CMD_TAG, which is used to describe the command tag. The 33rd to 64th bits represent FIRST_ERR_LBA, which is used to describe the first LBA error.

[0059] The above describes the extraction process in detail. The following describes the command writing process and the command reading process in detail.

[0060] The specific process of writing commands is as follows:

[0061] If the write command list is not empty, DATA_XFER reads CSRAM to obtain a new write command. If the required PRP / SGL is greater than PRP1 / PRP2 / SGL1, DATA_XFER reads the PRP / SGL list from the host. When PRP / SGL is available, DATA_XFER reads data from the host and writes it to SRAM. The read is split into DUs (for example, 4KB, 4KB+8B, or 4KB+64B for a 4KB DU). The first and last DUs can be partial DUs. Since the write commands are executed sequentially, CSRAM does not need to update the remaining data length. After writing all the data of the command to SRAM, DATA_XFER requests CMD_PROC to update the command completion status. CMD_PROC releases the command slot and writes the completion queue to SRAM. If the hardware automatic completion function is enabled for this command, then if the command is completed without error, CMD_PROC will send {SQ_ID, CID} information to NVMe_CTRL. If the hardware automatic completion function is not enabled for this command, the command is aborted or completed incorrectly, the completion status will be prepared later and NVMe_CTRL will be notified to send it. NVMe_CTRL updates the host CQ.

[0062] The specific process of reading commands is as follows:

[0063] When DATA_XFER gets the early indication from the NAND control block, it requests CMD_PROC with CMD_TAG and DU_OFFSET. CMD_PROC returns the command slot, PSDT, data pointer (DPTR), metadata pointer (MPTR), SLBA, PRINFO, and NLB. Then DATA_XFER reads the host memory to prepare PRP / SGL. After DATA_XFER gets the data tag from the BM, it requests CMD_PROC with CMD_TAG and DU_OFFSET. CMD_PROC returns the command slot, PSDT, DPTR, MPTR, SLBA, PRINFO, NLB, EILBRT, ELBATM, and ELBAT. CMD_PROC also reduces the remaining data length stored in the command static random access memory. If this is the last DU, CMD_PROC sends the last_du signal with confirmation to DATA_XFER. If DATA_XFER READ_PRP_CTRL cannot find the relevant PRP / SGL of the data tag, it will request CMD_PROC with CMD_SLOT and DU_OFFSET. CMD_PROC returns the command slot, PSDT, DPTR, MPTR, SLBA, PRINFO and NLB, and then DATA_XFER READ_PRP_CTRL reads the host memory to obtain PRP / SGL. After DATA_XFER sends the last DU to the host, it requests CMD_PROC to update the command completion status. CMD_PROC releases the command slot, requests DATA_XFER READ_PRP_CTRL to release the PRP / SGL cache entry related to this command, and writes the completion queue to SRAM. If the hardware automatic completion function is enabled for this command, CMD_PROC sends the SQ_ID, CID information to NVMe_CTRL when the command is completed without error. If the hardware automatic completion function is not enabled for this command, the command is aborted or completed with error, the completion status will be prepared later and NVMe_CTRL will be notified to send it. NVMe_CTRL updates the host CQ.

[0064] In addition, the command may be aborted during execution. For example, the command CMD_TAG can be written to the command abort register to abort the command. If the command issue queue is not empty, the aborted command may still be in the queue and cannot reach the CSRAM. At this time, the abort operation will be retried until the command problem queue is empty. To abort the read command, you need to ensure that there is no pending data tag related to this command in the BM and NVMe_CTRL. If CMD_TAG is not found, this abort operation will be ignored and will not be written to the completion queue. If CMD_TAG is found, the HW immediately aborts the read command and updates the completion queue with the CMD_ABORT position 1. To abort a write command, if CMD_TAG is not found, this abort operation will be ignored and the completion queue will not be written. If CMD_TAG is found, the write command will not be aborted immediately. The WCMD_ABORT bit will be set to 1 in the command static random access memory. DATA_XFER treats WCMD_ABORT in the same way as a fatal error and aborts the command after finding that the WCMD_ABORT bit is set to 1.

[0065] The above describes in detail the method of the embodiment of the present application. In order to facilitate better implementation of the above scheme of the embodiment of the present application, correspondingly, related equipment for cooperating in implementing the above scheme is also provided below.

[0066] See also Figure 8 , Figure 8 This is a structural diagram of an NVMe command processing system provided by an embodiment of the present application. Figure 8 As shown, the system 800 includes an updating unit 810, a reading unit 820 and a processing unit 830.

[0067] An updating unit 810, configured to update a command queue entry and a command queue write pointer;

[0068] A reading unit 820 is configured to read a command table entry from a static random access memory (SRAM), wherein the command table entry includes a command buffer address;

[0069] The processing unit 830 is configured to obtain a command from the SRAM according to the command table entry and save the command to a command static random access memory (CSRAM), process the command, and update a command completion queue in the SRAM.

[0070] As an embodiment, the processing unit 830 is specifically configured to: search for a slot from the CSRAM and save the command into the slot; and update a command tag table and a write command link list.

[0071] As an embodiment, the processing unit 830 is further configured to update a command queue read pointer.

[0072] As an embodiment, the processing unit 830 is specifically used to: if the command is a write command and the write command link list is not empty, read the CSRAM to obtain a new write command; determine the last data unit DU transmission and release the slot.

[0073] As an embodiment, the processing unit 830 is specifically configured to: if the command is a read command, release the slot after sending the last DU to the host.

[0074] As an embodiment, the system also includes a receiving unit 840, which is used to receive a command tag, and the command tag is used to terminate the command corresponding to the command tag; the processing unit 830 is also used to set the corresponding flag bit in the completion queue entry to 1 to terminate the command according to the command tag.

[0075] It should be understood that the structure of the above NVMe command processing system is only an example and should not constitute a specific limitation. The various units of the system can be increased, reduced or merged as needed. In addition, the operations and / or functions of the various units in the system are respectively to achieve the above Figure 3 For the sake of brevity, the corresponding process of the described method will not be repeated here.

[0076] See also Figure 9 , Figure 9 This is a schematic diagram of the structure of a computing device provided in an embodiment of the present application. Figure 9 As shown, the computing device 900 includes a processor 910 , a communication interface 920 , and a memory 930 . The processor 910 , the communication interface 920 , and the memory 930 are interconnected via an internal bus 940 .

[0077] The computing device 900 may be Figure 2 The NVMe command processing system in . Figure 2 The functions performed by the NVMe command processing system are actually performed by the processor 910 of the computing device.

[0078] The processor 910 may be composed of one or more general-purpose processors, such as a central processing unit (CPU), or a combination of a CPU and a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0079] The bus 940 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus 940 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0080] The memory 930 may include a volatile memory, such as a random access memory (RAM); the memory 730 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); the memory 930 may also include a combination of the above types. The program code may be used to implement the functional units shown in the NVMe command processing system 800, or to implement Figure 3 The method embodiment shown uses the NVMe command processing system as the execution subject for the method steps.

[0081] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, it can implement part or all of the steps of any one of the above method embodiments, as well as implement the above method embodiments. Figure 8The function of any functional unit described.

[0082] The present application also provides a computer program product that, when executed on a computer or processor, causes the computer or processor to perform one or more steps of any of the aforementioned methods. If the various components of the aforementioned devices are implemented as software functional units and sold or used as independent products, they may be stored in the computer-readable storage medium.

[0083] In the above embodiments, the description of each embodiment has different emphases. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0084] It should also be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0085] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0086] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0087] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A command processing method for a solid-state drive based on NVMe, characterized in that: The method comprises: Update command queue entries and command queue write pointers; Reading a command table entry from a static random access memory SRAM, wherein the command table entry includes a command buffer address; According to the command table entry, obtaining a command from the SRAM and saving it to a command static random access memory CSRAM arbiter; Processing the command and updating the command completion queue in the SRAM; Wherein, according to the command table entry, obtaining the command from the SRAM and saving it to the command static random access memory CSRAM includes: Find a slot from the CSRAM and save the command into the slot; Update the command tag table and write command link list.

2. The method according to claim 1, characterized in that After acquiring the command from the SRAM and storing it in the command static random access memory CSRAM, the method further comprises: Update the command queue read pointer.

3. The method according to claim 1, characterized in that Processing the command includes: If the command is a write command and the write command link list is not empty, read the CSRAM to obtain a new write command; The last data unit DU transmission is determined and the slot is released.

4. The method according to claim 2, characterized in that Processing the command includes: If the command is a write command and the write command link list is not empty, read the CSRAM to obtain a new write command; The last data unit DU transmission is determined and the slot is released.

5. The method according to any one of claims 1 to 4, characterized in that: Processing the command includes: If the command is a read command, the slot is released after the last DU is sent to the host.

6. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: receiving a command tag, wherein the command tag is used to terminate a command corresponding to the command tag; According to the command tag, the corresponding flag bit in the completion queue entry is set to 1 to terminate the command.

7. An NVMe command processing system, characterized in that: include: An update unit, used for updating a command queue entry and a command queue write pointer; A reading unit, configured to read a command table entry from a static random access memory SRAM, wherein the command table entry includes a command buffer address; A processing unit, configured to obtain a command from the SRAM and save the command to a command static random access memory CSRAM according to the command table entry, process the command and update a command completion queue in the SRAM; Wherein, the processing unit is specifically used for: Find a slot from the CSRAM and save the command into the slot; Update the command tag table and write command link list.

8. The system according to claim 7, characterized in that The processing unit is also used to update the command queue read pointer.

9. The system according to claim 7, characterized in that The processing unit is specifically used for: If the command is a write command and the write command link list is not empty, read the CSRAM to obtain a new write command; The last data unit DU transmission is determined and the slot is released.

10. The system according to claim 8, characterized in that The processing unit is specifically used for: If the command is a write command and the write command link list is not empty, read the CSRAM to obtain a new write command; The last data unit DU transmission is determined and the slot is released.

11. The system according to any one of claims 7 to 10, characterized in that: The processing unit is specifically used for: If the command is a read command, the slot is released after the last DU is sent to the host.

12. The system according to any one of claims 7 to 10, characterized in that: The system further comprises a receiving unit, The receiving unit is used to receive a command tag, where the command tag is used to terminate the command corresponding to the command tag; The processing unit is further configured to set a corresponding flag bit in a completion queue entry to 1 according to the command tag to terminate the command.

13. A computing device, characterized in that: The computing device comprises a memory and a processor, and the processor executes computer instructions stored in the memory, so that the computing device performs the method according to any one of claims 1 to 6.

14. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the function of the method according to any one of claims 1 to 6 is realized.