[go: up one dir, main page]

CN114579489B - Dual-mode SATA (Serial advanced technology attachment) transmission layer optimization method - Google Patents

Dual-mode SATA (Serial advanced technology attachment) transmission layer optimization method Download PDF

Info

Publication number
CN114579489B
CN114579489B CN202210252714.6A CN202210252714A CN114579489B CN 114579489 B CN114579489 B CN 114579489B CN 202210252714 A CN202210252714 A CN 202210252714A CN 114579489 B CN114579489 B CN 114579489B
Authority
CN
China
Prior art keywords
sata
state
transport layer
state machine
stp
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
CN202210252714.6A
Other languages
Chinese (zh)
Other versions
CN114579489A (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.)
Wuxi Zhongxing Microsystem Technology Co ltd
Original Assignee
Wuxi Zhongxing Microsystem 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 Wuxi Zhongxing Microsystem Technology Co ltd filed Critical Wuxi Zhongxing Microsystem Technology Co ltd
Priority to CN202210252714.6A priority Critical patent/CN114579489B/en
Publication of CN114579489A publication Critical patent/CN114579489A/en
Application granted granted Critical
Publication of CN114579489B publication Critical patent/CN114579489B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • G06F13/287Multiplexed DMA
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Communication Control (AREA)
  • Information Transfer Systems (AREA)

Abstract

The invention provides a dual-mode SATA (Serial advanced technology attachment) transmission layer optimization method, which comprises the steps of determining whether the current mode of a SAS (serial attached small computer system interface) controller is an STP (standard transfer protocol) mode when a SATA transmission layer state machine is in an HT _ HostIdle state, and jumping the SATA transmission layer state machine to a target state corresponding to a predefined event based on the current mode and the predefined event of the SAS controller; when the SATA transport layer state machine is in an HT _ DS _ FIS state, if the data direction is a writing direction and the auto active bit is set, jumping the SATA transport layer state machine to an HT _ HostIdle state; when the SATA transport layer state machine receives the DMA active FIS and is in the HT _ DMAOTrans1 state, the SATA transport layer state machine is directly jumped to the HT _ HostIdle state. The invention avoids the state abnormity of the SAS controller in the STP scene of concurrent control, automatically selects the working mode of the transmission layer through the link negotiation result reported by the link layer, and can support the two scenes of direct connection of STP and SATA equipment by using one set of design.

Description

Dual-mode SATA (Serial advanced technology attachment) transmission layer optimization method
Technical Field
The invention belongs to the technical field of disk connection, and particularly relates to a dual-mode SATA (serial advanced technology attachment) transmission layer optimization method.
Background
SATA (Serial ATA) is a high-speed Serial bus, which adopts a Serial differential signal connection mode and a point-to-point transmission mode, has a built-in data/command verification unit, has strong error correction capability, supports noise filtering and hot plugging, has the characteristics of a small number of pins, high data transmission rate, high reliability, good compatibility, and the like, and is widely used in the industry for a main I/O interface between a storage device and a host. The SATA topology is point-to-point, where a host can support multiple devices through port multiplexer links, each device occupies a hundred percent of the bus bandwidth, and a link error of one device does not affect the links of other devices.
SAS is a new generation SCSI technology, and like SATA technology, it also employs a serial interface to achieve higher transmission speeds. Meanwhile, the SAS design considers the downward compatibility of SATA technology, and the interconnection and data transmission between the SAS controller and SATA devices are realized by STP protocol (SATA channel protocol). STP in the SAS protocol standard is a method for carrying an SATA protocol to a SAS bottom layer (physical layer + link layer + transport layer) for transmission based on the bottom layer transport logic. The STP protocol specification defines the details of the communication technology of SAS systems and SATA devices. The transmission layer of STP is realized by adopting the transmission layer defined by SATA standard protocol as the basis and is adapted to the function of Port layer (Port layer) in SAS standard.
In a typical SAS data storage topology, a SAS controller supports large-scale disk management via one or more levels of Expander(s). The SAS Expander usually integrates STP/SATA bridge to complete the conversion from SAS protocol to SATA protocol, so as to be compatible with SATA disk device connection. Fig. 1 is a diagram of a typical STP connection for accessing SATA devices into a SAS network. An SAS controller (SAS controller) is used as an initiator of a control command and a data read-write command, is responsible for managing the topological structure of the whole storage system, sending a disk data read-write command and receiving a device response; the SAS Expander is used for expanding the topological structure of the storage system and is compatible with the connection of SATA equipment; the SATA disk storage device stores service data and accesses the SAS system.
To illustrate the problem of the SATA standard transport layer in supporting the STP application scenario of the SAS, a typical STP message interaction scenario is described by taking an FPDMA (First-Party DMA) write operation defined in the SATA standard as an example. As shown in fig. 2: the host sends an FPDMA command after initialization, and the command content is framed by an SATA transmission layer of the host end and then sent to the equipment driver; the device end adds the command into a drive execution queue after receiving the command, and then sends a response frame to the host to inform the completion of receiving the FPDMA command; the SATA transmission layer at the host end receives and analyzes the received equipment response command frame and informs the host; after the device executes the completed FPDMA command, the device sends a DMA setup FIS to the host to indicate that the received data is ready, and the host uses the contents of the FIS frame for DMA related configuration. Then the equipment end sends DMA active FIS to request the host to send data, and the SATA transmission layer of the host end receives DMA setup FIS and DMA active FIS returned by the analytic equipment and reports the DMA setup FIS and the DMA active FIS to the application layer; and starting to send data after the host configuration finishes DMA. The SATA transmission layer of the host end enters a data sending flow, data to be sent are formed into data frames and then sent, and the sending state is checked; the device end writes data into a corresponding sector of the hard disk through driving after receiving the data, and returns SetDevBits FIS to the host to inform the state after the execution is finished; the SATA transport layer at the host end receives and analyzes the received SetDevBits FIS and reports the SetDevBits FIS to the host to update the corresponding state, and informs the software to end the current process.
However, the SATA standard protocol does not fully consider support for an SAS application scenario at the beginning of its formulation, and in an STP application scenario in which a SAS controller concurrently accesses a plurality of SATA devices, a transport layer of the SATA standard protocol cannot correctly and efficiently complete a data interaction process defined in the SAS standard, resulting in data communication failure. In summary, the problems of the current typical SATA transport layer optimization method are as follows:
1. the method comprises the following steps that in the face of a scene that a single SAS controller controls a plurality of SATA disks, abnormal problems exist in concurrent control access operation;
2. the design and development cost of a transport layer is high, and two sets of logic codes need to be independently developed to support direct connection scenes of STP and SATA equipment respectively;
3. the transmission layer design compatibility is poor, one set of transmission layer design can only support one of direct connection scenes of STP and SATA equipment, and design iteration is not facilitated;
4. the transmission layer has poor design maintainability, and once the design is changed, two sets of logics of the STP and SATA direct connection scenes need to be modified simultaneously, so that the error risk is increased.
Disclosure of Invention
The invention aims to solve the problems of a typical SATA transmission layer optimization method, and provides a dual-mode SATA transmission layer optimization method which is used for realizing correct support for a SAS controller to concurrently control multiple SATA devices and meeting a dual-mode scene of direct connection of STP and SATA devices.
The dual-mode SATA transmission layer optimization method comprises the following steps:
when the SATA transport layer state machine is in an HT _ HostIdle state, determining whether the current mode of the SAS controller is an STP mode or a SATA direct connection mode, and jumping the SATA transport layer state machine to a destination state corresponding to a predefined event based on the current mode of the SAS controller and the predefined event;
when the SATA transport layer state machine is in an HT _ DS _ FIS state, if the data direction is a writing direction and an auto active bit is set, jumping the SATA transport layer state machine to the HT _ HostIdle state;
and when the SATA transport layer state machine receives DMA active FIS and is in an HT _ DMAOTrans1 state, directly jumping the SATA transport layer state machine to the HT _ HostIdle state.
Preferably, after the SATA transport layer state machine jumps from the HT _ DS _ FIS state or the HT _ DMAOTrans1 state to the HT _ host idle state, the method further includes:
and the upper layer software determines whether to transmit data to the current SATA device.
Preferably, based on a current mode of the SAS controller and a predefined event, jumping the SATA transport layer state machine to a destination state corresponding to the predefined event, further comprises:
if the current mode of the SAS controller is not STP mode and the predefined event is the presence of a request to send a command or data, jumping the SATA transport layer state machine to the HT _ DMAOTrans2 state and performing a DMA data send.
Preferably, based on the current mode of the SAS controller and a predefined event, jumping the SATA transport layer state machine to a destination state corresponding to the predefined event further comprises:
jumping the SATA transport layer state machine to an HT _ STP _ OpenReq state if a current mode of the SAS controller is an STP mode and the predefined event is the presence of a request to send a command or data; and the HT _ STP _ OpenReq state indicates the SATA transport layer state machine to communicate with a port layer and send a request for establishing a link.
Preferably, after jumping the SATA transport layer state machine to the HT _ STP _ OpenReq state, the method further includes:
if the request for establishing the link is sent completely, jumping the SATA transport layer state machine to an HT _ STP _ CoWait state; wherein the HT _ STP _ CoWait state indicates the SATA transport layer state machine to wait for the port layer to return a link establishment result.
Preferably, after jumping the SATA transport layer state machine to the HT _ STP _ OpenReq state, the method further includes:
jumping the SATA transport layer state machine to an HT _ Co _ Fail state if an abnormal error is generated when the request for establishing the link is sent; and the HT _ Co _ Fail state indicates the SATA transport layer state machine to generate a corresponding error state, reports the error state and then automatically jumps to the HT _ HostIdle state.
Preferably, after jumping the SATA transport layer state machine to the HT _ STP _ CoWait state, the method further includes:
if the port layer returns a message of successfully establishing the link, the SATA transport layer state machine is jumped to an HT _ Co _ Done state; wherein the HT _ Co _ Done state instructs the SATA transport layer state machine to perform a corresponding send control flow based on established links in response to a previous request to send a command or data.
Preferably, after jumping the SATA transport layer state machine to the HT _ STP _ CoWait state, further comprising:
and if the port layer returns a message of link establishment failure, jumping the SATA transport layer state machine to the HT _ Co _ Fail state.
Preferably, based on the current mode of the SAS controller and a predefined event, jumping the SATA transport layer state machine to a destination state corresponding to the predefined event further comprises:
and if the current mode of the SAS controller is not the STP mode and a Host to device Register FIS command needs to be sent, jumping the SATA transport layer state machine to the HT _ CmdFIS state and entering a command sending process.
Preferably, when the current mode of the SAS controller is STP mode, the SAS controller connects a plurality of SATA devices through Expander.
Compared with the prior art, the invention has the following advantages:
through the optimization of the SATA transport layer state machine, the correctness of controlling access equipment by an STP scene and the correctness and the high efficiency of concurrent control of multi-disk operation are ensured; the configuration of the working mode is automatically completed through the transmission layer, and the direct connection scene of the STP or SATA equipment is flexibly switched to be supported. When subsequent design change is carried out, only one set of logic codes needs to be modified and maintained, the problems existing in a typical SATA transmission layer optimization method are effectively solved, correct support for controlling multiple SATA devices concurrently by a single SAS controller is provided, the dual-mode scene of direct connection of STP and SATA devices is met, design and development cost and risk are reduced, and design compatibility and maintainability are enhanced.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 shows a schematic diagram of a typical STP connection of a SATA device into a SAS network according to the prior art.
FIG. 2 shows a SATA FPDMA write flow diagram according to the prior art.
Fig. 3 shows a flow diagram of FPDMA write flow for a single SAS controller controlling two SATA disks in accordance with the prior art.
FIG. 4 illustrates a dual mode SATA transport layer state machine jump diagram in accordance with the present invention.
FIG. 5 illustrates a first waveform diagram of a FPDMA write operation in a dual-mode SATA transport layer STP scenario in accordance with the present invention.
FIG. 6 illustrates a second waveform diagram of a FPDMA write operation in a dual-mode SATA transport layer STP scenario in accordance with the present invention.
FIG. 7 illustrates a third waveform diagram of a FPDMA write operation in a dual-mode SATA transport layer STP scenario in accordance with the present invention.
FIG. 8 illustrates a fourth waveform diagram for a FPDMA write operation in a dual mode SATA transport layer STP scenario in accordance with the present invention.
FIG. 9 illustrates a fifth waveform diagram for a FPDMA write operation in a dual-mode SATA transport layer STP scenario in accordance with the present invention.
Fig. 10 is a diagram showing an abnormal waveform of an FPDMA multi-disk write operation according to a typical SATA transport layer optimization method in the related art.
FIG. 11 illustrates a first waveform diagram of a FPDMA write operation of a dual mode SATA transport layer in a SATA device direct connection scenario in accordance with the present invention.
FIG. 12 illustrates a second waveform diagram of a FPDMA write operation of a dual mode SATA transport layer in a SATA device direct connection scenario in accordance with the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. 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 invention.
Fig. 3 is a schematic diagram of a flow of a single SAS controller controlling two SATA disks to perform FPDMA write, and describes a process in which one SAS controller sends FPDMA commands to SATA device 0 and SATA device 1 through the Expander, and sends data to corresponding devices after receiving DMA setup FIS and DMA active FIS returned by each device. Before the SAS controller and the SATA device communicate with each other, both the SAS controller and the SATA device need to communicate with the Expander, and perform normal communication after establishing a corresponding link connection, and the flow operation of a single SATA device is consistent with the SATA FPDMA write flow of fig. 2, so the description of establishing a link event is omitted in fig. 3.
In the scenario of fig. 3, the sequence of events of the normal process may be described as:
an event T1: the SAS controller sends an FPDMA write command to the SATA device 0 through the Expander;
event T2: the SAS controller sends an FPDMA write command to the SATA device 1 through the Expander;
event T3: the SATA device 0 sends DMA active FIS to the SAS controller through the Expander;
event T4: the SATA device 1 transmits a DMA setup FIS to the SAS controller through Expander.
However, if event T4 occurs during a period when the transport layer has not completely responded to event T3, a control access exception is caused. According to the DMA active FIS skip indication table, the DMA write operation skip indication table, and the DMA setup FIS skip indication table of the transport layer state machine specified in the SATA standard protocol shown in tables 1 to 3, the transport layer state machine skips from the Idle state (Idle state) to the HT _ DMAOTrans1 state (see item 1 in table 1) after receiving the DMA active FIS of the SATA device 0 according to the SATA standard protocol, and then skips to the HT _ DMAOTrans2 state (see item 2 in table 2) if the DMA configuration is completed. If the SATA device 1 sends a DMA setup FIS to the SAS controller (a T4 event occurs), the transport layer state machine cannot normally respond according to table 3 because it is still in the HT _ DMAOTrans2 state, that is, cannot realize a state jump for receiving the DMA setup FIS from the HT _ DMAOTrans2 state, thereby causing an access control exception.
TABLE 1
Figure BDA0003547444100000081
TABLE 2
Figure BDA0003547444100000082
TABLE 3
Figure BDA0003547444100000083
In view of this, the present invention provides a dual-mode SATA transport layer optimization method for overcoming the defects of the current typical SATA transport layer optimization method and the SATA standard protocol transport layer in SAS applications. The state machine of the original standard protocol SATA transport layer is newly added with four states of HT _ STP _ OpenReq, HT _ STP _ CoWait, HT _ Co _ Done and HT _ Co _ Fail and used for applying for establishing a link with a Port layer before sending a command or data, and subsequent sending flow operation is carried out after link establishment success information is returned, so that the accuracy of controlling access equipment by an STP scene is ensured. The three states of HT _ HostIdle, HT _ DS _ FIS and HT _ DMAOTrans1 in the state machine of the original transport layer of the SATA standard protocol are optimized and modified in part of jumping conditions, so that the accuracy and the efficiency of concurrent control of multi-disk operation are guaranteed. The transmission layer automatically completes the configuration of the working mode when the link negotiation result is reported by the link layer, and the different modes are flexibly switched to support the direct connection scene of the STP or SATA equipment.
First, the solution of the present invention requires optimization of multiple states in the SATA standard transport layer state machine. In order to enable the SATA transport layer state machine to support dual modes, on the basis of an original standard protocol SATA state machine, states of HT _ STP _ OpenReq, HT _ STP _ CoWait, HT _ Co _ Done and HT _ Co _ Fail are added. The optimization and modification of the partial state jump of HT _ HostIdle, HT _ DS _ FIS and HT _ DMAOTrans1 in the original state machine comprises the following steps:
HT (HistIdle) state jump optimization
TABLE 4
Figure BDA0003547444100000091
Table 4 shows the state jump tables before and after optimization in HT _ host idle state in a comparison form (note that, in tables 2 to 10, bold type parts indicate portions newly added on the basis of the standard SATA transport layer state definition, a deleted line part indicates a portion removed from the standard SATA transport layer state definition, and the rest is a portion inheriting the standard SATA transport layer state definition). In entries 1-6 of table 4, the HT _ HostIdle state jump condition adds an STP mode enabled/disabled determination (If STP mode disabled/enabled) to the original protocol, i.e., it is first determined whether the STP mode is enabled or disabled. When the STP mode is disabled, the current mode may be the SATA direct mode. In addition, table 4 item 7 has a new status jump branch, i.e. when there is a request to send command or data, if STP mode is not enabled, the branch is jumped from Idle status to HT _ DMAOTrans2, and then DMA data is sent. Table 4 item 8 is the branch of the new added state jump, i.e. if STP mode is enabled, the transport layer state machine jumps from Idle state to HT _ STP _ OpenReq.
2. Increasing HT _ STP _ OpenReq state
TABLE 5
Figure BDA0003547444100000101
As shown in table 5, after the transport layer state machine enters the HT _ STP _ OpenReq state, it starts to communicate with the Port layer, that is, sends a request for establishing a link, and the Port layer performs a link establishment operation according to the request. According to item 1 of table 5, the transport layer state machine jumps to the HT _ STP _ CoWait state after the transmission request is completed to wait for the result. According to item 2 of table 5, the HT _ Co _ Fail state is jumped if an abnormal error occurs halfway.
3. Increasing HT _ STP _ CoWait state
TABLE 6
Figure BDA0003547444100000102
As shown in table 6, after the transport layer state machine enters the HT _ STP _ CoWait state, the transport layer waits for the Port layer to return the result of applying for link establishment. According to item 1 of table 6, if the Port layer returns a successful link establishment, the transport layer state machine jumps to HT _ Co _ Done state; according to table 6 item 2, if a link establishment failure message is returned, a jump is made to HT _ Co _ Fail state.
4. Incrementing HT _ Co _ Done state
TABLE 7
Figure BDA0003547444100000111
As shown in table 7, after the transport layer state machine enters the HT _ Co _ Done state, the transport layer state machine enters different branches according to the previously issued command or data sending request to execute the corresponding sending control flow, and then the transport layer state machine jumps and follows the SATA protocol standard design.
5. Increasing HT _ Co _ Fail State
TABLE 8
Figure BDA0003547444100000112
As shown in table 8, after the transport layer state machine enters the HT _ Co _ Fail state, a corresponding error state is generated and reported, and then the transport layer state machine automatically jumps to the Idle state, and ends the process, as shown in item 1 of table 8.
HT _DS _FISstate jump optimization
TABLE 9
Figure BDA0003547444100000113
As shown in Table 9, the transport layer state machine enters the HT _ DS _ FIS state upon receiving the DMA setup FIS. According to the new item 4 of the optimized table 9, if the direction is write and the auto active bit is set, the state of the state machine jump destination is changed from HT _ DMAOTrans2 state defined by the original SATA protocol standard to Idle state (HT _ hostild). Then, the software determines whether to perform data transmission on the current device, but not limited to performing other operations after completing the data transmission on the current device. Because the software application can flexibly manage and control the whole transceiving process, when a plurality of equipment end scenes are controlled, the effects of flexible scheduling for accessing a plurality of equipment and correct and efficient data transmission can be achieved.
HT (r) dmaotrans1 state jump optimization
TABLE 10
Figure BDA0003547444100000121
As shown in table 10, after receiving the DMA active FIS, the transport layer state machine enters the HT _ DMAOTrans1 state, and the state machine jumps to the HT _ DMAOTrans1 state or the HT _ DMAOTrans2 state (items 1 and 2 in the deletion line part of table 10) respectively according to whether the DMA controller is configured completely, which is defined by the original SATA protocol standard, and all the states are changed to jump to the Idle state (items 1 and 2 in table 10 without deletion marks in bold). And recording and reporting the DMA active FIS content by hardware, and processing the DMA active FIS content by an application layer subsequently. Similarly to table 9, by changing table 10, it can also be determined by software whether to perform data transmission to the current device, but not limited to performing other operations after the data transmission of the current device has to be completed.
By optimizing the state machine of the SATA standard transport layer, various exceptions of the SAS controller in STP scene and concurrent control of multiple SATA are effectively solved.
FIG. 4 illustrates a transport layer related state transition segment implemented by the present invention, covering the SATA standard service scenario illustrated in FIG. 2. Under the STP mode, the jump flow of the transport layer state machine is described as follows:
1. before sending a command or data, the host applies for establishing a link:
an event T1: corresponding to entry 8 of table 4, i.e., STP mode enabled, the controller commands the layer to configure the command register to request the transport layer to issue a FPDMA write command to the SATA device;
an event T2: corresponding to item 1 in table 5, the transport layer communicates with the Port layer, i.e., sends a request for establishing a link, and waits for the Port layer to return a result of applying for establishing a link;
event T3: corresponding to item 1 of table 6, the transport layer receives the Port layer and returns a successful link establishment;
2. the Host sends a Host to device register FIS command:
event T4: corresponding to item 1 of table 7, the transport layer enters the command sending flow after the link is successfully established;
event T5: the transmission layer command is sent to finish, and the state is checked;
event T6: the transport layer checks the state to pass, and the command is successfully sent;
3. the host receives a Device to host register FIS:
event R1: a transmission layer receives frame contents sent by a device end;
an event R2: the transmission layer identifies the type of the received frame as Device to host register FIS;
event R3: the transmission layer checks the receiving state of the frame type as Device to host register FIS;
an event R4: the transmission layer successfully receives the Device to host register FIS;
4. host receiving DMA setup FIS:
event R1: a transmission layer receives frame contents sent by a device end;
event R5: the transmission layer identifies the type of the received frame as DMA setup FIS;
an event R6: corresponding to entry 4 of table 9, the transport layer successfully receives the DMA setup FIS;
5. receiving DMA active FIS by the host:
event R1: a transmission layer receives frame contents sent by a device end;
event R7: the transmission layer identifies the type of the received frame as DMA active FIS;
an event R8: the transmission layer successfully receives the DMA active FIS;
event R9: corresponding to item 1 of table 10, the transport layer records and reports DMA configuration information;
6. the host sends data:
an event T7: corresponding to item 6 of table 7, the transport layer enters the data transmission flow after the link is successfully established;
event T8: after the transmission of the data of the transmission layer is finished, starting to check the transmission state;
event T9: the transmission state of the data of the transmission layer is checked to be passed, which indicates that the data is successfully transmitted;
7. host receives SetDevBits FIS:
event R1: a transmission layer receives frame contents sent by a device end;
event R10: the transmission layer identifies the type of the received frame as SetDevBits FIS;
event R11: the transmission layer checks the receiving state of the frame type SetDevBits FIS;
event R12: the transport layer successfully receives the SetDevBits FIS;
in the direct connection mode of the SATA device, the receiving process is the same as the transport layer design of the STP mode, and only the transmitting process is different. In a preferred embodiment, the transport layer state machine in the direct connection mode of the SATA device bypasses the portion of fig. 4 where the link establishment is applied before sending a command or data, that is, skipping the events T1, T2, and T3. The state machine can directly jump to other states from the Idle state to perform sending flow control, which is specifically shown as follows:
1. the Host sends a Host to device register FIS command:
event T10: corresponding to item 1 of table 4, the transport layer enters the command sending flow;
event T5: the transmission layer command is sent to finish, and the state is checked;
event T6: the transmission layer checks the state to pass, which indicates that the command is successfully sent;
2. the host sends data:
event T11: corresponding to item 7 of table 4, the transport layer enters the data sending flow;
event T8: after the transmission of the data of the transmission layer is finished, starting to check the transmission state;
an event T9: the transmission state of the transmission layer data is checked to be passed, which indicates that the data is successfully transmitted;
according to the state machine jump schematic diagram shown in fig. 4, after each service is ensured to be normally completed, the state machine of the SATA transmission layer successfully returns to the idle state HT _ HostIdle, and the closed-loop operation is completed. The method effectively solves the abnormal problem that a single SAS controller controls access to a plurality of SATA disk scenes, and simultaneously supports two modes of STP and SATA device direct connection scenes.
It should be noted that the state machine jumping process shown in fig. 4 is only used for illustrating and not limiting the technical solution of the present invention. It should be understood by those skilled in the art that any conceivable adjustment of the number of events, the number of states, etc. of the disk connection structure and the state machine may be made according to actual needs based on the present invention, and the present invention should not be limited to the specific structures or parameters illustrated above.
In an illustrative embodiment, a scenario that 1 SAS controller controls access to 2 SATA devices (STP) is taken as an example to illustrate an effect achieved by using the dual-mode SATA transport layer optimization method according to the present invention. For a 1 SAS controller and 2 SATA device (STP) scenario, the specific events of fig. 5-9 are described as follows:
event E1: the transmission layer automatically enables the STP mode according to the link negotiation result reported by the link layer, and receives a request of sending an FPDMA write command to the SATA device 0 by the SAS controller;
event E2: after receiving the link establishment success returned by the Port layer, the transport layer starts to issue an FPDMA write command to the SATA device 0;
event E3: after finishing the command transmission, the transmission layer receives an R _ OK message returned by the SATA device 0 and indicates that the command transmission is successful;
event E4: the transmission layer starts to receive the transmission frame of the SATA Device 0, and the type is judged to be Device to host register FIS;
event E5: the transport layer receives the Device to host Register FIS of the SATA Device 0, and the state machine returns to the Idle state;
event E6: the transmission layer automatically enables the STP mode according to a link negotiation result reported by the link layer, and receives a request of sending an FPDMA write command to the SATA device 1 by the SAS controller;
event E7: after receiving the link establishment success returned by the Port layer, the transport layer starts to issue an FPDMA write command to the SATA device 1;
event E8: after finishing sending the command, the transmission layer receives an R _ OK message returned by the SATA device 1 and indicates that the command is successfully transmitted;
event E9: the transmission layer starts to receive the frame transmitted by the SATA Device 1, and the type is judged to be Device to host register FIS;
event E10: the transport layer receives the Device to host Register FIS of the SATA Device 1, and the state machine returns to the Idle state;
event E11: the transport layer receives the DMA setup FIS of the SATA device 0, and the state machine returns to the Idle state after the reception is finished;
event E12: the transport layer receives DMA active FIS of the SATA device 0, and the state machine returns to the Idle state after receiving;
event E13: the transport layer receives the DMA setup FIS of the SATA device 1, and the state machine returns to the Idle state after the reception is finished;
event E14: the transport layer receives DMA active FIS of the SATA device 1, and the state machine returns to the Idle state after receiving;
event E15: the transmission layer receives a request of sending data to the SATA device 0 by the SAS controller;
event E16: after receiving the link establishment success returned by the Port layer, the transport layer starts to send data to the SATA device 0;
event E17: after finishing data transmission, the transmission layer receives an R _ OK message returned by the SATA device 0 and indicates that the data transmission is successful;
event E18: the transmission layer starts to receive the transmission frame of the SATA device 0 and judges that the type is SetDevBits FIS;
event E19: the transport layer receives the SetDevBits FIS of the SATA device 0, checks that the status passes and indicates that the FPDMA write operation to the SATA device 0 is completed, and the state machine returns to the Idle state;
event E20: the transmission layer receives a request of sending data to the SATA device 1 from the SAS controller;
event E21: after the transmission layer receives the link returned by the Port layer and successfully establishes, the transmission layer starts to send data to the SATA device 1;
event E22: after the transmission layer finishes data transmission, receiving an R _ OK message returned by the SATA device 1 to indicate that the data transmission is successful;
event E23: the transmission layer starts to receive the frame transmitted by the SATA device 1, and the type is determined to be SetDevBits FIS;
event E24: the transport layer receives the SetDevBits FIS that completes the SATA device 1, checks that the status passes and indicates that the FPDMA write operation to the SATA device 1 is complete, and the state machine finally returns the Idle status.
If the typical SATA transport layer optimization method is adopted in the above scenario, when an event E12 in fig. 7 occurs, after the transport layer receives a DMA active FIS of the SATA device 0, the state may jump to the HT _ DMAOTrans1 state, and then the DMA engine is waited to complete configuration and then data is sent to the SATA device 0. During this time, if a DMA setup FIS returned by the SATA device 1 is received, corresponding to event E28 in fig. 10, the transport layer state machine cannot respond normally, thereby causing an operational anomaly of the subsequent SATA device 1. The events described with particular reference to FIG. 10 are as follows:
event E25: the same as the event E11 in fig. 7, that is, the transport layer receives the DMA setup FIS of the SATA device 0, and the state machine returns to the Idle state after the reception is completed;
event E26: the same as the event E12 in fig. 7, that is, the transport layer receives the DMA active FIS of the SATA device 0, and after the reception is completed, the state machine returns to the Idle state;
event E27: and the transport layer state machine enters an HT _ DMAOTrans1 state to wait for the completion of the configuration of the DMA engine, and then jumps to an HT _ DMAOTrans2 state to send data to the SATA device 0.
Event E28: the same as event E13 in fig. 7, i.e. the SATA device 1 returns a DMA setup FIS to the transport layer. However, at this time, the transport layer state machine is in the HT _ DMAOTrans1 or HT _ DMAOTrans2 state and cannot perform normal reception response, which finally causes an abnormal subsequent operation on the SATA device 1.
In an optional embodiment, an FPDMA write operation in a direct connection scenario of a SATA device is taken as an example to describe an effect achieved by using the dual-mode SATA transport layer optimization method according to the present invention. For the SATA device direct connection scenario, see events in fig. 11-12 described below:
event E1: the transmission layer automatically closes the STP mode according to a link negotiation result reported by the link layer, namely, the transmission layer enters the SATA direct connection mode, and starts to issue commands after receiving a request for issuing FPDMA write commands to SATA direct connection equipment;
event E2: after the transmission layer finishes sending the command, the SATA direct-connected equipment returns an R _ OK message to indicate that the command is successfully transmitted;
event E3: the transmission layer starts to receive the SATA direct-connected equipment transmission frame, and the type is judged to be Device to host register FIS;
event E4: the transmission layer receives a Device to host register FIS of the SATA direct-connected Device, and the state machine returns to the Idle state after the check state is passed;
event E5: the transport layer receives a DMA setup FIS of the SATA direct-connected equipment, and the state machine returns to an Idle state after the reception is finished;
event E6: the transport layer receives DMA active FIS of the SATA direct-connected equipment, and the state machine returns to the Idle state after receiving;
event E7: the transmission layer receives a request for transmitting data to the SATA direct-connected equipment and starts to transmit the data;
event E8: and the transmission layer starts to receive the SetDevBits FIS transmitted by the SATA direct-connected equipment, indicates that the FPDMA write operation of the SATA direct-connected equipment is completed after the reception is completed and the check state passes, and finally returns the state machine to the Idle state.
The invention effectively solves the problems of the typical SATA transmission layer optimization method, provides correct support for the SAS controller to concurrently control a plurality of SATA devices, and meets the dual-mode scene of direct connection of STP and SATA devices. Those skilled in the art will appreciate that the concepts of the present invention are equally applicable to scenarios with more than two SATA devices, in addition to the scenario described in fig. 3 where a single SAS controller concurrently controls two SATA devices.
As is clear from the timing diagram and the description, the dual-mode SATA transport layer state machine designed by the invention effectively solves the problem of FPDMA operation abnormality in the typical SATA transport layer design for concurrent communication between the SAS controller and the SATA multiple devices, ensures correct performance of the multiple device concurrent data service, ensures that the data communication service for concurrently controlling the multiple SATA devices by the SAS controller is correctly completed, and more efficiently utilizes the physical link to improve the throughput of the entire storage system; meanwhile, two scenes of direct connection of STP and SATA equipment are supported. Even if the design is changed subsequently, only one set of logic code needs to be modified and maintained, so that the design and development cost and risk are reduced, and the design compatibility and maintainability are enhanced.
Although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (7)

1. A dual-mode SATA transport layer optimization method is characterized by comprising the following steps:
when the SATA transport layer state machine is in an HT _ HostIdle state, determining whether a current mode of a SAS controller is an STP mode, and jumping the SATA transport layer state machine to a destination state corresponding to a predefined event based on the current mode of the SAS controller and the predefined event;
when the SATA transmission layer state machine is in an HT _ DS _ FIS state, if the data direction is a writing direction and an auto active bit is set, jumping the SATA transmission layer state machine to the HT _ HostIdle state;
when the SATA transport layer state machine receives DMA active FIS and is in an HT _ DMAOTrans1 state, directly jumping the SATA transport layer state machine to the HT _ HostIdle state;
after the SATA transport layer state machine jumps from the HT _ DS _ FIS state or the HT _ DMAOTrans1 state to the HT _ host idle state, the method further includes: determining whether to transmit data to the current SATA equipment or not by upper software;
wherein based on the current mode of the SAS controller and a predefined event, jumping the SATA transport layer state machine to a destination state corresponding to the predefined event further comprises: if the current mode of the SAS controller is not STP mode and the predefined event is that there is a request to send a command or data, jumping the SATA transport layer state machine to HT _ DMAOTrans2 state and performing DMA data sending; jumping the SATA transport layer state machine to an HT _ STP _ OpenReq state if a current mode of the SAS controller is an STP mode and the predefined event is the presence of a request to send a command or data; and the HT _ STP _ OpenReq state indicates the SATA transport layer state machine to communicate with a port layer and send a request for establishing a link.
2. The dual-mode SATA transport layer optimization method of claim 1, wherein after jumping the SATA transport layer state machine to the HT _ STP _ OpenReq state, further comprising:
if the request for establishing the link is sent completely, jumping the SATA transport layer state machine to an HT _ STP _ CoWait state; wherein the HT _ STP _ CoWait state indicates the SATA transport layer state machine to wait for the port layer to return a link establishment result.
3. The dual-mode SATA transport layer optimization method of claim 2, wherein after jumping the SATA transport layer state machine to the HT _ STP _ OpenReq state, further comprising:
jumping the SATA transport layer state machine to an HT _ Co _ Fail state if an abnormal error is generated when the request for establishing the link is sent; and the HT _ Co _ Fail state indicates the SATA transport layer state machine to generate a corresponding error state, reports the error state and then automatically jumps to the HT _ HostIdle state.
4. The dual-mode SATA transport layer optimization method of claim 3, wherein after jumping the SATA transport layer state machine to the HT _ STP _ CoWait state, further comprising:
if the port layer returns a message of successfully establishing the link, the SATA transport layer state machine is jumped to an HT _ Co _ Done state; wherein the HT _ Co _ Done state instructs the SATA transport layer state machine to perform a corresponding send control flow based on established links in response to a previous request to send a command or data.
5. The dual-mode SATA transport layer optimization method of claim 3, wherein after jumping the SATA transport layer state machine to the HT _ STP _ CoWait state, further comprising:
and if the port layer returns a message of failed link establishment, jumping the SATA transmission layer state machine to the HT _ Co _ Fail state.
6. The dual-mode SATA transport layer optimization method of claim 1, wherein jumping the SATA transport layer state machine to a destination state corresponding to a predefined event based on a current mode of the SAS controller and the predefined event further comprises:
and if the current mode of the SAS controller is not the STP mode and a Host to device Register FIS command needs to be sent, jumping the SATA transport layer state machine to the HT _ CmdFIS state and entering a command sending process.
7. The dual-mode SATA transport layer optimization method of claim 1, wherein when the current mode of the SAS controller is an STP mode, the SAS controller is connected to a plurality of SATA devices through an Expander.
CN202210252714.6A 2022-03-15 2022-03-15 Dual-mode SATA (Serial advanced technology attachment) transmission layer optimization method Active CN114579489B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210252714.6A CN114579489B (en) 2022-03-15 2022-03-15 Dual-mode SATA (Serial advanced technology attachment) transmission layer optimization method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210252714.6A CN114579489B (en) 2022-03-15 2022-03-15 Dual-mode SATA (Serial advanced technology attachment) transmission layer optimization method

Publications (2)

Publication Number Publication Date
CN114579489A CN114579489A (en) 2022-06-03
CN114579489B true CN114579489B (en) 2023-01-24

Family

ID=81775866

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210252714.6A Active CN114579489B (en) 2022-03-15 2022-03-15 Dual-mode SATA (Serial advanced technology attachment) transmission layer optimization method

Country Status (1)

Country Link
CN (1) CN114579489B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7496700B1 (en) * 2005-01-12 2009-02-24 Pmc-Sierra, Inc. Serial tunneling protocol (STP) flow control in SAS expanders without SATA link state machine
CN112559407A (en) * 2020-12-22 2021-03-26 无锡众星微系统技术有限公司 STP link layer state machine optimization method
CN112559406A (en) * 2020-12-22 2021-03-26 无锡众星微系统技术有限公司 SATA transport layer state machine optimization method
CN112765078A (en) * 2021-01-20 2021-05-07 无锡众星微系统技术有限公司 STP transmission layer realizing method for supporting multi-disk PIO command concurrence

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010037479A1 (en) * 2000-04-28 2001-11-01 Whetsel Lee D. Selectable dual mode test access port method and apparatus
DE10214701B4 (en) * 2002-04-03 2004-08-05 Advanced Micro Devices, Inc., Sunnyvale ATA and SATA compliant controller component, method of operation and integrated circuit chip
US8751718B2 (en) * 2006-03-13 2014-06-10 Lsi Corporation Apparatus and methods for a simplified, multi-client SAS port for management of other devices in an enhanced SAS device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7496700B1 (en) * 2005-01-12 2009-02-24 Pmc-Sierra, Inc. Serial tunneling protocol (STP) flow control in SAS expanders without SATA link state machine
CN112559407A (en) * 2020-12-22 2021-03-26 无锡众星微系统技术有限公司 STP link layer state machine optimization method
CN112559406A (en) * 2020-12-22 2021-03-26 无锡众星微系统技术有限公司 SATA transport layer state machine optimization method
CN112765078A (en) * 2021-01-20 2021-05-07 无锡众星微系统技术有限公司 STP transmission layer realizing method for supporting multi-disk PIO command concurrence

Also Published As

Publication number Publication date
CN114579489A (en) 2022-06-03

Similar Documents

Publication Publication Date Title
JP3918394B2 (en) Data migration method
US8127059B1 (en) Apparatus for interconnecting hosts with storage devices
US7120705B2 (en) Magnetic disk array device with processing offload function module
US8275938B2 (en) Computer system for controlling allocation of physical links and method thereof
KR101506368B1 (en) Active-active failover for a direct-attached storage system
US8751718B2 (en) Apparatus and methods for a simplified, multi-client SAS port for management of other devices in an enhanced SAS device
US7870417B2 (en) Apparatus, system, and method for adapter card failover
CN112559407B (en) STP link layer state machine optimization method
CN102215268A (en) Method and device for transferring file data
CN112116444B (en) Butt joint system of banking financial service system and financial futures data exchange platform
CN104731635A (en) Virtual machine access control method and virtual machine access control system
US20080263391A1 (en) Apparatus, System, and Method For Adapter Card Failover
US20190042161A1 (en) Hard Disk Operation Method and Hard Disk Manager
CN114579489B (en) Dual-mode SATA (Serial advanced technology attachment) transmission layer optimization method
JP4433372B2 (en) Data access system and method
JP4988213B2 (en) Apparatus for maintaining storage device, method of operating the apparatus, and computer-readable storage medium
CN112559406B (en) SATA transport layer state machine optimization method
CN112765078B (en) STP transmission layer realizing method for supporting multi-disk PIO command concurrence
WO2023186143A1 (en) Data processing method, host, and related device
US7900028B2 (en) Method for initializing bus device
US6490544B1 (en) System for testing a multi-tasking computing device
CN111600685A (en) Device for realizing CAN bus redundancy based on Ethernet
CN113672537B (en) SATA (Serial advanced technology attachment) equipment hot plug management method and device
US20050022056A1 (en) Access by distributed computers to a same hardware resource
WO2011116571A1 (en) Virtual memory, virtual memory system and method

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