A method for constructing a device table in the cascaded state of a SAS Expander

By performing level sorting and command optimization of the topology structure in the Expander cascade state, the inefficiency and omission risks of hot plugging of equipment in the existing technology are solved, and fast and accurate device table reconstruction is achieved.

CN114942723BActive Publication Date: 2025-07-04HANGZHOU DIANZI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210322462.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-29
Publication Date
2025-07-04
Estimated Expiration
2042-03-29

AI Technical Summary

Technical Problem

In the SAS Expander cascade state, the prior art requires repeated sending of SMP discover commands when the device is hot-plugged, resulting in low efficiency, cumbersome process and the risk of missing devices.

Method used

By sorting the Expander in the topology, determine the level of the hot plug-in device, and send only the broadcast command to the previous level device, combining the discover command to complete the flag bit, reducing the repeated sending and confirmation process of the command.

Benefits of technology

It realizes rapid response to hot plug-ins of equipment, reduces the number of commands sent, ensures rapid establishment of equipment tables, improves equipment identification and response speed, and reduces the risk of equipment omissions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114942723B_ABST
    Figure CN114942723B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for constructing a device table in the cascaded state of a SAS Expander, which includes first performing a level sorting on the Expanders in the topology structure to obtain the level order of all Expanders; when there is a hot plugging behavior of the hard disks directly connected to an Expander at a certain level, it can be known which level of Expander has the behavior; according to the above sorting method, let Expander A be the first-level Expander, Expander B be the second-level Expander, Expander C be the third-level Expander, and so on. The present invention can perform a level sorting on each Expander level. When there is a hot plugging behavior of a certain device (Expander, hard disk) in the system topology structure, it can reduce the command sending process, reduce the repetition of commands, quickly make a response, remove it from the device where it is located, and establish a routing table of the current device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer data processing, and relates to a method for constructing a device table in the cascaded state of a SAS Expander. Background Art

[0002] As is well known, the hard disk interfaces of personal hosts or enterprise servers are limited and cannot be connected to solid state drives without limit to increase the storage capacity. At most, only 4 to 5 hard disks can be expanded. However, the storage capacity brought by just a few hard disks is a drop in the bucket compared to the storage capacity required by enterprises. At this time, a SAS Expander device is needed to expand the hard disk connection. After using the expander, the maximum number of devices that a storage system can connect can reach 16,384, and the storage capacity can achieve a qualitative leap, fully meeting the storage requirements of enterprises. In short, the Expander device can be understood as a switch and a router in a network, and with this device, there are more ports to connect the devices to be used. In the field of data storage, the data transfer rate is one of the important indicators for evaluating the quality of a device. When the number of Expander devices and hard disks connected under the HBA (Host Bus Adapter) card increases, it is necessary to enable the HBA card to quickly identify the connected devices, and when a device is unplugged, it can quickly respond. Refer to Figure 1 Figure 0000006 is a system topology diagram when the HBA card is connected to 3 Expanders and 9 hard disks.

[0003] The SAS protocol can be divided into three parts: SSP (Serial SCSI Protocol), SMP (Serial Management Protocol), and STP (SATA Tunneling Protocol). Among them, the commands of SMP are used to manage and maintain devices. In the process of system device recognition, the discover command of SMP is mainly used. The discover command is for the device information connected to the current device. For example, when the HBA sends a discover command to Expander A, it can obtain the SAS address, phy id, device type, etc. of Expander A and the three hard disks it is connected to. When a disk is unplugged in the entire topology structure, the Expander of the unplugged disk device will send a broadcast command to the remaining devices, and once the remaining devices receive the broadcast command, they have to immediately send a discover command.

[0004] When there is hot plugging and unplugging of devices in the system, assume that one of the hard disks in Expander B is unplugged. The traditional technical solution for re-acquiring all devices is shown inFigure 2 。

[0005] When there is a hot plug operation on one of the hard disks in Expander B, the following operations will be performed:

[0006] 1. Expander B sends a broadcast to Expander A and Expander C, and sends a discover command to Expander C. Expander C will return a discover response with the disk device information connected to it to Expander B.

[0007] 2. As soon as Expander A receives the broadcast, it will send a discover command to Expander B and forward the broadcast command to the HBA at the same time. Expander B will return a discover response with the disk device information connected to it to Expander A.

[0008] 3. As soon as the HBA receives the broadcast, it will send a discover command to Expander A. Expander A will return a discover response with the disk device information connected to it to the HBA.

[0009] 4. When the HBA or each Expander sends a discover command to the other devices, it needs to be sent repeatedly, at least two times. Compare the device information returned by the discover responses of the previous and subsequent times. When the results of the two times are the same, it can be confirmed that all the devices below are included.

[0010] In the commonly used Expander technology, when there is a hot plug behavior of the devices connected to a certain Expander in the entire cascaded topology structure, the SMP discover command needs to be sent repeatedly at each level. According to whether the device information returned by the discover responses of the previous and subsequent times is exactly the same, it is judged whether the complete lower-layer link information is obtained currently. The longer the topology structure is, the more discover commands need to be sent until it is confirmed that the response obtained by the last discover command sent by the topmost layer, that is, the HBA, can have the complete link information, and the entire table building process is completed. The entire process has low efficiency, the command flow is cumbersome and redundant, and there is a certain probability of missing a certain disk device. Summary of the Invention

[0011] To solve the above problems, in the case of multiple Expanders in cascade, the system can perform a level sorting on each Expander level. When a device (Expander or hard disk) in the system topology has a hot plug and unplug behavior, the process of sending commands can be reduced, command duplication can be lowered, and a quick response can be made to remove it from the device where it is located and establish a routing table for the current device.

[0012] The technical solution is a method for constructing a device table in the SAS Expander cascade state, including first performing a level sorting on the Expanders in the topology to obtain the level order of all Expanders; when there is a hot plug and unplug behavior of the hard disks directly connected to a certain level of Expander, it can be known which level of Expander has the behavior.

[0013] According to the above sorting method, let Expander A be the first-level Expander, Expander B be the second-level Expander, Expander C be the third-level Expander, and so on.

[0014] Based on the above purpose, the present invention also provides a method for hot plugging and unplugging to construct a device table in the SAS Expander cascade state. Using the above method, it includes the following steps:

[0015] S10. Confirm the level of the device with hot plug and unplug operation. Assume it is Expander B, and only send the broadcast command of Expander B to the upper level.

[0016] S20. After receiving the broadcast command, Expander A sends a discover command to Expander B. When the device discovery in Expander B is completed, a discover command completion flag is sent to Expander A.

[0017] S30. Expander A retrieves a bit in the discover response, that is, the flag bit set in S20. When it is set to 1, it means that the retrieval of the devices connected to Expander B is completed, and a broadcast command is sent to the HBA.

[0018] S40. After the HBA receives the broadcast command, it sends a discover command to Expander A to obtain information about the devices connected to Expander A. Expander A is the first-level Expander, and at this time, information about all the connected devices at lower levels has been obtained. Expander A sends a discover response back to the HBA, and this discover response includes device information in the entire topology structure.

[0019] S50. Complete the re-establishment of the device table.

[0020] Preferably, there are no device changes in the Expanders below Expander B in S10, and there is no need to re-obtain information about the devices connected to the lower levels.

[0021] The beneficial effects of the present invention at least include:

[0022] 1. In the cascaded state of multiple Expander devices, it is possible to sort the levels of each Expander device and know the entire topology structure.

[0023] 2. When a disk is hot-plugged or hot-unplugged in an Expander at a certain level, the Expander device with the hot-plugging or hot-unplugging action only sends the broadcast command to the upper level, reducing the number of broadcast command transmissions.

[0024] 3. Set the completion bit of the discover command. When the discover command is executed, the flag bit is set to 1 in the response, and there is no need to repeatedly send the discover command to compare the content of the response, greatly reducing the number of discover command transmissions.

[0025] 4. It can ensure that when the upper-level device sends a discover command to the lower-level device, the lower-level device already contains information about all the devices at its level. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a schematic diagram of the topology structure of the method for constructing a device table in the cascaded state of the SAS Expander of the present invention;

[0027] Figure 2 It is a schematic diagram of the hot-plugging process of the prior art;

[0028] Figure 3 It is a schematic diagram of the level sorting of the method for constructing a device table in the cascaded state of the SAS Expander of the present invention;

[0029] Figure 4Schematic flowchart of the method for constructing a device table in the cascaded state of the SAS Expander of the present invention;

[0030] Figure 5 Schematic diagram of the command completion flag for the method of constructing a device table in the cascaded state of the SAS Expander of the present invention. Detailed implementation manners

[0031] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention.

[0032] On the contrary, the present invention covers any alternatives, modifications, equivalent methods and solutions made within the spirit and scope of the present invention defined by the claims. Further, in order to enable the public to have a better understanding of the present invention, some specific details are described in detail in the following detailed description of the present invention. Those skilled in the art can fully understand the present invention without the description of these details.

[0033] See Figures 3 - 5 , which is a schematic diagram of the technical solution of the present invention for the method of constructing a device table in the cascaded state of the SAS Expander of the embodiment of the present invention. A method for constructing a device table in the cascaded state of the SAS Expander includes first sorting the Expanders in the topology by level, see Figure 3 to obtain the level order of all Expanders; when there is a hot plug and unplug behavior of the hard disks directly connected to an Expander at a certain level, it can be known which level of Expander has the behavior;

[0034] According to the above sorting method, let Expander A be the first-level Expander, Expander B be the second-level Expander, Expander C be the third-level Expander, and so on.

[0035] See Figure 4 , which is a method for hot plugging and unplugging a device table in the cascaded state of the SAS Expander. Using the above method, it includes the following steps:

[0036] S10. Confirm the level of the device with hot plug and unplug operation. Assume it is Expander B, and only send the broadcast command of Expander B to the upper level; (that is Figure 4 1. Sending the broadcast command in

[0037] S20. After Expander A receives the broadcast command, it sends a discover command to Expander B (i.e., the 2 in Figure 4 , sending the discover command); when the device discovery in Expander B is completed, it sends a discover command completion flag to Expander A (i.e., the 2' in Figure 4 returning the discover response);

[0038] S30. Expander A retrieves a bit in the discover response, which is the flag bit set in S20. Refer to Figure 5 . When it is set to 1, it means that the retrieval of the devices connected to Expander B is completed, and a broadcast command is sent to the HBA; (i.e., the 3 in Figure 4 , retrieving the completion flag bit in the response and forwarding the broadcast)

[0039] S40. After the HBA receives the broadcast command, it sends a discover command to Expander A to obtain information about the devices connected to Expander A. Expander A is the first-level Expander, and at this time, it has obtained information about all the connected devices at lower levels (i.e., the 4 in Figure 4 , sending the discover command); Expander A returns a discover response to the HBA, and this discover response includes device information in the entire topology structure (i.e., the 4' in Figure 4 returning the discover response);

[0040] S50. Re-establish the device table.

[0041] There is no change in the devices of the Expanders below Expander B in S10, and there is no need to re-obtain information about the devices connected to the lower levels.

[0042] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for constructing a device table in the cascaded state of a SAS Expander, characterized in that, It includes first performing a level sorting on the Expanders in the topology to obtain the level order of all Expanders; when there is a hot plugging or unplugging behavior of the hard disks directly connected to a certain level of Expander, it can be known which level of Expander has the behavior. Let Expander A be the first-level Expander, Expander B be the second-level Expander, Expander C be the third-level Expander, and so on. A method for hot plugging a device table in a cascaded state of SAS Expanders, including the following steps: S10. Confirm the level of the device with hot plugging or unplugging operation. Assume it is Expander B. Only send the broadcast command of Expander B to the upper level. S20. After receiving the broadcast command, Expander A sends a discover command to Expander B. When the device discovery in Expander B is completed, send a discover command completion flag to Expander A. S30. Expander A retrieves a bit in the discover response, that is, the flag bit set in S20. When it is set to 1, it means that the retrieval of the devices connected to Expander B is completed, and a broadcast command is sent to the HBA. S40. After receiving the broadcast command, the HBA sends a discover command to Expander A to obtain the information of the devices connected to Expander A. Expander A is the first-level Expander, and at this time, it has obtained the information of all the connected devices at levels below it. Expander A returns a discover response to the HBA, and this discover response includes the device information in the entire topology. S50. Complete the re - establishment of the device table.

2. The method for constructing a device table in the cascaded state of the SAS Expander according to claim 1, wherein In S10, there is no device change in the Expanders below Expander B, and there is no need to re - obtain the information of the devices connected to the lower level.

Citation Information

Patent Citations

  • Method for fixing mapping relationships between disk slot position numbers and disk identifiers

    CN107239231A

  • Hard disk backboard, hard disk control method and server

    CN109976817A