SAS expander and arbitration method and device thereof, and SAS transmission subsystem
By introducing a cascading priority management module into the SAS expander, high priority is set for channel requests in the downstream port direction, which solves the problem of uneven read and write performance in the multi-level SAS expander cascade topology and achieves a more balanced Hard disk array read and write performance.
Patent Information
- Application Number
- CN202410868275.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-07-01
AI Technical Summary
In a multi-level SAS expander cascade topology connection, the SAS host's read and write performance for all hard disks gradually decreases, resulting in uneven read and write performance. The existing LRU arbitration fairness mechanism cannot effectively guarantee equal opportunities in a multi-level cascade scenario. .
By introducing a cascading priority management module into the SAS expander, the application type of the expansion port is determined and a high priority is set for the access request in the downstream port direction to ensure that it gets the opportunity first in the link layer arbitration, thereby improving the performance of the hard disk array. Random read and write performance.
It effectively improves the read and write performance balance of the SAS host to the hard disk array, ensures that access requests in the downstream port direction are given priority to participate in link layer arbitration, and improves the read and write performance imbalance problem in the multi-level SAS expander cascade topology.
Smart Images

Figure CN118427129B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of SAS expanders, and in particular to a SAS expander and an arbitration method and device thereof, and a SAS transmission subsystem. Background Art
[0002] Based on the requirements of high performance, high reliability, large capacity and manageability, storage systems usually adopt SAS (Serial Attached SCSI) storage architecture, also known as Serial SCSI (Small Computer StorgeInterface) architecture, which mainly includes processor, SAS HBA (SAS Host Bus Adapter), SAS expander, hard disk group, etc. Please refer to Figure 1 , Figure 1 The figure is a schematic diagram of the structure of a typical SAS storage system. The storage system adopts a multi-level SAS expander cascade topology connection, connected to a large number of hard disks, forming a large-capacity hard disk array, in which the SAS expander is a key chip in the hard disk array.
[0003] The function of SAS expander is to build SAS transmission subsystem to expand SAS interface, which is used to connect more hosts and more SAS hard disks. SAS expander has different expansion ports, including upstream port, downstream port and hard disk port, depending on the type of device connected. Figure 2 , Figure 2 The following is a schematic diagram of the structure of another typical SAS storage system. Before starting the business operation, the SAS host and the SAS hard disk must use the OPEN command (OPEN Address Frame) to establish a communication link between the SAS host, the SAS expander group and the SAS hard disk. For example, when the SAS host writes data to the SAS hard disk, the SAS host first uses the OPEN command to initiate the establishment of a communication link between the SAS host, the SAS expander and the SAS hard disk, and then the SAS host sends a data write command and processes the corresponding data write operation.
[0004] According to the SAS protocol, when processing the received OPEN command, if the SAS expander has received multiple OPEN commands, the SAS expander should use the LRU (Least-recently used) arbitration fairness mechanism to perform link layer arbitration on the path requests corresponding to multiple OPEN commands, so as to select an OPEN command to establish a communication link. When the LRU arbitration fairness mechanism of the SAS protocol is adopted, all hard disk ports and downstream ports under the same level SAS expander have equal opportunities to establish a communication link with the SAS host. Therefore, in the application scenario of a single-level SAS expander, the LRU arbitration fairness mechanism of the SAS protocol is fair and reasonable. However, in the topological connection of a multi-level SAS expander cascade, the opportunity for all hard disk ports under two adjacent levels of SAS expanders to establish a communication link with the SAS host is not equal, but decreases step by step with the increase in the number of levels. This causes the read and write performance of the SAS host to all hard disks to decrease step by step, showing an imbalance in read and write performance. Summary of the invention
[0005] The purpose of the present application is to provide a SAS expander and an arbitration method and device thereof, and a SAS transmission subsystem, so that a path request in the downstream port direction obtains a high arbitration priority before participating in link layer arbitration, thereby enabling such path requests to have a priority opportunity to participate in link layer arbitration, thereby improving the imbalance of random reading and writing of a SAS host to a hard disk array.
[0006] In order to solve the above technical problems, the present application provides an arbitration method for a SAS expander, comprising:
[0007] When receiving a path request sent by the expansion port of the SAS expander, the ECM determines the application type of the expansion port; the application type includes an upstream port, a hard disk port, and a downstream port;
[0008] The ECM determines the communication direction of the path request based on the application type of the expansion port;
[0009] If the communication direction is the downlink port direction, the ECM sets the arbitration priority in the path request to a high priority;
[0010] If the communication direction is not the downlink port direction, the ECM keeps the arbitration priority in the path request unchanged;
[0011] The ECM performs link layer arbitration on the path requests that have undergone arbitration priority adjustment or whose arbitration priority remains unchanged, and establishes a communication link;
[0012] The downstream port direction indicates that the path request comes from the downstream port of the SAS expander or the destination direction of the path request is the downstream port of the SAS expander.
[0013] As an example, determining the application type of the expansion port includes:
[0014] Determining identification information of the expansion port;
[0015] Determine the application type of the extended port based on the identification information and a preset port application type table;
[0016] The preset port application type table is used to record the correspondence between the identification information of all expansion ports in the SAS expander and the application type.
[0017] As an example, determining the application type of the expansion port includes:
[0018] The application type of the extended port is obtained from the access request, wherein the access request is generated based on the application type of the pre-configured extended port and an OPEN command received by the extended port.
[0019] As an example, determining the communication direction of the path request based on the application type of the expansion port includes:
[0020] If the application type of the extended port is a downstream port, determining that the communication direction of the path request is a downstream port direction;
[0021] If the application type of the expansion port is a hard disk port, determining that the communication direction of the path request is a non-downstream port direction;
[0022] If the application type of the extended port is an uplink port, determining the destination direction of the path request;
[0023] If the destination direction of the path request is the hard disk port of the SAS expander, determining that the communication direction of the path request is a non-downstream port direction;
[0024] If the destination direction of the path request is the downstream port of the SAS expander, then the communication direction of the path request is determined to be the downstream port direction.
[0025] As an example, determining the destination direction of the path request includes:
[0026] Determining a SAS destination address in the access request;
[0027] The destination direction of the access request is determined based on the SAS destination address and a SAS address routing table.
[0028] As an example, before link layer arbitration is performed on a path request whose arbitration priority has been adjusted or whose arbitration priority remains unchanged, the following steps are further included:
[0029] The path request with the arbitration priority adjusted or unchanged is saved in the path request table;
[0030] Perform link layer arbitration on path requests that have undergone arbitration priority adjustment or whose arbitration priority remains unchanged, including:
[0031] Link layer arbitration is performed on the path requests in the path request table.
[0032] As an example, before the ECM determines the application type of the expansion port, the process further includes:
[0033] Determine whether the cascade priority function is enabled;
[0034] If yes, proceed to the step of determining the application type of the expansion port;
[0035] Otherwise, link layer arbitration is performed on the path request.
[0036] As an example, determining whether the cascade priority function is enabled includes:
[0037] Determining a function configuration value in a preset enable register in the ECM;
[0038] If the function configuration value is the enabled preset value, it is determined that the cascade priority function is enabled;
[0039] If the function configuration value is a closed preset value, it is determined that the cascade priority function is closed.
[0040] As an example, the process of setting the function configuration value includes:
[0041] When receiving the cascade priority function enable command, the CPU of the SAS expander sets the function configuration value of the preset enable register to the enable preset value;
[0042] When a cascade priority function shutdown command is received, the function configuration value of the preset enable register is set to the shutdown preset value.
[0043] As an example, the process of determining the function configuration value includes:
[0044] The CPU of the SAS expander determines the cascade level of the SAS expander;
[0045] If the cascade number of the SAS expander is not less than 2, setting the function configuration value of the preset enable register to the enable preset value;
[0046] If the cascade level of the SAS expander is 1, the function configuration value of the preset enable register is set to the shutdown preset value.
[0047] As an example, determining the cascade level of the SAS expander includes:
[0048] Determine the communication distance between the SAS expander and the SAS host;
[0049] The cascade level of the SAS expander is determined based on the communication distance.
[0050] In order to solve the above technical problems, the present application also provides an arbitration device of a SAS expander, comprising:
[0051] A cascade priority management module, configured to determine the application type of the expansion port upon receiving a path request sent by the expansion port of the SAS expander; the application type includes an upstream port, a hard disk port, and a downstream port; determine the communication direction of the path request based on the application type of the expansion port; if the communication direction is a downstream port direction, set the arbitration priority in the path request to a high priority; if the communication direction is a non-downstream port direction, keep the arbitration priority in the path request unchanged;
[0052] The downstream port direction indicates that the path request comes from the downstream port of the SAS expander or the destination direction of the path request is the downstream port of the SAS expander;
[0053] The ECM core functional module is used to perform link layer arbitration on path requests that have undergone arbitration priority adjustment or whose arbitration priority remains unchanged, and to establish a communication link.
[0054] To solve the above technical problems, the present application also provides a SAS expander, including:
[0055] An arbitration device as described above;
[0056] A plurality of expansion ports are used for generating path requests based on an OPEN command when receiving the OPEN command, and sending the path requests to the arbitration device.
[0057] In order to solve the above technical problems, the present application also provides a SAS transmission subsystem, including:
[0058] A first-level SAS expander, a second-level SAS expander, and finally an N-th-level SAS expander connected in sequence, wherein the first-level SAS expander is connected to a SAS host, N is an integer not less than 2, and i is a positive integer less than N;
[0059] The first-level SAS expander, the second-level SAS expander, and up to the N-th-level SAS expander are all SAS expanders as described above.
[0060] The present application provides an arbitration method for a SAS expander, when receiving a path request sent by an expansion interface of a SAS expander, the ECM determines the application type of the expansion interface; if it is determined based on the application type of the expansion interface that the path request comes from the downstream port of the SAS expander or the destination direction of the path request is the downstream port of the SAS expander, the arbitration priority in the path request is set to a high priority, otherwise, the arbitration priority in the path request is kept unchanged, and the ECM performs link layer arbitration on the path request that has undergone arbitration priority adjustment or unchanged arbitration priority. It can be seen that this scheme enables the path request in the downstream port direction to obtain a high priority of arbitration before participating in link layer arbitration, thereby enabling such path requests to have priority in participating in link layer arbitration, thereby improving the imbalance of random reading and writing of the SAS host to the hard disk array.
[0061] The present application also provides an arbitration device for a SAS expander, a SAS expander and a SAS transmission subsystem, which have the same beneficial effects as the arbitration method for the SAS expander mentioned above. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the prior art and the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0063] Figure 1 It is a schematic diagram of the structure of a typical SAS storage system;
[0064] Figure 2 It is a structural diagram of another typical SAS storage system;
[0065] Figure 3 A schematic diagram of an expansion port of a SAS expander provided in this application;
[0066] Figure 4 A schematic diagram of operation commands and responses between a SAS host and a SAS hard disk provided in this application;
[0067] Figure 5 A schematic diagram of a process of establishing a SAS communication link initiated by a SAS host;
[0068] Figure 6 A schematic diagram of a process of establishing a SAS communication link initiated by a SAS target device;
[0069] Figure 7 A schematic diagram of the connection topology of a single-stage SAS expander;
[0070] Figure 8 A schematic diagram of a connection topology of a multi-stage SAS expander cascade;
[0071] Fig. 9 A schematic diagram of LRU arbitration for a multi-stage SAS expander;
[0072] Fig.10 A process flow chart of an arbitration method for a SAS expander provided in the present application;
[0073] Fig.11 An example schematic diagram of an LRU arbitration fairness mechanism in a SAS expander;
[0074] Fig.12 A schematic diagram of an application of cascade priority management in multi-level SAS expander cascading provided by the present application;
[0075] Fig.13 A process flow chart of another arbitration method for a SAS expander provided by the present application;
[0076] Fig.14 A schematic diagram of the structure of an arbitration device of a SAS expander in the prior art;
[0077] Fig.15 A schematic diagram of the structure of an arbitration device of a SAS expander provided in the present application;
[0078] Fig.16 A schematic diagram of the structure of a SAS transmission subsystem provided in this application. DETAILED DESCRIPTION
[0079] The core of the present application is to provide a SAS expander and its arbitration method, device and SAS transmission subsystem, so that the path request in the downstream port direction obtains a high priority of arbitration before participating in the link layer arbitration, thereby making such path request have priority to participate in the link layer arbitration, thereby improving the imbalance of random reading and writing of the SAS host to the hard disk array.
[0080] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0081] Please refer to Figure 3 , Figure 3A schematic diagram of an expansion port of a SAS expander provided in this application. In this application, the SAS expander includes multiple expansion interfaces, which are divided into three categories, namely:
[0082] Uplink expansion port: referred to as the uplink port in this application, used to connect to a SAS host or an upper-level SAS expander;
[0083] Downstream expansion port: referred to as downstream port, used to connect to the next-level SAS expander;
[0084] Hard disk expansion port: referred to as hard disk port, used to connect to SAS hard disk.
[0085] In the storage system, according to business requirements, the SAS host will send SCSI commands, task management functions, and data write operations to the SAS hard disk, and the SAS hard disk will correspondingly send read data, write data requests, service responses, and other operation responses to the SAS host. Figure 4 As shown, Figure 4 A schematic diagram of operation commands and responses between a SAS host and a SAS hard disk provided in the present application.
[0086] Before starting the service operation, the SAS host and the SAS hard disk must use the OPEN command to establish a communication link between the SAS host, the SAS expander group and the SAS hard disk. Figure 5 and Figure 6 , Figure 5 The figure is a schematic diagram of the process of establishing a SAS communication link initiated by a SAS host. Figure 6 The diagrams are schematic diagrams of the process of establishing a SAS communication link initiated by a SAS target device. The AIP in these two figures represents a response signal. The expander group includes a SAS expander-1 and a SAS expander-n.
[0087] exist Figure 6 During the SAS communication link establishment process, the main functions of the SAS expander include:
[0088] 1) Receive the OPEN command from the hard disk port or downstream port;
[0089] 2) Establish a path between the upstream port and the downstream port or the hard disk port according to the received OPEN command and the SAS address routing table;
[0090] 3) Forward the received OPEN command from the corresponding upstream port.
[0091] When the SAS expander receives multiple OPEN commands, it uses the LRU arbitration fairness mechanism to perform link layer arbitration on the path requests of multiple OPEN commands, thereby selecting an OPEN command to perform as follows: Figure 5 or Figure 6 The SAS communication link is established as shown.
[0092] Please refer to Figure 7 , Figure 7 The figure is a connection topology diagram of a single-stage SAS expander.
[0093] In the topological connection of a single-stage SAS expander, the SAS expander only has an upstream port and a hard disk port. According to the LRU arbitration fairness mechanism of the SAS protocol, each hard disk has an equal opportunity to establish a communication link with the SAS host, and each OPEN command can be processed fairly and promptly, which makes the SAS host have balanced read and write performance for all hard disks. Therefore, in the application scenario of a single-stage SAS expander, the LRU arbitration fairness mechanism of the SAS protocol is fair and reasonable.
[0094] Please refer to Figure 8 , Figure 8 The figure is a schematic diagram of a connection topology of a multi-stage SAS expander cascade.
[0095] In the multi-level SAS expander cascade topology, the SAS expander includes not only upstream ports and hard disk ports, but also downstream ports. According to the LRU arbitration fairness mechanism of the SAS protocol, under the same level of SAS expander, all hard disk ports and downstream ports have equal opportunities to establish communication links with the SAS host. However, the opportunities for all hard disk ports under two adjacent levels of SAS expanders to establish communication links with the SAS host are not equal, but decrease with the increase of the level, which causes the SAS host's read and write performance of all hard disks to decrease step by step and the performance is unbalanced.
[0096] by Figure 8 Take this as an example, the specific analysis is as follows:
[0097] 1) On SAS expander-1, one upstream port is connected to the SAS host, n hard disk ports L_1.1 are connected to n hard disks T_1.1 to T_1.n, and four downstream ports L_1.2 are connected to SAS expander-2; therefore, the probability (theoretical data) of the hard disk ports and downstream ports of SAS expander-1 establishing a communication link is as follows:
[0098] Each directly connected hard disk under L_1.1: 1 / Σ(n+4);
[0099] Each downstream port under L_1.2: 1 / Σ(n+4);
[0100] 2) On SAS expander-2, m hard disk ports L_2.1 are connected to m hard disks T_2.1 to T_2.m, and 4 downstream ports L_2.2 are connected to SAS expander-N; therefore, the probability (theoretical data) of establishing a communication link between the hard disk ports and downstream ports on SAS expander-2 is as follows:
[0101] Each directly connected hard disk under L_2.1: 1 / Σ(n+4) * (4 / Σ(m+4));
[0102] Each downstream port under L_2.2: 1 / Σ(n+4) * (4 / Σ(m+4)) .
[0103] 3) On SAS expander-N, k hard disk ports L_N.1 are connected to k hard disks T_N.1~T_N.k; therefore, the probability (theoretical data) of hard disk ports on SAS expander-N establishing a communication link is as follows:
[0104] Each directly connected hard disk under L_N.1: 1 / Σ(n+4) * (4 / Σ(m+4)) * (4 / k).
[0105] 4) Comparing the probability values of each level of direct-connected hard disks in 1) to 3) above to establish a communication link, it can be seen that in actual multi-level cascade applications, compared with the direct-connected hard disks on the nth level SAS expander, the probability of the direct-connected hard disks on the n+1th level SAS expander to establish a communication link is lower, showing obvious imbalance. For example, Figure 8 In the example, when n=m=k=25, the probability (theoretical data) of establishing a communication link between the directly connected hard disk and each level of SAS expander is as follows:
[0106] Each directly connected hard disk under L_1.1: 1 / 29;
[0107] Each directly connected hard disk under L_2.1: 1 / 29 * 4 / 29;
[0108] Each directly connected hard disk under L_N.1: 1 / 29 * 4 / 29 * 4 / 25.
[0109] In addition, experimental tests show that in a topology connection with multi-level SAS expanders cascaded, the read and write performance of the SAS host for all hard disks not only decreases level by level, but also presents a problem of unbalanced read and write performance; especially when the business layer of the storage system is not specially optimized, the read and write performance of the two adjacent levels is severely degraded.
[0110] In summary, the LRU arbitration fairness mechanism only defines the arbitration algorithm within a single-stage SAS expander and does not consider the multi-stage cascade situation; therefore, the LRU arbitration fairness mechanism only ensures the balance of the read and write performance of each hard disk by the SAS host in a single-stage SAS expander.
[0111] In the connection topology of multi-level SAS expander cascade, the LRU arbitration fairness mechanism runs independently and asynchronously in each level of SAS expander; between the upper and lower levels of SAS expanders, the AWT (Arbitration Waiting Time) parameter is passed level by level through the OPEN command for the LRU arbitration algorithm, without a coordination mechanism and cannot be adjusted with each other. Therefore, the arbitration process has the following obvious characteristics:
[0112] An OPEN command, from the source address to the destination address, participates in the competition and arbitration of the local LRU arbitration fairness algorithm in the SAS expanders along the way. Therefore, this is an arbitration mechanism that runs asynchronously, competes locally, and is passed step by step. It is not inherently globally fair and balanced. When arbitration competition occurs, arbitration unfairness and imbalance will occur.
[0113] For example, Fig. 9 For example, Fig. 9 The figure is a schematic diagram of LRU arbitration for a multi-level SAS expander. At a certain moment, AWT_T2.3=9 and AWT_T1.3=3, which indicates that hard disk T2.3 initiates the OPEN command before hard disk T1.3 and should establish a communication link on SAS expander-1 before hard disk T1.3. However, when SAS expander-1 performs LRU arbitration before SAS expander-2, the OPEN from hard disk T2.3 has not yet reached SAS expander-1, so hard disk T1.3 will win the arbitration; only when SAS expander-2 performs LRU arbitration before SAS expander-1, hard disk T2.3 can participate in LRU arbitration with hard disk T1.3 on SAS expander-1 and win the arbitration. In other words, the opportunities for directly connected hard disks under two adjacent levels of SAS expanders to obtain communication links with the SAS host are not equal, but decrease step by step.
[0114] Please refer to Fig.10 , Fig.10 A process flow chart of an arbitration method for a SAS expander provided in the present application, the arbitration method comprising:
[0115] S11: upon receiving a path request sent by an expansion port of a SAS expander, determining an application type of the expansion port; the application type includes an upstream port, a hard disk port, and a downstream port;
[0116] S12: Determine the communication direction of the path request based on the application type of the extended port;
[0117] S13: If the communication direction is the downlink port direction, the arbitration priority in the path request is set to a high priority;
[0118] S14: If the communication direction is not the downlink port direction, the arbitration priority in the path request is kept unchanged;
[0119] S15: performing link layer arbitration on the path request whose arbitration priority has been adjusted or whose arbitration priority remains unchanged, and establishing a communication link;
[0120] The downstream port direction indicates that the path request comes from the downstream port of the SAS expander or the destination direction of the path request is the downstream port of the SAS expander.
[0121] It should be noted that the present application adds a cascade priority management module (Cascade Priority Manager, CPM) in ECM (Expander Connection Manager), wherein CPM executes steps S11-S14, which is also called cascade priority processing, and the core function module in ECM executes step S15. In practical applications, ECM can be implemented by FPGA (Field Programmable Gate Array) or ASIC (Application Specific Integrated Circuit).
[0122] It should also be noted that in this application, when performing link layer arbitration on a path request, an LRU arbitration fairness mechanism is used for link layer arbitration. Fig.11 , Fig.11 The figure is an example diagram of an LRU arbitration fairness mechanism in a SAS expander. In the SAS protocol, the LRU arbitration fairness mechanism is as follows:
[0123] 1) Each SAS port or expansion port has an AWT timer. The SAS port here refers to the SAS interface on the SAS host or SAS hard disk.
[0124] 2) When the SAS port sends an OPEN command, the SAS port starts the AWT timer; the initial value of the AWT timer is usually 0, but it is also allowed to be non-zero.
[0125] 3) In the SAS expander, when expansion port A receives an OPEN command, it takes the AWT value from the received OPEN command and sets it to the AWT timer of expansion port A, and starts the AWT timer of expansion port A.
[0126] 4) Expansion port A sends a "Request Path request" (REQ) to the ECM of the SAS expander, requesting to establish a connection path to the SAS hard disk. The path request contains at least parameters such as priority identifier, AWT value, source SAS address, and destination SAS address. These parameters come from the received OPEN command.
[0127] 5) At a certain moment, according to the LRU arbitration fairness mechanism, ECM first performs link layer arbitration on all current path requests, that is, ECM selects path requests with high priority, large AWT value, and large source SAS address value from all path requests, and then enters the communication link establishment process. Fig.11 This is an example of LRU arbitration. In the case of the same priority, REQ-3 with the largest AWT value wins the LRU arbitration.
[0128] 6) During the communication link establishment process, based on the routing selection result, the SAS expander will select an expansion port B and instruct expansion port B to forward the OPEN command received from expansion port A, where the AWT field of the OPEN command is set to the current value of the AWT timer of expansion port A. Fig.11 In the example shown in FIG. 1 , after REQ-3 wins the LRU arbitration, the SAS expander will establish a connection path between expansion port A.3 and expansion port B, and forward the OPEN-3 command from expansion port B.
[0129] Considering that the path request includes a priority identifier, the priority identifier is used to characterize the arbitration priority of the path request. In order to increase the limited opportunity for the path request in the downstream direction to participate in the link layer arbitration and establish a communication link, the present application automatically sets a high priority for the path request of the expansion port in the downstream direction based on the LRU arbitration fairness mechanism.
[0130] In order to facilitate the determination of the communication direction of sending the access request, in the present application, each expansion port in the SAS expander has its one-to-one corresponding application type, where the application type includes an upstream port, a downstream port, and a hard disk port, and the expansion port can be any port of the SAS expander. Then the communication direction of the access request is determined based on the application type of the expansion port. Among them, the communication direction includes a downstream port direction and a non-downstream port direction, and the downstream port direction refers to the downstream port of the access request coming from the SAS expander or the destination direction of the access request is the downstream port of the SAS expander; the non-downstream port direction refers to the upstream port of the hard disk port of the SAS expander when the access request comes from the hard disk port or the destination direction of the access request is the hard disk port of the SAS expander.
[0131] If the communication direction is the downlink port direction, the arbitration priority in the path request is set to high priority, that is, the priority flag is set to high; if the communication direction is not the downlink port direction, the arbitration priority in the path request is kept unchanged.
[0132] Finally, the CPM sends the path request with adjusted arbitration priority or unchanged arbitration priority to the ECM core function module, and the ECM core function module performs link layer arbitration on the path request with adjusted arbitration priority or unchanged arbitration priority and establishes a communication link.
[0133] Please refer to Fig.12 , Fig.12 A schematic diagram of the application of cascade priority management in multi-level SAS expander cascading provided by the present application.
[0134] 1) At time t1, SAS expander-1 receives three OPEN commands from the upstream port, requesting to establish communication links with T1.1, T1.2, and T2.3, and generates three channel requests REQ-1, REQ-2, and REQ-3 respectively;
[0135] 2) These three channel requests are first processed by the CPM cascade priority, where the REQ-3 request to T2.3 under SAS expander-2 is set to a high priority; then these three REQ requests participate in the LRU link layer arbitration of SAS expander-1 at time t2. It should be noted that the CPM processing process is very fast, so time t2 is usually very close to time t1;
[0136] 3) Under the same conditions, REQ-3 will win the LRU arbitration of SAS expander-1 first, so OPEN-3 will be forwarded to the downstream port of SAS expander-1 first at time t3, recorded as OPEN-3b.
[0137] 4) After time t3, the ECM modules of SAS expander-1 and SAS expander-2 continue the LRU arbitration and communication link establishment process, which is specifically divided into:
[0138] a. After time t3, REQ-1 and REQ-2 under SAS expander-2 continue to participate in LRU arbitration;
[0139] b. After time t3, on SAS expander-2, REQ-3b triggered by OPEN-3b from SAS expander-1 participates in LRU arbitration.
[0140] 5) From the analysis of 3) and 4) above, we can see that CPM gives the OPEN command to the downstream port more opportunities to establish a communication link with the SAS host.
[0141] The present application provides an arbitration method for a SAS expander. Based on the LRU arbitration fairness mechanism of the SAS protocol, a cascade priority management module and a management method thereof are designed, so that path requests in the downstream port direction are given high priority before participating in the LRU link layer arbitration, thereby enabling such path requests to have a priority opportunity to participate in the link layer arbitration, thereby improving the imbalance of random reading and writing of the SAS host to the hard disk array.
[0142] In addition, the management method of the cascade priority management module does not change the LRU arbitration fairness mechanism in the SAS protocol and has good compatibility; in addition, the algorithm logic is concise and clear and easy to implement in circuits.
[0143] Based on the above embodiments:
[0144] As an optional embodiment, determining the application type of the expansion port includes:
[0145] Determine identification information of the expansion port;
[0146] Determine the application type of the extended port based on the identification information and the preset port application type table;
[0147] The preset port application type table is used to record the correspondence between the identification information of all expansion ports in the SAS expander and the application type.
[0148] Specifically, each expansion port has its own identification information, where the identification information can be but is not limited to the port number. In addition, a preset port application type table (Port Application Class Table, PACT) is also provided in the CPM, where the correspondence between the identification information and the application type of all expansion ports in the SAS expander is recorded, and is used to maintain the port application type of all expansion ports of the SAS expander, where the application type includes an upstream port, a downstream port, and a hard disk port. The PACT can be set by the CPU (Central Processing Unit) in the SAS expander upon receiving an application type configuration instruction for the expansion port of the SAS expander.
[0149] When a path request sent by an extended port is received, identification information of the extended port can be determined. By querying PACT based on the identification information of the extended port, the application type of the extended port can be determined.
[0150] It can be seen that this method can simply and reliably determine the application type of the expansion port, and the table lookup method is fast; there is no need to adjust the expansion port and the generation method of the path request, and the compatibility is good.
[0151] Determine the application type of the expansion port, including:
[0152] The application type of the extended port is obtained from a path request, wherein the path request is generated based on the application type of the extended port configured in advance and an OPEN command received by the extended port.
[0153] In this embodiment, an application type is configured for each expansion port of the SAS expander. Specifically, when the CPU in the SAS expander receives the application type configuration instruction of the expansion port of the SAS expander, it configures the application type of the expansion port to the expansion port. In this way, when the subsequent expansion port receives the OPEN command, it generates a path request based on the OPEN command and the application type, wherein the path request includes parameters such as the priority identifier, the AWT value, the source SAS address, and the destination SAS address, and also includes the application type of the expansion port. In this way, after receiving the path request sent by the expansion port, the CPM can determine the application type of the expansion port based on the path request.
[0154] As an optional embodiment, the ECM determines the communication direction of the path request based on the application type of the extended port, including:
[0155] If the application type of the extended port is a downstream port, the ECM determines that the communication direction of the path request is the downstream port direction;
[0156] If the application type of the expansion port is a hard disk port, the ECM determines that the communication direction of the channel request is a non-downstream port direction;
[0157] If the application type of the extended port is an uplink port, the ECM determines the destination direction of the path request;
[0158] If the destination direction of the access request is the hard disk port of the SAS expander, the ECM determines that the communication direction of the access request is the non-downstream port direction;
[0159] If the destination direction of the path request is the downstream port of the SAS expander, the ECM determines that the communication direction of the path request is the downstream port direction.
[0160] As an optional embodiment, the ECM determines the destination direction of the path request including:
[0161] Determine the SAS destination address in the access request;
[0162] The destination direction of the access request is determined based on the SAS destination address and the SAS address routing table.
[0163] Please refer to Fig.13 , Fig.13 A process flow chart of another arbitration method for a SAS expander provided in the present application.
[0164] Specifically, any access request from an extended port is first processed by the CPM cascade priority process, which includes determining the communication direction of the access request based on the application type of the extended port. The specific processing process is as follows:
[0165] 1) Determine the application type of the extended port that sends the path request by comparing PACT;
[0166] 2) If the application type of the extended port is a downstream port, the communication direction of the path request is determined to be the downstream port direction;
[0167] 3) If the application type of the expansion port is a hard disk port, determine that the communication direction of the path request is a non-downstream port direction;
[0168] 4) If the application type of the expansion port is an upstream port, determine the SAS destination address in the path request, and determine the destination direction of the path request based on the SAS destination address and the SAS address routing table. If the destination direction is the hard disk port of the SAS expander, determine the communication direction of the path request as a non-downstream port direction; if the destination direction is the downstream port of the SAS expander, determine the communication direction of the path request as a downstream port direction.
[0169] It can be seen that the application type of the expansion port and the communication direction of the path request can be determined simply and reliably in this way.
[0170] As an optional embodiment, before link layer arbitration is performed on the path request whose arbitration priority has been adjusted or whose arbitration priority remains unchanged, the method further includes:
[0171] The path request with the arbitration priority adjusted or unchanged is saved in the path request table;
[0172] Perform link layer arbitration on path requests that have undergone arbitration priority adjustment or whose arbitration priority remains unchanged, including:
[0173] Perform link layer arbitration on path requests in the path request table.
[0174] In order to facilitate the management of the path requests received by the ECM, before performing link layer arbitration on the path requests with adjusted arbitration priority or unchanged arbitration priority, the CPM will save the path requests with adjusted arbitration priority or unchanged arbitration priority in the path request table in the order of reception. That is, all path requests from the expansion port are stored in the path request table. In this way, link layer arbitration can be performed on all path requests saved in the path request table later.
[0175] As an optional embodiment, before the ECM determines the application type of the expansion port, the method further includes:
[0176] Determine whether the cascade priority function is enabled;
[0177] If yes, the process proceeds to the step of determining the application type of the expansion port, that is, performing cascade priority management, and then performing link layer arbitration;
[0178] Otherwise, the ECM performs link layer arbitration for the path request.
[0179] Specifically, considering the compatibility with the LRU arbitration fairness mechanism of the SAS protocol, whether it is a single-stage SAS expander or a multi-stage SAS expander cascade topology connection application, you can choose to turn on or off the cascade priority function of the SAS expander. The initial state of the cascade priority function can be set, and an example is: the cascade priority function is turned on by default.
[0180] When the ECM is working, it will determine whether the cascade priority function is enabled. If it is enabled, it will then enter the step of determining the application type of the expansion port to implement cascade priority management. Otherwise, it will receive the path request message from each expansion port of the SAS expander at any time, and add it to the path request table in a timely and sequential manner, and directly perform link layer arbitration in sequence with all the path requests in the current path request table, so as to implement the LRU defined in the SAS standard.
[0181] As an optional embodiment, determining whether the cascade priority function is enabled includes:
[0182] Determine the function configuration value in the preset enable register in the ECM;
[0183] If the function configuration value is the enabled preset value, the cascade priority function is determined to be enabled;
[0184] If the function configuration value is the closed preset value, the cascade priority function is determined to be closed.
[0185] Specifically, a preset enable register can be set in the ECM, and the preset enable register can be configured by the CPU in the SAS expander. The ECM can determine whether the cascade priority function is enabled by judging whether the function configuration value in the preset enable register is an enabled preset value or a disabled preset value.
[0186] It can be seen that this method can simply and reliably determine whether the cascade priority function is enabled.
[0187] As an optional embodiment, the process of setting the function configuration value includes:
[0188] When the CPU of the SAS expander receives the cascade priority function enable command, it sets the function configuration value of the preset enable register to the enable preset value;
[0189] When a cascade priority function shutdown command is received, the function configuration value of the preset enable register is set to a shutdown preset value.
[0190] In actual applications, the function configuration value of the preset enable register in the ECM can be configured by the user. Specifically, when the user sends a cascade priority function enable command to the CPU, the CPU sets the function configuration value of the preset enable register to the enable preset value based on the cascade priority function enable command. When the user sends a cascade priority function disable command to the CPU, the CPU sets the function configuration value of the preset enable register to the disable preset value based on the cascade priority function disable command. It can be seen that in this way, the user can configure the function configuration value of the preset enable register according to the needs, and then indirectly set whether the cascade priority function of the SAS expander is turned on.
[0191] As an optional embodiment, the process of determining the function configuration value includes:
[0192] The CPU of the SAS expander determines the cascade level of the SAS expander;
[0193] If the cascade number of the SAS expander is not less than 2, the function configuration value of the preset enable register is set to the enable preset value;
[0194] If the cascade level of the SAS expander is 1, the function configuration value of the preset enable register is set to a closed preset value.
[0195] Specifically, when the SAS expander is multi-level in the SAS transmission subsystem, the read and write performance of the SAS host to all hard disks will gradually decrease, showing an imbalance in read and write performance. When the SAS expander is single-level in the SAS transmission subsystem, the LRU arbitration fairness mechanism of the SAS protocol is fair and reasonable.
[0196] Based on this, in the present application, the CPU of the SAS expander can determine the cascade number of the SAS expander; if the cascade number of the SAS expander is not less than 2, the function configuration value of the preset enable register is set to the on preset value; if the cascade number of the SAS expander is 1, the function configuration value of the preset enable register is set to the off preset value.
[0197] Different from the user configuration method in the above-mentioned embodiment, in this embodiment, the CPU will autonomously determine whether the cascade priority function is enabled through the discovery mechanism of the SAS.
[0198] It can be seen that the function configuration value of the preset enable register can be configured without user participation in this process, that is, whether to enable the cascade priority function can be determined autonomously, and the degree of automation is high.
[0199] As an optional embodiment, determining the cascade level of the SAS expander includes:
[0200] Determine the communication distance between the SAS expander and the SAS host;
[0201] The number of cascade levels of SAS expanders is determined based on the communication distance.
[0202] Considering that the higher the level of the SAS expander, the farther the communication distance, therefore, in order to determine the cascade level of the SAS expander, the communication distance between the SAS expander and the SAS host can be determined first, wherein it should be noted that the communication distance here refers to the transmission distance of data during data communication between the SAS expander and the SAS host. In practical applications, considering that the communication distance is positively correlated with the communication duration, the communication distance can be characterized by the communication time. After determining the communication distance, the cascade level of the SAS expander can be determined based on the communication distance and the preset communication distance-cascade level correspondence. In this way, the cascade level of the SAS expander can be automatically determined, thereby improving the user experience.
[0203] In summary, the random read and write performance of the storage system mainly depends on the hard disk, the SAS transmission subsystem composed of the SAS expander group, and the SAS HBA; therefore, improving the random read and write performance of the SAS expander group will also improve the data access performance of the storage system, thereby improving the storage capacity (i.e. storage power) of the storage system, which is conducive to promoting the in-depth development of big data and cloud computing.
[0204] Please refer to Fig.14 and Fig.15 , Fig.14 is a structural schematic diagram of an arbitration device of a SAS expander in the prior art, Fig.15 A schematic diagram of the structure of an arbitration device of a SAS expander provided in the present application.
[0205] The arbitration device comprises:
[0206] The cascade priority management module 151 is used to determine the application type of the expansion port when receiving a path request sent by the expansion port of the SAS expander; the application type includes an upstream port, a hard disk port, and a downstream port; determine the communication direction of the path request based on the application type of the expansion port; if the communication direction is the downstream port direction, set the arbitration priority in the path request to a high priority; if the communication direction is not the downstream port direction, keep the arbitration priority in the path request unchanged;
[0207] The downstream port direction indicates that the path request comes from the downstream port of the SAS expander or the destination direction of the path request is the downstream port of the SAS expander;
[0208] The ECM core function module 152 is used to perform link layer arbitration on the path request whose arbitration priority has been adjusted or whose arbitration priority remains unchanged.
[0209] For the introduction of the cascade priority management module 151 , please refer to the above arbitration method embodiment, and this application will not go into details here.
[0210] In addition, the ECM core function module 152 supports ECM core functions such as route mapping, link layer LRU arbitration, configuration of ECR (Expander Connectiong Router), and management of physical layer power conditions specified in the SAS standard.
[0211] The present application also provides a SAS expander, including:
[0212] An arbitration device as described above;
[0213] A plurality of expansion ports are provided, wherein the expansion ports are used to generate a path request based on the OPEN command when receiving the OPEN command, and send the path request to the arbitration device.
[0214] For the introduction of the SAS expander provided in this application, please refer to the above arbitration device embodiment, and this application will not go into details here.
[0215] Please refer to Fig.16 , Fig.16 A schematic diagram of the structure of a SAS transmission subsystem provided in the present application, the SAS transmission subsystem comprising:
[0216] A first-level SAS expander, a second-level SAS expander, and finally an N-th-level SAS expander are connected in sequence, the first-level SAS expander is connected to a SAS host, N is an integer not less than 2, and i is a positive integer less than N;
[0217] The first-level SAS expander, the second-level SAS expander, and finally the N-th-level SAS expander are all the SAS expanders described above.
[0218] Specifically, the SAS transmission subsystem is a SAS signal transmission network defined by the SAS standard, which is composed of multiple interconnected SAS expanders, including one or more first-level SAS expanders, one or more second-level SAS expanders, and up to one or more N-th-level SAS expanders connected in sequence, where N is a positive integer not less than 2; the first-level SAS expander is connected to one or more SAS hosts through one or more upstream ports, each SAS expander is connected to zero or one or more SAS hard disks through zero or one or more hard disk ports, and each SAS expander realizes the interconnection of zero or one or more SAS expanders with the upstream port of the next-level SAS expander through zero or one or more downstream ports.
[0219] For the introduction of the SAS transmission subsystem provided in this application, please refer to the above arbitration device embodiment, and this application will not go into details here.
[0220] It should be noted that, in this specification, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0221] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An arbitration method for a SAS expander, It is characterized in that include: The expander link manager ECM determines the application type of the expansion port when receiving a path request sent by the expansion port of the SAS expander; the application type includes an upstream port, a hard disk port, and a downstream port; The ECM determines the communication direction of the path request based on the application type of the expansion port; If the communication direction is the downlink port direction, the ECM sets the arbitration priority in the path request to a high priority; If the communication direction is not the downlink port direction, the ECM keeps the arbitration priority in the path request unchanged; The ECM performs link layer arbitration on the path requests that have undergone arbitration priority adjustment or whose arbitration priority remains unchanged, and establishes a communication link; The downstream port direction indicates that the path request comes from the downstream port of the SAS expander or the destination direction of the path request is the downstream port of the SAS expander.
2. The arbitration method of the SAS expander according to claim 1, It is characterized in that Determining the application type of the expansion port includes: Determining identification information of the expansion port; Determine the application type of the extended port based on the identification information and a preset port application type table; The preset port application type table is used to record the correspondence between the identification information of all expansion ports in the SAS expander and the application type.
3. The arbitration method of the SAS expander according to claim 1, It is characterized in that Determining the application type of the expansion port includes: The application type of the extended port is obtained from the access request, wherein the access request is generated based on the application type of the pre-configured extended port and an OPEN command received by the extended port.
4. The arbitration method of the SAS expander according to claim 1, It is characterized in that The ECM determines the communication direction of the path request based on the application type of the expansion port, including: If the application type of the extended port is a downstream port, the ECM determines that the communication direction of the path request is a downstream port direction; If the application type of the expansion port is a hard disk port, the ECM determines that the communication direction of the path request is a non-downstream port direction; If the application type of the extended port is an uplink port, the ECM determines the destination direction of the path request; If the destination direction of the path request is the hard disk port of the SAS expander, the ECM determines that the communication direction of the path request is a non-downstream port direction; If the destination direction of the path request is the downstream port of the SAS expander, the ECM determines that the communication direction of the path request is the downstream port direction.
5. The arbitration method of the SAS expander as claimed in claim 4, It is characterized in that The ECM determines the destination direction of the path request by: Determining a SAS destination address in the access request; The destination direction of the access request is determined based on the SAS destination address and a SAS address routing table.
6. The arbitration method of the SAS expander according to claim 1, It is characterized in that Before link layer arbitration is performed on a path request whose arbitration priority has been adjusted or whose arbitration priority remains unchanged, the following steps are also included: The path request with the arbitration priority adjusted or unchanged is saved in the path request table; Perform link layer arbitration on path requests that have undergone arbitration priority adjustment or whose arbitration priority remains unchanged, including: Link layer arbitration is performed on the path requests in the path request table.
7. The arbitration method of a SAS expander according to any one of claims 1 to 6, It is characterized in that Before the ECM determines the application type of the expansion port, the method further includes: Determine whether the cascade priority function is enabled; If yes, proceed to the step of determining the application type of the expansion port; Otherwise, link layer arbitration is performed on the path request.
8. The arbitration method of the SAS expander according to claim 7, It is characterized in that Determine whether the cascade priority function is enabled, including: Determining a function configuration value in a preset enable register in the ECM; If the function configuration value is the enabled preset value, it is determined that the cascade priority function is enabled; If the function configuration value is a closed preset value, it is determined that the cascade priority function is closed.
9. The arbitration method of the SAS expander according to claim 8, It is characterized in that The process of setting the function configuration value includes: When receiving the cascade priority function enable command, the CPU of the SAS expander sets the function configuration value of the preset enable register to the enable preset value; When a cascade priority function shutdown command is received, the function configuration value of the preset enable register is set to the shutdown preset value.
10. The arbitration method of the SAS expander according to claim 8, It is characterized in that The process of determining the function configuration value includes: The CPU of the SAS expander determines the cascade level of the SAS expander; If the cascade number of the SAS expander is not less than 2, setting the function configuration value of the preset enable register to the enable preset value; If the cascade level of the SAS expander is 1, the function configuration value of the preset enable register is set to the shutdown preset value.
11. The arbitration method of the SAS expander according to claim 10, It is characterized in that Determining the cascade level of the SAS expander includes: Determine the communication distance between the SAS expander and the SAS host; The cascade level of the SAS expander is determined based on the communication distance.
12. An arbitration device for a SAS expander, It is characterized in that include: A cascade priority management module, configured to determine, upon receiving a path request sent by an expansion port of the SAS expander, an application type of the expansion port; the application type includes an upstream port, a hard disk port, and a downstream port; determine a communication direction of the path request based on the application type of the expansion port; if the communication direction is a downstream port direction, set the arbitration priority in the path request to a high priority; If the communication direction is not the downlink port direction, the arbitration priority in the path request is kept unchanged; The downstream port direction indicates that the path request comes from the downstream port of the SAS expander or the destination direction of the path request is the downstream port of the SAS expander; The expander link manager ECM core functional module is used to perform link layer arbitration on path requests that have undergone arbitration priority adjustment or whose arbitration priority remains unchanged, and to establish a communication link.
13. A SAS expander, It is characterized in that include: The arbitration device as claimed in claim 12; A plurality of expansion ports are used for generating path requests based on an OPEN command when receiving the OPEN command, and sending the path requests to the arbitration device.
14. A SAS transmission subsystem, It is characterized in that include: A first-level SAS expander, a second-level SAS expander, and finally an N-th-level SAS expander connected in sequence, wherein the first-level SAS expander is connected to a SAS host, N is an integer not less than 2, and i is a positive integer less than N; The first-level SAS expander, the second-level SAS expander, and up to the N-th-level SAS expander are all SAS expanders as claimed in claim 13.
