Instruction interaction method, storage controller card and interaction system

By maintaining IO context information in the storage controller card and using the target command frame identification and parity value for verification, the data inconsistency caused by SAS retransmission response frames in the SAS storage system is solved, and the effect of improving the reliability of the storage system is achieved.

CN120029549AActive Publication Date: 2025-05-23WUXI STARS MICRO SYSTEM TECHNOLOGIES CO LTD
View PDF 16 Cites 0 Cited by

Patent Information

Application Number
CN202510125330.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-05-23
Estimated Expiration
2045-01-24

AI Technical Summary

Technical Problem

In SAS storage system, data inconsistency caused by SAS retransmission of response frames.

Method used

By maintaining IO context information in the storage controller card, using the target command frame identification and parity value for frame data verification, ensuring that the completion response of the IO request is returned only when the command frame identification and parity value are consistent, and the inverse parity value is placed in the IO context information to distinguish continuous IO command frames.

Benefits of technology

The data inconsistency caused by SAS retransmission response frames is completely solved, and the reliability of the storage system is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029549A_ABST
    Figure CN120029549A_ABST
Patent Text Reader

Abstract

The invention provides an instruction interaction method, a storage controller card and an instruction interaction system, and the method comprises the steps: obtaining a target command frame identifier of an IO command frame corresponding to an IO request in response to the IO request of a host; obtaining a target parity check value associated with the target command frame identifier from IO context information stored locally; carrying the target command frame identifier and the target parity check value in the IO command frame, and sending the IO command frame to a disk; after a response frame returned by the disk is received, if a command frame identifier and a parity check value carried by the response frame are consistent with the target command frame identifier and the target parity check value, returning a completion response of the IO request to the host; and setting the target parity check value associated with the target command frame identifier in the IO context information as an opposite value. According to the method and the device, the problem of data inconsistency caused by SAS retransmission response frames is solved, and the reliability of a storage system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data storage, and in particular relates to an instruction interaction method, a storage controller card and an instruction interaction system. Background Art

[0002] like Figure 1A As shown, in a SAS storage system, a host (HOST) communicates with a SAS (Serial Attached SCSI) hard disk through an HBA (Host Bus Adapter) / RAID card; Figure 1B As shown in the figure, if more hard disks need to be mounted, an expansion card SASExpander may be added between the HBA / RAID card and the hard disk. In the SAS storage system, the host driver (HOST) directly sends SCSI commands, which are converted into SAS commands by the HBA / RAID card to complete the read and write operations of the SAS hard disk. Summary of the invention

[0003] The purpose of the present application is to provide a command interaction method, a storage controller card and a command interaction system, aiming to solve the problem of data inconsistency caused by SAS retransmission response frames in the related art.

[0004] According to a first aspect of the present application, a command interaction method is provided, comprising:

[0005] In response to an IO request from the host, obtaining a target command frame identifier of an IO command frame corresponding to the IO request;

[0006] Acquire a target parity check value associated with the target command frame identifier from locally stored IO context information;

[0007] Carrying the target command frame identifier and the target parity check value in the IO command frame, and sending the frame to the disk;

[0008] After receiving the response frame returned by the disk, if the command frame identifier and the parity check value carried in the response frame are consistent with the target command frame identifier and the target parity check value, then returning a completion response of the IO request to the host;

[0009] The target parity check value associated with the target command frame identifier in the IO context information is set to an opposite value.

[0010] In an optional implementation manner, obtaining a target command frame identifier of an IO command frame corresponding to the IO request includes:

[0011] An available command frame identifier is taken from an identifier buffer pool as the target command frame identifier of the IO command frame.

[0012] In an optional implementation manner, after setting the target parity check value associated with the target command frame identifier in the IO context information to an opposite value, the method further includes:

[0013] The target command frame identifier is stored back into the identifier buffer pool as an available command frame identifier.

[0014] In an optional implementation, obtaining a target parity check value associated with the target command frame identifier from locally stored IO context information includes:

[0015] Matching the target command frame identifier with the locally stored IO context information; wherein the IO context information records all command frame identifiers and the parity check value associated with each command frame identifier;

[0016] A target parity check value associated with the target command frame identifier is determined according to the matching result.

[0017] According to a second aspect of the present application, a storage controller card is provided, comprising:

[0018] A response unit, configured to respond to an IO request of a host and obtain a target command frame identifier of an IO command frame corresponding to the IO request;

[0019] An acquiring unit, configured to acquire a target parity check value associated with the target command frame identifier from locally stored IO context information;

[0020] A sending unit, configured to carry the target command frame identifier and the target parity check value in the IO command frame and send the frame to the disk;

[0021] A response unit, configured to, after receiving a response frame returned by the disk, return a completion response of the IO request to the host if the command frame identifier and the parity check value carried in the response frame are consistent with the target command frame identifier and the target parity check value;

[0022] A setting unit is used to set the target parity check value associated with the target command frame identifier in the IO context information to an opposite value.

[0023] In an optional implementation, the response unit is used to retrieve an available command frame identifier from an identifier buffer pool as the target command frame identifier of the IO command frame.

[0024] In an optional implementation manner, the storage controller card further includes:

[0025] The recycling unit is used to store the target command frame identifier as an available command frame identifier back into the identifier buffer pool after the setting unit sets the target parity check value associated with the target command frame identifier in the IO context information to an opposite value.

[0026] In an optional embodiment, the acquisition unit is used to match the target command frame identifier with locally stored IO context information, and determine the target parity value associated with the target command frame identifier based on the matching result; wherein the IO context information records all command frame identifiers and the parity value associated with each command frame identifier.

[0027] According to a third aspect of the present application, there is provided a command interaction system, comprising: a storage controller card and a disk;

[0028] The storage controller card responds to the IO request of the host, obtains the target command frame identifier of the IO command frame corresponding to the IO request, obtains the target parity check value associated with the target command frame identifier from the locally stored IO context information, and carries the target command frame identifier and the target parity check value in the IO command frame, and sends it to the disk;

[0029] The disk receives and processes the IO command frame, and returns a response frame to the storage controller card after processing is completed;

[0030] After the storage controller card receives the response frame returned by the disk, when the command frame identifier and the parity check value carried in the response frame are consistent with the target command frame identifier and the target parity check value, it returns a completion response of the IO request to the host, and sets the target parity check value associated with the target command frame identifier in the IO context information to an opposite value.

[0031] In an optional implementation manner, the storage controller card takes out an available command frame identifier from an identifier buffer pool as the target command frame identifier of the IO command frame.

[0032] In an optional implementation, after the storage controller card sets the target parity check value associated with the target command frame identifier in the IO context information to an opposite value, it stores the target command frame identifier back into the identifier cache pool as an available command frame identifier.

[0033] In an optional embodiment, the storage controller card matches the target command frame identifier with locally stored IO context information, and determines the target parity value associated with the target command frame identifier based on the matching result; wherein the IO context information records all command frame identifiers and the parity value associated with each command frame identifier.

[0034] Compared with the related art, the technical solution of the present application has at least the following advantages:

[0035] In order to manage the execution of IO commands, the storage controller card in the HBA card of the present application will maintain the IO context information corresponding to each IPTT number according to each IPTT number. The IO context information is maintained by hardware, generally saved by SRAM, and indexed by IPTT number. For example, 1 bit of information is stored in a fixed position corresponding to the IO context information as the extended high-bit parity check value of the IPTT number. Each time a command frame is sent, the information at this position is sent together with the command frame as the value of the highest bit of the IPTT number in the command frame. After each IO execution ends the response, the extended high-bit parity check value in the IO context information is reversed. In this way, when each identical IPTT number is sent continuously, the parity check bits must be unequal. When the storage controller card performs the IO transceiver frame operation, the parity check bit needs to be checked. Only when the parity check bits are the same, it is considered to be the frame data of the same IO command frame, otherwise it is considered to be the frame data of different IO command frames. The above method can completely solve the problem of data inconsistency caused by SAS retransmission response frame response, and improve the reliability of the storage system.

[0036] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained through the structures and processes indicated in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. It is obvious that the drawings described below are certain 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.

[0038] Figure 1A-1B It is a schematic diagram of a SAS storage system architecture according to the related art.

[0039] Figure 2 It is a schematic diagram of the interaction of non-data instructions of a SAS storage system according to the related art.

[0040] Figure 3 It is a schematic diagram of response frame retransmission caused by ACK loss in Non-data instruction interaction according to the related technology.

[0041] Figure 4This is a schematic diagram of an abnormality in which data inconsistency is caused by ACK loss in the Non-data instruction interaction according to the related technology.

[0042] Figure 5 This is a timing diagram of abnormal frame interaction due to ACK loss in Non-data instruction interaction according to the related technology.

[0043] Figure 6 It is a flowchart of the instruction interaction method according to an exemplary embodiment of the present application.

[0044] Figure 7 This is a schematic diagram of IPTT high parity bit transmission on an extended link according to an exemplary embodiment of the present application.

[0045] Figure 8 It is a schematic diagram of an implementation of a parity bit extension solution according to an exemplary embodiment of the present application.

[0046] Fig. 9 is a structural block diagram of a storage controller card according to an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0047] 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.

[0048] like Figure 2 As shown in the figure, the non-data instruction interaction process between the HBA / RAID card and the SAS disk is as follows (the HBA card is used as an example below):

[0049] 1. HBA sends a command frame with IPTT (command frame identification) number 1. IPTT (Initiator port transfer tag), i.e. Command ID, can be understood as the IO identification, which is used to uniquely identify a command frame. In the communication between HBA (Host Bus Adapter) and SAS Disk (SAS disk), each command frame carries an IPTT number so that the receiver can identify and process the corresponding command.

[0050] 2. After receiving the command frame, the SAS Disk returns an ACK confirmation to inform the HBA that it has successfully received the command frame with IPTT = 1.

[0051] 3. After HBA receives ACK, it means that the command frame with IPTT 1 is sent successfully and waits for the SAS Disk to respond.

[0052] 4. After SAS Disk completes the command frame processing with IPTT number 1, it returns a response frame (Response Frame) carrying IPTT number 1.

[0053] 5. After receiving the response frame, HBA returns ACK to inform SAS Disk that it has successfully received the response frame with IPTT 1.

[0054] 6. SAS Disk ends the command processing with IPTT 1 and releases related resources.

[0055] 7. HBA ends the command processing with IPTT = 1, responds to the command to the host, and releases related resources. The command execution ends successfully.

[0056] However, during the actual operation of the device, the link may be abnormal, resulting in frame loss. Figure 3 As shown, the HBA returns ACK after receiving the response frame (Response Frame), but due to the link reason, the SAS Disk does not receive the ACK frame, which will trigger the SAS Disk to resend the response frame (Response Frame).

[0057] The protocol stipulates that the retransmit flag is set to 1 in the retransmitted response frame, indicating that the current frame is a retransmitted frame. The protocol also stipulates that the HBA returns ACK normally after receiving a response frame with the retransmit flag set to 1. The received frame is then processed as follows:

[0058] If the Response frame has been successfully received before, the current Response frame will be discarded; if the Response frame has not been received, the normal reception processing of the Response frame will be performed.

[0059] However, after the HBA / RAID card is designed according to the protocol, the system may experience data inconsistency exceptions during actual operation, such as Figure 4 shown.

[0060] Figure 4 The command execution process is described as follows:

[0061] 1. HBA sends the first IO command frame, which carries the IPTT number 1.

[0062] 2. SAS Disk returns ACK of IO command frame;

[0063] 3. After SAS Disk processes the IO command frame, it returns a response frame to HBA, and the response frame carries the IPTT number 1;

[0064] 4. After receiving the response frame, the HBA returns the ACK corresponding to the response frame to the SAS Disk, but the ACK is lost and the SAS Disk does not receive it;

[0065] 5. After the HBA successfully receives the response frame, it successfully responds to the first IO request to the host. After receiving the response, the host believes that IPTT 1 has been executed and recycles IPTT 1. Due to link reasons, the ACK frame corresponding to the response frame is lost, and the SAS Disk does not receive the ACK frame corresponding to the response frame, which will trigger the SAS Disk to retransmit the response frame with IPTT number 1.

[0066] 6. HBA sends the second IO command frame, using the same IPTT 1 (because the resources of the first IO command frame have been recycled, and the IPTT resources are reused);

[0067] 7. After receiving the second IO command frame, the SAS Disk link layer returns ACK;

[0068] 8. The SAS Disk transport layer prepares to retransmit the response frame corresponding to the first IO command frame. The IPTT number carried in the response frame is 1.

[0069] 9. After receiving the ACK of the second IO command frame, HBA receives the retransmission response frame of the first IO command frame. Since the IPTT numbers are the same, HBA mistakenly thinks it is the response frame of the second IO command frame, so it determines that the second IO is also executed successfully;

[0070] 10. When the SAS Disk receives the second IO command frame, the execution of the first IO command frame has not yet ended, and the ACK corresponding to the response frame of the first IO command frame has not yet been received. Therefore, the second IO command frame is considered to be an illegal frame, and an incorrect response frame is returned for the second IO command frame, that is, a Long response is returned;

[0071] 11. The HBA receives the error response frame Long response of the second IO command frame. At this time, the second IO command frame has been responded to. The HBA considers the long response to be an illegal frame and discards it.

[0072] Result: The HBA believes that the second IO command frame is executed successfully, but in fact the second IO command frame fails to be executed on the SAS Disk side, resulting in data inconsistency.

[0073] The detailed frame interaction timing diagram of the above process is as follows Figure 5 As shown. Data inconsistency is a serious problem in storage systems and must be strictly avoided. However, the SAS protocol does not provide any instructions for this situation. In actual design, the usual practice is to use a ring buffer in the IPTT reuse scheme to increase the time interval for the same IPTT to be quickly reused. However, this solution can only reduce the probability and cannot completely prevent the occurrence of this problem.

[0074] To this end, the present application extends the IPTT number to completely eliminate the occurrence of frame recognition errors, thereby fundamentally solving this type of data inconsistency problem.

[0075] like Figure 6 As shown, the first aspect of the present application exemplarily provides a command interaction method, including:

[0076] In step S601, in response to an IO request from a host, a target command frame identifier of an IO command frame corresponding to the IO request is obtained;

[0077] In step S602, a target parity check value associated with a target command frame identifier is obtained from the locally stored IO context information;

[0078] In step S603, the target command frame identifier and the target parity check value are carried in the IO command frame and sent to the disk;

[0079] In step S604, after receiving the response frame returned by the disk, if the command frame identifier and parity check value carried in the response frame are consistent with the target command frame identifier and target parity check value, a completion response of the IO request is returned to the host;

[0080] In step S605, the target parity check value associated with the target command frame identifier in the IO context information is set to an opposite value.

[0081] Exemplarily, the method is executed on a storage controller card, which may be an HBA card or a RAID card. After receiving an IO request from a host (which may be an application layer client running on the host), the storage controller card forms an IO command frame based on the IO request, and the IO command frame carries a target command frame identifier for uniquely identifying the IO command frame, such as in the SAS protocol, the target command frame identifier may be an IPTT number. In some embodiments, the target command frame identifier may be carried by the host in the IO request and sent to the storage controller card. In other embodiments, the target command frame identifier may be obtained by the storage controller card from an identifier buffer pool. The identifier buffer pool may record multiple available command frame identifiers, and the storage controller card may take one of them out of the identifier buffer pool card as the target command frame identifier of the current IO command frame when needed. After the IO command frame is processed, the target command frame identifier may be recovered, that is, put back into the identifier buffer pool, so that the subsequent storage controller card may use it when needed. It should be noted that the IO request sent by the host carries an ID identifying the IO request, and the ID corresponds to the target command frame identifier one by one. If the target command frame identifier is carried in the IO request sent by the host, the target command frame identifier can be directly used as the ID; currently, the IO request can also carry a one-to-one corresponding ID and target command frame identifier at the same time, that is, the ID and the target command frame identifier are independent of each other. If the IO request sent by the host does not carry the target command frame identifier but only carries the ID, the storage controller card can obtain the target command frame identifier from the identifier buffer pool and establish a one-to-one correspondence between the ID and the target command frame identifier.

[0082] Exemplarily, the storage controller card can store the parity value of each command frame identifier in the local storage identifier cache pool. For example, the storage controller card records the IO context information in the SRAM, and the association between each command frame identifier and its parity value is stored in the IO context information. After the storage controller card obtains the target command frame identifier, it searches for its associated target parity value from the IO context information based on the target command frame identifier, and fills the target parity value in the parity bit of the target command frame identifier. In some embodiments, the parity bit is one of the high bits of the target command frame identifier. Taking the SAS protocol as an example, the maximum number of IPTT resources is 32K, that is, the range of IPTT numbers that can be used is 0 to 32767. The bit width of the IPTT number is 16 bits, and all high bits can be freely allocated and used by the storage controller card, so any one of all high bits can be used as the parity bit. In other embodiments, if all bits of the target command frame identifier are occupied, one of the reserved bits can be selected from the IO command frame as the parity bit.

[0083] Exemplarily, after the storage controller card sends the IO command frame to the disk, the disk returns an ACK after receiving the IO command frame to confirm that it has received the IO command frame. After that, after the disk processes the IO command frame, it returns a response frame of the IO command frame. Taking the SAS protocol as an example, the response frame can be a response frame in the SSP protocol frame. The response frame will carry the command frame identifier and parity check value of the IO command frame to which it responds. The command frame identifier and parity check value carried by it are obtained from the received and processed IO command frame. Therefore, if the command frame identifier and parity check value carried in the response frame received by the memory card are consistent with the target command frame identifier and target parity check value carried in the IO command frame sent by it, it means that the response frame is returned by the disk for the IO command frame previously sent by the storage controller card, which means that the disk has completed the processing of the IO command frame, so the storage controller card can return a response to the host that the IO request is completed. Afterwards, the storage controller card also sets the target parity check value corresponding to the target command frame identifier recorded in the IO context information to the opposite value, that is, if the target parity check value recorded in the current context is an odd number, it is set to an even number, and if it is an even number, it is set to an odd number. In the above process, if the command identification frame carried in the response frame is consistent with the target command identification frame, but the parity check value carried is inconsistent with the target parity check value, the storage controller card can consider that the response frame is not the response frame corresponding to the IO command frame it sent out.

[0084] In some optional implementations, obtaining a target command frame identifier of an IO command frame corresponding to an IO request includes:

[0085] An available command frame identifier is taken from the identifier buffer pool as a target command frame identifier of the IO command frame.

[0086] Exemplarily, as described above, the storage controller card can read an available command frame identifier from the identifier buffer pool as the target command frame identifier of the IO command frame. The specific position of the parity bit in the command identifier frame is predefined (if all bits in the command identifier frame are occupied, the parity bit is a reserved bit in the IO command frame, and the position of the reserved bit can also be predefined). It can be understood that the parity bit in the command identifier frame taken out from the target buffer pool is empty.

[0087] In some optional implementations, after setting the target parity check value associated with the target command frame identifier in the IO context information to an opposite value, the method further includes:

[0088] The target command frame identifier is stored back into the identifier buffer pool as an available command frame identifier.

[0089] Exemplarily, after the disk returns the response frame of the current IO command frame, it indicates that the current IO command frame has been processed, and the storage controller card can return a corresponding response to the host to inform the host that the IO command corresponding to the IO command frame has been executed. At the same time, the storage controller card will also set the target parity check value associated with the target command frame identifier of the IO command frame in the context to the opposite value (for example, 1 is set to 0, or 0 is set to 1), and put the target command frame identifier back into the identifier cache pool to release the resources of the target command frame identifier, so that the next time the storage controller card needs to read the command frame identifier, it can reuse the target command frame identifier. In addition, after receiving the second IO request from the host, the storage controller card still takes out the target command frame identifier from the identifier buffer pool. When the second IO command frame corresponding to the second IO request is formed, the target command frame identifier will be reused, and then the target parity check value associated with the target command frame identifier will be obtained from the IO context information. Previously, because the target parity check value in the IO context information has been set to an opposite value, the target command frame and the new target parity check value are carried in the second IO command frame and sent out. The response frame returned by the disk also carries the target command frame identifier and the new target parity check value. Therefore, the storage controller card can also distinguish whether the response frame is for the first IO command frame or the second IO command frame, and the data inconsistency problem existing in the related technology described above will not occur. It should be noted that if the target command frame is carried in the IO request sent by the host, it will be recovered by the host.

[0090] In some optional implementations, obtaining a target parity check value associated with a target command frame identifier from locally stored IO context information includes:

[0091] Matching the target command frame identifier with the locally stored IO context information; wherein the IO context information records all command frame identifiers and the parity check value associated with each command frame identifier;

[0092] A target parity check value associated with the target command frame identifier is determined according to the matching result.

[0093] Exemplarily, as described above, the storage controller card stores IO context information locally, and the IO context information records all command frame identifiers and the parity check value currently associated with each command frame identifier. After the storage controller card obtains the target command frame identifier of the IO command frame corresponding to the currently received IO request, it matches the target command frame identifier with all command frame identifiers stored in the IO context information, and after finding a matching command frame identifier, the parity check value associated with the matching command frame identifier is used as the target parity check value of the target command frame identifier. The target parity check value is combined with the target command identifier frame into a final command identifier frame, and is carried in the IO command frame and sent to the disk.

[0094] Below through Figure 7 as well as Figure 8 An implementation process of the instruction interaction method provided in this application is exemplified.

[0095] In this application, the host's strategy for sending IPTT (that is, the target command frame identifier) ​​remains unchanged, but the HBA extends and sends the IPTT number on the link when sending the IO command frame. In actual applications, the protocol stipulates that the IPTT number in the frame structure is 16 bits wide, which means that there are 64K (65536) IPTT resources, but in actual applications, only 8K (8192) IPTT resources are generally sufficient, and the high bits are generally fixed with 0 and not used. Therefore, the highest bit, the 16th bit, is used as a parity bit. When the same IPTT is sent twice in a row, the highest bits transmitted on the link twice are opposite, so as to distinguish the IO command frames corresponding to the same two consecutive IPTT numbers.

[0096] If it is necessary to use up all 16 bits of the IPTT number in actual applications, the parity bits are extended through the reserved bits in the frame structure.

[0097] The following uses the HBA card and SAS disk as an example to illustrate the interaction process:

[0098] 1. HBA sends the first IO command frame, in which IPTT is 1. Assuming that the parity value corresponding to IPTT 1 is 1 at this time, the actual IPTT number in the SAS frame structure sent on the link is 0x8001.

[0099] 2. SAS Disk returns the response frame Response of the first IO command frame.

[0100] 3. After receiving the response frame Response, the HBA returns an ACK of the response frame Response to the SAS Disk.

[0101] 4. After the HBA successfully receives the response frame Response, it also successfully responds to the first IO request to the host and inverts the parity value corresponding to IPTT 1 in the IO context information (0 after inversion). After receiving the response, the host considers that IPTT 1 has been executed and recycles IPTT1; if the IPTT1 is taken out of the identification buffer pool by the HBA card, the IPTT1 is reclaimed by the HBA card.

[0102] 5. Due to link problems, the ACK returned by the HBA to the SAS Disk is lost, and the SAS Disk does not receive the ACK corresponding to the response frame; retransmission is about to be triggered.

[0103] 6. HBA sends the second IO command frame and uses the same IPTT 1 (because the IPTT resources of the first IO command frame have been recycled and can be reused); at this time, the parity value of IPTT1 recorded by HBA in the IO context information is 0, so the actual IPTT number in the SAS frame structure of the second IO sent on the link is 0x0001.

[0104] 7. After receiving the second IO command frame, the SAS Disk link layer returns ack.

[0105] 8. The SAS Disk transport layer prepares to retransmit the response frame response of the first IO command frame.

[0106] 9. After receiving ACK, HBA receives the retransmission response frame response of the first IO command frame. Since the IPTT numbers are different (the highest bits are not equal), HBA successfully identifies that the retransmission response frame response is the retransmission response frame response of the first IO command frame and performs a discard operation.

[0107] 10. After receiving the second IO command frame (IPTT=0x0001), the SAS Disk considers it to be a new IO command frame, and therefore returns the response frame of the second IO command frame normally.

[0108] 11. The HBA receives the response frame resopnse of the second IO command frame normally, and the second IO command frame is executed successfully.

[0109] It can be seen that the solution of the present application successfully solves the problem of data inconsistency existing in the related technologies described above.

[0110] In order to manage the execution of IO commands, the storage controller card in the HBA card of the present application will maintain the IO context information corresponding to each IPTT number according to each IPTT number. The IO context information is maintained by hardware, generally saved by SRAM, and indexed by IPTT number. For example, 1 bit of information is stored in a fixed position corresponding to the IO context information as the extended high-bit parity check value of the IPTT number. Each time a command frame is sent, the information at this position is sent together with the command frame as the value of the highest bit of the IPTT number in the command frame. After each IO execution ends the response, the extended high-bit parity check value in the IO context information is reversed. In this way, when each identical IPTT number is sent continuously, the parity check bits must be unequal. When the storage controller card performs the IO transceiver frame operation, the parity check bit needs to be checked. Only when the parity check bits are the same, it is considered to be the frame data of the same IO command frame, otherwise it is considered to be the frame data of different IO command frames. The above method can completely solve the problem of data inconsistency caused by SAS retransmission response frame response, and improve the reliability of the storage system.

[0111] Accordingly, see Fig. 9 As shown, the second aspect of the present application exemplarily proposes a storage controller card, including:

[0112] A response unit 901 is used to respond to an IO request of a host and obtain a target command frame identifier of an IO command frame corresponding to the IO request;

[0113] An acquiring unit 902 is configured to acquire a target parity check value associated with a target command frame identifier from locally stored IO context information;

[0114] A sending unit 903 is used to carry a target command frame identifier and a target parity check value in an IO command frame and send the frame to the disk;

[0115] The response unit 904 is used to return a completion response of the IO request to the host after receiving the response frame returned by the disk, if the command frame identifier and the parity check value carried in the response frame are consistent with the target command frame identifier and the target parity check value;

[0116] The setting unit 905 is used to set the target parity check value associated with the target command frame identifier in the IO context information to an opposite value.

[0117] In some optional implementations, the response unit is used to take out an available command frame identifier from the identifier buffer pool as the target command frame identifier of the IO command frame.

[0118] In some optional implementations, the storage controller card further includes:

[0119] The recycling unit is used to store the target command frame identifier as an available command frame identifier back to the identifier buffer pool after the setting unit sets the target parity check value associated with the target command frame identifier in the IO context information to an opposite value.

[0120] In some optional implementations, the acquisition unit is used to match the target command frame identifier with locally stored IO context information, and determine the target parity value associated with the target command frame identifier based on the matching result; wherein the IO context information records all command frame identifiers and the parity value associated with each command frame identifier.

[0121] The above-mentioned storage controller card is a physical device for executing the instruction interaction method provided in the first aspect embodiment. The relevant details have been described in the instruction interaction method executed on the storage controller card described in the first aspect embodiment. Please refer to the contents described in the first aspect embodiment and will not be repeated here.

[0122] Accordingly, the third aspect of the present application exemplarily proposes a command interaction system, including: a storage controller card and a disk;

[0123] The storage controller card responds to the IO request of the host, obtains the target command frame identifier of the IO command frame corresponding to the IO request, obtains the target parity check value associated with the target command frame identifier from the locally stored IO context information, and carries the target command frame identifier and the target parity check value in the IO command frame and sends it to the disk;

[0124] The disk receives and processes the IO command frame, and returns a response frame to the storage controller card after processing is completed;

[0125] After the storage controller card receives the response frame returned by the disk, if the command frame identifier and parity check value carried in the response frame are consistent with the target command frame identifier and target parity check value, it returns a completion response of the IO request to the host and sets the target parity check value associated with the target command frame identifier in the IO context information to the opposite value.

[0126] In some optional implementations, the storage controller card takes out an available command frame identifier from the identifier buffer pool as the target command frame identifier of the IO command frame.

[0127] In some optional implementations, after the storage controller card sets the target parity check value associated with the target command frame identifier in the IO context information to an opposite value, the target command frame identifier is stored back into the identifier buffer pool as an available command frame identifier.

[0128] In some optional implementations, the storage controller card matches the target command frame identifier with locally stored IO context information, and determines the target parity value associated with the target command frame identifier based on the matching result; wherein the IO context information records all command frame identifiers and the parity value associated with each command frame identifier.

[0129] The relevant details of the above-mentioned instruction interaction system can be found in the description of the first aspect and the second aspect, which will not be repeated here.

[0130] The following describes a method for command interaction between a storage controller card and a disk in the above command interaction system, the method comprising:

[0131] In response to the IO request of the host, the storage controller card obtains the target command frame identifier of the IO command frame corresponding to the IO request;

[0132] The storage controller card obtains a target parity check value associated with a target command frame identifier from locally stored IO context information;

[0133] The storage controller card carries the target command frame identifier and the target parity check value in the IO command frame and sends it to the disk;

[0134] The disk receives and processes the IO command frame, and returns a response frame to the storage controller card after the processing is completed;

[0135] After the storage controller card receives the response frame returned by the disk, if the command frame identifier and parity check value carried in the response frame are consistent with the target command frame identifier and target parity check value, it returns a completion response of the IO request to the host;

[0136] The storage controller card sets the target parity check value associated with the target command frame identifier in the IO context information to an opposite value.

[0137] In some optional implementations, the storage controller card obtains the target command frame identifier of the IO command frame corresponding to the IO request, including:

[0138] The storage controller card takes out an available command frame identifier from the identifier buffer pool as a target command frame identifier of the IO command frame.

[0139] In some optional implementations, after the storage controller card sets the target parity check value associated with the target command frame identifier in the IO context information to an opposite value, the method further includes:

[0140] The storage controller card stores the target command frame identifier back into the identifier cache pool as an available command frame identifier.

[0141] In some optional implementations, the storage controller card obtains a target parity check value associated with a target command frame identifier from locally stored IO context information, including:

[0142] The storage controller card matches the target command frame identifier with the locally stored IO context information; wherein the IO context information records all command frame identifiers and the parity check value associated with each command frame identifier;

[0143] The storage controller card determines a target parity value associated with the target command frame identifier according to the matching result.

[0144] The above-mentioned instruction interaction method is an interaction method between a storage controller card and a disk. The relevant details have been described in the instruction interaction method executed on the storage controller card described in the first aspect embodiment. Please refer to the content described in the first aspect embodiment and will not be repeated here.

[0145] It is understood that the circuit structures, names and parameters described in the above embodiments are only examples. Those skilled in the art can also easily combine and adjust the structural features of the above embodiments according to the use requirements, and should not limit the concept of the present application to the specific details of the above examples.

[0146] Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that he or she may still modify the technical solutions described in the aforementioned embodiments, or make equivalent substitutions for some of the technical features therein; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A command interaction method, characterized in that: include: In response to an IO request from the host, obtaining a target command frame identifier of an IO command frame corresponding to the IO request; Acquire a target parity check value associated with the target command frame identifier from locally stored IO context information; Carrying the target command frame identifier and the target parity check value in the IO command frame, and sending the frame to the disk; After receiving the response frame returned by the disk, if the command frame identifier and the parity check value carried in the response frame are consistent with the target command frame identifier and the target parity check value, then returning a completion response of the IO request to the host; The target parity check value associated with the target command frame identifier in the IO context information is set to an opposite value.

2. The instruction interaction method according to claim 1, characterized in that: Obtaining a target command frame identifier of an IO command frame corresponding to the IO request includes: An available command frame identifier is taken from an identifier buffer pool as the target command frame identifier of the IO command frame.

3. The instruction interaction method according to claim 2, characterized in that: After setting the target parity check value associated with the target command frame identifier in the IO context information to an opposite value, the method further includes: The target command frame identifier is stored back into the identifier buffer pool as an available command frame identifier.

4. The instruction interaction method according to any one of claims 1 to 3, characterized in that: Obtaining a target parity check value associated with the target command frame identifier from the locally stored IO context information, including: Matching the target command frame identifier with the locally stored IO context information; wherein the IO context information records all command frame identifiers and the parity check value associated with each command frame identifier; A target parity check value associated with the target command frame identifier is determined according to the matching result.

5. A storage controller card, characterized in that: include: A response unit, configured to respond to an IO request of a host and obtain a target command frame identifier of an IO command frame corresponding to the IO request; An acquiring unit, configured to acquire a target parity check value associated with the target command frame identifier from locally stored IO context information; A sending unit, configured to carry the target command frame identifier and the target parity check value in the IO command frame and send the frame to the disk; A response unit, configured to, after receiving a response frame returned by the disk, return a completion response of the IO request to the host if the command frame identifier and the parity check value carried in the response frame are consistent with the target command frame identifier and the target parity check value; A setting unit is used to set the target parity check value associated with the target command frame identifier in the IO context information to an opposite value.

6. The storage controller card according to claim 5, characterized in that: The response unit is used to take out an available command frame identifier from an identifier buffer pool as the target command frame identifier of the IO command frame.

7. The storage controller card according to claim 6, wherein: The storage controller card further includes: The recycling unit is used to store the target command frame identifier as an available command frame identifier back into the identifier buffer pool after the setting unit sets the target parity check value associated with the target command frame identifier in the IO context information to an opposite value.

8. The storage controller card according to any one of claims 5 to 7, characterized in that: The acquisition unit is used to match the target command frame identifier with the locally stored IO context information, and determine the target parity value associated with the target command frame identifier based on the matching result; wherein the IO context information records all command frame identifiers and the parity value associated with each command frame identifier.

9. A command interaction system, characterized in that: include: Storage controller cards and disks; The storage controller card responds to the IO request of the host, obtains the target command frame identifier of the IO command frame corresponding to the IO request, obtains the target parity check value associated with the target command frame identifier from the locally stored IO context information, and carries the target command frame identifier and the target parity check value in the IO command frame, and sends it to the disk; The disk receives and processes the IO command frame, and returns a response frame to the storage controller card after processing is completed; After the storage controller card receives the response frame returned by the disk, when the command frame identifier and the parity check value carried in the response frame are consistent with the target command frame identifier and the target parity check value, it returns a completion response of the IO request to the host, and sets the target parity check value associated with the target command frame identifier in the IO context information to an opposite value.

10. The instruction interaction system according to claim 9, characterized in that: The storage controller card takes out an available command frame identifier from an identifier buffer pool as the target command frame identifier of the IO command frame.

11. The instruction interaction system according to claim 10, characterized in that: After the storage controller card sets the target parity check value associated with the target command frame identifier in the IO context information to an opposite value, the storage controller card stores the target command frame identifier back into the identifier buffer pool as an available command frame identifier.

12. The instruction interaction system according to any one of claims 9 to 11, characterized in that: The storage controller card matches the target command frame identifier with the locally stored IO context information, and determines the target parity value associated with the target command frame identifier based on the matching result; wherein the IO context information records all command frame identifiers and the parity value associated with each command frame identifier.

Citation Information

Patent Citations

  • Digital coding device of reader-writer chip and coding method applying the same

    CN103095407A

  • Data storage method, device and system

    CN103530066A

  • Communication device and communication system

    CN109074294A

  • Storage system

    CN109313593A

  • Data communication method and device and readable storage medium

    CN112242997A