CN115657961B - RAID disk array management method, system, electronic device and storage medium - Google Patents

RAID disk array management method, system, electronic device and storage medium Download PDF

Info

Publication number
CN115657961B
CN115657961B CN202211409875.8A CN202211409875A CN115657961B CN 115657961 B CN115657961 B CN 115657961B CN 202211409875 A CN202211409875 A CN 202211409875A CN 115657961 B CN115657961 B CN 115657961B
Authority
CN
China
Prior art keywords
raid
command
management
host
logical volume
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211409875.8A
Other languages
Chinese (zh)
Other versions
CN115657961A (en
Inventor
李幸远
孙华锦
王江
李树青
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202211409875.8A priority Critical patent/CN115657961B/en
Publication of CN115657961A publication Critical patent/CN115657961A/en
Application granted granted Critical
Publication of CN115657961B publication Critical patent/CN115657961B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a RAID disk array management method, a system, electronic equipment and a storage medium, belonging to the technical field of storage management. The RAID disk array management method comprises the following steps: constructing a RAID management command by using the RAID management tool, and packaging the RAID management command into an SQE format; writing the packaged RAID management command into an Admin SQ queue of the RAID controller by using the NVMe device driver, and sending notification information to the RAID controller through a doorbell register so that the RAID controller executes the RAID management command in the Admin SQ queue after receiving the notification information. The RAID disk array management can be realized on the NVMe interface.

Description

RAID disk array management method, system, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of storage management technologies, and in particular, to a RAID disk array management method, a system, an electronic device, and a storage medium.
Background
RAID (Redundant Array of Independent Disks) is a Redundant Array of Disks, and RAID combines a plurality of disk devices to form one or more storage Array groups, and aims to improve performance and increase redundancy to protect data. RAID cards are traditionally implemented as PCIe devices on a computer system, connected to a host through a PCIe bus, and use a SCSI interface at the command level. However, the SCSI interface only defines an application layer, i.e., a command interaction mode, and does not specifically define a protocol on a host interface layer, and this part is left to the manufacturer of the RAID device to define implementation. Due to the existence of the private host interface and the management command, the RAID controllers implemented by various manufacturers are incompatible with each other in terms of host driving and management tools. Besides the basic RAID service, the RAID controller manufacturer needs to spend effort on the implementation of host interface definition, host drive, RAID management tools, and the like. Higher development cost and development period are brought to the development of the whole RAID controller chip. The NVMe (Non-Volatile Memory express, a PCIe-based storage device specification) specification is a high-speed solid state disk storage device interface specification, and has the characteristics of high performance, low latency, simple interface, and good expandability. The method has good open source software support on the host side driver and the application software, and the NVMe interface is used for realizing the RAID controller, so that the development cost of the host side software can be reduced. However, the NVMe specification only defines basic storage device interfaces and does not include RAID-related concepts.
Therefore, how to implement RAID disk array management on the NVMe interface is a technical problem that needs to be solved by those skilled in the art at present.
Disclosure of Invention
The application aims to provide a RAID disk array management method, a RAID disk array management system, electronic equipment and a storage medium, and RAID disk array management can be achieved on an NVMe interface.
In order to solve the technical problem, the present application provides a RAID disk array management method, which is applied to a host connected to a RAID controller, where the host includes a RAID management tool based on an NVMe interface and an NVMe device driver, the RAID controller is connected to a RAID disk array, and the RAID disk array management method includes:
constructing a RAID management command by using the RAID management tool, and packaging the RAID management command into an SQE format;
writing the packaged RAID management command into an Admin SQ queue of the RAID controller by using the NVMe device driver, and sending notification information to the RAID controller through a doorbell register so that the RAID controller executes the RAID management command in the Admin SQ queue after receiving the notification information.
Optionally, the method further includes:
if the NVMe device driver receives an interrupt notification, reading a command completion queue entry in an Admin CQ queue, and returning the command completion queue entry to the RAID management tool;
and constructing the command completion queue entry by the RAID controller according to the execution result of the RAID management command.
Optionally, constructing a RAID management command by using the RAID management tool includes:
constructing a RAID management command comprising a command operation code, command parameters and data pointers by using the RAID management tool;
and the RAID controller is used for storing the data to be returned obtained after the RAID management command is executed to the address space pointed by the data pointer.
The application also provides a RAID disk array management method, which is applied to a RAID controller connected with a host, wherein the host comprises an RAID management tool based on an NVMe interface and an NVMe device driver, the RAID controller is connected with the RAID disk array, and the RAID disk array management method comprises the following steps:
after receiving the notification information sent by the doorbell register, reading a RAID management command sent by the host from an Admin SQ queue; wherein, the process of the host issuing the RAID management command includes: constructing the RAID management command by using the RAID management tool, and packaging the RAID management command into an SQE format; writing the packaged RAID management command into an Admin SQ queue of the RAID controller by using the NVMe device driver, and sending notification information to the RAID controller through a doorbell register;
and executing the operation corresponding to the RAID management command.
Optionally, after the operation corresponding to the RAID management command is executed on the RAID disk array, the method further includes:
constructing a command completion queue entry according to an execution result of the RAID management command;
writing the command completion queue entry into an Admin CQ queue of the host, and sending an interrupt notification to the NVMe device driver, so that the NVMe device reads the command completion queue entry in the Admin CQ queue and returns the command completion queue entry to the RAID management tool.
Optionally, if the RAID management command is a RAID controller discovery command, executing an operation corresponding to the RAID management command, including:
analyzing the RAID controller discovery command to obtain a first data pointer;
summarizing the characteristic data of the RAID controller and returning the characteristic data of the RAID controller to the address space pointed by the first data pointer;
the characteristic data of the RAID controller comprises any one or a combination of any several of a ready state, a firmware version number, a serial number, a supported RAID level list, a physical disk number list supported by each RAID level, a supported RAID data arrangement mode list, a supported RAID level migration type list, a supported physical disk type list, a supported data Cache characteristic, a supported power failure protection characteristic and a standby power state; the data Cache characteristics comprise Cache capacity and/or Cache strategy types.
Optionally, if the RAID management command is a physical disk discovery command, executing an operation corresponding to the RAID management command, including:
analyzing the physical disk discovery command to obtain a second data pointer;
acquiring physical disk list data structures of all physical disks in the RAID disk array, and returning the physical disk list data structures to an address space pointed by the second data pointer; wherein the physical disk list data structure includes an identifier of each of the physical disks;
or, determining a target physical disk corresponding to the physical disk discovery command, and returning physical disk information of the target physical disk to an address space pointed by the second data pointer; wherein the physical disk information includes any one or a combination of any several items of an identifier of the target physical disk, a physical disk state, a physical disk type, a logical block size supported by a physical disk, a physical disk capacity, and physical disk topology information.
Optionally, if the RAID management command is a RAID group discovery command, executing an operation corresponding to the RAID management command, including:
analyzing the RAID group discovery command to obtain a third data pointer;
acquiring RAID group list data structures of all RAID groups in the RAID disk array, and returning the RAID group list data structures to an address space pointed by the third data pointer; wherein said RAID group list data structure comprises an identifier for each of said RAID groups;
or, determining a target RAID group corresponding to the RAID group discovery command, and returning RAID group information of the target RAID group to an address space to which the third data pointer points; the RAID group information comprises any one item or any combination of several items in an identifier of the target RAID group, a RAID group state, a RAID group level, a logic block size supported by the RAID group, a RAID group capacity, RAID group Cache attributes, a background task state and progress of the RAID group, and a RAID group physical disk list and state.
Optionally, if the RAID management command is a logical volume discovery command, executing an operation corresponding to the RAID management command, including:
analyzing the logical volume discovery command to obtain a fourth data pointer and an identifier of the RAID group to be queried;
returning the logical volume information of the RAID group to be inquired to the address space pointed by the fourth data pointer according to the identifier of the RAID group to be inquired;
wherein the logical volume information comprises any one or combination of logical volume identifier, logical volume capacity, logical volume status, and logical volume bound NVM namespace identifier.
Optionally, if the RAID management command is a logical volume binding command, executing an operation corresponding to the RAID management command, including:
analyzing the logical volume binding command to obtain a logical volume ID to be bound;
determining a free first namespace, and sending a namespace binding notification to the host so that the host sends a namespace query command to be bound; the namespace query command to be bound is used for acquiring identifiers of namespaces to be bound;
and if the namespace query command to be bound is received, uploading the identifier of the first namespace to the host, so that the host can bind the identifier of the first namespace with the ID of the logical volume to be bound.
Optionally, if the RAID management command is a logical volume unbinding command, executing an operation corresponding to the RAID management command, including:
analyzing the logical volume unbinding command to obtain the ID of the logical volume to be unbound;
judging whether all the IO operations in progress on the logical volume corresponding to the logical volume ID to be unbound are executed completely;
if so, sending a namespace unbinding notice to the host so that the host can send a namespace query command to be unbound; the command for querying the namespace to be unbound is used for acquiring an identifier of the namespace to be unbound;
if the namespace query command to be unbound is received, uploading an identifier of a second namespace to the host, so that the host can unbind the identifier of the second namespace from the ID of the logical volume to be unbound; and the second name space is a name space bound with the logical volume corresponding to the logical volume ID to be unbound.
Optionally, if the RAID management command is a namespace IO read-write command, executing an operation corresponding to the RAID management command, including:
determining a target name space corresponding to the name space IO read-write command, and determining a target logical volume bound with the target name space;
converting the operating parameters of the target namespace in the namespace IO read-write command into the operating parameters of the target logical volume; wherein the operating parameters include logical block addresses and logical block numbers;
and executing IO read-write operation on the target logical volume according to the operating parameters of the target logical volume.
Optionally, if the RAID management command is an asynchronous event reporting command, executing an operation corresponding to the RAID management command, where the operation includes:
detecting a RAID management event and determining an event type corresponding to the RAID management event;
and reporting the status code corresponding to the event type to the host so that the host can acquire the relevant data of the RAID management event from the RAID controller.
The application also provides a RAID disk array management system, is applied to the host computer of being connected with the RAID controller, the host computer includes RAID management instrument and NVMe device drive based on NVMe interface, the RAID controller is connected with the RAID disk array, RAID disk array management system includes:
the command construction module is used for constructing a RAID management command by using the RAID management tool and packaging the RAID management command into an SQE format;
and the command issuing module is used for writing the packaged RAID management command into an Admin SQ queue of the RAID controller by using the NVMe device driver, and sending notification information to the RAID controller through a doorbell register so that the RAID controller can execute the RAID management command in the Admin SQ queue after receiving the notification information.
The application also provides a RAID disk array management system, which is applied to a RAID controller connected with a host, wherein the host comprises an RAID management tool based on an NVMe interface and an NVMe device driver, the RAID controller is connected with the RAID disk array, and the RAID disk array management method comprises the following steps:
the command reading module is used for reading the RAID management command sent by the host from an Admin SQ queue after receiving the notification information sent by the doorbell register; wherein, the process of the host issuing the RAID management command includes: constructing the RAID management command by using the RAID management tool, and packaging the RAID management command into an SQE format; writing the packaged RAID management command into an Admin SQ queue of the RAID controller by using the NVMe device driver, and sending notification information to the RAID controller through a doorbell register;
and the command execution module is used for executing the operation corresponding to the RAID management command.
The application also provides a storage medium, on which a computer program is stored, and when the computer program is executed, the steps executed by the RAID disk array management method are implemented.
The application also provides electronic equipment, which comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor realizes the steps executed by the RAID disk array management method when calling the computer program in the memory.
The application provides a RAID disk array management method, which is applied to a host connected with a RAID controller, wherein the host comprises a RAID management tool based on an NVMe interface and an NVMe device driver, the RAID controller is connected with a RAID disk array, and the RAID disk array management method comprises the following steps: constructing a RAID management command by using the RAID management tool, and packaging the RAID management command into an SQE format; writing the packaged RAID management command into an Admin SQ queue of the RAID controller by using the NVMe device driver, and sending notification information to the RAID controller through a doorbell register so that the RAID controller executes the RAID management command in the Admin SQ queue after receiving the notification information.
The application provides a host connected with a RAID controller, which comprises a RAID management tool based on an NVMe interface and an NVMe device driver, and when the host device needs to manage a RAID disk array connected with the RAID controller, the RAID management tool can be used for constructing a RAID management command, and the RAID management command is encapsulated. The NVMe device driver may write RAID management commands encapsulated by the RAID management tool to the Admin SQ queue of the RAID controller. The RAID controller may read and execute RAID management commands in the Admin SQ queue. In the scheme, an interface defined by an NVMe standard is adopted between the RAID controller and the host, and an NVMe driver is loaded on the host side. NVMe defined commands between the RAID controller and the host complete management operations on the RAID disk array. According to the scheme, RAID disk array management can be realized on the NVMe interface. The application also provides a RAID disk array management system, a storage medium and an electronic device, which have the beneficial effects and are not repeated herein.
Drawings
In order to more clearly illustrate the embodiments of the present application, the drawings needed for the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a RAID disk array management method according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a RAID controller based on an NVMe host interface according to an embodiment of the present application;
FIG. 3 is a flow chart of another RAID disk array management method according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating the operation of a RAID management command according to an embodiment of the present application;
fig. 5 is a diagram of an SQE structure of a RAID management command according to an embodiment of the present application;
fig. 6 is a diagram of a RAID management command CQE structure provided in the embodiment of the present application;
fig. 7 is a diagram illustrating a structure of RAID controller characteristic data according to an embodiment of the present application;
fig. 8 is a diagram illustrating a structure of a physical disk data list according to an embodiment of the present application;
FIG. 9 is a schematic diagram illustrating relationships between physical disks, RAID groups and logical volumes according to an embodiment of the present application;
fig. 10 is a diagram of a data structure of a RAID group list according to an embodiment of the present application;
fig. 11 is a flowchart illustrating a binding process between a logical volume and a Namespace according to an embodiment of the present application;
fig. 12 is a flowchart of unbinding a logical volume from a Namespace according to an embodiment of the present application;
fig. 13 is a flowchart illustrating a conversion process from a Namesapce IO operation to a logical volume IO operation according to an embodiment of the present application;
fig. 14 is a flow chart illustrating active reporting of a RAID event according to an embodiment of the present application;
fig. 15 is a schematic structural diagram of a RAID disk array management system according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a flowchart of a RAID disk array management method according to an embodiment of the present application, where the management method may be applied to a host connected to a RAID controller, the RAID controller is connected to a RAID disk array, and specific steps of RAID disk array management may include:
s101: constructing a RAID management command by using the RAID management tool;
referring to fig. 2, fig. 2 is a schematic structural diagram of a RAID controller based on an NVMe host interface according to an embodiment of the present disclosure, where the host includes a RAID management tool based on the NVMe interface, an NVMe device driver, a PCIe (serial computer expansion bus express) bus driver, and a PCIe Root Complex (PCIe Root Complex), the RAID controller includes a management interface based on an NVMe protocol, an NVMe device interface, a PCIe Endpoint, a RAID controller, and a hard Disk interface logic (SAS/SATA/NVMe), and Disk1, disk2, disk 8230, disk RAID in fig. 2 are RAID arrays. The host can send an NVMe RAID management command to the RAID controller through an NVMe host interface, and the host and the RAID controller are connected through a PCIe bus.
In this embodiment, an interface defined by the NVMe standard is used between the RAID controller and the host, and a standard NVMe driver is loaded on the host side. The standard command defined by NVMe between the RAID controller and the host completes the basic operation of the storage device, including the operations of device discovery, IO transmission and the like.
Before this step, there may be an operation of receiving a user operation request, and then a RAID management command corresponding to the user operation request is constructed by using a RAID management tool. Specifically, this step may use the RAID management tool to construct a RAID management command including a command operation code, a command parameter, and a data pointer; the RAID controller may store the data to be returned obtained after the RAID management command is executed to the address space pointed by the data pointer, and the RAID controller may further execute an operation corresponding to the RAID management command according to the command operation code and the command parameter.
S102: packaging the RAID management command into an SQE format;
after the RAID management command is constructed, the RAID management command may be further packaged into an SQE format command by using a RAID management tool. SQE (scheduling Queue Entry), i.e., command Submission Queue entries, each corresponding to NVMe of one host.
S103: writing the packaged RAID management command into an Admin SQ queue of the RAID controller by using the NVMe device driver, and sending notification information to the RAID controller through a doorbell register so that the RAID controller executes the RAID management command in the Admin SQ queue after receiving the notification information.
The RAID management tool can transmit the packaged RAID management command to an NVMe device driver, and the NVMe device driver is used for writing the packaged RAID management command into an Admin SQ queue of the RAID controller. SQ (permission Queue) is the command Submission Queue. The Admin SQ queue is a queue defined by the NVMe standard for a host to submit commands to the NVMe controller.
After writing the RAID management command into the Admin SQ queue, notification information can be sent to the RAID controller through a doorbell register, and after receiving the notification information, the RAID controller can read the Admin SQ queue to the local and execute the RAID management command in the Admin SQ queue. The Admin SQ queue may be a host internal queue.
The embodiment provides a host connected with a RAID controller, where the host includes a RAID management tool based on an NVMe interface and an NVMe device driver, and when the host needs to manage a RAID disk array connected with the RAID controller, a RAID management command may be constructed by using the RAID management tool, and the RAID management command is encapsulated. The NVMe device driver may write RAID management commands encapsulated by the RAID management tool to the Admin SQ queue of the RAID controller. The RAID controller may read and execute RAID management commands in the Admin SQ queue. In the scheme, an interface defined by an NVMe standard is adopted between the RAID controller and the host, and an NVMe driver is loaded on the host side. Commands defined by NVMe between the RAID controller and the host complete management operations on the RAID disk array. According to the scheme, RAID disk array management can be realized on the NVMe interface.
As a possible implementation manner, if the NVMe device driver receives an interrupt notification, reading a command completion queue entry in an Admin CQ queue, and returning the command completion queue entry to the RAID management tool; and constructing the command completion queue entry by the RAID controller according to the execution result of the RAID management command.
Referring to fig. 3, fig. 3 is a flowchart of another RAID disk array management method provided in this embodiment of the present application, where the method is applied to a RAID controller connected to a host, where the host includes a RAID management tool based on an NVMe interface and an NVMe device driver, and the RAID controller is connected to a RAID disk array, and may include the following steps:
s301: receiving notification information sent by a doorbell register;
s302: reading a RAID management command sent by the host from an Admin SQ queue;
wherein, the process of the host issuing the RAID management command includes: constructing the RAID management command by using the RAID management tool, and packaging the RAID management command into an SQE format; writing the packaged RAID management command into an Admin SQ queue of the RAID controller by using the NVMe device driver, and sending notification information to the RAID controller through a doorbell register;
s303: and executing the operation corresponding to the RAID management command.
The RAID management command may include a discovery command, a disk management command, and a task management command; the discovery class commands comprise RAID controller discovery commands, physical disk discovery commands, RAID group discovery commands and logical volume discovery commands; the disk management type commands comprise RAID group creating and deleting commands, logical volume creating and deleting commands, and commands for binding and unbinding the logical volume and the Namespace; the task management type commands comprise commands of starting and stopping background tasks such as composition, copy back, capacity expansion, consistency check, disk polling and the like, parameter configuration and the like. Namespace, which is a logical unit of storage on NVMe devices, is a Namespace, each Namespace appearing to the host as a storage device. Similar to LUNs of SCSI devices.
The embodiment provides a RAID controller connected to a host, where the host includes a RAID management tool based on an NVMe interface and an NVMe device driver, and when the host needs to manage a RAID disk array connected to the RAID controller, a RAID management command may be constructed by using the RAID management tool, and the RAID management command is encapsulated. The NVMe device driver may write RAID management commands encapsulated by the RAID management utility to the Admin SQ queue of the RAID controller. The RAID controller may read and execute RAID management commands in the Admin SQ queue. In the scheme, an interface defined by an NVMe standard is adopted between the RAID controller and the host, and an NVMe driver is loaded on the host side. Commands defined by NVMe between the RAID controller and the host complete management operations on the RAID disk array. According to the scheme, RAID disk array management can be realized on the NVMe interface.
Further, after the operation corresponding to the RAID management command is executed on the RAID disk array, a command completion queue entry may be further constructed according to the execution result of the RAID management command; writing the command completion queue entry into an Admin CQ queue of the host, and sending an interrupt notification to the NVMe device driver, so that the NVMe device reads the command completion queue entry in the Admin CQ queue and returns the command completion queue entry to the RAID management tool. One Queue defined by CQ (Completion Queue) NVMe standard is used for reporting Completion of the command to the host by the NVMe controller; each Entry of the CQE (Completion Queue Entry) corresponds to a command Completion data structure reported by the NVMe controller. The NVMe controller reports CQEs to the CQ after each command issued by the host.
As a possible implementation manner, if the RAID management command is a RAID controller discovery command, the process of the RAID controller executing the RAID controller discovery command includes: analyzing the RAID controller discovery command to obtain a first data pointer; and summarizing the characteristic data of the RAID controller, and returning the characteristic data of the RAID controller to the address space pointed by the first data pointer.
The characteristic data of the RAID controller comprises any one or a combination of any several of a ready state, a firmware version number, a serial number, a supported RAID level list, a physical disk number list supported by each RAID level, a supported RAID data arrangement mode list, a supported RAID level migration type list, a supported physical disk type list, a supported data Cache characteristic, a supported power failure protection characteristic and a standby power state; the data Cache characteristics comprise Cache capacity and/or Cache policy type.
As a possible implementation manner, if the RAID management command is a physical disk discovery command, the process of executing the physical disk discovery command includes: analyzing the physical disk discovery command to obtain a second data pointer; acquiring physical disk list data structures of all physical disks in the RAID disk array, and returning the physical disk list data structures to an address space pointed by the second data pointer; wherein the physical disk list data structure includes an identifier of each of the physical disks; or, determining a target physical disk corresponding to the physical disk discovery command, and returning physical disk information of the target physical disk to an address space pointed by the second data pointer; wherein the physical disk information includes any one or a combination of any several items of an identifier of the target physical disk, a physical disk state, a physical disk type, a logical block size supported by a physical disk, a physical disk capacity, and physical disk topology information.
As a possible implementation manner, if the RAID management command is a RAID group discovery command, the process of executing the RAID group discovery command includes: analyzing the RAID group discovery command to obtain a third data pointer; acquiring RAID group list data structures of all RAID groups in the RAID disk array, and returning the RAID group list data structures to an address space pointed by the third data pointer; wherein said RAID group list data structure comprises an identifier for each of said RAID groups; or, determining a target RAID group corresponding to the RAID group discovery command, and returning RAID group information of the target RAID group to the address space to which the third data pointer points; the RAID group information comprises any one item or any combination of several items in an identifier of the target RAID group, a RAID group state, a RAID group level, a logic block size supported by the RAID group, a RAID group capacity, RAID group Cache attributes, a background task state and progress of the RAID group, and a RAID group physical disk list and state.
As a possible implementation manner, if the RAID management command is a logical volume rendering command, the process of executing the logical volume rendering command includes: analyzing the logical volume discovery command to obtain a fourth data pointer and an identifier of the RAID group to be queried; returning the logical volume information of the RAID group to be inquired to the address space pointed by the fourth data pointer according to the identifier of the RAID group to be inquired; wherein the logical volume information comprises any one or combination of logical volume identifier, logical volume capacity, logical volume status, and logical volume bound NVM namespace identifier.
As a possible implementation manner, if the RAID management command is a logical volume binding command, the process of executing the logical volume binding command includes: analyzing the logical volume binding command to obtain a logical volume ID to be bound; determining a first free namespace, and sending a namespace binding notification to the host so that the host can send a namespace query command to be bound; the name space query command to be bound is used for acquiring an identifier of the name space to be bound; and if the namespace query command to be bound is received, uploading the identifier of the first namespace to the host, so that the host can bind the identifier of the first namespace with the ID of the logical volume to be bound. The free first namespace refers to a namespace that is not bound to a logical volume.
As a possible implementation manner, if the RAID management command is a logical volume unbinding command, the process of executing the logical volume unbinding command includes: analyzing the logical volume unbinding command to obtain the ID of the logical volume to be unbound; judging whether all the IO operations in progress on the logical volume corresponding to the logical volume ID to be unbound are executed completely; if so, sending a namespace unbinding notice to the host so that the host can send a namespace query command to be unbound; the command for querying the namespace to be unbound is used for acquiring an identifier of the namespace to be unbound; if the namespace query command to be unbound is received, uploading an identifier of a second namespace to the host, so that the host can unbind the identifier of the second namespace from the ID of the logical volume to be unbound; and the second name space is a name space bound with the logical volume corresponding to the logical volume ID to be unbound.
As a feasible implementation manner, if the RAID management command is a namespace IO read-write command, the process of executing the namespace IO read-write command includes: determining a target name space corresponding to the name space IO read-write command, and determining a target logical volume bound with the target name space; converting the operating parameters of the target namespace in the namespace IO read-write command into the operating parameters of the target logical volume; wherein the operating parameters include logical block addresses and logical block numbers; and performing IO read-write operation on the target logical volume according to the operating parameters of the target logical volume.
As a possible implementation manner, if the RAID management command is an asynchronous event reporting command, the process of executing the asynchronous event reporting command includes: detecting a RAID management event and determining an event type corresponding to the RAID management event; and reporting the status code corresponding to the event type to the host so that the host can acquire the relevant data of the RAID management event from the RAID controller. The related data is detailed data of RAID management events, such as occurrence events, occurrence positions and the like.
The flow described in the above embodiment is explained by an embodiment in practical use as follows.
When a conventional RAID card in the field is connected to a host, a manufacturer self-defined host interface is used for packaging SCSI command and response data packets of an upper layer on the RAID controller side and transmitting the SCSI command and response data packets on a PCIe bus; the manufacturer also defines a RAID management interface for transmitting RAID management commands and responses. On the host, vendor-defined RAID controller drivers and RAID management tools are required. And the RAID controller driver is used for detecting, initializing and configuring the RAID controller, providing an IO interface of RAID storage equipment for a host computer and providing an operation interface for a RAID management tool. And the manufacturer-defined RAID management tool is used for interacting RAID management related commands with the RAID controller. Due to the existence of these proprietary host interfaces and management commands, RAID controllers implemented by various vendors are incompatible with each other in terms of host drivers and management tools. In addition to the RAID business required to be made, the RAID controller manufacturer also needs to spend effort on implementing host interface definition, host driver, RAID management tool, and the like. Higher development cost and development period are brought to the development of the whole RAID controller chip.
In order to solve the above technical problems, the present application provides a RAID management interface and a RAID management scheme, and this embodiment provides a method for sending a RAID management command from a host to a RAID controller according to NVMe specification definition, and returning a command execution result to the host after the RAID controller completes processing the command. The embodiment provides a RAID controller discovery method based on an NVMe interface. By the method, the host can acquire that the NVMe device is an RAID controller and find the RAID functional characteristics supported by the RAID controller; discovering physical disk information connected under RAID control; and discovering RAID group information formed by physical disks under the RAID controller and discovering logical storage volume information divided on the RAID group. In this embodiment, after physical disks managed under a RAID controller form a RAID group, a logical storage volume established in the RAID group is mapped to a host through Namespace defined by an NVMe protocol. The embodiment also provides a process for separating and deleting the logic storage volume from the Namespace. In this embodiment, the method for actively reporting the RAID management event to the host through the NVMe host interface by the RAID controller specifically includes a physical disk state change, an RAID group state change, and a logical storage volume state change.
The RAID management interface in this embodiment is implemented by extending the NVMe interface protocol, and these commands conform to the command format defined by the NVMe standard, and follow the queue and completion mechanism required for issuing NVMe commands. And the RAID management tool at the host side sends a RAID management command to the equipment through an interface provided by the drive, and the RAID controller receives the command and then processes the command and returns the execution result of the command to the host.
Referring to fig. 4, fig. 4 is a flowchart of an operation of a RAID management command according to an embodiment of the present application, which specifically includes the following steps:
s401: the RAID management tool constructs an RAID management command, packages the command into an SQE format and sends the SQE format to an NVMe device driver on the host;
s402: the method comprises the steps that an NVMe device driver on a host computer puts an SQE into an Admin SQ queue of an RAID controller;
s403: NVMe equipment on a host drives a write RAID controller Admin SQ queue corresponding to a Doorbell (Doorbell register), and informs the RAID controller of a new command;
doorbell register: a register on the NVMe controller is written by the host to inform the NVMe controller that a new CQE has been committed to the CQ queue.
S404: the RAID controller moves the SQE from the Admin SQ queue to the local;
s405: the RAID controller analyzes and executes the RAID management command;
s406: if data need to be returned to the host, the RAID controller writes the data into an address space pointed by the SQE data pointer;
s407: the RAID controller constructs a CQE according to the command execution result and puts the CQE into an Admin CQ queue; the RAID controller optionally informs the host of a new CQE through interruption;
s408: the NVMe device driver on the host reads the CQE in the Admin CQ queue and returns to the RAID management tool.
The extended RAID management command according to the present embodiment belongs to the Admin command type defined by the NVMe standard, and the operation code of the command belongs to the vendor-specific operation code (Combined Opcode) range specified by the NVMe standard, and has values of C0h to FFh.
In the RAID management command operation flow described above, the structured RAID management command SQE (i.e., the RAID management command in the SQE format) includes a RAID management command operation code and a RAID command parameter. And the RAID controller executes specific RAID management command operation according to different operation codes and parameters in the SQE. A data pointer is an option that points to a block of address space in host memory allocated by the RAID management tool, and if the RAID controller needs to return data to the host during command execution, the data is written to the address space pointed to by this pointer.
Referring to fig. 5, fig. 5 is a diagram of an SQE structure of a RAID management command according to an embodiment of the present application. The SQE includes a RAID management command opcode, RAID command parameters, and data pointers to data buffers.
After the RAID controller finishes executing the command, the command execution result is returned to the host through the CQE, and the result is returned to the host through a command status code in the CQE. Referring to fig. 6, fig. 6 is a structural diagram of a RAID management command CQE provided in the embodiment of the present application, where the RAID management command CQE includes a RAID management command status code.
The RAID controller discovery method is a process and a method for acquiring information of the RAID controller by the host, and these methods are all completed by implementing the RAID management command process described in method 1. The RAID controller discovery method comprises the following 4 command types:
(1) The RAID controller discovers the processing flow of the order: the host computer obtains the characteristic data of the RAID controller through the discovery command of the RAID controller, and after the RAID controller receives the command, the characteristic data of the RAID controller is written into an address space pointed by the data pointer in the SQE. The RAID controller characteristic number includes. After acquiring the data, the host may acquire the RAID characteristics supported by the RAID controller according to the data. Referring to fig. 7, fig. 7 is a configuration diagram of characteristic data of a RAID controller provided in an embodiment of the present application, where the characteristic data of the RAID controller includes a ready state, a firmware version number, a serial number, a supported RAID level list, a list of physical disk numbers supported by each RAID level, a supported RAID data arrangement mode list, a supported RAID level migration type list, a supported physical disk type list, supported data Cache characteristics (Cache capacity and Cache policy type), a supported power-down protection characteristic, and a standby power state.
(2) Processing flow of physical disc discovery command: as shown in fig. 2, a series of physical disks Disk1 to N are connected under the RAID controller, and these physical disks are managed by the RAID controller and cannot be directly accessed by the host. A dedicated physical disc discovery command is required to acquire information of these discs.
The physical disk discovery command has two types, the first type is to obtain a list of physical disks, and after the RAID controller receives the command, the data structure of the list of physical disks is written into the address space pointed by the data pointer in the SQE. Referring to fig. 8, fig. 8 is a diagram of a structure of a data list of a physical disk according to an embodiment of the present application, where the data list structure of the physical disk includes a physical disk1 identifier, a physical disk2 identifier, \ 8230; \8230;, and a physical disk N identifier.
The second is to acquire the designated physical disc information. The host specifies the identifier of the target physical disk in the RAID management command parameter in the SQE, and the RAID controller writes the physical disk information data structure into the address space pointed by the data pointer in the SQE after receiving the command. The physical disc information includes the following contents: physical disk identifier, physical disk status (normal/failed), physical disk type (SAS/SATA/NVMe, HDD/SDD), logical block size supported by the physical disk, physical disk capacity, physical disk topology information (controller of disk connection, bus address, port number, etc.).
(3) Processing flow of RAID group discovery command: referring to fig. 9, fig. 9 is a schematic diagram illustrating a relationship between a physical disk, a RAID group and a logical volume according to an embodiment of the present application. As shown in FIG. 9, there are 6 physical disks under the RAID controller, disks 1 through 4 comprising RAID group 1, and disks 5 and 6 comprising RAID group 2. The RAID group discovery command is used to obtain RAID group information managed by the RAID controller, including the relationship between each RAID group and the physical disk.
The RAID group discovery command has two types, the first type is a RAID group list, and after the RAID controller receives the command, the data structure of the RAID group list is written into an address space pointed by the data pointer in the SQE. Referring to fig. 10, fig. 10 is a diagram of a data structure of a RAID group list according to an embodiment of the present application, where the data structure of the RAID group list includes: RAID group 1 identifier, RAID group 2 identifier, \8230;, RAID group N identifier.
The second is to acquire specified RAID group information. The host computer indicates the identifier of the target RAID group in the RAID management command parameter in the SQE, and the RAID controller writes the information data structure of the RAID group into the address space pointed by the data pointer in the SQE after receiving the command. The RAID group information includes the following: the method comprises the steps of identifying the physical disk identifier of the RAID group, identifying the state (normal/degraded/failed) of the RAID group, the level of the RAID group, the size of a logic block of the RAID group, the capacity of the RAID group, the attribute (including Cache quota and capacity) of the Cache of the RAID group, the background task state and progress (rebuild/copyback/migration/capacity expansion) of the RAID group, and the physical disk list and the physical disk state of the RAID group, wherein each item in the list comprises the physical disk identifier and the physical disk state.
(4) The processing flow of the logic volume presentation command is as follows: as shown in fig. 9, one RAID group may be divided into a plurality of logical volumes. The host obtains logical volume information on the specified RAID group using the logical volume discovery command. The host specifies the identifier of the target RAID group in the RAID management command parameters in the SQE. The RAID controller receives the command and writes the logical volume information data structure on the specific RAID group into the address space pointed by the data pointer in the SQE. The logical volume information includes a list of all logical volumes on the RAID group, and each item in the list includes information of the logical volume, which includes the following: logical volume identifier, logical volume capacity, logical volume state, logical volume bound NVMe Namespace identifier
The logical volume on the RAID group presents to the host and the IO operation mode. As shown in FIG. 9 for example, there are 6 physical disks under the RAID controller, disks 1 through 4 comprising RAID group 1, and disks 5 and 6 comprising RAID group 2. In which RAID group 1 is divided into three logical volumes and RAID group 2 is divided into one logical volume.
Referring to fig. 10, fig. 10 is a schematic diagram illustrating a binding relationship between a ria logical volume and NVMe Namespace according to an embodiment of the present application. The logical volume is divided into two states, visible to the host and invisible to the host. The logical volume visible to the host is implemented by binding to NVMe Namespace. The logical volume that is not visible to the host is not bound to NVMe Namespace. As shown in fig. 10, the logical volume 1 is bound with Namespace1, the logical volume 3 is bound with Namespace2, the logical volume 4 is bound with Namespace3, and these three logical volume hosts are visible. Logical volume 2 is not bound to Namespace and is therefore not visible to the host.
Referring to fig. 11, fig. 11 is a flowchart illustrating a binding process between a logical volume and a Namespace according to an embodiment of the present application, which specifically includes the following steps:
s1101: and the RAID management tool sends a logical volume binding command, and the parameter is a logical volume ID.
S1102: the RIAD controller receives the logic volume binding command and selects a free Namespace to bind with the logic volume.
S1103: the host of the RAID pipe controller reports that the Namespace is changed.
S1104: the host NVMe driver sends a command to get the changed Namespace list.
S1105: and the RAID controller reports the newly bound Namespace identifier.
S1106: and the host starts to perform IO operation on the newly added Namespace, and the binding is completed.
Referring to fig. 12, fig. 12 is a flowchart for unbinding the logical volume from the Namespace according to the embodiment of the present application, which specifically includes the following steps:
s1201: the RAID management tool sends out a logical volume binding release command, and the parameter is a logical volume ID.
S1202: the RIAD controller receives the logical volume unbinding command and waits for all the IO in progress on the logical volume to complete.
S1203: the RAID pipe controller reports a change in Namespace to the host.
S1204: the host NVMe driver sends a command to get the changed Namespace list.
S1205: and the RAID controller reports the unbound Namespace to be in an inactive state.
S1206: the host NVMe driver removes Namespace.
After the logical volume is bound with the Namespace, the host can send an IO read-write command to the Namespace, wherein the IO command comprises the read-write logical block starting address and the logical block number. The RAID controller completes the IO request of the host by converting the IO command for reading and writing Namespace into the reading and writing command for the logical volume, the process is as shown in fig. 13, and fig. 13 is a flowchart of conversion from Namesapce IO operation to logical volume IO operation provided in the embodiment of the present application, specifically including the following steps:
s1301: the RAID controller receives IO operations to Namespace.
S1302: the RIAD controller finds the logical volume identifier bound to the Namespace.
S1303: and the RAID controller converts the logical block address and the logical block number in the IO operation parameters for the Namespace into the logical block address and the logical block number for the logical volume.
S1304: the RAID controller completes the IO operations on the logical volume.
S1305: the RAID controller returns the result state of the IO operation to the host.
The RAID group actively informs the host of the method of having RAID time. When a RAID controller works, a physical disk, a RAID group, and a logical volume managed by the RAID controller, and a background task managed by the RAID controller may have a state change, and a related information state needs to be reported to a host, please refer to fig. 14, where fig. 14 is a flow chart for actively reporting a RAID event provided in an embodiment of the present application, which specifically includes the following steps:
s1401: the host machine issues an asynchronous event reporting command.
S1402: the RIAD controller discovers RAID management events.
S1403: the RAID controller completes the asynchronous event report command of the host and reports the event type in the status code.
S1404: and the host issues a command to acquire RAID management event detailed data.
S1405: the RAID controller returns RAID management event detail data to the host.
Through the design and method steps provided by the present embodiment, all commands and flows required to implement RAID management on a standard NVMe interface can be implemented. Because NVMe is a standard interface which is widely applied to SSD storage equipment, the method has good host-side driving programs and management tools, and can realize the RAID management tool on the host with lower cost by combining the steps of the method, thereby shortening the development period related to the host interface for RAID controller development, reducing the overall development cost and reducing the technical difficulty of development.
Referring to fig. 15, fig. 15 is a schematic structural diagram of a RAID disk array management system according to an embodiment of the present application, where the system may be applied to a host connected to a RAID controller, where the host includes a RAID management tool based on an NVMe interface and an NVMe device driver, the RAID controller is connected to a RAID disk array, and the RAID disk array management system includes:
a command construction module 1501, configured to construct a RAID management command using the RAID management tool, and encapsulate the RAID management command into an SQE format;
a command issuing module 1502, configured to write the encapsulated RAID management command into an Admin SQ queue of the RAID controller by using the NVMe device driver, and send notification information to the RAID controller through a doorbell register, so that the RAID controller executes the RAID management command in the Admin SQ queue after receiving the notification information.
The embodiment provides a host connected with a RAID controller, where the host includes a RAID management tool based on an NVMe interface and an NVMe device driver, and when the host needs to manage a RAID disk array connected with the RAID controller, a RAID management command may be constructed by using the RAID management tool, and the RAID management command is encapsulated. The NVMe device driver may write RAID management commands encapsulated by the RAID management tool to the Admin SQ queue of the RAID controller. The RAID controller may read and execute the RAID management commands in the Admin SQ queue. In the scheme, an interface defined by an NVMe standard is adopted between the RAID controller and the host, and an NVMe driver is loaded on the host side. NVMe defined commands between the RAID controller and the host complete management operations on the RAID disk array. According to the scheme, RAID disk array management can be realized on the NVMe interface.
Further, the method also comprises the following steps:
a command completion queue entry obtaining module, configured to read a command completion queue entry in an Admin CQ queue and return the command completion queue entry to the RAID management tool if the NVMe device driver receives an interrupt notification; and constructing the command completion queue entry by the RAID controller according to an execution result of the RAID management command.
Further, the process of the command construction module 1501 constructing the RAID management command by using the RAID management tool includes: constructing a RAID management command comprising a command operation code, command parameters and data pointers by using the RAID management tool; and the RAID controller is used for storing the data to be returned obtained after the RAID management command is executed to the address space pointed by the data pointer.
The embodiment of the present application further provides a RAID disk array management system, which is applied to a RAID controller connected to a host computer, where the host computer includes a RAID management tool based on an NVMe interface and an NVMe device driver, the RAID controller is connected to a RAID disk array, and the RAID disk array management method includes:
the command reading module is used for reading the RAID management command issued by the host from the Admin SQ queue after receiving the notification information sent by the doorbell register; wherein, the process of the host issuing the RAID management command includes: constructing the RAID management command by using the RAID management tool, and packaging the RAID management command into an SQE format; writing the packaged RAID management command into an Admin SQ queue of the RAID controller by using the NVMe device driver, and sending notification information to the RAID controller through a doorbell register;
and the command execution module is used for executing the operation corresponding to the RAID management command.
The embodiment provides a RAID controller connected to a host, where the host includes a RAID management tool based on an NVMe interface and an NVMe device driver, and when the host needs to manage a RAID disk array connected to the RAID controller, a RAID management command may be constructed by using the RAID management tool, and the RAID management command is encapsulated. The NVMe device driver may write RAID management commands encapsulated by the RAID management utility to the Admin SQ queue of the RAID controller. The RAID controller may read and execute RAID management commands in the Admin SQ queue. In the scheme, an interface defined by an NVMe standard is adopted between the RAID controller and the host, and an NVMe driver is loaded on the host side. NVMe defined commands between the RAID controller and the host complete management operations on the RAID disk array. According to the scheme, RAID disk array management can be realized on the NVMe interface.
Further, the method also comprises the following steps:
the reporting module is used for constructing a command completion queue entry according to an execution result of the RAID management command after the operation corresponding to the RAID management command is executed on the RAID disk array; the apparatus is further configured to write the command completion queue entry into an Admin CQ queue of the host, and send an interrupt notification to the NVMe device driver, so that the NVMe device reads the command completion queue entry in the Admin CQ queue and returns the command completion queue entry to the RAID management tool.
Further, if the RAID management command is a RAID controller discovery command, the process of executing, by the command execution module, the operation corresponding to the RAID management command includes: analyzing the RAID controller discovery command to obtain a first data pointer; summarizing the characteristic data of the RAID controller and returning the characteristic data of the RAID controller to the address space pointed by the first data pointer; the characteristic data of the RAID controller comprises any one or a combination of any several of a ready state, a firmware version number, a serial number, a supported RAID level list, a physical disk number list supported by each RAID level, a supported RAID data arrangement mode list, a supported RAID level migration type list, a supported physical disk type list, a supported data Cache characteristic, a supported power-down protection characteristic and a standby power state; the data Cache characteristics comprise Cache capacity and/or Cache policy type.
Further, if the RAID management command is a physical disk discovery command, the process of executing the operation corresponding to the RAID management command by the command execution module includes: analyzing the physical disk discovery command to obtain a second data pointer; acquiring physical disk list data structures of all physical disks in the RAID disk array, and returning the physical disk list data structures to an address space pointed by the second data pointer; wherein the physical disk list data structure includes an identifier of each of the physical disks; or, determining a target physical disk corresponding to the physical disk discovery command, and returning physical disk information of the target physical disk to an address space pointed by the second data pointer; wherein the physical disk information includes any one or a combination of any several items of an identifier of the target physical disk, a physical disk state, a physical disk type, a logical block size supported by a physical disk, a physical disk capacity, and physical disk topology information.
Further, if the RAID management command is a RAID group discovery command, the process of executing the operation corresponding to the RAID management command by the command execution module includes: analyzing the RAID group discovery command to obtain a third data pointer; acquiring RAID group list data structures of all RAID groups in the RAID disk array, and returning the RAID group list data structures to an address space pointed by the third data pointer; wherein said RAID group list data structure comprises an identifier for each of said RAID groups; or, determining a target RAID group corresponding to the RAID group discovery command, and returning RAID group information of the target RAID group to the address space to which the third data pointer points; the RAID group information includes any one item or a combination of any several items of an identifier of the target RAID group, a RAID group status, a RAID group level, a logical block size supported by the RAID group, a RAID group capacity, a RAID group Cache attribute, a RAID group background task status and progress, and a RAID group physical disk list and status.
Further, if the RAID management command is a logical volume discovery command, the process of executing the operation corresponding to the RAID management command by the command execution module includes: analyzing the logical volume discovery command to obtain a fourth data pointer and an identifier of the RAID group to be queried; returning the logical volume information of the RAID group to be inquired to the address space pointed by the fourth data pointer according to the identifier of the RAID group to be inquired; wherein the logical volume information includes any one or a combination of any several of a logical volume identifier, a logical volume capacity, a logical volume status, and a logical volume bound NVM namespace identifier.
Further, if the RAID management command is a logical volume binding command, the process of executing the operation corresponding to the RAID management command by the command execution module includes: analyzing the logical volume binding command to obtain a logical volume ID to be bound; determining a first free namespace, and sending a namespace binding notification to the host so that the host can send a namespace query command to be bound; the namespace query command to be bound is used for acquiring identifiers of namespaces to be bound; and if the query command of the name space to be bound is received, uploading the identifier of the first name space to the host, so that the host binds the identifier of the first name space with the ID of the logical volume to be bound.
Further, if the RAID management command is a logical volume unbinding command, the process of executing, by the command execution module, the operation corresponding to the RAID management command includes: analyzing the logical volume unbinding command to obtain the ID of the logical volume to be unbound; judging whether all the IO operations in progress on the logical volume corresponding to the logical volume ID to be unbound are executed completely; if so, sending a namespace unbinding notice to the host so that the host can send a namespace query command to be unbound; the namespace query command to be unbound is used for acquiring identifiers of namespaces to be unbound; if the namespace query command to be unbound is received, uploading an identifier of a second namespace to the host, so that the host can remove the binding between the identifier of the second namespace and the ID of the logical volume to be unbound; and the second name space is a name space bound with the logical volume corresponding to the logical volume ID to be unbound.
Further, if the RAID management command is a namespace IO read-write command, the process of executing the operation corresponding to the RAID management command by the command execution module includes: determining a target name space corresponding to the name space IO read-write command, and determining a target logical volume bound with the target name space; converting the operating parameters of the target namespace in the namespace IO read-write command into the operating parameters of the target logical volume; wherein the operating parameters comprise a logical block address and a logical block number; and executing IO read-write operation on the target logical volume according to the operating parameters of the target logical volume.
Further, if the RAID management command is an asynchronous event reporting command, the process of executing the operation corresponding to the RAID management command by the command execution module includes: detecting a RAID management event and determining an event type corresponding to the RAID management event; and reporting the status code corresponding to the event type to the host so that the host can acquire the relevant data of the RAID management event from the RAID controller.
Since the embodiment of the system part and the embodiment of the method part correspond to each other, please refer to the description of the embodiment of the method part for the embodiment of the system part, and details are not repeated here.
The present application also provides a storage medium having a computer program stored thereon, which when executed, may implement the steps provided by the above-described embodiments. The storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The application further provides an electronic device, which may include a memory and a processor, where the memory stores a computer program, and the processor may implement the steps provided by the foregoing embodiments when calling the computer program in the memory. Of course, the electronic device may also include various network interfaces, power supplies, and the like.
The embodiments are described in a progressive mode in the specification, the emphasis of each embodiment is on the difference from the other embodiments, and the same and similar parts among the embodiments can be referred to each other. For the system disclosed by the embodiment, the description is relatively simple because the system corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, without departing from the principle of the present application, the present application can also make several improvements and modifications, and those improvements and modifications also fall into the protection scope of the claims of the present application.
It should also be noted that, in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

Claims (17)

1. A RAID disk array management method is applied to a host computer connected with a RAID controller, the host computer comprises an RAID management tool based on an NVMe interface and an NVMe device driver, the RAID controller is connected with a RAID disk array, and the RAID disk array management method comprises the following steps:
constructing a RAID management command by using the RAID management tool, and packaging the RAID management command into an SQE format;
and writing the encapsulated RAID management command into an Admin SQ queue of the RAID controller through an NVMe host interface by utilizing the NVMe device driver, and sending notification information to the RAID controller through a doorbell register so that the RAID controller executes the RAID management command in the Admin SQ queue after receiving the notification information.
2. The RAID disk array management method of claim 1, further comprising:
if the NVMe device driver receives an interrupt notification, reading a command completion queue entry in an Admin CQ queue, and returning the command completion queue entry to the RAID management tool;
and constructing the command completion queue entry by the RAID controller according to an execution result of the RAID management command.
3. The RAID disk array management method of claim 1 wherein constructing RAID management commands using the RAID management tools comprises:
constructing a RAID management command comprising a command operation code, command parameters and data pointers by using the RAID management tool;
and the RAID controller is used for storing the data to be returned obtained after the RAID management command is executed to the address space pointed by the data pointer.
4. A RAID disk array management method is characterized in that the method is applied to a RAID controller connected with a host computer, the host computer comprises a RAID management tool based on an NVMe interface and an NVMe device driver, the RAID controller is connected with a RAID disk array, and the RAID disk array management method comprises the following steps:
after receiving the notification information sent by the doorbell register, reading a RAID management command sent by the host from an Admin SQ queue; wherein, the process of the host issuing the RAID management command includes: constructing the RAID management command by using the RAID management tool, and packaging the RAID management command into an SQE format; writing the packaged RAID management command into an Admin SQ queue of the RAID controller through an NVMe host interface by using the NVMe device driver, and sending notification information to the RAID controller through a doorbell register;
and executing the operation corresponding to the RAID management command.
5. The RAID disk array management method of claim 4, after performing the operation corresponding to the RAID management command on the RAID disk array, further comprising:
constructing a command completion queue entry according to an execution result of the RAID management command;
writing the command completion queue entry into an Admin CQ queue of the host, and sending an interrupt notification to the NVMe device driver, so that the NVMe device reads the command completion queue entry in the Admin CQ queue and returns the command completion queue entry to the RAID management tool.
6. The RAID disk array management method of claim 4, wherein if the RAID management command is a RAID controller discovery command, executing an operation corresponding to the RAID management command includes:
analyzing the RAID controller discovery command to obtain a first data pointer;
summarizing the characteristic data of the RAID controller and returning the characteristic data of the RAID controller to an address space pointed by the first data pointer;
the characteristic data of the RAID controller comprises any one or a combination of any several of a ready state, a firmware version number, a serial number, a supported RAID level list, a physical disk number list supported by each RAID level, a supported RAID data arrangement mode list, a supported RAID level migration type list, a supported physical disk type list, a supported data Cache characteristic, a supported power-down protection characteristic and a standby power state; the data Cache characteristics comprise Cache capacity and/or Cache strategy types.
7. The RAID disk array management method of claim 4, wherein if the RAID management command is a physical disk discovery command, executing an operation corresponding to the RAID management command includes:
analyzing the physical disk discovery command to obtain a second data pointer;
acquiring physical disk list data structures of all physical disks in the RAID disk array, and returning the physical disk list data structures to an address space pointed by the second data pointer; wherein the physical disk list data structure includes an identifier of each of the physical disks;
or, determining a target physical disk corresponding to the physical disk discovery command, and returning physical disk information of the target physical disk to an address space pointed by the second data pointer; wherein the physical disk information includes any one or a combination of any several items of an identifier of the target physical disk, a physical disk state, a physical disk type, a logical block size supported by a physical disk, a physical disk capacity, and physical disk topology information.
8. The RAID disk array management method of claim 4, wherein if the RAID management command is a RAID group discovery command, executing an operation corresponding to the RAID management command includes:
analyzing the RAID group discovery command to obtain a third data pointer;
acquiring RAID group list data structures of all RAID groups in the RAID disk array, and returning the RAID group list data structures to an address space pointed by the third data pointer; wherein said RAID group list data structure comprises an identifier for each of said RAID groups;
or, determining a target RAID group corresponding to the RAID group discovery command, and returning RAID group information of the target RAID group to an address space to which the third data pointer points; the RAID group information comprises any one item or any combination of several items in an identifier of the target RAID group, a RAID group state, a RAID group level, a logic block size supported by the RAID group, a RAID group capacity, RAID group Cache attributes, a background task state and progress of the RAID group, and a RAID group physical disk list and state.
9. The RAID disk array management method of claim 4, wherein if the RAID management command is a logical volume discovery command, performing an operation corresponding to the RAID management command includes:
analyzing the logical volume discovery command to obtain a fourth data pointer and an identifier of the RAID group to be queried;
returning the logical volume information of the RAID group to be inquired to the address space pointed by the fourth data pointer according to the identifier of the RAID group to be inquired;
wherein the logical volume information includes any one or a combination of any several of a logical volume identifier, a logical volume capacity, a logical volume status, and a logical volume bound NVM namespace identifier.
10. The RAID disk array management method of claim 4, wherein if the RAID management command is a logical volume binding command, performing an operation corresponding to the RAID management command includes:
analyzing the logical volume binding command to obtain a logical volume ID to be bound;
determining a first free namespace, and sending a namespace binding notification to the host so that the host can send a namespace query command to be bound; the name space query command to be bound is used for acquiring an identifier of the name space to be bound;
and if the namespace query command to be bound is received, uploading the identifier of the first namespace to the host, so that the host can bind the identifier of the first namespace with the ID of the logical volume to be bound.
11. The RAID disk array management method of claim 4, wherein if the RAID management command is a logical volume unbind command, then performing an operation corresponding to the RAID management command includes:
analyzing the logical volume unbinding command to obtain the ID of the logical volume to be unbound;
judging whether all the in-process IO operations on the logical volume corresponding to the logical volume ID to be unbundled are executed completely;
if so, sending a namespace unbinding notice to the host so that the host sends a namespace query command to be unbound; the command for querying the namespace to be unbound is used for acquiring an identifier of the namespace to be unbound;
if the namespace query command to be unbound is received, uploading an identifier of a second namespace to the host, so that the host can unbind the identifier of the second namespace from the ID of the logical volume to be unbound; and the second name space is a name space bound with the logical volume corresponding to the logical volume ID to be unbound.
12. The RAID disk array management method according to claim 4, wherein if the RAID management command is a namespace IO read/write command, the executing an operation corresponding to the RAID management command includes:
determining a target name space corresponding to the name space IO read-write command, and determining a target logical volume bound with the target name space;
converting the operating parameters of the target namespace in the namespace IO read-write command into the operating parameters of the target logical volume; wherein the operating parameters comprise a logical block address and a logical block number;
and executing IO read-write operation on the target logical volume according to the operating parameters of the target logical volume.
13. The RAID disk array management method of claim 4, wherein if the RAID management command is an asynchronous event reporting command, executing an operation corresponding to the RAID management command, includes:
detecting a RAID management event and determining an event type corresponding to the RAID management event;
and reporting the status code corresponding to the event type to the host so that the host can acquire the relevant data of the RAID management event from the RAID controller.
14. The RAID disk array management system is applied to a host connected with a RAID controller, the host comprises a RAID management tool based on an NVMe interface and an NVMe device driver, the RAID controller is connected with a RAID disk array, and the RAID disk array management system comprises:
the command construction module is used for constructing a RAID management command by using the RAID management tool and packaging the RAID management command into an SQE format;
and the command issuing module is used for writing the encapsulated RAID management command into an Admin SQ queue of the RAID controller through an NVMe host interface by utilizing the NVMe device driver, and sending notification information to the RAID controller through a doorbell register so that the RAID controller can execute the RAID management command in the Admin SQ queue after receiving the notification information.
15. The RAID disk array management system is characterized by being applied to a RAID controller connected with a host computer, wherein the host computer comprises a RAID management tool based on an NVMe interface and an NVMe device driver, the RAID controller is connected with a RAID disk array, and the RAID disk array management method comprises the following steps:
the command reading module is used for reading the RAID management command issued by the host from the Admin SQ queue after receiving the notification information sent by the doorbell register; wherein, the process of the host issuing the RAID management command includes: constructing the RAID management command by using the RAID management tool, and packaging the RAID management command into an SQE format; writing the packaged RAID management command into an Admin SQ queue of the RAID controller through an NVMe host interface by using the NVMe device driver, and sending notification information to the RAID controller through a doorbell register;
and the command execution module is used for executing the operation corresponding to the RAID management command.
16. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the RAID disk array management method according to any one of claims 1 to 13 when calling the computer program in the memory.
17. A storage medium having stored thereon computer-executable instructions that, when loaded and executed by a processor, perform the steps of a RAID disk array management method according to any one of claims 1 to 13.
CN202211409875.8A 2022-11-11 2022-11-11 RAID disk array management method, system, electronic device and storage medium Active CN115657961B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211409875.8A CN115657961B (en) 2022-11-11 2022-11-11 RAID disk array management method, system, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211409875.8A CN115657961B (en) 2022-11-11 2022-11-11 RAID disk array management method, system, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN115657961A CN115657961A (en) 2023-01-31
CN115657961B true CN115657961B (en) 2023-03-17

Family

ID=85022002

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211409875.8A Active CN115657961B (en) 2022-11-11 2022-11-11 RAID disk array management method, system, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN115657961B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116303130B (en) * 2023-05-16 2023-08-15 苏州浪潮智能科技有限公司 Asynchronous event reporting method for storage device and application device thereof
CN116501263B (en) * 2023-06-21 2023-09-12 苏州浪潮智能科技有限公司 Data storage device, server, data storage method, electronic apparatus, and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109634771A (en) * 2018-10-31 2019-04-16 华为技术有限公司 A kind of data guard method, apparatus and system
CN112256601A (en) * 2020-10-19 2021-01-22 凌云光技术股份有限公司 Data access control method, embedded storage system and embedded equipment
CN114780458A (en) * 2018-06-30 2022-07-22 华为技术有限公司 Data processing method and storage system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114780458A (en) * 2018-06-30 2022-07-22 华为技术有限公司 Data processing method and storage system
CN109634771A (en) * 2018-10-31 2019-04-16 华为技术有限公司 A kind of data guard method, apparatus and system
CN112256601A (en) * 2020-10-19 2021-01-22 凌云光技术股份有限公司 Data access control method, embedded storage system and embedded equipment

Also Published As

Publication number Publication date
CN115657961A (en) 2023-01-31

Similar Documents

Publication Publication Date Title
CN115657961B (en) RAID disk array management method, system, electronic device and storage medium
US11080181B1 (en) Flash memory drive that supports export of erasable segments
JP6138275B2 (en) Data storage method and storage device
US8903956B2 (en) On-demand virtual storage capacity
US8924659B2 (en) Performance improvement in flash memory accesses
US8943265B2 (en) Storage array controller
JP5155861B2 (en) Smart scalable memory switch architecture
US8307186B2 (en) Computer system performing capacity virtualization based on thin provisioning technology in both storage system and server computer
JP6734751B2 (en) Electronic system having interface control mechanism and operating method thereof
US20080229046A1 (en) Unified support for solid state storage
JP2012523624A (en) Method and apparatus for storing data in a flash memory data storage device
US20150121003A1 (en) Storage controllers
US20130254455A1 (en) Solid state drive interface controller and method of controlling solid state drive interface
JP4905511B2 (en) Storage device control unit and control method
US8572347B2 (en) Storage apparatus and method of controlling storage apparatus
EP1126366A2 (en) Storage apparatus and access control method
JP2014137783A (en) Raid controller and command processing method thereof
CN111221753A (en) Multi-host controller and semiconductor device including the same
JPH09305324A (en) Mirror disk system
JP2018101440A (en) Computer system
US8856481B1 (en) Data processing system having host-controlled provisioning of data storage resources
US20130275627A1 (en) Methods for exchanging adminsitrative information through a communication interface with limited administrative information exchange features
CN115826874A (en) Method, device and assembly for realizing virtual RAID card
Scriba et al. Disk and Storage System Basics

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant