A method and system for physical disk management under a raid controller
By constructing Physical Disk Passthrough Command (SQE) and Type-Based Physical Disk Command (SQE), the complexity of RAID controllers managing different types of physical disks is solved, achieving the effects of simplified interface and improved flexibility.
Patent Information
- Application Number
- CN202210906226.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-07-29
AI Technical Summary
Existing RAID controllers cannot effectively manage different types of physical disks, resulting in a complex and inflexible RAID management interface that cannot cover commands for all types of physical disks.
By constructing a Physical Disk Passthrough Command (SQE), the target physical disk type is determined, and a corresponding physical disk command SQE is constructed based on the type, simplifying the interface design of the RAID controller and enabling command processing for different types of physical disks.
It simplifies the interface design of the RAID controller, reduces development difficulty, and improves the flexibility and coverage of the RAID management interface.
Smart Images

Figure CN115145492B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer data storage, in particular to the technical field of physical disk management under a RAID controller, and specifically relates to a physical disk management method and system under a RAID controller, a storage medium and equipment. BACKGROUND
[0002] Since the physical disks Disk 1 to Disk N are directly connected to the RAID controller and not directly to the host, the discovery and management of these physical disks can only be operated by the RAID controller, and the host cannot see and these physical disks. If the host wants to directly send a command to the physical disk through the RAID controller, a new dedicated command interface must be expanded on the RAID management command interface to achieve it. The usual process is as follows: first, the host sends a command to the RAID controller to obtain specific information on the physical disk. After receiving the command, the RAID controller constructs a corresponding physical disk command and sends it to the physical disk, and after the physical disk returns the data, the RAID controller constructs the data and returns it to the host. This method must construct a command for each type of disk for each command of the RAID controller, which results in the RAID controller having to implement an interface for each command of each type of disk.
[0003] Since the physical disks connected to the RAID controller are of multiple protocols, such as NVMe disks, SAS disks and SATA disks, these disks follow different protocols on the command interface. If a command is expanded on the RAID management interface for each command of each type of disk, the number of commands on the RAID management interface cannot be controlled. Moreover, due to the differences between physical disk manufacturers, the command sets supported by them are different, and there may be manufacturer-defined commands, which results in the possibility that the method of expanding a dedicated command cannot cover all types of physical disk commands. This results in the RAID management module in the RAID controller having an incomplete requirement, which results in difficulties in implementation.
[0004] Therefore, in view of the above problems, a general command interface is needed to reduce the complexity of the RAID management interface and improve the flexibility of the interface. SUMMARY
[0005] Therefore, the present application aims to provide an improved physical disk management method and system under a RAID controller, a storage medium and equipment to improve the coverage and flexibility of the test.
[0006] To achieve the above purpose, in one aspect, the present application provides a physical disk management method under a RAID controller, wherein the method comprises the following steps:
[0007] Constructing a physical disk pass-through command SQE;
[0008] sending the physical disk pass-through command SQE to the RAID controller;
[0009] reading the pass-through command opcode in DW0 in the received physical disk pass-through command SQE to confirm that the physical disk pass-through command SQE is a physical disk pass-through command;
[0010] reading DW2 in the physical disk pass-through command SQE to obtain the physical disk ID to determine the type of the target physical disk;
[0011] constructing a physical disk command SQE based on the type of the target physical disk;
[0012] sending the physical disk command SQE to the target physical disk and waiting for the target physical disk to return a physical disk CQE; and
[0013] constructing a pass-through command CQE based on the physical disk CQE and returning the pass-through command CQE.
[0014] In some embodiments of the method of physical disk management under the RAID controller according to the present application, "constructing a physical disk pass-through command SQE" comprises the following steps:
[0015] filling the pass-through command opcode and the host command identifier into DW0 in the physical disk pass-through command SQE;
[0016] filling the physical disk ID in the pass-through command and the pass-through command opcode into DW2 and DW3 in the physical disk pass-through command SQE, respectively; and
[0017] copying the content of other fields in the pass-through command to the corresponding fields in the physical disk pass-through command SQE.
[0018] In some embodiments of the method of physical disk management under the RAID controller according to the present application, "constructing a physical disk command SQE" comprises the following steps:
[0019] filling the pass-through command opcode in DW3 in the physical disk pass-through command SQE into DW0 in the physical disk command SQE;
[0020] regenerating a new physical disk command identifier and filling it into DW0 in the physical disk SQE; and
[0021] copying the content of other fields in the physical disk pass-through command SQE to the corresponding positions in the physical disk command SQE.
[0022] In some embodiments of the method of physical disk management under the RAID controller according to the present application, "constructing a pass-through command CQE" comprises the following steps:
[0023] filling the host command identifier in DW0 of the physical disk pass-through command SQE into DW3 in the pass-through command CQE;
[0024] copying DW0 and DW1 in the physical disk CQE returned by the target physical disk to corresponding locations in the pass-through command CQE; and
[0025] copying status information bits in DW3 in the physical disk CQE returned by the target physical disk to corresponding locations in the pass-through command CQE.
[0026] In some embodiments of the method of physical disk management under the RAID controller according to the present application, "constructing a physical disk pass-through command SQE" comprises the following steps:
[0027] filling the pass-through command operation code and the host command identifier into DW0 in the physical disk pass-through command SQE;
[0028] filling the physical disk ID in the pass-through command and the pass-through command operation code into DW2 and DW3 in the physical disk pass-through command SQE, respectively; and
[0029] filling the FIS frame in the pass-through command into DW10 to DW14 in the physical disk pass-through command SQE or filling the CDB frame in the pass-through command into DW10 to DW13 in the physical disk pass-through command SQE.
[0030] In some embodiments of the method of physical disk management under the RAID controller according to the present application, when there is a data transmission phase in the pass-through command, a PRP data structure is constructed according to the NVMe standard and filled into the DW6 to DW9 fields in the physical disk pass-through command SQE.
[0031] In some embodiments of the method of physical disk management under the RAID controller according to the present application,
[0032] when it is determined that the type of the target physical disk is a SATA disk, constructing a physical disk command SQE comprises taking out the FIS from DW10 to DW14 in the physical disk pass-through command SQE and filling it into the SATA controller in the target physical disk, or
[0033] when it is determined that the type of the target physical disk is a SAS disk, constructing a physical disk command SQE comprises taking out the CDB from DW10 to DW13 in the physical disk pass-through command SQE and filling it into the SAS controller in the target physical disk.
[0034] In some embodiments of the method of physical disk management under the RAID controller according to the present application, the step of "constructing the physical disk command SQE" further comprises the following steps:
[0035] The PRP data structure is taken out from the DW6 to DW9 of the physical disk pass-through command SQE, and a SATA data buffer descriptor structure is constructed according to the requirement of the SATA controller or a SAS data buffer descriptor structure is constructed according to the requirement of the SAS controller.
[0036] In some embodiments of the method of physical disk management under the RAID controller according to the present application, the method further comprises:
[0037] After the target physical disk receives the physical disk command SQE, the SATA controller or the SAS controller is operated to send the physical disk command SQE to the target physical disk.
[0038] In some embodiments of the method of physical disk management under the RAID controller according to the present application, when there is a data transmission stage in the pass-through command, the data transfer between the data buffer of the host and the target physical disk is completed by the SATA controller or the SAS controller.
[0039] In some embodiments of the method of physical disk management under the RAID controller according to the present application, the step of "constructing the pass-through command CQE" comprises the following steps:
[0040] The command execution status in the physical disk CQE returned by the SATA controller or the SAS controller is filled into the status in DW3 of the pass-through command CQE;
[0041] The status data in the returned physical disk CQE is filled into DW0 of the pass-through command CQE; and
[0042] The status information bit in DW3 in the returned physical disk CQE is copied to the corresponding position in the pass-through command CQE.
[0043] Another aspect of the present application also provides a system of physical disk management under a RAID controller, which comprises:
[0044] A pass-through command SQE construction module configured to construct a physical disk pass-through command SQE;
[0045] A pass-through command SQE sending module configured to send the physical disk pass-through command SQE to the RAID controller;
[0046] a command confirmation module configured to read a pass-through command operation code in DW0 in the received physical disk pass-through command SQE to confirm that the physical disk pass-through command SQE is a physical disk pass-through command;
[0047] a physical disk type confirmation module configured to read DW2 in the physical disk pass-through command SQE, obtain a physical disk ID, and determine the type of the target physical disk;
[0048] a physical disk command SQE construction module configured to construct a physical disk command SQE based on the type of the target physical disk;
[0049] a physical disk command SQE processing module configured to send the physical disk command SQE to the target physical disk and wait for a physical disk CQE returned by the target physical disk; and
[0050] a pass-through command CQE processing module configured to construct a pass-through command CQE based on the physical disk CQE and return the pass-through command CQE.
[0051] Still another aspect of the present application provides a computer readable storage medium storing computer program instructions, which, when executed, implement any of the above methods of physical disk management under a RAID controller according to the present application.
[0052] Still another aspect of the present application provides a computer device including a memory and a processor, the memory storing a computer program, which, when executed by the processor, implements any of the above methods of physical disk management under a RAID controller according to the present application.
[0053] The present application has at least the following beneficial technical effects: the present application proposes a physical disk management mode under a SOC RAID controller, through the design and method steps provided by the present application, any command for different types of physical disks can be encapsulated in an NVMe command, through a forwarding operation process for each type of physical disk on the RAID controller, any physical disk command issued by the host can be processed. The processing process of the command is only related to the type of the physical disk and is independent of the command. Therefore, the RAID controller is relieved of the implementation of specific physical disk commands, thereby simplifying the design of the RAID controller interface and reducing the development difficulty. BRIEF DESCRIPTION OF DRAWINGS
[0054] In order to make the technical solutions in the embodiments of the present application or the prior art clearer, the accompanying drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description only need to be some embodiments of the present application, and other embodiments can be obtained by those skilled in the art without any creative work on the basis of the accompanying drawings.
[0055] In the drawings:
[0056] Figure 1 An embodiment of a schematic block diagram of a method for physical disk management under a RAID controller according to the present application is shown;
[0057] Figure 2 A basic format of a physical disk pass-through command format SQE in the method for physical disk management under a RAID controller according to the present application is shown;
[0058] Figure 3 A basic format of a command parameter in the physical disk pass-through command format SQE in the method for physical disk management under a RAID controller according to the present application when the target physical disk is an NVMe disk is shown;
[0059] Figure 4 A basic format of a command parameter in the physical disk pass-through command format SQE in the method for physical disk management under a RAID controller according to the present application when the target physical disk is an SAS disk is shown;
[0060] Figure 5 A basic format of a command parameter in the physical disk pass-through command format SQE in the method for physical disk management under a RAID controller according to the present application when the target physical disk is an SATA disk is shown;
[0061] Figure 6 A basic format of a physical disk CQE in the method for physical disk management under a RAID controller according to the present application is shown;
[0062] Figure 7 A conversion schematic diagram from a physical disk pass-through command SQE to a physical disk command SQE in the method for physical disk management under a RAID controller according to the present application is shown;
[0063] Figure 8 A storage position of a FIS in DW10 to DW14 in the physical disk pass-through command SQE in the method for physical disk management under a RAID controller according to the present application is shown;
[0064] Figure 9 A storage position of a CDB in DW10 to DW13 in the physical disk pass-through command SQE in the method for physical disk management under a RAID controller according to the present application is shown;
[0065] Figure 10 Fig. 1 shows a schematic block diagram of an embodiment of a system for managing physical disks under a RAID controller according to the present application;
[0066] Figure 11 Fig. 2 shows a schematic diagram of an embodiment of a computer readable storage medium for implementing a method for managing physical disks under a RAID controller according to the present application;
[0067] Figure 12 Fig. 3 shows a hardware structure schematic diagram of an embodiment of a computer device for implementing a method for managing physical disks under a RAID controller according to the present application;
[0068] Figure 13 Fig. 4 shows a schematic diagram of a connection architecture of a RAID controller with a host and physical disks according to the prior art. DETAILED DESCRIPTION
[0069] In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application are further described in detail below with reference to the drawings.
[0070] It should be noted that all the expressions of "first" and "second" in the embodiments of the present application are used to distinguish two non-identical entities or non-identical parameters with the same name, and it can be seen that "first" and "second" are only used for the convenience of description, and should not be understood as a limitation of the embodiments of the present application. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, other steps or units inherent to the process, method, system, product or device that includes a series of steps or units.
[0071] RAID (Redundant Array of Independent Disks) is a technology that combines multiple disk devices into a storage array group, aiming to improve performance and increase redundancy to protect data.
[0072] The RAID card, as a device for implementing the RAID technology, is usually implemented as a PCIe device on a computer system and connected to the host through the PCIe bus. The core component on the RAID card is the RAID controller. As shown in the prior art RAID controller, Figure 13 the interface with the host follows the NVMe (a PCIe-based storage device specification, used for high-speed solid-state hard disk SSD host interface.) protocol standard, and the RAID management command is extended on the NVMe host interface to complete the RAID management related operation.
[0073] The application aims to provide a method for realizing a general command interface on a RAID controller management interface based on an NVMe host interface, so that the host can directly send a command to a physical disk under RAID control through the RAID controller, thereby reducing the complexity of the RAID management interface and improving the flexibility of the interface.
[0074] To this end, the first aspect of the application provides a method 100 for managing a physical disk under a RAID controller. Figure 1 An embodiment of the method for managing a physical disk under a RAID controller according to the application is shown in a schematic block diagram. In the embodiment shown in FIG. 1, the method comprises the following steps. Figure 1 The method comprises the following steps.
[0075] Step S10: constructing a physical disk pass-through command SQE;
[0076] Step S20: sending the physical disk pass-through command SQE to the RAID controller;
[0077] Step S30: reading the pass-through command operation code in DW0 in the received physical disk pass-through command SQE to confirm that the physical disk pass-through command SQE is a physical disk pass-through command;
[0078] Step S40: reading DW2 in the physical disk pass-through command SQE to obtain a physical disk ID, so as to determine the type of a target physical disk;
[0079] Step S50: constructing a physical disk command SQE based on the type of the target physical disk;
[0080] Step S60: sending the physical disk command SQE to the target physical disk and waiting for the target physical disk to return a physical disk CQE;
[0081] Step S70: constructing a pass-through command CQE based on the physical disk CQE and returning the pass-through command CQE.
[0082] SQE (Submission Queue Entry) is a command submission queue entry, each entry corresponding to a command of the host to the NVMe device. CQE (Completion Queue Entry) is a command completion queue entry, each entry corresponding to a command completion data structure reported by the NVMe controller. The NVMe controller reports CQE in the CQ after completing each command issued by the host.
[0083] The physical disk pass-through command is used for the host to directly send a command to a physical disk under the RAID controller through the RAID controller, including a command format and a command response format.
[0084] The physical disk pass-through command format is an NVMe command, which is a data structure called SQE format, the SQE length is 64 bytes, divided into 16 double words (DW0~DW15), which contains the operation code of the command and the parameters of the command. The data structure is as shown in Figure 2 .
[0085] In Figure 2 ,
[0086] ①The physical disk pass-through command operation code belongs to the vendor-defined operation code (Combined Opcode) range specified in the NVMe standard, and its value is any one of C0h to FFh;
[0087] ②The command identifier is an identifier assigned by the host to construct the command, which is used to associate the command and the response of the command;
[0088] ③Physical disk identifier type: since there may be multiple and multiple physical disks under the RAID controller, the identifier here is used to set which physical disk the physical disk pass-through command is sent to;
[0089] ④Data pointer: if there is data to be sent from the host to the physical disk or the physical disk to return data to the host during the execution of the command, the pointer points to a buffer area in the host memory region for storing these data;
[0090] ⑤Command parameters: according to the type of the target physical disk-NVMe, SAS, SATA, the command parameters here have different types. The following are introduced separately:
[0091] If the target physical disk is an NVMe disk, the command parameters are as shown in Figure 3 . Among them, ① the physical disk NVMe operation code is the command operation code to be sent to the NVMe physical disk; ② the NVMe command parameter is the command parameter corresponding to ① the physical disk NVMe command.
[0092] If the target physical disk is an SAS disk, the command parameters are as shown in Figure 4 . Among them, CDB (command descriptor block) is a data structure used to encapsulate SCSI protocol commands. SCSI (Small Computer System Interface) is a protocol specification commonly used for hard disk interface.
[0093] If the target physical disk is an SATA disk, the command parameters are as shown in Figure 5 . Among them, FIS (Frame Information Structure) is a data structure used to encapsulate SATA hard disk commands.
[0094] The physical disk pass-through command response is used for the RAID controller to return the execution status of the command to the host, and is mainly used to indicate whether the command is executed successfully. The response of the NVMe command is a data structure called CQE, which is 16 bytes long and consists of 4 double words (DW0-DW3). The response format of the physical disk pass-through command is as shown in Figure 6
[0095] ①Command identifier, from the command identifier in the physical disk pass-through command, indicating which command the command response is for;
[0096] ②Command status code indicating whether the command is executed successfully;
[0097] ③is a parameter related to the command result status.
[0098] In a preferred embodiment of the method for managing the physical disk under the RAID controller according to the present application, the construction of the physical disk pass-through command SQE includes the following steps:
[0099] Fill the pass-through command operation code and the host command identifier into DW0 in the physical disk pass-through command SQE;
[0100] Fill the physical disk ID in the pass-through command and the pass-through command operation code into DW2 and DW3 in the physical disk pass-through command SQE, respectively; and
[0101] Copy the contents of other fields in the pass-through command to the corresponding fields in the physical disk pass-through command SQE.
[0102] The construction of the physical disk command SQE includes the following steps:
[0103] Fill the pass-through command operation code in DW3 of the physical disk pass-through command SQE into DW0 of the physical disk command SQE;
[0104] Regenerate a new physical disk command identifier and fill it into DW0 of the physical disk SQE; and
[0105] Copy the contents of other fields in the physical disk pass-through command SQE to the corresponding positions in the physical disk command SQE.
[0106] The construction of the pass-through command CQE includes the following steps:
[0107] Fill the host command identifier in DW0 of the physical disk pass-through command SQE into DW3 in the pass-through command CQE;
[0108] Copy DW0 and DW1 in the physical disk CQE returned by the target physical disk to the corresponding positions in the pass-through command CQE; and
[0109] The status information bit in DW3 in the physical disk CQE returned by the target physical disk is copied to the corresponding position in the pass-through command CQE.
[0110] The preferred embodiment described above corresponds to the process of the host sending a command directly to the physical disk through the disk pass-through command when the physical disk is an NVMe disk. Specifically, the process is as follows:
[0111] 1. The host constructs a physical disk pass-through command SQE:
[0112] The physical disk pass-through command operation code, the host-generated host command identifier are filled in DW0 of the physical disk pass-through command SQE, the physical disk ID, the pass-through command operation code are filled in DW2 and DW3 of the physical disk pass-through command SQE respectively, and the other fields DW1, DW4-DW15 of the pass-through command are copied to the corresponding fields of the physical disk pass-through command SQE;
[0113] 2. The host sends the constructed physical disk pass-through command SQE to the RAID controller;
[0114] 3. The RAID controller receives the physical disk pass-through command SQE, reads the operation code in the command DW0, and judges that it is a physical disk pass-through command;
[0115] 4. The RAID controller reads DW2 in the physical disk pass-through command, obtains the physical disk ID, and judges that the target physical disk is an NVMe disk according to the ID;
[0116] 5. The RAID controller constructs a physical disk command SQE sent to the physical disk:
[0117] The operation code of the pass-through command is taken out from DW3 of the physical disk pass-through command SQE and filled in DW0 of the physical disk command SQE, the RAID controller generates a new physical disk command identifier and fills it in DW0 of the physical disk command SQE, DW1, DW4-DW15 are taken out from the physical disk pass-through command SQE and copied to the corresponding positions in the physical command SQE, Figure 7 The conversion from the physical disk pass-through command SQE to the physical disk command SQE is shown;
[0118] 6. The physical disk command SQE is sent to the physical disk, and the physical disk CQE returned by the physical disk is waited for;
[0119] 7. The RAID controller constructs a pass-through command CQE and returns it to the host:
[0120] The pass-through command identifier in the physical disk pass-through command SQE DW0 is taken out, filled in DW3 in the CQE, DW0 and DW1 in the returned physical disk CQE are copied to the corresponding positions in the pass-through command CQE, and the status information bit in DW3 in the returned physical disk CQE is copied to the corresponding position in the pass-through command CQE.
[0121] In addition, in another preferred embodiment of the method for managing the physical disk under the RAID controller according to the application,
[0122] The physical disk pass-through command SQE is constructed, including the following steps:
[0123] The pass-through command operation code and the host command identifier are filled in DW0 in the physical disk pass-through command SQE.
[0124] The physical disk ID in the pass-through command and the pass-through command operation code are filled in DW2 and DW3 in the physical disk pass-through command SQE, respectively.
[0125] The FIS frame in the pass-through command is filled in DW10 to DW14 in the physical disk pass-through command SQE, or the CDB frame in the pass-through command is filled in DW10 to DW13 in the physical disk pass-through command SQE.
[0126] When there is a data transmission stage in the pass-through command, the PRP data structure is constructed according to the NVMe standard and filled in the DW6 to DW9 field in the physical disk pass-through command SQE.
[0127] When it is determined that the type of the target physical disk is a SATA disk, the construction of the physical disk command SQE includes taking out the FIS from DW10 to DW14 in the physical disk pass-through command SQE and filling it into the SATA controller in the target physical disk, or when it is determined that the type of the target physical disk is a SAS disk, the construction of the physical disk command SQE includes taking out the CDB from DW10 to DW13 in the physical disk pass-through command SQE and filling it into the SAS controller in the target physical disk.
[0128] The construction of the physical disk command SQE further includes the following steps:
[0129] The PRP data structure is taken out from DW6 to DW9 in the physical disk pass-through command SQE, and the SATA data buffer descriptor structure is constructed according to the requirements of the SATA controller or the SAS data buffer descriptor structure is constructed according to the requirements of the SAS controller.
[0130] The method further includes, after the target physical disk receives the physical disk command SQE, operating the SATA controller or the SAS controller to send the physical disk command SQE to the target physical disk.
[0131] When there is a data transfer phase in the pass-through command, the data transfer between the host's data buffer and the target physical disk is completed by the SATA controller or the SAS controller.
[0132] The pass-through command CQE is constructed by the following steps:
[0133] The command execution status in the physical disk CQE returned by the SATA controller or the SAS controller is filled into the status in DW3 in the pass-through command CQE;
[0134] The status data in the returned physical disk CQE is filled into DW0 in the pass-through command CQE; and
[0135] The status information bit in DW3 in the returned physical disk CQE is copied to the corresponding position in the pass-through command CQE.
[0136] The preferred embodiment above corresponds to the flow of the host sending a command to a physical disk directly through a disk pass-through command when the physical disk is a SATA disk or a SAS disk.
[0137] Specifically, the flow of the host sending a command to a physical disk directly through a physical disk pass-through command when the physical disk is a SATA disk is as follows:
[0138] 1. The host constructs a physical disk pass-through command SQE:
[0139] The physical disk pass-through command operation code and the command identifier generated by the host are filled into DW0 of the physical disk pass-through command SQE, the physical disk ID and the pass-through command operation code are filled into DW2 and DW3 of the physical disk pass-through command SQE respectively, and the SATA command FIS frame is filled into SQE DW10-DW14. The FIS length is 20 bytes, and the storage position of the FIS in DW10-DW14 of the CQE is as shown in Figure 8 If the command has a data transfer phase, a PRP data structure is constructed according to the NVMe standard and filled into DW6-DW9 of the physical disk pass-through command SQE;
[0140] 2. The host sends the constructed physical disk pass-through command SQE to the RAID controller;
[0141] 3. The RAID controller receives the physical disk pass-through command SQE, reads the operation code in DW0 of the physical disk pass-through command, and judges that it is a physical disk pass-through command;
[0142] 4. The RAID controller reads DW2 in the physical disk pass-through command to obtain the physical disk ID, and judges that the target physical disk is a SATA disk according to the ID;
[0143] 5、RAID controller constructs physical disk command SQE and sends it to SATA physical disk:
[0144] FIS is taken out from DW10-DW14 of the physical disk pass-through command SQE, filled into the SATA controller, and if there is a data transmission stage, PRP data structure is taken out from DW6-DW9 of the physical disk pass-through command SQE, and a SATA data buffer descriptor structure is constructed according to the requirement of the SATA controller;
[0145] 6、SATA controller is operated to send a command to the SATA disk. If there is a data transmission stage, data transfer between the host data buffer and the disk is completed by the SATA controller;
[0146] 7、RAID controller constructs pass-through command CQE and returns it to the host:
[0147] The command execution status returned by the SATA controller is filled into the status in DW3 of the pass-through command CQE, if the SATA controller returns detailed status data, the data is filled into DW0 of the pass-through command CQE, and the status information bit in DW3 of the returned physical disk CQE is copied to the corresponding position in the pass-through command CQE.
[0148] Specifically, when the physical disk is a SAS disk, the host sends a command to the physical disk directly through a physical disk pass-through command, and the flow is as follows:
[0149] 1、The host constructs a physical disk pass-through command SQE:
[0150] The physical disk pass-through command operation code and the command identifier generated by the host are filled into DW0 of the physical disk pass-through command SQE, the physical disk ID and the pass-through command operation code are filled into DW2 and DW3 of the physical disk pass-through command SQE respectively, and the SCSI command CDB frame is filled into SQE DW10-DW13. The CDB length bit is up to 16 bytes, and the storage position of the CDB in DW10-DW13 of the CQE is as shown in the following figure: Figure 9 If the command has a data transmission stage, PRP data structure is constructed according to the NVMe standard and filled into DW6-DW9 field of the physical disk pass-through command SQE;
[0151] 2、The host sends the constructed physical disk pass-through command SQE to the RAID controller;
[0152] 3、The RAID controller receives the physical disk pass-through command SQE, reads the operation code in DW0 of the physical disk pass-through command, and judges that it is a physical disk pass-through command;
[0153] 4. The RAID controller reads DW2 in the physical disk pass-through command, obtains the physical disk ID, and determines that the target physical disk is a SAS disk according to the ID;
[0154] 5. The RAID controller constructs a physical disk command SQE and sends it to the SAS physical disk:
[0155] CDB is taken out from DW10-DW13 in the pass-through command SQE and filled into the SAS controller. If there is a data transmission stage, PRP data structure is taken out from DW6-DW9 in the pass-through command SQE, and SAS data buffer descriptor structure is constructed according to the requirement of the SAS controller;
[0156] 6. The SAS controller is operated, and the physical disk command SQE is sent to the SAS disk. If there is a data transmission stage, data transfer between the host data buffer and the disk is completed by the SAS controller;
[0157] 7. The RAID controller constructs a pass-through command CQE and returns it to the host:
[0158] The command execution status returned by the SAS controller is filled into the status in DW3 in the pass-through command CQE. If the SAS controller returns detailed status data, the data is filled into DW0 in the pass-through command CQE, and the status information bit in DW3 in the returned physical disk CQE is copied to the corresponding position in the pass-through command CQE.
[0159] The second aspect of the application also provides a system 200 for physical disk management under a RAID controller. Figure 10 A schematic block diagram of an embodiment of the system 200 for physical disk management under a RAID controller according to the application is shown. As shown, the system comprises: Figure 10
[0160] a pass-through command SQE construction module 210 configured to construct a physical disk pass-through command SQE;
[0161] a pass-through command SQE sending module 220 configured to send the physical disk pass-through command SQE to the RAID controller;
[0162] a command confirmation module 230 configured to read the pass-through command operation code in DW0 in the received physical disk pass-through command SQE to confirm that the physical disk pass-through command SQE is a physical disk pass-through command;
[0163] a physical disk type confirmation module 240 configured to read DW2 in the physical disk pass-through command SQE, obtain the physical disk ID, and determine the type of the target physical disk;
[0164] a physical disk command SQE constructing module 250 configured to construct a physical disk command SQE based on a type of a target physical disk;
[0165] a physical disk command SQE processing module 260 configured to send the physical disk command SQE to the target physical disk and wait for the target physical disk to return a physical disk CQE; and
[0166] a pass-through command CQE processing module 270 configured to construct a pass-through command CQE based on the physical disk CQE and return the pass-through command CQE.
[0167] A third aspect of the embodiment of the present application further provides a computer readable storage medium, Figure 11 A schematic diagram of a computer readable storage medium is shown, which provides a method of physical disk management under a RAID controller according to an embodiment of the present application. As shown in the figure, Figure 11 the computer readable storage medium 300 stores computer program instructions 310, which can be executed by a processor. The computer program instructions 310, when executed, implement the method of any one of the above embodiments.
[0168] It should be understood that, in the case of not conflicting with each other, all the embodiments, features and advantages described above in relation to the method of physical disk management under a RAID controller according to the present application are equally applicable to the system of physical disk management under a RAID controller and the storage medium according to the present application.
[0169] A fourth aspect of the embodiment of the present application further provides a computer device 400, which comprises a memory 420 and a processor 410, and the memory stores a computer program, which, when executed by the processor, implements the method of any one of the above embodiments.
[0170] As shown in the figure, Figure 12 a hardware structure schematic diagram of an embodiment of a computer device for implementing the method of physical disk management under a RAID controller according to the present application is shown. As shown in the figure, Figure 12 a computer device 400 is taken as an example, which comprises a processor 410 and a memory 420, and can further comprise an input device 430 and an output device 440. The processor 410, the memory 420, the input device 430 and the output device 440 can be connected through a bus or other means, Figure 6 for example, through a bus. The input device 430 can receive input digital or character information and generate signal input related to the physical disk management under a RAID controller. The output device 440 can comprise a display device such as a display screen.
[0171] The memory 420, as a non-volatile computer readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the resource monitoring method in the embodiments of the present application. The memory 420 can include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required by a function; the data storage area can store data created by use of the resource monitoring method, etc. In addition, the memory 420 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state memory device. In some embodiments, the memory 420 can optionally include a memory disposed remotely with respect to the processor 410, and these remote memories can be connected to the local module through a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0172] The processor 410 performs various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 420, that is, implements the resource monitoring method of the above method embodiments.
[0173] Those skilled in the art will also appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein can be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends on the particular application and design constraints imposed on the overall system. Skilled persons can implement the functions in various ways for each particular application, but such an implementation decision should not be interpreted as causing a departure from the scope of the embodiments of the present application.
[0174] Finally, it is noted that the computer-readable storage media of the present disclosure (e.g., the memory) can be volatile or nonvolatile storage. By way of example, and not limitation, nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM), which can act as external cache memory. By way of example, and not limitation, RAM is available in many forms such as Static RAM (DRAM), Dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed aspects of the disclosure intend to include all such forms of memory.
[0175] The various illustrative logical blocks, modules, and circuits described in connection with the disclosure herein can be implemented or performed with a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field
[0176] The foregoing is a summary of an exemplary embodiment of the disclosure, but it should be noted that various changes and modifications can be made without departing from the scope of the disclosure as defined by the claims. The functions, steps and / or actions of the method claims in accordance with the embodiments of the disclosure described herein need not be performed in any particular order. Furthermore, although elements of the disclosure embodiment disclosed can be described or claimed in individual forms, other embodiments can include a plurality of those elements in order to carry out the intended functions of the disclosure.
[0177] It should be understood that, as used herein, "and / or," includes any and all possible combinations of one or more of the associated listed items. The foregoing disclosure of the disclosure embodiment numbers is merely intended to describe the disclosure and is not intended to be limiting.
[0178] Those skilled in the art should understand that the above discussion of any embodiment is only intended to be illustrative and is not intended to be limiting to the scope of the embodiments of the present application (including claims) as set out above; the above embodiments or technical features among different embodiments can also be combined, and there are many other changes of different aspects of the embodiments of the present application as above, which are not provided in details for the sake of brevity. Therefore, any omission, modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present application shall be included in the protection scope of the embodiments of the present application.
Claims
1. A method for managing physical disks under a RAID controller, characterized in that, Includes the following steps: Construct a physical disk pass-through command SQE; wherein, the pass-through command opcode and the host command identifier are filled into DW0 in the physical disk pass-through command SQE; The physical disk ID and the operation code of the pass-through command are respectively filled into DW2 and DW3 of the physical disk pass-through command SQE; as well as Copy the contents of other fields in the transmitted command to the corresponding fields of the physical disk transmitted command SQE; Fill the pass-through command opcode and host command identifier into DW0 in the physical disk pass-through command SQE; The physical disk ID and the operation code of the pass-through command are respectively filled into DW2 and DW3 of the physical disk pass-through command SQE; and Fill the FIS frame in the transmitted command into the physical disk transmission command SQE DW10 to DW14, or fill the CDB frame in the transmitted command into the physical disk transmission command SQE DW10 to DW13. When there is a data transmission phase in the transmitted command, a PRP data structure is constructed according to the NVMe standard and the DW6 to DW9 fields of the physical disk transmission command SQE are filled in. Send the physical disk pass-through command SQE to the RAID controller; Read the pass-through command opcode in DW0 of the received physical disk pass-through command SQE to confirm that the physical disk pass-through command SQE is a physical disk pass-through command. Read DW2 from the physical disk pass-through command SQE to obtain the physical disk ID, and determine the type of the target physical disk. Construct physical disk command SQE based on the type of the target physical disk; Send the physical disk command SQE to the target physical disk, and wait for the target physical disk to return the physical disk CQE; and Construct a pass-through command CQE based on the physical disk CQE, and return the pass-through command CQE.
2. The method according to claim 1, characterized in that, The SQE command for constructing a physical disk includes the following steps: The opcode of the transmitted command in DW3 of the physical disk pass-through command SQE is filled into DW0 of the physical disk command SQE. Regenerate a new physical disk command identifier and fill it into the DW0 field of the physical disk SQE; and Copy the contents of other fields in the Physical Disk Passthrough Command SQE to the corresponding positions in the Physical Disk Command SQE.
3. The method according to claim 2, characterized in that, The construction of the transparent transmission command (CQE) includes the following steps: Fill the host command identifier in DW0 of the physical disk pass-through command SQE into DW3 of the pass-through command CQE; Copy DW0 and DW1 from the physical disk CQE returned by the target physical disk to the corresponding positions in the pass-through command CQE; and Copy the status information bits in DW3 of the physical disk CQE returned by the target physical disk to the corresponding position in the pass-through command CQE.
4. The method according to claim 1, characterized in that, When the target physical disk is determined to be a SATA disk, the physical disk construction command SQE includes retrieving the FIS from DW10 to DW14 of the physical disk pass-through command SQE and filling it into the SATA controller in the target physical disk, or When the type of the target physical disk is determined to be a SAS disk, the physical disk construction command SQE includes retrieving the CDB from DW10 to DW13 of the physical disk pass-through command SQE and filling it into the SAS controller in the target physical disk.
5. The method according to claim 4, characterized in that, The SQE command for constructing a physical disk also includes the following steps: The PRP data structure is extracted from DW6 to DW9 of the physical disk pass-through command SQE, and a SATA data buffer descriptor structure is constructed according to the requirements of the SATA controller or a SAS data buffer descriptor structure is constructed according to the requirements of the SAS controller.
6. The method according to claim 4, characterized in that, The method further includes: After the target physical disk receives the physical disk command SQE, the SATA controller or SAS controller is operated to send the physical disk command SQE to the target physical disk; and When a data transfer phase exists in the transmitted command, the SATA controller or SAS controller completes the data transfer between the host's data buffer and the target physical disk.
7. The method according to claim 4, characterized in that, The construction of the transparent transmission command (CQE) includes the following steps: Fill the command execution status returned by the SATA controller or SAS controller from the physical disk CQE into the status in DW3 of the pass-through command CQE; The returned status data from the physical disk CQE is filled into DW0 of the pass-through command CQE; and Copy the status information bits from DW3 in the returned physical disk CQE to the corresponding position in the pass-through command CQE.
8. A system for managing physical disks under a RAID controller, characterized in that, include: A pass-through command SQE construction module is configured to construct a physical disk pass-through command SQE; wherein, the pass-through command opcode and the host command identifier are filled into DW0 of the physical disk pass-through command SQE. The physical disk ID and the operation code of the pass-through command are respectively filled into DW2 and DW3 of the physical disk pass-through command SQE; as well as Copy the contents of other fields in the transmitted command to the corresponding fields of the physical disk transmitted command SQE; Fill the pass-through command opcode and host command identifier into DW0 in the physical disk pass-through command SQE; The physical disk ID and the operation code of the pass-through command are respectively filled into DW2 and DW3 of the physical disk pass-through command SQE; and Fill the FIS frame in the transmitted command into the physical disk transmission command SQE DW10 to DW14, or fill the CDB frame in the transmitted command into the physical disk transmission command SQE DW10 to DW13. When there is a data transmission phase in the transmitted command, a PRP data structure is constructed according to the NVMe standard and the DW6 to DW9 fields of the physical disk transmission command SQE are filled in. A pass-through command SQE sending module is configured to send the physical disk pass-through command SQE to the RAID controller; The command confirmation module is configured to read the pass-through command opcode in DW0 of the received physical disk pass-through command SQE to confirm that the physical disk pass-through command SQE is a physical disk pass-through command. Physical disk type confirmation module, which is configured to read DW2 in the physical disk pass-through command SQE to obtain the physical disk ID in order to determine the type of the target physical disk; A physical disk command SQE construction module, which is configured to construct a physical disk command SQE based on the type of the target physical disk; A physical disk command SQE processing module, configured to send the physical disk command SQE to the target physical disk and wait for the target physical disk to return a physical disk CQE; and A pass-through command CQE processing module is configured to construct a pass-through command CQE based on the physical disk CQE and return the pass-through command CQE.
Citation Information
Patent Citations
Data access control method, embedded storage system and embedded device
CN112256601A
Data transmission method and device and electronic equipment
CN113392046A