Test model and method for testing NVME data transmission SGL function

By providing a test model for NVME data transmission SGL functionality, the problem of difficulty in understanding and utilizing SGL functionality in existing technologies is solved, enabling efficient testing and simplified management of different data types and improving data transmission efficiency.

CN121579290APending Publication Date: 2026-02-27LUANQI TECH (SUZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511921374.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-18
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively understand and utilize the characteristics of the SGL function in the NVME data transmission protocol, especially when dealing with different data types, as there is a lack of convenient testing methods.

Method used

A test model for testing the SGL function of NVME data transmission is provided, including continuous and discrete test modules. By configuring different linked list construction modes, it supports multiple test scenarios and customized driver kernel modifications, and provides multiple SGL linked list construction modes to adapt to different data types.

Benefits of technology

It enables in-depth understanding and flexible use of the NVME data transmission SGL function, improves data transmission efficiency, reduces system resource consumption, simplifies operating system management, and supports customized driver kernel modifications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579290A_ABST
    Figure CN121579290A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of SSD testing, and particularly relates to a testing model and method for testing an NVME SSD data transmission SGL function, the testing model for testing the NVME SSD data transmission SGL function is used for testing some characteristics of NVME data transmission, and the model is divided into two large data testing categories including a data continuous testing category and a data discrete testing category. The method is mainly characterized in that whether Address of a Descriptor required by a target Transfer Data is continuous or not is mainly distinguished, and the test is divided into various small test types including different data structures, data distribution, descriptor types, error injection tests and the like. A plurality of specific SGL linked list construction modes are provided in the model, a successful data Transfer function is realized by constructing different linked lists, a test mode can be flexibly defined according to different requirements, customized drive kernel modification is supported so as to be matched with implementation of a test scene, a user can master characteristics of SGL data transmission skillfully, and the test efficiency is improved. And proficiently using the corresponding SGL data transmission modes according to different data types.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of SSD testing, and particularly relates to a test model and method for testing NVME data transmission SGL function. BACKGROUND

[0002] NVME (Non-Volatile Memory Express) is a high-performance storage protocol based on the PCIExpress (PCIe) bus, which can provide higher data transmission rate, and the NVME SSD is a solid state disk based on the NVME protocol, the function of the SSD (Solid State Disk) is used for data storage and reading. The NVME SSD is directly connected with the CPU through the PCIe channel, avoiding the external controller of the traditional SATA interface, thereby reducing the delay and power consumption of data transmission. In the process of data storage and reading of the NVME SSD, the types of data storage are different, including discrete data and continuous data, and the data volume is large or small. Different data types are suitable for data transmission through different data transmission modes, and the same data type uses different data transmission modes, which are different in data transmission efficiency and consumption of system resources in the data transmission process. For the user of the SSD, how to conveniently and familiarly acquire a more suitable data transmission mode for different data types is a technical problem to be solved. SUMMARY

[0003] The application aims to provide a test model and method for testing NVME data transmission SGL function, so as to realize the testing of the SGL function in the NVME data transmission protocol by the test model for testing NVME data transmission SGL function, to learn and use different data transmission modes, and to be familiar with the characteristics of the SGL function in the NVME data transmission protocol.

[0004] In the NVME data transmission protocol, the host has two ways to tell the SSD where the data is located in the memory, one is PRP (Physical Region Page, physical region page) mode, and the other is SGL (Scatter / Gather List, scatter / gather list) mode. The current data transmission of the SSD is mostly in the form of PRP. PRP is more suitable for describing the data block of a continuous memory area, and has a higher requirement for data continuity. SGL is much more flexible than PRP. SGL allows the transmission of data in multiple non-continuous memory areas in a single I / O operation, provides great flexibility, improves data transmission efficiency, reduces bus transaction times, reduces delay, simplifies management and scheduling work at the operating system level, and has obvious advantages in processing large files, databases or virtual machine environment I / O requests. However, the structure of SGL is relatively complex, and a linked list needs to be maintained, which increases the complexity of implementation. The test model for testing the SGL function of the NVME data transmission provided by the application can be used for users to deeply understand and learn the SGL function by setting up a variety of different modes of linked list construction.

[0005] To achieve the above purpose, the application adopts the following technical solutions: A test model for testing the SGL function of the NVME data transmission is provided, which includes a data continuous type test module and a data discrete type test module. The data continuous type test module includes a continuous single data linked list test unit and a continuous multiple data linked list test unit. The continuous single data linked list test unit transmits continuous data by configuring a data linked list with unique addresses or continuous addresses. The continuous multiple data linked list test unit configures multiple data linked lists, each of which is configured with different linked list combinations based on the NVME protocol, so that the multiple data linked lists form a complete, address-continuous data transmission linked list group for transmitting continuous data. The data discrete type test module includes a discrete single data linked list test unit and a discrete multiple data linked list test unit. The discrete single data linked list test unit transmits discrete data by configuring a data linked list with non-continuous addresses. The discrete multiple data linked list test unit configures multiple data linked lists, each of which is configured with different linked list combinations based on the NVME protocol, so that the multiple data linked lists form a complete, address-non-continuous data transmission linked list group for transmitting discrete data.

[0006] Preferably, the data continuous type test module includes a first data continuous type test unit and a second data continuous type test unit, and the first data continuous type test unit and the second data continuous type test unit are both continuous single data linked list test units. The first data continuity test unit has an SGL segment x-1, and the SGL segment x-1 has an SGL descriptor x-1. The SGL descriptor x-1 is directly used as the unique data block descriptor to describe the complete continuous transfer data. The second data continuity test unit has an SGL segment x-2, and the SGL segment x-2 has an SGL descriptor x-2-1 and an SGL descriptor x-2-2. The SGL descriptor x-2-1 and the SGL descriptor x-2-2 are used to describe a portion of continuous transfer data, and the addresses described by the SGL descriptor x-2-1 and the SGL descriptor x-2-2 are continuous.

[0007] Preferably, the data continuity test module further includes a third data continuity test unit, which is a continuous multi-data linked list test unit. The third data continuity test unit has two SGL segments, namely SGL segment x-3-1 and SGL segment x-3-2. SGL segment x-3-1 has an SGL descriptor x-3-1, the content of which points to the address of SGL segment x-3-2. SGL segment x-3-2 has an SGL descriptor x-3-2, which acts as a data block descriptor to describe the complete continuous transfer data.

[0008] Preferably, the data continuity test module further includes a fourth data continuity test unit, which is a continuous multi-data linked list test unit. The fourth data continuity test unit has two SGL segments, namely SGL segment x-4-1 and SGL segment x-4-2. SGL segment x-4-1 contains two SGL descriptors, namely SGL descriptor x-4-1 and SGL descriptor x-4-2. SGL descriptor x-4-1 describes a portion of the continuous transfer data. The content of SGL descriptor x-4-2 points to SGL segment x-4-2. SGL segment x-4-2 contains one SGL descriptor x-4-3, which describes another portion of the continuous transfer data. Furthermore, SGL descriptor x-4-1 and SGL descriptor x-4-2... The addresses of x-4-3 must be consecutive.

[0009] Preferably, the data continuity test module further includes a fifth data continuity test unit, which is a continuous multi-data linked list test unit. The fifth data continuity test unit has two SGL segments, namely SGL segment x-5-1 and SGL segment x-5-2. SGL segment x-5-1 contains two SGL descriptors, namely SGL descriptor x-5-1 and SGL descriptor x-5-2. SGL descriptor x-5-1 describes a portion of the continuous transfer data. The content of SGL descriptor x-5-2 points to SGL segment x-5-2. SGL segment x-5-2 contains two SGL descriptors, namely SGL descriptor x-5-3 and SGL descriptor x-5-4. SGL descriptor x-5-3 describes a portion of the remaining continuous transfer data. x-5-4 describes the last part of the continuous transfer data, and the addresses of the SGL descriptor x-5-1, SGL descriptor x-5-3 and SGL descriptor x-5-4 must be consecutive.

[0010] Preferably, the discrete data testing module includes a first discrete data testing unit, which is a discrete single data linked list testing unit. It has an SGL segment s-1, which contains two SGL descriptors: SGL descriptor s-1-1 and SGL descriptor s-1-2. SGL descriptor s-1-1 describes a portion of the discrete transfer data, and SGL descriptor s-1-2 describes the remaining discrete transfer data. The addresses of SGL descriptor s-1-1 and SGL descriptor s-1-2 are not contiguous.

[0011] Preferably, the data discrete test module further includes a second data discrete test unit and a third data discrete test unit, both of which are discrete multi-data linked list test units; The second discrete data test unit has two SGL segments, namely SGL segment s-2-1 and SGL segment s-2-2. SGL segment s-2-1 contains only one SGL descriptor, Descriptor s-2-1, and the content of SGL descriptor s-2-1 points to the address of SGL segment s-2-2. SGL segment s-2-2 contains two SGL descriptors, namely SGL descriptor s-2-2 and SGL descriptor s-2-3. SGL descriptor s-2-2 and SGL descriptor s-2-3 describe a portion of the discrete transfer data, but the addresses of SGL descriptor s-2-2 and SGL descriptor s-2-3 are not contiguous. The third discrete data test unit has two SGL segments, namely SGL segment s-3-1 and SGL segment s-3-2. SGL segment s-3-1 contains two SGL descriptors, namely SGL descriptor s-3-1 and SGL descriptor s-3-2. SGL descriptor s-3-1 describes a portion of discrete transfer data. The content of SGL descriptor s-3-2 points to the address of SGL segment s-3-2. SGL segment s-3-2 contains one SGL descriptor s-3-3. SGL descriptor s-3-3 describes another portion of discrete transfer data, and the addresses of SGL descriptor s-3-1 and SGL descriptor s-3-3 are not contiguous.

[0012] Preferably, it also includes a data error injection test module, which is used to set various illegal parameters through scripts when constructing the SGL memory space according to the NVME protocol, so as to create test scenarios that are expected to report errors.

[0013] This invention also provides a test method for testing the NVMe data transmission SGL function, wherein the test model for testing the NVMe data transmission SGL function described in any of the preceding claims is set up on a test host, and the method includes: (1) Test the host computer writing data to the NVMe solid-state drive: Establish a data transmission channel between the NVMe solid-state drive used for testing and the test host; Obtain test data from the test host, and determine the data transmission type of the test data based on the type of test data; Based on the test data information and data transmission type, construct an SGL linked list; The test host sends a "write command" to the NVMe solid-state drive to perform a data write test; Check the completed queue to determine if the data write test passed. (2) Test the host computer reading data from the NVMe solid-state drive: Test data is stored in an NVMe solid-state drive used for testing; Establish a data transmission channel between the NVMe solid-state drive and the test host; Based on the type of test data, confirm the data transmission type of the test data; Based on the test data information and data transmission type, construct an SGL linked list; The test host sends a "read command" to the NVMe solid-state drive to perform a data read test; After checking the queue, determine whether the data read test has passed.

[0014] Preferably, the method also includes an error injection test step, in which a certain type of illegal parameter value is injected into the test data, the error-injected test data is transmitted through the constructed SGL linked list, the returned NVME status code is verified, and the error injection test feedback is checked to see if it is correct.

[0015] Compared with existing technologies, the beneficial effects of this invention are as follows: This test model for testing the SGL function of NVMe SSD data transfer is used to test some characteristics of NVMe data transfer. The model is divided into two main categories of data tests: 1. Continuous data test, and 2. Discrete data test. The main difference lies in whether the addresses of the SGL descriptors required for the target transfer data are continuous. Each category is further divided into various sub-test types, including different data structures, data distributions, descriptor types, and error injection tests. Data transfer is executed by constructing a series of different SGL linked lists, and the results are verified. This test model provides multiple specific SGL linked list construction modes. Successful data transfer is achieved by constructing different linked lists. Test methods can be flexibly defined according to different needs, and customized driver kernel modifications are supported to match the implementation of test scenarios. This helps users to master the characteristics of SGL data transfer and skillfully use the corresponding SGL data transfer methods according to different data types. Attached Figure Description

[0016] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is an architecture diagram of an embodiment of the test model for testing the SGL function of NVME data transmission according to the present invention.

[0017] Figure 2 This is a structural block diagram of the data continuity test module in one embodiment of the test model for testing the SGL function of NVME data transmission according to the present invention.

[0018] Figure 3 This is a structural block diagram of a data discrete test module in one embodiment of the test model for testing the SGL function of NVME data transmission according to the present invention.

[0019] Figure 4 This is a schematic representation of the SGL chain of the first data continuity test unit in one embodiment of the test model for testing the SGL function of NVME data transmission according to the present invention.

[0020] Figure 5 This is a schematic representation of the SGL chain of the second data continuity test unit in one embodiment of the test model for testing the SGL function of NVME data transmission according to the present invention.

[0021] Figure 6 This is a schematic representation of the SGL chain of the third data continuity test unit in one embodiment of the test model for testing the SGL function of NVME data transmission according to the present invention.

[0022] Figure 7 This is a schematic representation of the SGL chain of the fourth data continuity test unit in one embodiment of the test model for testing the SGL function of NVME data transmission according to the present invention.

[0023] Figure 8 This is a schematic representation of the SGL chain of the fifth data continuity test unit in one embodiment of the test model for testing the SGL function of NVME data transmission according to the present invention.

[0024] Figure 9 This is a schematic representation of the SGL chain of the first data discrete test unit in one embodiment of the test model for testing the SGL function of NVME data transmission according to the present invention.

[0025] Figure 10 This is a schematic representation of the SGL chain of the second data discrete test unit in one embodiment of the test model for testing the SGL function of NVME data transmission according to the present invention.

[0026] Figure 11 This is a schematic representation of the SGL chain of the third data discrete test unit in one embodiment of the test model for testing the SGL function of NVME data transmission according to the present invention.

[0027] Figure 12 This is a flowchart of an embodiment of the test method for testing the SGL function of NVME data transmission according to the present invention. Detailed Implementation

[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0029] In one embodiment, a test model is provided for testing the SGL function of NVME data transmission, such as... Figure 1As shown, the test model for testing the SGL function of NVME data transmission includes a continuous data test module 100, a discrete data test module 200, and a data error injection test module 300. The continuous data test module 100 is used for continuous data transmission testing, the discrete data test module 200 is used for discrete data transmission testing, and the data error injection test module 300 is used for error injection testing of the data. The error injection test can verify the reliability and robustness of data transmission.

[0030] The data continuity test module 100 includes a continuous single data linked list test unit and a continuous multi-data linked list test unit, such as... Figure 2 As shown, the data continuity test module 100 includes a first data continuity test unit 101, a second data continuity test unit 102, a third data continuity test unit 103, a fourth data continuity test unit 104, and a fifth data continuity test unit 105, each with a different data transmission mechanism.

[0031] The first data continuity test unit 101 and the second data continuity test unit 102 are both continuous single data linked list test units. These units use a single data linked list with unique or consecutive addresses for transmitting continuous data. The third data continuity test unit 103, the fourth data continuity test unit 104, and the fifth data continuity test unit 105 are continuous multi-data linked list test units. These units configure multiple data linked lists, each with different combinations based on the NVME protocol, forming a complete, consecutively addressed data transmission linked list group for transmitting continuous data. The data continuity test module may also include only one or a few of the above-mentioned data continuity test units.

[0032] The discrete data testing module 200 includes discrete single data linked list testing units and discrete multi-data linked list testing units, such as... Figure 3As shown, the discrete data testing module 200 includes a first discrete data testing unit 201, a second discrete data testing unit 202, and a third discrete data testing unit 203. Each discrete data testing unit has a different data transmission mechanism. The first discrete data testing unit 201 is a discrete single-data linked list testing unit, which uses a data linked list with discontinuous addresses to transmit discrete data. The second discrete data testing unit 202 and the third discrete data testing unit 203 are discrete multi-data linked list testing units, which configure multiple data linked lists. Each data linked list is configured with different combinations based on the NVME protocol, so that the multiple data linked lists form a complete, discontinuous data transmission linked list group for transmitting discrete data. The discrete data testing module may also include only one or a few of the above-mentioned discrete data testing units.

[0033] Combination Figure 4 As shown, the first data continuity test unit 101 uses only one SGL segment x-1 to transmit data, and the SGL segment x-1 has only one SGL descriptor x-1. The content of the segment x-1 can be configured and described by the host command developed by Luanqi Technology (Suzhou) Co., Ltd., as the SGL Entry1 in SQ, and sent to the driver layer. This SGL descriptor x-1 directly serves as the only Data Block Descriptor to describe the complete amount of Transfer Data.

[0034] SGL is a linked list in the NVMe data transfer protocol. The SGL data structure is used to describe a data space, which can be the space where the data source is located or the data destination space. An SGL consists of one or more SGL segments. An SGL segment is used to describe a contiguous physical memory space. The size of the data space described by each SGL segment is greater than or equal to the size of the data transfer. If there is a next SGL segment, it can also point to the next SGL segment. An SGL segment consists of one or more SGL descriptors. Only the last descriptor in an SGL segment can be an SGL segment descriptor (used to describe the next SGL segment) or an SGL Last Segment descriptor (used to describe the last SGL segment).

[0035] exist Figure 4 In this context, the SGL segment Segment x-1 used in the first data continuity test unit 101 is the SGL segment Segment. Figure 4 In the context of SGL segment x-1, the SGL descriptor x-1 is the only and first descriptor for SGL segment x-1. It can be configured using the host command system developed by Luanqi Technology (Suzhou) Co., Ltd. to describe the content of this Segment x-1, serving as SGL Entry 1 in SQ, and then distributed to the driver layer. Figure 4 In this context, the SGL descriptor x-1 serves as the Data Block Descriptor. This Data Block Descriptor describes the starting address and length of a data block, thus representing the complete amount of Transfer Data. When the host writes data to the SSD, the data structure in the SGL Data Block Descriptor describes the space where the data source resides within the host's storage space. When the host reads data from the SSD, the data structure in the SGL Data Block Descriptor describes the storage space of the data target within the SSD, including its starting address and size.

[0036] Combination Figure 5 As shown, the second data continuity test unit 102 also uses only one SGL segment x-2 to transmit data, and the SGL segment x-2 has two SGL descriptors, namely SGL descriptor x-2-1 and SGL descriptor x-2-2. SGL descriptor x-2-1 and SGL descriptor x-2-2 are used to describe a part of the data, and the addresses described by SGL descriptor x-2-1 and SGL descriptor x-2-2 are continuous.

[0037] Compared to the first data continuity test unit 101, the second data continuity test unit 102 here is equipped with two SGL descriptors. Both of these SGL descriptors are Data Block Descriptors. Compared to a single SGL descriptor, two descriptors can transmit a larger amount of data.

[0038] Combination Figure 6 As shown, the third data continuity test unit 103 uses two SGL segments to transfer data, namely SGL segment x-3-1 and SGL segment x-3-2. SGL segment x-3-1 contains only one SGL descriptor x-3-1, which serves as the Last SGL segment descriptor and points to the address of SGL segment x-3-2. SGL segment x-3-2 contains only one SGL descriptor x-3-2, which serves as the Data Block Descriptor and describes the complete amount of Transfer Data.

[0039] Compared to the first data continuity test unit 101, the third data continuity test unit 103 provides another way to transmit data using a single Data Block Descriptor by setting two SGL segments to transmit data.

[0040] Combination Figure 7As shown, the fourth data continuity test unit 104 uses two SGL segments to transmit data, namely SGL segment x-4-1 and SGL segment x-4-2. SGL segment x-4-1 contains two SGL descriptors, namely SGL descriptor x-4-1 and SGL descriptor x-4-2. Descriptor x-4-1 of SGL segment x-4-1, i.e., SGL Entry1, serves as a Data Block Descriptor describing a portion of the data. SGL descriptor x-4-2 serves as the Last SGL segment descriptor, pointing to the next SGL segment x-4-2. SGL segment x-4-2 contains an SGL descriptor x-4-3, which serves as a Data Block Descriptor describing another portion of the data. Furthermore, SGL descriptors x-4-1 and SGL segment x-4-2... The addresses of the SGL descriptor x-4-3 for x-4-2 must be contiguous.

[0041] Combination Figure 8As shown, the fifth data continuity test unit 105 uses two SGL segments to transmit data, namely SGL segment x-5-1 and SGL segment x-5-2. SGL segment x-5-1 contains two SGL descriptors, namely SGL descriptor x-5-1 and SGL descriptor x-5-2. SGL descriptor x-5-1 of SGL segment x-5-1 acts as a Data Block Descriptor, describing a portion of the data. SGL descriptor x-5-2 of SGL segment x-5-1 acts as the Last SGL segment descriptor, pointing to the next SGL segment x-5-2. SGL segment x-5-2 contains two SGL descriptors, namely SGL descriptor x-5-3 and SGL descriptor x-5-4, both of which are Data Block Descriptors. x-5-3 describes a portion of the remaining data, and SGL descriptor x-5-4 describes the last portion of data. The addresses of the two SGL descriptors, SGL descriptor x-5-1 and SGL segment x-5-2, must be consecutive.

[0042] The first data continuity test unit 101, the second data continuity test unit 102, the third data continuity test unit 103, the fourth data continuity test unit 104, and the fifth data continuity test unit 105 in the above data continuity test module 100 provide different modes of data continuity transmission test methods. These data continuity test units have different data transmission mechanisms, which flexibly demonstrate to users the construction methods of various linked lists used for transmitting continuous data, thereby enabling users to intuitively and deeply understand, learn, and use the data transmission mechanisms of different data continuity test units.

[0043] Combination Figure 9As shown, the first data discrete test unit 201 in the data discrete test module 200 uses one SGL segment to transmit data, namely SGL segment s-1. SGL segment s-1 contains two SGL descriptors, namely SGL descriptor s-1-1 and SGL descriptor s-1-2. SGL descriptor s-1-1 serves as a Data Block Descriptor to describe a portion of the data, and SGL descriptor s-1-2 is also a Data Block Descriptor used to describe the remaining data. However, the Address fields of SGL descriptor s-1-1 and SGL descriptor s-1-2 are not contiguous.

[0044] Combination Figure 10 As shown, the second discrete data test unit 202 uses two SGL segments to transmit data, namely SGL segment s-2-1 and SGL segment s-2-2. SGL segment s-2-1 contains only one SGL descriptor, s-2-1, which serves as the Last SGL segment descriptor and points to the address of SGL segment s-2-2. SGL segment s-2-2 contains two SGL descriptors, namely SGL descriptor s-2-2 and SGL descriptor s-2-3. Both SGL descriptors s-2-2 and SGL descriptor s-2-3 serve as Data Block Descriptors, describing the complete amount of Transfer Data. However, the addresses of SGL descriptors s-2-2 and SGL descriptor s-2-3 are not contiguous.

[0045] Combination Figure 11As shown, the third discrete data test unit uses two SGL segments to transmit data, namely SGL segment s-3-1 and SGL segment s-3-2. SGL segment s-3-1 contains two SGL descriptors, namely SGL descriptor s-3-1 and SGL descriptor s-3-2. SGL descriptor s-3-1 describes a portion of discrete transfer data. SGL descriptor s-3-2 serves as the Last SGL segment descriptor, pointing to the next SGL segment s-3-2. SGL segment s-3-2 contains one SGL descriptor s-3-3 as a Data Block Descriptor. Furthermore, the SGL descriptors s-3-1 and s-3-2 of SGL segment s-3-1 and SGL segment s-3-2 are also related. The addresses of s-3-3 are not contiguous.

[0046] The first discrete data test unit 201, the second discrete data test unit 202, and the third discrete data test unit 203 in the discrete data test module 200 above provide different modes of discrete data transmission test methods. These discrete data test units have different data transmission mechanisms, which flexibly demonstrate to users the construction methods of various linked lists used for transmitting discrete data, so that users can intuitively and deeply understand, learn and use the data transmission mechanisms of different discrete data test units.

[0047] The data error injection test module 300 in the test model for testing the SGL function of NVME data transmission sets various invalid values ​​and creates error scenarios, including Invalid Type and Invalid Format error items, according to the NVME protocol when building the SGL buffer, and then verifies the returned NVME Status Code.

[0048] The SGL buffer here is a host memory buffer used to store the SGL linked list. The various invalid values ​​set indicate data that does not meet specific requirements or conditions. Specifically, the Invalid Format error indicates data with an unexpected or incorrect format; the Invalid Type error indicates data with an unsupported or incorrect data type. After injecting the erroneous data into the test data, the data is transmitted to verify the returned NVME Status Code. The NVME Status Code is the status feedback after the NVME command is executed, indicating the command's execution result. By injecting error data, the reliability and robustness of data transmission can be verified.

[0049] This test model for testing NVMe data transmission SGL functionality can be used both to learn about the SGL function in NVMe data transmission and to test it. The following two examples further illustrate the purpose of this test model for testing NVMe data transmission SGL functionality: Example of use: 1. Users can learn the working principle of NVMe SSD through this model.

[0050] 2. Users read the reference code provided with the model, and each test module is implemented using the corresponding reference code.

[0051] 3. The user builds an SGL linked list based on the information of the host reading and writing data to the SSD. There is one SGL segment in the default, and it contains only one SGL descriptor as the Data Block Descriptor to describe the complete data. This SGL linked list is implemented with reference to the first data continuity test unit 101.

[0052] 4. The host sends a Write command to the SSD. In this example, the write data size is set to 4KB. The PSDTField in SQ is configured to 1 or 2, and data is transferred using SGL. The PSDT Field here is used to configure the transfer method. If it is configured to 0, data is transferred via PRP; if it is configured to 1 or 2, data is transferred via SGL.

[0053] 5. The host sends a Read command to the SSD, reads the data written to the SSD back to the host, and checks whether the read-back data is the same data written by the host to the SSD. The CQE Status Code should be cleared to zero. The status code of the Write command should be cleared to form the status code of the Read command.

[0054] Example of use 2: 1. Users can learn the working principle of NVMe SSD through this model.

[0055] 2. Users read the reference code that comes with the model.

[0056] 3. Based on the read / write data information, construct an SGL linked list. It is assumed that two SGL segments are used for data transfer. SGL segment 1 has only one descriptor, serving as the Last SGL segment descriptor, pointing to the address of SGL segment 2. SGL segment 2 contains two descriptors, serving as the Last SGL segment descriptor, pointing to the address of SGL segment 2. SGL segment 2 contains two descriptors, serving as Data Block Descriptors 1 and 2 respectively, describing the complete Transfer Data volume. The address addresses are not contiguous. This SGL linked list is implemented with reference to the second data discrete test unit 202.

[0057] 4. Send the Write command, set the write data size to 4k, configure the PSDT Field in SQ to 1 or 2, and use SGL to transmit the data.

[0058] 5. Send a Read command and check if the read data is the same as the data that was written, and the CQE Status Code should be cleared to zero.

[0059] In one embodiment, a test method for testing the NVMe data transfer SGL function is provided. This method is executed by deploying the test model for testing the NVMe data transfer SGL function from the previous embodiment on a test host, combined with... Figure 12 As shown, this method mainly includes two aspects: host-to-NVMe SSD data writing test and host-to-NVMe SSD data reading test. The host-to-NVMe SSD data writing test tests the writing of data stored on the host to the SSD, while the host-to-NVMe SSD data reading test tests the reading of data stored in the SSD. For example... Figure 12 As shown: (1) The test of writing data from the host to the NVMe SSD includes the following steps: (1.1) Establish a data transfer channel between the NVMe SSD used for testing and the test host.

[0060] (1.2) Obtain test data from the test host and confirm the data transmission type of the test data according to the type of test data.

[0061] (1.3) Based on the information of the test data and the data transmission type, build an SGL linked list by pre-setting the SGL segment through the test model.

[0062] (1.4) The test host sends a “Write command” to the NVME SSD based on the test model to perform a write data test.

[0063] (1.5) Check CQE to determine whether the data writing test has passed.

[0064] (2) Test of host reading data from NVMe SSD: (2.1) The test data is stored in an NVMe SSD.

[0065] (2.2) Establish a data transfer channel between the NVMe SSD used for testing and the test host.

[0066] (2.3) Based on the type of test data, confirm the data transmission type of the test data. Based on the information of the test data and the data transmission type, build an SGL linked list by pre-setting the SGL segment in the test model.

[0067] (2.4) The test host sends a “Read command” to the NVME SSD in the test model to perform a read data test.

[0068] (2.5) Check CQE to determine whether the data reading test has passed.

[0069] In the test method for testing the NVMe data transfer SGL function above, the NVMe SSD used for testing refers to an SSD that transmits data via the NVMe protocol. Establishing a data transfer channel between the NVMe SSD and the test host means establishing a connection between the NVMe SSD and the test host so that they can communicate.

[0070] The test data is acquired from the test host and then transferred to the test host for storage. The test data can be discrete or continuous, and the data volume can vary. Users set the appropriate data transfer type according to the data type and size. Setting the appropriate data transfer type here refers to predicting how to build the SGL linked list, such as how many SGL segments need to be set, how many descriptors need to be set for each SGL segment, and the function of each descriptor, etc.

[0071] When building the SGL linked list, the SGL segments are preset by the test units provided by the test model. Each test unit has already built the relevant SGL linked list framework. Only the starting address and data size related values ​​of the Descriptor need to be defined according to the information of the test data.

[0072] For the two different types of test requirements—host-to-NVMe SSD data writing tests and host-to-NVMe SSD data reading tests—according to the NVMe protocol, both involve the host sending information to the NVMe SSD. For example, when testing a host-to-NVMe SSD data writing operation, the host sends a "Write" command to the SSD. This "Write" command informs the SSD that data from the host is being written to the SSD, and it also sends an SGL linked list to the SSD. The SSD uses this SGL linked list to determine the distribution of the data source within the host's memory; the SGL linked list describes the location of the test data on the host. Similarly, when testing a host-to-NVMe SSD data reading operation, the host sends a "Read" command to the SSD. This "Read" command informs the SSD that data from the SSD is being written to the host, and it also sends an SGL linked list to the SSD. The SSD uses this SGL linked list to determine the distribution of the data storage target space within the host's memory.

[0073] Furthermore, the test method for testing the SGL function of NVME data transmission also includes an error injection test step, which involves injecting a certain type of Invalid value into the test data, transmitting the error-injected test data through the constructed SGL linked list, verifying the returned NVME Status Code, and checking whether the error injection test feedback is correct.

[0074] exist Figure 12 In this context, a Completion Queue Element (CQE) is a notification generated after a "Write" or "Read" command operation is completed. The CQE contains the operation's status, error messages, and detailed information about the data transmission. By checking the CQE, it's possible to determine whether the data transmission was successful or resulted in an error. If an error occurred, the CQE is checked to determine if the cause of the error is as expected, such as whether it was due to a misclassification. If the data transmission was successful or the cause of the error is as expected, the test passes. If the cause of the data transmission error is not as expected, the test fails.

[0075] In the above test method for testing the NVME data transmission SGL function, since it is implemented by deploying the test model for testing the NVME data transmission SGL function in the previous embodiment on the test host, this method is mainly divided into tests for continuous data and discrete data. Each test method is divided into the following two categories: 1. Continuous data testing methods, including the following 6 types: 1.1 Use one SGL segment to transfer data. The segment contains only one Descriptor, which serves as the Data Block Descriptor to describe the complete data: Only one SGL segment Segment1 is used, and SGL segment Segment1 has only one Descriptor. This Descriptor is directly used as the sole Data Block Descriptor to describe the complete amount of Transfer Data.

[0076] 1.2. Data is transmitted using one SGL segment, which contains two descriptors, both of which are Data Block Descriptors, describing a portion of the data. That is, only one SGL segment Segment1 is used, and SGL segment Segment1 has two descriptors. Descriptor1 and Descriptor2 are used to describe a portion of the data, and the addresses described by Descriptor1 and Descriptor2 are contiguous.

[0077] 1.3. Two SGL segments are used to transfer data, serving as the descriptor for the Last SGL Segment Descriptor. Specifically, two SGL segments are used: SGL segment 1 contains only one Descriptor 1, which serves as the Last SGL Segment Descriptor and points to the address of SGL segment 2. SGL segment 2 contains only one Descriptor, which serves as the Data Block Descriptor, describing the complete TransferData data volume.

[0078] 1.4. Data is transmitted using two SGL segments. Segment 1 contains two descriptors, and Segment 2 contains one descriptor. That is, by using two SGL segments, Segment 1 contains two descriptors. Descriptor 1 of Segment 1 serves as a Data Block Descriptor, describing a portion of the data. Descriptor 2 serves as the Last SGL Segment Descriptor, pointing to the next SGL segment, Segment 2. Segment 2 contains one Data Block Descriptor, and the addresses of Descriptor 1 of Segment 1 and Descriptor 1 of Segment 2 must be contiguous.

[0079] 1.5. Data is transmitted using two SGL segments. Segment 1 contains two descriptors, and Segment 2 also contains two descriptors. That is, by using two SGL segments, Segment 1 contains two descriptors: Descriptor 1 of Segment 1 serves as the Data Block Descriptor, describing a portion of the data, and Descriptor 2 serves as the Last SGL Segment Descriptor, pointing to the next SGL segment, Segment 2. Segment 2 contains two Data Block Descriptors: Descriptor 1 describes a portion of the remaining data, and Descriptor 2 describes the final portion. Furthermore, the addresses of Descriptor 1 of Segment 1 and the two descriptors of Segment 2 must be contiguous.

[0080] 1.6 Error Injection Test: According to the NVME protocol, when building the SGL buffer, various invalid values ​​are set to create error scenarios, including Invalid Type, Invalid Format, and other error items, and then the returned NVME StatusCode is verified.

[0081] 2. Data discreteness testing methods, including the following four scenarios: 2.1. Data is transmitted using a single SGL segment containing two descriptors, both of which function as Data Block Descriptors. That is, only one SGL segment is used, containing two descriptors: Descriptor 1, which acts as a Data Block Descriptor to describe a portion of the data, and Descriptor 2, also a Data Block Descriptor, which describes the remaining data. However, the Address field of Descriptor 1 is not contiguous with the Address field of the Descriptor 2.

[0082] 2.2 Data is transferred using two SGL segments. Segment 1 contains one descriptor, and Segment 2 contains two descriptors. That is, two SGL segments are used. Segment 1 contains only one descriptor, which serves as the Last SGL segment descriptor and points to the address of Segment 2. Segment 2 contains two descriptors, serving as Data Block Descriptors 1 and 2, respectively, describing the complete Transfer Data volume. The address values ​​are not contiguous.

[0083] 2.3. Data is transmitted using two SGL segments. Segment 1 contains two descriptors, and Segment 2 contains one descriptor. That is, two SGL segments are used. Segment 1 contains two descriptors: Descriptor 1 acts as a Data Block Descriptor, describing a portion of the data, and Descriptor 2 acts as the Last SGL Segment Descriptor, pointing to the next SGL segment, Segment 2. Segment 2 contains one Data Block Descriptor, and the addresses of Descriptor 1 in Segment 1 and Descriptor 1 in Segment 2 are not contiguous.

[0084] 2.4 Error Injection Test: According to the NVME protocol, when building the SGL buffer, various invalid values ​​are set to create error scenarios, including Invalid Type, Invalid Format, and other error items, and then the returned NVME StatusCode is verified.

[0085] Based on the above embodiments, it can be seen that the test method for testing the SGL function of NVMe SSD data transfer is used to test some characteristics of NVMe data transfer. This method can be divided into two main categories: 1. Data continuity test, 2. Data discrete test. The main difference is whether the address of the descriptor required for the target transfer data is continuous. This is further divided into various sub-test types, including different data structures, data distributions, descriptor types, and error injection tests. Data transfer is executed by building a series of different SGL linked lists, and the results are verified. The model in this test method provides multiple specific SGL linked list construction modes. Successful data transfer is achieved by building different linked lists. This method can flexibly define test methods according to different needs and supports customized driver kernel modifications to match the implementation of test scenarios.

[0086] Currently, SSD data transfer is mostly performed in PRP form. PRP is more suitable for describing data blocks of contiguous memory regions and has high requirements for data continuity. In contrast, SGL is much more flexible. SGL allows the transfer of data from multiple non-contiguous memory regions in a single I / O operation, providing great flexibility, improving data transfer efficiency, reducing the number of bus transactions, lowering latency, and simplifying the management and scheduling work at the operating system level. It has significant advantages when handling I / O requests in large file, database, or virtual machine environments. The model in this method constructs various different modes of SGL data transfer, which helps users to master the characteristics of SGL data transfer and use the corresponding SGL data transfer mode according to different data types.

[0087] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0088] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A test model for testing the SGL function of NVME data transmission, characterized in that: The test model includes a continuous data test module and a discrete data test module. The continuous data test module includes a continuous single data linked list test unit and a continuous multi-data linked list test unit. The continuous single data linked list test unit uses a single data linked list with unique or consecutive addresses to transmit continuous data. The continuous multi-data linked list test unit uses multiple data linked lists, each configured with different linked list combinations based on the NVME protocol, so that the multiple data linked lists form a complete, consecutively addressed data transmission linked list group for transmitting continuous data. The discrete data testing module includes a discrete single data linked list testing unit and a discrete multi-data linked list testing unit. The discrete single data linked list testing unit uses a single data linked list with non-contiguous addresses to transmit discrete data. The discrete multi-data linked list testing unit uses multiple data linked lists, each configured with different linked list combinations based on the NVME protocol, so that the multiple data linked lists form a complete, non-contiguous data transmission linked list group for transmitting discrete data.

2. The test model for testing the SGL function of NVME data transmission according to claim 1, characterized in that: The data continuity test module includes a first data continuity test unit and a second data continuity test unit, both of which are continuous single data linked list test units. The first data continuity test unit has an SGL segment x-1, and the SGL segment x-1 has an SGL descriptor x-1. The SGL descriptor x-1 is directly used as the unique data block descriptor to describe the complete continuous transfer data. The second data continuity test unit has an SGL segment x-2, and the SGL segment x-2 has an SGL descriptor x-2-1 and an SGL descriptor x-2-2. The SGL descriptor x-2-1 and the SGL descriptor x-2-2 are used to describe a portion of continuous transfer data, and the addresses described by the SGL descriptor x-2-1 and the SGL descriptor x-2-2 are continuous.

3. The test model for testing the SGL function of NVME data transmission according to claim 1, characterized in that: The data continuity test module further includes a third data continuity test unit, which is a continuous multi-data linked list test unit. The third data continuity test unit has two SGL segments, namely SGL segment x-3-1 and SGL segment x-3-2. SGL segment x-3-1 has an SGL descriptor x-3-1, the content of which points to the address of SGL segment x-3-2. SGL segment x-3-2 has an SGL descriptor x-3-2, which acts as a data block descriptor to describe the complete continuous transfer data.

4. The test model for testing the SGL function of NVME data transmission according to claim 3, characterized in that: The data continuity test module further includes a fourth data continuity test unit, which is a continuous multi-data linked list test unit. This fourth data continuity test unit has two SGL segments: SGL segment x-4-1 and SGL segment x-4-2. SGL segment x-4-1 contains two SGL descriptors: SGL descriptor x-4-1 and SGL descriptor x-4-2. SGL descriptor x-4-1 describes a portion of the continuous transfer data. The content of SGL descriptor x-4-2 points to SGL segment x-4-2. SGL segment x-4-2 contains one SGL descriptor x-4-3, which describes another portion of the continuous transfer data. Furthermore, SGL descriptor x-4-1 and SGL descriptor x-4-2... The addresses of x-4-3 must be consecutive.

5. The test model for testing the SGL function of NVME data transmission according to claim 4, characterized in that: The data continuity test module further includes a fifth data continuity test unit, which is a continuous multi-data linked list test unit. This fifth data continuity test unit has two SGL segments: SGL segment x-5-1 and SGL segment x-5-2. SGL segment x-5-1 contains two SGL descriptors: SGL descriptor x-5-1 and SGL descriptor x-5-2. SGL descriptor x-5-1 describes a portion of the continuous transfer data. The content of SGL descriptor x-5-2 points to SGL segment x-5-2. SGL segment x-5-2 contains two SGL descriptors: SGL descriptor x-5-3 and SGL descriptor x-5-4. SGL descriptor x-5-3 describes a portion of the remaining continuous transfer data. x-5-4 describes the last part of the continuous transfer data, and the addresses of the SGL descriptor x-5-1, SGL descriptor x-5-3 and SGL descriptor x-5-4 must be consecutive.

6. The test model for testing the SGL function of NVME data transmission according to claim 1, characterized in that: The discrete data testing module includes a first discrete data testing unit, which is a discrete single data linked list testing unit. It has an SGL segment s-1, which contains two SGL descriptors, namely SGL descriptor s-1-1 and SGL descriptor s-1-2. SGL descriptor s-1-1 describes a portion of the discrete transfer data, and SGL descriptor s-1-2 describes the remaining discrete transfer data. The addresses of SGL descriptor s-1-1 and SGL descriptor s-1-2 are not contiguous.

7. The test model for testing the SGL function of NVME data transmission according to claim 6, characterized in that: The data discrete test module further includes a second data discrete test unit and a third data discrete test unit, both of which are discrete multi-data linked list test units; The second discrete data test unit has two SGL segments, namely SGL segment s-2-1 and SGL segment s-2-2. SGL segment s-2-1 contains only one SGL descriptor, Descriptor s-2-1, and the content of SGL descriptor s-2-1 points to the address of SGL segment s-2-2. SGL segment s-2-2 contains two SGL descriptors, namely SGL descriptor s-2-2 and SGL descriptor s-2-3. SGL descriptor s-2-2 and SGL descriptor s-2-3 describe a portion of the discrete transfer data, but the addresses of SGL descriptor s-2-2 and SGL descriptor s-2-3 are not contiguous. The third discrete data test unit has two SGL segments, namely SGL segment s-3-1 and SGL segment s-3-2. SGL segment s-3-1 contains two SGL descriptors, namely SGL descriptor s-3-1 and SGL descriptor s-3-2. SGL descriptor s-3-1 describes a portion of discrete transfer data. The content of SGL descriptor s-3-2 points to the address of SGL segment s-3-2. SGL segment s-3-2 contains one SGL descriptor s-3-3. SGL descriptor s-3-3 describes another portion of discrete transfer data, and the addresses of SGL descriptor s-3-1 and SGL descriptor s-3-3 are not contiguous.

8. The test model for testing the SGL function of NVME data transmission according to claim 1, characterized in that: It also includes a data error injection test module, which is used to set various illegal parameters through scripts when building the SGL memory space according to the NVME protocol, and create test scenarios that are expected to report errors.

9. A test method for testing the SGL function of NVME data transmission, characterized in that, Deploying the test model for testing NVME data transmission SGL functionality as described in any one of claims 1-8 on a test host, the method comprising: (1) Test the host computer writing data to the NVMe solid-state drive: Establish a data transmission channel between the NVMe solid-state drive used for testing and the test host; Obtain test data from the test host, and determine the data transmission type of the test data based on the type of test data; Based on the test data information and data transmission type, construct an SGL linked list; The test host sends a "write command" to the NVMe solid-state drive to perform a data write test; Check the completed queue to determine if the data write test passed. (2) Test the host computer reading data from the NVMe solid-state drive: Test data is stored in an NVMe solid-state drive used for testing; Establish a data transmission channel between the NVMe solid-state drive and the test host; Based on the type of test data, confirm the data transmission type of the test data; Based on the test data information and data transmission type, construct an SGL linked list; The test host sends a "read command" to the NVMe solid-state drive to perform a data read test; After checking the queue, determine whether the data read test has passed.

10. The test method for testing the SGL function of NVME data transmission according to claim 9, characterized in that, It also includes a step of error injection testing, which involves injecting a certain type of illegal parameter value into the test data, transmitting the injected test data through the constructed SGL linked list, verifying the returned NVME status code, and checking whether the error injection test feedback is correct.