Method, device and system for testing NVMe (Non-Volatile Memory Express) system and solid state disk
By introducing an out-of-band error-call interface in a solid-state drive, parsing the error-call command and returning error messages, the instability and compatibility problems during NVMe system verification of reliability is solved, and a more efficient, flexible and economical test solution is achieved.
Patent Information
- Application Number
- CN202310994709.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-08
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art has problems of instability, poor reliability and compatibility, and high cost when verifying the reliability of NVMe systems, especially when handling custom policies and protocol updates and iterations of solid-state drives are fast.
By setting up an out-of-band error-taking interface in the solid state drive, receiving and parsing the error-taking command, obtaining error information, and returning it to the host to be tested to handle the error. This allows the NVMe system to flexibly configure error-recall information, simulate different error scenarios, customize test solutions, and reduce dependence on association certification.
It improves the testing reliability and accuracy of NVMe system, reduces testing costs, and can flexibly respond to the testing needs of different main airport scenarios, ensuring the compatibility and reliability of NVMe system.
Smart Images

Figure CN119479749A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data storage technology, and in particular to a testing method, device, system and solid-state hard disk of an NVMe system. Background Art
[0002] With the increasing popularity and application of solid-state drives based on the NVMe (Non-Volatile Memory Express) protocol, the reliability of the NVMe protocol and the compatibility of the system have become very thorny issues for both hard disk manufacturers and upper-layer manufacturers (server manufacturers or PC manufacturers). Currently, the methods for verifying the reliability of the protocol include passing the verification test recognized by the association, or purchasing test equipment certified by the association.
[0003] In the process of implementing the embodiments of the present application, the inventors found that the prior art has at least the following problems: the tests written by the association are mostly general principles, and the certification can only prove that there are no major problems with the overall protocol, but there are often compatibility issues caused by some special points. For example, some hard disks have their own strategies, such as temperature strategies, alarm strategies, etc. These strategies are often not defined in the protocol. These different strategies may affect the compatibility of the NVMe system, causing some devices to fail to work properly in certain specific situations, or fail to work properly with other devices, thereby affecting the stability and reliability of the system; in addition, the protocol is updated and iterated very quickly, and constantly applying for test cases and test tools from the association is also an expense; finally, verification of specific systems cannot be done. For example, the host manufacturer needs to verify the hard disk manufacturer's customized command set and the hard disk manufacturer's customized functions, which may cause some compatibility issues. Summary of the invention
[0004] The embodiments of the present application provide a testing method, device, system and solid-state hard disk for an NVMe system, which mainly solve the technical problems of instability, poor reliability and compatibility, and high cost in related technologies when verifying the reliability of an NVMe system.
[0005] To solve the above technical problems, a technical solution adopted in the implementation mode of the present application is: to provide a testing method for an NVMe system, applied to a solid-state hard disk, the solid-state hard disk is provided with an out-of-band error injection interface, the method comprising: receiving a first command input through the out-of-band error injection interface; parsing the first command, obtaining first error information corresponding to the first command, and storing the first error information; receiving a second command sent by a host to be tested; obtaining second error information corresponding to the second command according to the first error information and the second command, and returning the second error information to the host to be tested, so that the host to be tested obtains an error according to the second error information and handles the error.
[0006] In some embodiments, the parsing of the first command, obtaining the first error information corresponding to the first command, and storing the first error information include: parsing the first command to obtain the error handling type and the error information type of the first command; when the error handling type of the first command is an injection error fault type, and the error information type is a command error, assigning an identification number to the command error, and storing the command error and the identification number corresponding to the command error; when the error handling type of the first command is an injection error fault type, and the error information type is an event error, obtaining the condition information corresponding to the event error, assigning an identification number to the event error, and storing the event error and the condition information and the identification number corresponding to the event error.
[0007] In some embodiments, obtaining the second error information corresponding to the second command based on the first error information and the second command includes: parsing the second command and detecting the error information type corresponding to the second command; when the error information type of the second command is the command error, detecting whether the second command meets the hit condition based on the command error and the first error information, and if so, obtaining the second error information corresponding to the command error; when the error information type of the second command is the event error, detecting whether the condition information corresponding to the event error is triggered based on the event error and the first error information, and if the condition information is triggered and it is detected that the second command is an asynchronous event request command, obtaining the second error information corresponding to the event error.
[0008] In some embodiments, when the error information type is an event error, the method further includes: polling the event error and the condition information corresponding to the event error.
[0009] In some embodiments, the method also includes: when the error handling type of the first command is to remove the error fault type, obtaining an identification number corresponding to the first command; obtaining the corresponding error according to the identification number, and removing the error, wherein if the error is the event error, the conditional information corresponding to the error is also removed at the same time.
[0010] In some embodiments, the method further includes: when the error handling type of the first command is a display error fault type, obtaining an identification number corresponding to the first command; obtaining a corresponding error according to the identification number, and sending the error to an external device.
[0011] To solve the above technical problems, another technical solution adopted in the implementation mode of the present application is: to provide a test device for an NVMe system, applied to a solid-state hard disk, the solid-state hard disk is provided with an out-of-band error injection interface, and the device includes: a first receiving module, used to receive a first command input through the out-of-band error injection interface; a parsing module, used to parse the first command, obtain first error information corresponding to the first command, and store the first error information; a second receiving module, used to receive a second command sent by the host to be tested; a processing module, used to obtain second error information corresponding to the second command according to the first error information and the second command, and return the second error information to the host to be tested, so that the host to be tested obtains an error according to the second error information and processes the error.
[0012] To solve the above technical problems, another technical solution adopted in the implementation mode of the present application is: providing a solid state drive, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.
[0013] In order to solve the above technical problems, another technical solution adopted in the implementation mode of the present application is: providing a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a solid-state hard disk, the solid-state hard disk executes the method as described above.
[0014] To solve the above technical problems, another technical solution adopted in the implementation mode of the present application is: to provide a test system, including: a solid-state hard disk as described above, the solid-state hard disk is provided with an out-of-band error injection interface; an error injection host, used to input a first command to the solid-state hard disk through the out-of-band error injection interface; a host to be tested, used to send a second command to the solid-state hard disk; the solid-state hard disk is used to: receive the first command; parse the first command, obtain first error information corresponding to the first command, and store the first error information; receive the second command; obtain second error information corresponding to the second command according to the first error information and the second command, and return the second error information to the host to be tested, so that the host to be tested obtains an error according to the second error information and handles the error.
[0015] Different from the related art, the embodiments of the present application provide a test method, device, system and solid-state hard disk of an NVMe system, which mainly receives a first command input through the out-of-band error injection interface by setting an out-of-band error injection interface on the solid-state hard disk; parses the first command, obtains the first error information corresponding to the first command, and stores the first error information; receives the second command sent by the host to be tested; obtains the second error information corresponding to the second command according to the first error information and the second command, and returns the second error information to the host to be tested, so that the host to be tested obtains the error according to the second error information and handles the error. The implementation method of the present application can help check the error handling capability of the NVMe system, especially in solid-state hard disk devices, by obtaining and processing error information through the out-of-band error injection interface, which improves the reliability and accuracy of the test; furthermore, the error injection information can be flexibly configured, different error scenarios can be simulated according to the host scenario requirements, and a variety of different test schemes can be customized. In addition, there is no need to apply for test cases and test tools from the association, which can save costs in this regard. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] One or more embodiments are exemplarily described by corresponding drawings, which do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and the figures in the drawings do not constitute proportional limitations unless otherwise stated.
[0017] Figure 1 is a structural schematic diagram of a test system provided in an embodiment of the present application;
[0018] Figure 2 It is a flowchart of a test method for verifying the reliability of an NVMe system provided in an embodiment of the present application;
[0019] Figure 3 It is a flow chart of a testing method of an NVMe system provided in an embodiment of the present application;
[0020] Figure 4 It is a structural schematic diagram of a testing device for an NVMe system provided in an embodiment of the present application;
[0021] Figure 5 It is a hardware structure diagram of a solid-state hard disk for executing the test method of the NVMe system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0023] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order than the module division in the device schematic diagram or the order in the flow chart.
[0024] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used in this specification includes any and all combinations of one or more of the related listed items.
[0025] NVMe (Non-Volatile Memory Express) is a high-performance, low-latency storage interface protocol used to connect solid-state drives (SSDs) and hosts. Compared with traditional storage interface protocols such as SATA and SAS, the NVMe protocol has the following advantages: faster data transfer speed. The NVMe protocol uses a high-speed PCIe bus to achieve higher bandwidth and faster data transfer speed, thereby improving the performance of the storage system; lower latency. The NVMe protocol can achieve lower latency by optimizing the I / O operation queue structure and management method, thereby improving the response speed and performance of the storage system; more scalability. The NVMe protocol supports multiple namespaces and queues, which can better support data isolation and sharing between multiple applications and multiple virtual machines; higher reliability. The NVMe protocol supports a variety of data protection technologies, such as end-to-end data protection, command retry, error reporting and event logging, which can improve the reliability and data integrity of the storage system. In short, the NVMe protocol is a high-performance, low-latency, and highly reliable storage interface protocol, which makes it the preferred storage interface protocol in high-performance computing fields such as data centers and cloud computing. At the same time, the application of the NVMe protocol is also constantly expanding to personal computers such as desktop computers and laptops.
[0026] However, compared with other traditional storage interface protocols, such as SATA and SCSI, the NVMe protocol is more complex, involving many new technologies and concepts, such as namespaces, queues, and I / O priorities. This means that hard disk manufacturers need more technical strength and resources to develop and test NVMe solid-state drives, while server and PC manufacturers also need corresponding technical capabilities and resources to support the NVMe protocol. In addition, since the NVMe protocol is a relatively new storage interface protocol, there may be compatibility issues between different hardware devices and systems. This requires closer cooperation and consultation between hard disk manufacturers, server manufacturers, and PC manufacturers to ensure compatibility between devices and systems. Furthermore, the application scenarios of the NVMe protocol are very wide, including high-performance computing fields such as data centers and cloud computing, as well as personal computer fields such as desktop computers and laptops. This means that hard disk manufacturers, server manufacturers, and PC manufacturers need to perform different optimizations and customized developments according to different application scenarios to meet the needs of different users.
[0027] Therefore, the embodiment of the present application provides a flexible solution, so that each NVMe system can flexibly configure requirements on the basic verification system, so as to achieve the form of what to verify and what to test. Let each NVMe system have its own independent verification system, so that the host, system, and solid-state drive can achieve the ideal working state of the developer. Through the internally negotiated agreement, the SSD manufacturer and the Host manufacturer can achieve customized verification. For the SSD manufacturer, only one Host is needed to verify the reliability of the SSD protocol and the compatibility of the system. Conversely, for the Host manufacturer, only a few hard drives are needed to verify the protocol reliability and system compatibility of the Host. Therefore, while ensuring cost reduction, the compatibility of the SSD and the Host is further guaranteed. Among them, Host refers to the host or computer connected to the NVMe solid-state drive. Host manufacturer refers to the manufacturer of host devices such as servers, workstations or personal computers.
[0028] Specifically, see Figure 1 , Figure 1 1 is a schematic diagram of a test system provided in an embodiment of the present application. The test system 100 includes an error-injection host 10, a host to be tested 20, and a solid-state hard disk 30. An out-of-band error-injection interface is provided on the solid-state hard disk 30, and the error-injection host 10 is connected to the solid-state hard disk 30 through the out-of-band error-injection interface, and the solid-state hard disk 30 is also connected to the host to be tested 20.
[0029] The error-injection host 10 is used to input a first command to the solid-state drive 30 through the out-of-band error-injection interface. The host 20 to be tested is used to send a second command to the solid-state drive 30. The solid-state drive 30 is used to receive the first command, parse the first command, obtain the first error information corresponding to the first command, and store the first error information; receive the second command; obtain the second error information corresponding to the second command according to the first error information and the second command, and return the second error information to the host 20 to be tested, so that the host 20 to be tested obtains the error according to the second error information and handles the error. The test system 100 realizes the acquisition, storage and return of error information through four components: the error-injection host 10, the out-of-band error-injection interface, the host 20 to be tested and the solid-state drive 30, so as to perform error handling and debugging.
[0030] The error injection host 10 can be a computer specifically used for testing and debugging, or an embedded device for performing error injection operations on the solid-state drive 30. The solid-state drive 30 is a storage device using the NVMe protocol. In the development and testing process of the NVMe solid-state drive, the error injection host 10 is usually used to simulate different error scenarios to test the error handling and recovery capabilities of the NVMe solid-state drive. Through the error injection host 10, various error conditions, such as communication errors, data transmission errors, command errors, etc., can be simulated to verify the response and processing capabilities of the NVMe solid-state drive to these errors. At the same time, the error injection host 10 can also be used to obtain error information of the NVMe solid-state drive for fault diagnosis and debugging. It is worth noting that the error injection host 10 inputs a first command to the solid-state drive 30 through an out-of-band error injection interface to obtain a first error message. Thus, by injecting error information through the out-of-band error injection interface, various error scenarios of different types can be simulated, thereby verifying the error handling and recovery capabilities of the NVMe solid-state drive, and further improving the test quality and reliability. By using an out-of-band error injection interface, the reliance on physical hardware can be reduced, thereby reducing the cost of testing. Through the out-of-band error injection interface, various types of error information can be quickly and conveniently injected, thereby improving test efficiency and test coverage. Finally, through the out-of-band error injection interface, error information of NVMe SSDs can be obtained for fault diagnosis and debugging.
[0031] Among them, the out-of-band error injection interface is an interface that implements error injection operations and obtains error information through a physical interface or network connection, and is used to test the error handling and recovery capabilities of NVMe solid-state drives. During the development and testing of NVMe solid-state drives, the out-of-band error injection interface is often used to simulate various error scenarios to test the error handling and recovery capabilities of NVMe solid-state drives. The out-of-band error injection interface can be implemented in a variety of ways, such as through serial ports, IPMI, BMC, KVM, etc., to achieve remote monitoring and management of the system. Through the out-of-band error injection interface, error commands or data can be input into the NVMe solid-state drive to simulate different types of errors to test the error handling and recovery capabilities of the NVMe solid-state drive. At the same time, the out-of-band error injection interface can also be used to obtain error information of the NVMe solid-state drive for fault diagnosis and debugging.
[0032] The host to be tested 20 refers to a host device that needs to be tested and verified. Specifically, in this solution, the host to be tested is used to send a second command to the NVMe solid-state drive and receive a second error message returned by the NVMe solid-state drive. The host to be tested 20 can be a server, a workstation or a personal computer, connected to the NVMe solid-state drive via a PCIe bus. In the development and testing process of NVMe solid-state drives, the host to be tested 20 is generally used to verify the performance, stability and compatibility of NVMe solid-state drives. By sending different commands to the NVMe solid-state drive, its read and write performance, concurrency performance, response time and other indicators can be tested. At the same time, the host to be tested 20 can also be used to test the compatibility and stability of NVMe solid-state drives with different host devices.
[0033] The solid state drive 30 is a storage device using the NVMe protocol, which is used to receive the first command and the second command, obtain the first error information according to the first command, obtain the second error information according to the second command and the first error information, and return the second error information to the host 20 to be tested. The solid state drive 30 can be a hard disk using non-volatile memory (NVM) as a storage medium, which has higher read and write speeds, lower latency and higher concurrency performance than traditional mechanical hard disks. In the NVMe protocol, the solid state drive 30 can use the PCIe bus for communication, with higher transmission speeds and lower latency. In the development and testing process of the NVMe solid state drive, the solid state drive 30 is used to receive the first command and the second command, and obtain error information according to the command. The read and write performance, concurrency performance, response time, error handling and recovery capabilities of the NVMe solid state drive can be tested by the solid state drive 30. At the same time, the compatibility between the solid state drive 30 and different host devices can also be tested to ensure that it can communicate and work normally with different host devices.
[0034] In this embodiment, the host 20 to be tested, the solid-state drive 30 and the out-of-band error injection interface together constitute the NVMe system to be verified. The reliability and compatibility of the NVMe system can be verified by the test system 100. It is mainly that the error injection host 10 and the solid-state drive 30 send commands to the solid-state drive 30 in an out-of-band manner through a negotiated interface. The main control of the solid-state drive 30 receives the out-of-band command, immediately parses the received command, and then buries the error. When the host 20 to be tested sends a response command and hits an error, the main control of the solid-state drive 30 performs corresponding error processing and returns the corresponding status to the host 20 to be tested. After receiving the corresponding error, the host 20 to be tested performs error processing on the host side.
[0035] Specifically, see Figure 2 , Figure 2 It is a flow chart of a method for performing the NVMe system performance test based on the above-mentioned mis-injected host 10, the host to be tested 20 and the solid-state hard disk 30.
[0036] like Figure 2 As shown, the error injection host 10 injects the command containing the error injection script into the solid-state drive 30 through the out-of-band error injection interface. The error injection script is a script used to simulate different error scenarios, usually containing a series of commands and data for injecting different types of error information. During the development and testing process of NVMe solid-state drives, error injection scripts are usually used to simulate different types of error scenarios to test the error handling and recovery capabilities of NVMe solid-state drives. The error injection script can be written according to the test requirements and contain various types of error commands, data and parameters. For example, the error injection script can inject different types of errors such as communication errors, data transmission errors, command errors, controller errors, storage medium errors, etc. By injecting various types of errors, the response and processing capabilities of the NVMe solid-state drive to these errors can be tested to verify its error handling and recovery capabilities.
[0037] After receiving the command, the solid state drive 30 parses the command to obtain the error annotation script, determines the error information type corresponding to the error annotation script, and performs different processing according to the determined error information type. The error information type includes command error and event error.
[0038] Among them, command error and event error are two types of errors that may occur in NVMe SSDs, covering all commands defined by the NVMe protocol and the error codes that may be returned, as well as error events that may occur in SSDs. Command errors usually refer to errors that occur during the execution of commands defined by the NVMe protocol, including all commands defined by the NVMe protocol and the error codes that may be returned. For example, when an NVMe SSD receives an unsupported command, it returns error code 0x01 (Invalid Command Opcode); when the parameters in the command are incorrect, it returns error code 0x02 (Invalid Command Parameter); when an error occurs during command execution, it returns error code 0x03 (Command Execution Error), etc. Event errors usually refer to various error events that may occur during the operation of NVMe SSDs, including reset (including software reset and hardware reset), overtemperature, backup power abnormality, and other error events that may occur in the SSD itself, as well as some manufacturer-defined errors. For example, when the temperature of the SSD is too high, an overtemperature error may occur; when the backup power of the SSD is abnormal, a backup power abnormality error may occur. During the development and testing of NVMe SSDs, command errors and event errors need to be tested and verified to ensure that the NVMe SSD can handle and recover from various error conditions normally. By simulating various types of command errors and event errors, the error handling and recovery capabilities of the NVMe SSD can be tested, further improving its reliability and stability.
[0039] When it is determined that the error information type corresponding to the error injection script is a command error, the error injection script is stored in the command error pool; when it is determined that the error information type corresponding to the error injection script is an event error, the error injection script is stored in the event error pool. Among them, the command error pool and the event error pool are pools for storing command error scripts and event error scripts, respectively, for managing and storing different types of error injection scripts. The command error pool specifically refers to a collection of command error scripts for storage, which includes error injection scripts for simulating different types of command errors. These command error scripts can contain various types of command errors, such as incorrect command parameters, unsupported commands, uninitialized command queues, etc. By storing the command error script in the command error pool and injecting it into the NVMe solid-state drive using the command error injection tool, the error handling and recovery capabilities of the NVMe solid-state drive in different types of command error scenarios can be tested. The event error pool specifically refers to a collection of event error scripts for storage, which includes error injection scripts for simulating different types of event errors. These event error scripts can contain various types of event errors, such as controller reset, storage medium error, backup power abnormality, etc. By storing the event error script in the event error pool and injecting it into the NVMe SSD using the event error injection tool, you can test the error handling and recovery capabilities of the NVMe SSD in different types of event error scenarios.
[0040] Among them, the error command stored in the command error pool and the error event stored in the event error pool can include their respective corresponding identification numbers, and the identification number is used to uniquely identify the error command or the error event. The event error also includes condition information, and the condition information corresponding to the error event is also stored in the event error pool. For example, a certain event needs to be triggered only when the internal temperature of the hard disk reaches 80 degrees and an alarm is generated. The condition information usually contains a series of logical relationships between condition values and trigger conditions, which are used to describe the triggering conditions of the error event. For example, for the error event that the internal temperature of the hard disk reaches 80 degrees, the condition information can at least include: the current temperature value of the temperature sensor is greater than or equal to 80 degrees; the hard disk generates an alarm information; the power status of the hard disk is in a normal state, etc. These condition information describe the necessary conditions for triggering the error event, and these conditions can be simulated by the error injection tool to trigger the error event. By using condition information, error events can be simulated more accurately, and the error handling and recovery capabilities of NVMe solid-state drives can be tested to improve their reliability and stability.
[0041] The host 20 to be tested sends a command to the solid-state drive 30, which is a command corresponding to the task that the host 20 to be tested currently needs to test, and the type of the command can be a command error or an event error. In the process of testing the NVMe solid-state drive, the host 20 to be tested sends commands to the solid-state drive 30 to perform the test task. The types of these commands can be command errors or event errors, depending on the requirements of the test task and the purpose of the test. If the test task is to test the error handling and recovery capabilities of the NVMe solid-state drive under different types of command error scenarios, the command sent by the host 20 to the solid-state drive 30 to be a command error type command. If the test task is to test the error handling and recovery capabilities of the NVMe solid-state drive under different types of event error scenarios, the command sent by the host 20 to the solid-state drive 30 to be an event error type command.
[0042] It should be noted that the process of the error-annotation host 10 sending a command containing an error-annotation script to the solid-state drive 30 and the process of the host 20 to be tested sending a command to the solid-state drive 30 can be parallel. The error-annotation host 10 sends a command containing an error-annotation script to the solid-state drive 30 to prepare for testing the performance and stability of the NVMe solid-state drive; at the same time, the host 20 to be tested sends a normal command to the solid-state drive 30 to test the performance and stability of the NVMe solid-state drive. This can improve the test efficiency and effectively test the performance and stability of the NVMe solid-state drive.
[0043] After the solid state drive 30 obtains the command sent by the host 20 under test, it obtains the error information type of the command. When the error information type of the command is a command error, the command sent by the host 20 under test meets the hit condition based on the command error and the error command stored in the command error pool. If it meets the hit condition, the error information corresponding to the command error is obtained, and the error information is returned to the host 20 under test, so that the host 20 under test obtains the error according to the error information and processes the error. When the error information type of the command is an event error, the condition information corresponding to the command sent by the host 20 under test is detected based on the event error and the event error stored in the event error pool. If the condition information is triggered and it is determined that the command is an asynchronous event request command, the error information corresponding to the event error is obtained, and the error information is returned to the host 20 under test, so that the host 20 under test obtains the error according to the error information and processes the error.
[0044] Among them, when detecting whether the condition information corresponding to the command sent by the host 20 to be tested is triggered according to the event error and the event error stored in the event error pool, it can be detected by polling, polling the event error and the condition information corresponding to the event error, so as to find the condition information corresponding to the command sent by the host 20 to be tested. When testing the NVMe solid-state drive, the host 20 to be tested sends a command to the solid-state drive 30 to perform the test task. In order to detect whether the command triggers an event error, it is necessary to poll the event errors stored in the event error pool, and check whether each event error matches the condition information corresponding to the command sent by the host 20 to be tested. The event error pool is a data structure that stores different types of event errors, and each event error contains the condition information that triggers the event error. When the host 20 to be tested sends a command, it is necessary to check whether the command meets the condition information of any event error stored in the event error pool. If the condition information is met, the command will trigger the corresponding event error. If the condition information is not met, the command will not trigger any event error.
[0045] In addition to the above-mentioned polling hit command corresponding to the conditional information, it is also necessary to determine that the command is an asynchronous event request command, so as to obtain the error information corresponding to the event error. In the NVMe protocol, the asynchronous event request command is a special type of command used to request the NVMe solid-state drive to send an asynchronous event notification. Asynchronous event notification refers to the solid-state drive sending a notification message to the host when a specific event occurs. These events can be error events, warning events, or information events. When the host 20 to be tested sends an asynchronous event request command, if the command triggers an event error, it is necessary to obtain the error information corresponding to the event error through an asynchronous event notification. The asynchronous event notification is a message sent to the host by the NVMe solid-state drive, which contains error information related to the event error. Therefore, to obtain the error information corresponding to the event error, it is necessary to simultaneously meet: the command sent by the host 20 to be tested hits the conditional information of a certain event error stored in the event error pool, and the command sent by the host 20 to be tested is an asynchronous event request command. Only when these two conditions are met at the same time can the error information corresponding to the event error be obtained through the asynchronous event notification. Therefore, when detecting whether a command triggers an event error, it is necessary to simultaneously determine whether the command is an asynchronous event request command in order to obtain error information corresponding to the event error.
[0046] The error processing types corresponding to the above command errors and event errors all belong to the injection error fault type. Through the above steps, the command errors and event errors can be responded to respectively, so that the host under test performs corresponding error test processing.
[0047] In some embodiments, the error handling type also includes removing the error fault type. When the error handling type of the command sent by the error host 10 to the solid state drive 30 is removing the error fault type, the command corresponding identification number is obtained, the corresponding error is obtained according to the identification number, and the error is removed, wherein, if the error is the event error, the condition information corresponding to the error is also removed at the same time. In the NVMe solid state drive test, when the error host 10 sends a command to the solid state drive 30, an error fault may be injected, resulting in an error in the NVMe solid state drive. In order to make the test results more accurate, it is necessary to handle these error faults in a timely manner during the test process to ensure the reliability and effectiveness of the test. Among them, the removal of the error can be achieved by deleting the error from the command error pool. When the error is an event error, the event error can be deleted from the event error pool, and the condition information corresponding to the event error can be deleted. In this embodiment, it can help to effectively handle the error fault and prevent the error fault from interfering with the test results. In the NVMe solid state drive test, the injection of the error fault is to simulate the real usage scenario, but the error fault may cause the test results to be inaccurate. By removing the error fault, the test results can be made more accurate, thereby improving the reliability and effectiveness of the test.
[0048] In some embodiments, the error handling type also includes displaying an error failure type. When the error handling type of the command sent by the error host 10 to the solid-state drive 30 is a display error failure type, the corresponding identification number of the command is obtained, the corresponding error is obtained according to the identification number, and the error is sent to an external device so that the user can obtain relevant error information, or the error is displayed on an external device. In this embodiment, displaying the error failure type can help the user understand the cause and nature of the error in a timely manner so as to take appropriate measures to solve the problem. In the NVMe solid-state drive test, when an error occurs, it is necessary to display relevant error information to the user in a timely manner to help the user understand the cause and nature of the error and take appropriate measures to solve the problem. By displaying error failures, the operability and user experience of the test can be improved.
[0049] The test system provided by the embodiment of the present application can help check the error handling capability of the NVMe system, especially in solid-state hard disk devices, by obtaining and processing error information through an out-of-band error injection interface, thereby improving the reliability and accuracy of the test; furthermore, the error injection information can be flexibly configured, and different error scenarios can be simulated according to the host scenario requirements, and a variety of different test schemes can be customized. In addition, there is no need to purchase test cases and test tools from the association, thereby saving costs in this regard.
[0050] See also Figure 3 , Figure 3: is a flow chart of a method for testing an NVMe system provided in an embodiment of the present application. The method can be executed by the above-mentioned solid state drive 30. The method includes:
[0051] S101, receiving a first command input through the out-of-band error injection interface;
[0052] S102: parsing the first command, obtaining first error information corresponding to the first command, and storing the first error information;
[0053] S103, receiving a second command sent by the host to be tested;
[0054] S104. Obtain second error information corresponding to the second command according to the first error information and the second command, and return the second error information to the host under test, so that the host under test obtains an error according to the second error information and processes the error.
[0055] Among them, the parsing of the first command, obtaining the first error information corresponding to the first command, and storing the first error information include: parsing the first command to obtain the error handling type and error information type of the first command; when the error handling type of the first command is an injection error fault type, and the error information type is a command error, assigning an identification number to the command error, and storing the command error and the identification number corresponding to the command error; when the error handling type of the first command is an injection error fault type, and the error information type is an event error, obtaining the condition information corresponding to the event error, assigning an identification number to the event error, and storing the event error and the condition information and the identification number corresponding to the event error.
[0056] The acquiring, according to the first error information and the second command, second error information corresponding to the second command includes:
[0057] parsing the second command, and detecting an error information type corresponding to the second command;
[0058] When the error information type of the second command is the command error, detecting whether the second command meets a hit condition according to the command error and the first error information, and if so, acquiring second error information corresponding to the command error;
[0059] When the error information type of the second command is the event error, whether the condition information corresponding to the event error is triggered is detected based on the event error and the first error information; if the condition information is triggered and it is detected that the second command is an asynchronous event request command, the second error information corresponding to the event error is obtained.
[0060] Optionally, when the error information type is an event error, the method further includes: polling the event error and the condition information corresponding to the event error.
[0061] Optionally, the method also includes: when the error handling type of the first command is to remove the error fault type, obtaining an identification number corresponding to the first command; obtaining a corresponding error according to the identification number, and removing the error, wherein if the error is the event error, the conditional information corresponding to the error is also removed at the same time.
[0062] Optionally, the method further includes: when the error handling type of the first command is a display error fault type, acquiring an identification number corresponding to the first command; obtaining a corresponding error according to the identification number, and sending the error to an external device.
[0063] The testing method of the NVMe system provided in the embodiment of the present application has the same inventive concept as the above-mentioned testing system and can produce the same beneficial effects. For details, reference may be made to the above-mentioned embodiment.
[0064] See also Figure 4 The embodiment of the present application provides a testing device 40 for an NVMe system, which can be applied to the above-mentioned solid-state hard disk 30, and the device 40 includes:
[0065] A first receiving module 41, configured to receive a first command input through the out-of-band error injection interface;
[0066] The parsing module 42 is used to parse the first command, obtain first error information corresponding to the first command, and store the first error information;
[0067] A second receiving module 43, used for receiving a second command sent by the host to be tested;
[0068] The processing module 44 is used to obtain second error information corresponding to the second command according to the first error information and the second command, and return the second error information to the host under test, so that the host under test obtains an error according to the second error information and processes the error.
[0069] In some embodiments, a polling module is further included, for polling the event error and the condition information corresponding to the event error.
[0070] In some embodiments, an error removal module is also included, which is used to obtain the corresponding identification number of the first command when the error handling type of the first command is to remove the error fault type; obtain the corresponding error according to the identification number, and remove the error, wherein if the error is the event error, the condition information corresponding to the error is also removed at the same time.
[0071] In some embodiments, an error display module is also included, which is used to obtain an identification number corresponding to the first command when the error handling type of the first command is a display error fault type; obtain a corresponding error according to the identification number, and send the error to an external device.
[0072] It should be noted that the test device of the NVMe system described above can execute the test method of the NVMe system provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in the embodiment of the test device of the NVMe system, please refer to the test method of the NVMe system provided in the embodiment of the present application.
[0073] Figure 5 is a schematic diagram of the hardware structure of the solid-state drive 30 for executing the test method of the NVMe system provided in the embodiment of the present application, such as Figure 5 As shown, the solid state drive 30 includes:
[0074] One or more processors 31 and memory 32, Figure 5 A processor 31 is taken as an example.
[0075] The processor 31 and the memory 32 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0076] The memory 32 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the program instructions / modules corresponding to the test method of the NVMe system in the embodiment of the present application (for example, the attached Figure 4 The processor 31 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 32, that is, the test method of the NVMe system of the above method embodiment is implemented.
[0077] The memory 32 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created according to the use of the test device of the NVMe system, etc. In addition, the memory 32 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 32 may optionally include a memory remotely arranged relative to the processor 31, and these remote memories may be connected to the test device of the NVMe system via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0078] The one or more modules are stored in the memory 32, and when executed by the one or more processors 31, the test method of the NVMe system in any of the above method embodiments is executed, for example, the test method described above is executed. Figure 2 and Figure 3 The method steps in Figure 4 The functions of the modules in .
[0079] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.
[0080] The embodiment of the present application provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, such as Figure 5 A processor 31 in the embodiment may enable the one or more processors to execute the NVMe system test method in any of the above method embodiments, for example, to execute the above described Figure 2 and Figure 3 The method steps in Figure 4 The functions of the modules in .
[0081] The present application embodiment provides a computer program product, the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by the solid-state drive, the solid-state drive is enabled to execute the NVMe system test method in any of the above method embodiments, for example, execute the above described Figure 2 and Figure 3 The method steps in Figure 4 The functions of the modules in .
[0082] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0083] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, or by hardware. Those skilled in the art can understand that all or part of the processes in the above embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above methods. Among them, the storage medium can be a disk, an optical disk, or a random access memory (RAM), etc.
[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as described above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for testing an NVMe system, characterized in that: Applied to a solid state drive, the solid state drive is provided with an out-of-band error injection interface, the method comprises: receiving a first command input through the out-of-band error injection interface; parsing the first command, obtaining first error information corresponding to the first command, and storing the first error information; receiving a second command sent by the host to be tested; The second error information corresponding to the second command is obtained according to the first error information and the second command, and the second error information is returned to the host under test, so that the host under test obtains an error according to the second error information and processes the error.
2. The method according to claim 1, characterized in that: The parsing the first command, obtaining first error information corresponding to the first command, and storing the first error information includes: Parsing the first command to obtain an error handling type and an error information type of the first command; When the error handling type of the first command is an injection error fault type, and the error information type is a command error, assigning an identification number to the command error, and storing the command error and the identification number corresponding to the command error; When the error handling type of the first command is an injection error fault type, and the error information type is an event error, obtain condition information corresponding to the event error, assign an identification number to the event error, and store the event error and the condition information and identification number corresponding to the event error.
3. The method according to claim 2, characterized in that The acquiring, according to the first error information and the second command, second error information corresponding to the second command includes: parsing the second command, and detecting an error information type corresponding to the second command; When the error information type of the second command is the command error, detecting whether the second command meets a hit condition according to the command error and the first error information, and if so, acquiring second error information corresponding to the command error; When the error information type of the second command is the event error, whether the condition information corresponding to the event error is triggered is detected based on the event error and the first error information; if the condition information is triggered and it is detected that the second command is an asynchronous event request command, the second error information corresponding to the event error is obtained.
4. The method according to claim 2, characterized in that: When the error information type is an event error, the method further includes: The event error and the condition information corresponding to the event error are polled.
5. The method according to claim 2, characterized in that: The method further comprises: When the error handling type of the first command is a removal error fault type, obtaining an identification number corresponding to the first command; The corresponding error is obtained according to the identification number, and the error is removed, wherein if the error is the event error, the condition information corresponding to the error is also removed at the same time.
6. The method according to claim 2, characterized in that The method further comprises: When the error handling type of the first command is a display error fault type, obtaining an identification number corresponding to the first command; A corresponding error is obtained according to the identification number, and the error is sent to an external device.
7. A test device for an NVMe system, characterized in that: Applied to a solid state hard disk, the solid state hard disk is provided with an out-of-band error injection interface, the device comprises: A first receiving module, configured to receive a first command input through the out-of-band error injection interface; a parsing module, configured to parse the first command, obtain first error information corresponding to the first command, and store the first error information; A second receiving module, used for receiving a second command sent by the host to be tested; A processing module is used to obtain second error information corresponding to the second command according to the first error information and the second command, and return the second error information to the host under test, so that the host under test obtains an error according to the second error information and processes the error.
8. A solid state hard disk, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
9. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed by the solid-state hard disk, the solid-state hard disk executes the method according to any one of claims 1 to 6.
10. A testing system, characterized in that: include: The solid state drive of claim 8, wherein the solid state drive is provided with an out-of-band error injection interface; An error annotation host, configured to input a first command to the solid-state drive through the out-of-band error annotation interface; The host to be tested is used to send a second command to the solid state drive; The solid state drive is used for: receiving the first command; parsing the first command, obtaining first error information corresponding to the first command, and storing the first error information; receiving the second command; The second error information corresponding to the second command is obtained according to the first error information and the second command, and the second error information is returned to the host under test, so that the host under test obtains an error according to the second error information and processes the error.