Host bus adapter, control method and related equipment thereof
By designing a host bus adapter including a first controller, a processing module and a second controller, the problem that the serial hard disk cannot prevent silent data corruption during data transmission is solved, and the data integrity and accuracy in the data transmission path is guaranteed.
Patent Information
- Application Number
- CN202510535089.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2045-04-27
AI Technical Summary
Existing serial hard disks cannot prevent silent data corruption during data transmission, making it difficult to guarantee the integrity and accuracy of stored data in the transmission path.
A host bus adapter is designed, including a first controller, a processing module and a second controller. The first controller is connected to the host via a high-speed serial bus, receives the target request and allocates the target cache area to store the target protection information. The processing module parses the target request, performs corresponding operations and feedbacks the results. The second controller connects to the serial hard disk through a serial bus to convert the target request into a request that complies with the serial data transmission protocol.
Through the implementation of the host bus adapter, the protection information corresponding to the serial hard disk can be stored in the target cache area on the host side, so that data integrity and accuracy can be checked during data transmission to ensure the integrity and accuracy of the data in the entire transmission path.
Smart Images

Figure CN120045493A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technologies, and particularly to a host bus adapter, a control method and related devices thereof. Background Art
[0002] During the transmission of data in a storage system, it will pass through multiple components, multiple transmission channels and complex software processing. In this process, any error in any link may cause the data to be incorrect, and this kind of error is usually not detected immediately, but is only discovered when the subsequent application accesses the data. This kind of error that is difficult to detect immediately when the data is incorrect is called silent data corruption. Enterprise-level storage applications usually involve a large amount of critical data, such as financial transaction records, medical cases, important business documents, etc., and have extremely high requirements for the reliability and integrity of the data. Once silent data corruption occurs, it may lead to the loss or damage of critical data, thereby affecting the normal operation and business decisions of the enterprise.
[0003] Currently, a serial advanced technology attachment (SATA) hard disk cannot prevent silent data corruption during data transmission, so it is difficult for a SATA hard disk to ensure the integrity and accuracy of the stored data inside it throughout the transmission path. Currently, there is no relatively effective solution to this technical problem.
[0004] Therefore, it can be seen that how to ensure the integrity and accuracy of the stored data in a SATA hard disk throughout the transmission path is a technical problem that those skilled in the art need to solve urgently. Summary of the Invention
[0005] The purpose of the embodiments of the present invention is to provide a host bus adapter, a control method and related devices thereof, so as to solve the technical problem in the related art that the integrity and accuracy of a SATA hard disk cannot be ensured throughout the transmission path.
[0006] To solve the above technical problem, the present invention provides a host bus adapter, including:
[0007] A first controller, connected to a host through a peripheral component interconnect express (PCIe) bus, configured to receive a target request sent by the host, and request the host to allocate a target cache area to store target protection information by using the target cache area; the target protection information is protection information corresponding to a SATA hard disk;
[0008] A processing module, configured to parse the target request to obtain target parsing data, and perform corresponding operations according to the target parsing data and the target protection information, and feedback an operation result to the host at the same time;
[0009] A second controller, connected to the serial hard disk through a serial bus, is configured to convert the target request into a request conforming to the serial data transmission protocol to assist the processing module in responding to the target request.
[0010] In a specific embodiment of the present invention, it further includes:
[0011] A cache module, configured to temporarily store the data and the target protection information generated by the first controller, the processing module, and the second controller.
[0012] In a specific embodiment of the present invention, the cache module includes:
[0013] A cache unit, configured to temporarily store the target protection information.
[0014] In a specific embodiment of the present invention, the size of each cache line in the cache unit is set according to the maximum payload of the Peripheral Component Interconnect Express Link and the length of the preset information; the length of the preset information is the length of the protection information corresponding to the target logical data block in the serial hard disk; the lengths of the protection information corresponding to all logical data blocks in the serial hard disk are equal; the target logical data block is any logical data block in the serial hard disk.
[0015] In a specific embodiment of the present invention, the maximum payload of the Peripheral Component Interconnect Express Link is obtained by reading the configuration parameters of the high-speed serial computer expansion bus standard configuration register.
[0016] In a specific embodiment of the present invention, it further includes:
[0017] When the available storage space of the cache unit is less than a preset threshold, the stored data in the cache unit is deleted using a cache eviction algorithm so that the available storage space of the cache unit is greater than or equal to the preset threshold.
[0018] In a specific embodiment of the present invention, the cache eviction algorithm is specifically the Least Recently Used (LRU) algorithm.
[0019] In a specific embodiment of the present invention, the host includes:
[0020] A data submission queue, configured to store the target requests submitted to the first controller;
[0021] A data completion queue, configured to store the response execution results of the processing module for the target requests.
[0022] To solve the above technical problems, the present invention further provides a control method for a host bus adapter, which is applied to a processing module in the host bus adapter disclosed above, and includes:
[0023] Parse the target request to obtain target parsing data, perform corresponding operations according to the target parsing data and target protection information, and at the same time feedback the operation result to the host.
[0024] In a specific embodiment of the present invention, the step of parsing the target request to obtain target parsing data, performing corresponding operations according to the target parsing data and target protection information, and at the same time feedbacking the operation result to the host includes:
[0025] When the first controller stores the target request in the cache module, parse the command control word in the target request to obtain a parsing result;
[0026] If it is determined according to the parsing result that the target request is a write request, write the original data in the target request to the serial hard disk according to the command control word in the target request, store the protection information in the target request in the target cache area, and at the same time feedback the corresponding write operation result to the host;
[0027] If it is determined according to the parsing result that the target request is a read request, read data from the serial hard disk according to the command control word in the target request to obtain target read data, read protection information from the target cache area to obtain first protection information, and at the same time feedback the corresponding read operation result to the host according to the target read data and the first protection information.
[0028] In a specific embodiment of the present invention, the step of writing the original data in the target request to the serial hard disk according to the command control word in the target request, storing the protection information in the target request in the target cache area, and at the same time feedbacking the corresponding write operation result to the host includes:
[0029] Generate a first write operation command and a second write operation command, and respond to the first write operation command and the second write operation command; wherein, the first write operation command is used to instruct the second controller to write the original data in the target request to the serial hard disk according to the command control word in the target request; the second write operation command is used to instruct the first controller to store the protection information in the target request in the target cache area according to the command control word in the target request;
[0030] When the first write operation command and the second write operation command are executed, a first completion response word is generated and written into the cache module, so that the first controller returns the first completion response word in the cache module to the host.
[0031] In a specific embodiment of the present invention, the generating the first completion response word includes:
[0032] Generating the first completion response word according to the message format specified by the non-volatile memory standard.
[0033] In a specific embodiment of the present invention, the reading data from the serial hard disk according to the command control word in the target request to obtain target read data, reading protection information from the target cache area to obtain first protection information, and simultaneously feeding back corresponding read operation results to the host according to the target read data and the first protection information includes:
[0034] Generating a first read operation command and a second read operation command; wherein, the first read operation command is used to instruct the second controller to read data from the serial hard disk according to the command control word of the target request to obtain the target read data; the second read operation command is used to instruct the first controller to read protection information from the target cache area according to the command control word of the target request to obtain first protection information;
[0035] When the first read operation command and the second read operation command are executed, a second response word is generated;
[0036] Obtaining the target read data and the first protection information;
[0037] Calculating protection information corresponding to the target read data according to a preset rule and the target read data to obtain second protection information;
[0038] Judging whether the first protection information and the second protection information are consistent;
[0039] If the first protection information and the second protection information are consistent, it is determined that the target read data is not damaged;
[0040] If the first protection information and the second protection information are inconsistent, it is determined that the target read data is damaged;
[0041] Setting the value corresponding to the second response word according to the damage determination result of the target read data, and writing the second response word into the cache module, so that the first controller returns the second completion response word in the cache module to the host.
[0042] In a specific embodiment of the present invention, setting the value corresponding to the second response word according to the damage determination result of the target read data includes:
[0043] If it is determined that the target read data is not damaged, set the value corresponding to the second response word to zero;
[0044] If it is determined that the target read data is damaged, set the value corresponding to the second response word to a non-zero value.
[0045] In a specific embodiment of the present invention, calculating the protection information corresponding to the target read data according to a preset rule and the target read data to obtain the second protection information includes:
[0046] If the first protection information includes two types of verification data, namely a cyclic redundancy check code and an application tag, calculate the protection information corresponding to the target read data according to the cyclic redundancy check code, the application tag, and the target read data to obtain the second protection information.
[0047] In a specific embodiment of the present invention, calculating the protection information corresponding to the target read data according to a preset rule and the target read data to obtain the second protection information includes:
[0048] If the first protection information includes three types of verification data, namely a cyclic redundancy check code, an application tag, and an address check code, calculate the protection information corresponding to the target read data according to the cyclic redundancy check code, the application tag, the address check code, and the target read data to obtain the second protection information.
[0049] In a specific embodiment of the present invention, calculating the protection information corresponding to the target read data according to a preset rule and the target read data to obtain the second protection information includes:
[0050] If the first protection information includes four types of verification data, namely a cyclic redundancy check code, an application tag, an address check code, and a digital signature, calculate the protection information corresponding to the target read data according to the cyclic redundancy check code, the application tag, the address check code, the digital signature, and the target read data to obtain the second protection information.
[0051] To solve the above technical problems, the present invention also provides a control device for a host bus adapter, including:
[0052] A memory for storing a computer program;
[0053] A processor for executing the computer program to implement the steps of a control method for a host bus adapter as disclosed above.
[0054] To solve the above technical problems, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of a control method for a host bus adapter as disclosed above.
[0055] To solve the above technical problems, the present invention also provides a computer program product, including a computer program / instructions, and when the computer program / instructions are executed by a processor, it implements the steps of a control method for a host bus adapter as disclosed above.
[0056] Beneficial effects: In a host bus adapter provided by the present invention, a first controller, a processing module, and a second controller are provided. Among them, the first controller is connected to the host through a peripheral component interconnect high-speed serial bus, and is used to receive a target request sent by the host, and request the host to allocate a target cache area to store target protection information using the target cache area; the target protection information is protection information corresponding to a serial hard disk; the processing module is used to parse the target request to obtain target parsing data, and execute corresponding operations according to the target parsing data and the target protection information, and at the same time feedback the operation result to the host; the second controller is connected to the serial hard disk through a serial bus, and is used to convert the target request into a request that conforms to the serial data transmission protocol to assist the processing module in responding to the target request.
[0057] In this setting mode, the conversion from the NVMe (Non-Volatile Memory Express) protocol to the SATA protocol can be achieved through the host bus adapter. Moreover, by using the target cache area in the host to store the target protection information, it is equivalent to storing the end-to-end data protection information that conforms to the NVMe standard in the target cache area of the host, thereby providing a complete end-to-end data protection mechanism for the serial hard disk. In this way, the host bus adapter can verify the integrity and accuracy of the stored data in the serial hard disk during data transmission according to the target protection information stored in the target cache area of the host, and thus can ensure the integrity and accuracy of the stored data in the serial hard disk throughout the transmission path.
[0058] Furthermore, when the protection information corresponding to the serial hard disk is stored in the target cache area on the host side, the execution efficiency of the host bus adapter in verifying the stored data in the serial hard disk can be further improved, and the working performance of the host bus adapter can be improved.
[0059] Correspondingly, a control method, a control device, a computer-readable storage medium, and a computer program product for a host bus adapter provided by the present invention also have the above beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] To more clearly illustrate the embodiments of the present invention, the following will briefly introduce the drawings required for the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0061] Figure 1 It is a structural diagram of a host bus adapter provided by an embodiment of the present invention.
[0062] Figure 2 It is a schematic diagram of the end-to-end data protection function of NVMe.
[0063] Figure 3 It is a structural diagram of another host bus adapter provided by an embodiment of the present invention.
[0064] Figure 4 It is a structural diagram of a cache unit.
[0065] Figure 5 It is a flowchart when a processing module in a host bus adapter processes a target request.
[0066] Figure 6 It is a structural diagram of a control device for a host bus adapter provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0067] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present invention.
[0068] The terms "including" and "having" in the specification of the present invention and any variations related to "including" and "having" are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may include steps or units not listed.
[0069] To enable those skilled in the art to better understand the solutions of the present invention, the present invention will be further described in detail below with reference to the drawings and specific embodiments.
[0070] Please refer to Figure 1 , Figure 1 , which is a structural diagram of a host bus adapter provided by an embodiment of the present invention. The host bus adapter 100 includes:
[0071] A first controller 101 is connected to the host through a peripheral component interconnect high-speed serial bus, and is configured to receive a target request sent by the host, and request the host to allocate a target cache area, so as to store target protection information in the target cache area; the target protection information is protection information corresponding to a serial hard disk.
[0072] A processing module 102 is configured to parse the target request to obtain target parsing data, and perform corresponding operations according to the target parsing data and the target protection information, and at the same time feedback an operation result to the host.
[0073] A second controller 103 is connected to the serial hard disk through a serial bus, and is configured to convert the target request into a request that conforms to the serial data transmission protocol, so as to assist the processing module 102 to respond to the target request.
[0074] In this embodiment, a host bus adapter 100 is provided. By using the host bus adapter 100, the integrity and accuracy of the stored data in the serial hard disk can be guaranteed during the entire transmission path. Before introducing the host bus adapter 100, a brief description of the end-to-end data protection function (End-to-End Data Protection, E2E) of NVMe is given first.
[0075] The end-to-end data protection function of NVMe aims to ensure the integrity and accuracy of data during the entire transmission path to prevent silent data corruption. The end-to-end data protection function of NVMe mainly adds additional protection information (Protection Information, PI) to the logical block data (LogicalBlock Data), so that it is transmitted together as metadata of the data. After receiving the data, the host side and the non-volatile storage device (NVMe controller) can verify the integrity of the transmitted data according to the protection information added to the logical block data, thereby ensuring the availability and consistency of the transmitted data. Please refer to Figure 2 , Figure 2 , which is a schematic diagram of the end-to-end data protection function of NVMe. In Figure 2 , the data sent by the host to the non-volatile storage device includes 4096 bytes of user original data and 8 bytes of protection information.
[0076] NVMe HMB (Host Memory Buffer) is a feature introduced in the NVMe 1.2 standard. This feature allows the NVMe controller to use the host-side memory as a buffer, reducing the NVMe controller's need for DRAM (Dynamic Random Access Memory). This not only reduces the manufacturing cost of the NVMe controller but also improves its performance. In other words, by leveraging the HMB feature, the NVMe controller can make full use of the memory in the host and reduce its dependence on DRAM.
[0077] Since the SATA standard protocol itself does not have an end-to-end data protection mechanism and cannot guarantee the accuracy and reliability of data during transmission, in this embodiment, to address this technical issue, a host bus adapter 100 is provided. Using this host bus adapter 100, not only can the conversion from the NVMe protocol to the SATA protocol be achieved, but also a complete end-to-end data protection mechanism can be provided for the serial hard disk. In this host bus adapter 100, a first controller 101, a processing module 102, and a second controller 103 are provided. Among them, the serial hard disk connected to the second controller 103 can be one or more. And the serial hard disk is the user data storage area, storing the data that the user needs to store.
[0078] Among them, the first controller 101 is connected to the host through the Peripheral Component Interconnect Express (PCIe) bus and is used to receive the target request sent by the host and request the host to allocate a target cache area to store the target protection information; the target protection information is the protection information corresponding to the serial hard disk. Since the first controller 101 is connected to the host through the PCIe bus, the first controller 101 supports the NVMe standard protocol. On the host side, the first controller 101 appears as a standard NVMe device. That is to say, the first controller 101 is essentially an NVMe controller.
[0079] Since the first controller 101 has the HMB feature defined in the NVMe specification, the first controller 101 can request the host to allocate a target cache area for its own management and use, and use the target cache area to store the target protection information. In this setting, the first controller 101 can use the HMB feature of NVMe to store the target protection information in the target cache area of the host, which can reduce the demand of the host bus adapter 100 for internal DRAM and lower the cost of the host bus adapter 100. Moreover, by using the cache area of the host memory, the latency of the first controller 101 during data processing can also be reduced, further improving the processing speed of the first controller 101 for the received requests.
[0080] The processing module 102 is the management center of the host bus adapter 100, mainly used to parse the target requests sent by the host to obtain target parsing data, execute corresponding operations according to the target parsing data and the target protection information, and feedback the operation results to the host at the same time.
[0081] The second controller 103 is connected to the serial hard disk (SATA hard disk) through a serial bus (SATA bus), and is equivalent to a SATA controller, used to convert the target requests sent by the host into requests that conform to the serial data transmission protocol (SATA protocol) to assist the processing module 102 in responding to the target requests.
[0082] Obviously, after setting the first controller 101 and the second controller 103 in the host bus adapter 100, it can be connected to the host through the PCIe bus upstream of the host bus adapter 100 and connected to the serial hard disk through the SATA bus downstream, so as to realize the conversion from the NVMe protocol to the SATA protocol. That is, the host bus adapter 100 described in this embodiment uses the standard NVMe protocol upstream, which can be compatible with the existing NVMe system drivers on the host side, and uses the SATA controller downstream, which can be compatible with the existing SATA storage devices in the market. This design can not only effectively reduce the deployment difficulty of the system and enhance the scalability of the system, but also make the system upgrade process more flexible and simple.
[0083] Moreover, the host bus adapter 100 provided by this embodiment can integrate complex end-to-end data protection functions in the same hardware device, which can not only simplify the design complexity of the storage system, but also the unified protection mechanism and compatibility help to simplify the maintenance work of the storage system and improve the stability and maintainability of the storage system.
[0084] In addition, when the first controller 101 stores the target protection information (the target protection information is the protection information corresponding to the serial hard disk) in the target cache area of the host, during the process of receiving the target request sent by the host and parsing the target request, the first controller 101 can perform real-time detection and verification on the parsing result of the target request according to the target protection information stored in the host target cache area, so as to determine whether an error or abnormality occurs in the transmission data corresponding to the target request during the data transmission process, which can effectively prevent silent data corruption and ensure the integrity and accuracy of the data during the transmission process. Moreover, the real-time verification function of the end-to-end data protection mechanism also helps to reduce the repeated transmission and processing caused by data errors, which can further improve the data processing efficiency of the system.
[0085] For enterprise-level storage applications involving a large amount of critical data, such as financial transaction records, medical cases, important business documents, etc., the host bus adapter 100 described in this embodiment can provide a complete data verification mechanism, which can significantly reduce the enterprise operation risk and business decision-making risk caused by silent data corruption.
[0086] In addition, when the host bus adapter 100 detects that the stored data in the serial hard disk is damaged, it can timely identify and feedback error information, so that the upper-layer application can perform corresponding processing according to the error situation, such as data retransmission, error recovery, etc., which can not only enhance the fault tolerance of the entire storage system, but also improve the availability and stability of the storage system.
[0087] In this setting mode, the conversion from the NVMe protocol to the SATA protocol can be realized through the host bus adapter. Moreover, by using the target cache area in the host to store the target protection information, it is equivalent to storing the end-to-end data protection information conforming to the NVMe standard in the target cache area of the host, thus providing a complete end-to-end data protection mechanism for the serial hard disk, which enables the host bus adapter to verify the integrity and accuracy of the stored data in the serial hard disk during the data transmission process according to the target protection information stored in the target cache area of the host, thereby ensuring the integrity and accuracy of the stored data in the serial hard disk in the entire transmission path.
[0088] Based on the above embodiments, this embodiment further illustrates and optimizes the technical solution. Please refer to Figure 3 , Figure 3 which is the structural diagram of another host bus adapter provided by the embodiment of the present invention. As a preferred implementation manner, the above host bus adapter further includes:
[0089] The cache module 104 is used to temporarily store the data and target protection information generated by the first controller 101, the processing module 102, and the second controller 103.
[0090] In this embodiment, a cache module 104 is further provided in the host bus adapter, and the cache module 104 is used to temporarily store the relevant data and target protection information involved in the operation process of the first controller 101, the processing module 102, and the second controller 103. In this setting mode, it is more convenient for the first controller 101, the processing module 102, and the second controller 103 to schedule and manage data during the processing flow transaction.
[0091] As a preferred embodiment, the cache module 104 includes:
[0092] A cache unit for temporarily storing the target protection information.
[0093] In this embodiment, in order to further reduce the resource overhead of the host bus adapter when accessing the host and give full play to the transmission efficiency of the PCIe link between the host and the host bus adapter, a cache unit for temporarily storing the target protection information is further provided in the cache module.
[0094] In this setting mode, when the host bus adapter needs to use the target protection information, it does not need to read the target protection information from the target cache area of the host, but can directly read the target protection information from the cache unit, which can further improve the data processing efficiency of the host bus adapter.
[0095] As a preferred embodiment, the size of each cache line in the cache unit is set according to the maximum payload of the peripheral component interconnect express link and the length of the preset information; the length of the preset information is the length of the protection information corresponding to the target logical data block in the serial ATA hard disk; the lengths of the protection information corresponding to all logical data blocks in the serial ATA hard disk are equal; the target logical data block is any one of the logical data blocks in the serial ATA hard disk.
[0096] In this embodiment, the target protection information is the protection information corresponding to the serial ATA hard disk. In fact, the target protection information contains the protection information corresponding to each logical data block in the serial ATA hard disk, that is, the target protection information is the set of the protection information corresponding to all logical data blocks in the serial ATA hard disk.
[0097] It should be noted that for the convenience of data processing, the lengths of the protection information corresponding to all logical data blocks in the serial ATA hard disk are equal. If the target logical data block is any one of the logical data blocks in the serial ATA hard disk, then the length of the protection information corresponding to the target logical data block is the length of the preset information.
[0098] When setting the size of each cache line in the cache unit, it can be set according to the maximum payload (Max Payload Size) of the Peripheral Component Interconnect Express (PCIe) link and the length of the preset information. Specifically, when setting the size of each cache line in the cache unit according to the maximum payload of the PCIe link and the length of the preset information, it is dynamically set according to the least common multiple of the maximum payload of the PCIe link and the length of the preset information.
[0099] A specific example is used here for illustration. If the length of the preset information is 8 bytes and the maximum payload of the PCIe link is 256 bytes, then the size of each cache line in the cache unit is 256 bytes. If the length of the preset information is 8 bytes and the maximum payload of the PCIe link is 512 bytes, then the size of each cache line in the cache unit is 512 bytes.
[0100] Please refer to Figure 4 , Figure 4 for the structural diagram of the cache unit. In Figure 4 the cache unit shown, there are multiple cache lines, and there is a one-to-one mapping relationship between each cache line and the data cached inside it.
[0101] Obviously, through the technical solution provided by this embodiment, it is possible to maximize the data transferred from the cache line to the PCIe link in the cache unit, thereby reducing the resource overhead required during data transfer, improving the data transfer efficiency. Moreover, dynamically setting the size of each cache line in the cache unit can also reduce the replacement efficiency of the cache line, reduce the number of data accesses caused by cache misses, and reduce the overall latency of the system.
[0102] As a preferred implementation manner, the maximum payload of the Peripheral Component Interconnect Express link is obtained by reading the configuration parameters of the PCI Express Configuration Register.
[0103] In this embodiment, when obtaining the maximum payload of a Peripheral Component Interconnect Express (PCIe) link, during the initialization of the host bus adapter, the maximum payload of the PCIe link is obtained by reading the configuration parameters of the Peripheral Component Interconnect Express (PCIe) standard configuration register. Since when a PCIe device transmits data, its maximum payload is negotiated and determined by the PCIe standard configuration registers at both ends of the link, and each PCIe standard configuration register has two related parameters, one is the maximum payload supported by the device hardware (Max Payload Size Supported), and the other is the maximum payload actually used by the device (Max Payload Size). Therefore, during the initialization of the host bus adapter, the system software sets the maximum payload of the PCIe link according to the maximum payload supported by the PCIe standard configuration registers at both ends of the link.
[0104] Obviously, through the technical solution provided by this embodiment, the accuracy and reliability in setting the maximum payload of the PCIe link can be ensured.
[0105] As a preferred implementation manner, the above host bus adapter further includes:
[0106] When the available storage space of the cache unit is less than a preset threshold, the stored data in the cache unit is deleted by using a cache eviction algorithm, so that the available storage space of the cache unit is greater than or equal to the preset threshold.
[0107] The cache unit is set in the cache module to further reduce the overhead of the host bus adapter when accessing the host memory. However, the storage space of the cache unit is limited, and sometimes it may not be possible to cache and store all the data in the target protected information.
[0108] In this case, in order to ensure that the data stored in the cache unit are all the data that are frequently accessed recently and reduce the adverse effects brought by insufficient storage space of the cache unit, some of the stored data in the cache unit can be deleted by using a cache eviction algorithm. That is, when the available storage space of the cache unit is less than the preset threshold, the stored data in the cache unit can be deleted by using a cache eviction algorithm, so that the available storage space of the cache unit is greater than or equal to the preset threshold.
[0109] Obviously, through the technical solution provided by this embodiment, the adverse effects brought by insufficient storage space of the cache unit can be relatively reduced.
[0110] As a preferred implementation, in practical applications, the cache eviction algorithm can be set to the Least Recently Used (LRU) algorithm. Since this algorithm can evict the data that has not been used for the longest time and preferentially retain the data that has been recently accessed, the utilization rate and hit rate of the cache can be effectively improved under this eviction mechanism. In this way, when the system processes a large amount of data, it can access the data it wants to access more quickly, thereby improving the overall performance of the system.
[0111] As a preferred implementation, the host includes:
[0112] A data submission queue for storing target requests submitted to the first controller.
[0113] A data completion queue for storing the response execution results of the processing module for the target requests.
[0114] In this embodiment, in order to improve the working performance of the host, a data submission queue (Submission Queue) and a data completion queue (Completion Queue) can also be set in the host. Among them, the data submission queue is used to store target requests submitted to the first controller in the host bus adapter, and the data completion queue is used to store the response execution results of the processing module for the target requests.
[0115] It can be envisioned that by setting a data submission queue and a data completion queue in the host, the host is allowed to process multiple requests in a batch manner simultaneously, rather than processing each request one by one. This batch data processing method can reduce the number of interruptions when the host and the host bus adapter process requests, reduce the required resource overhead, and reduce the latency time during data transmission.
[0116] Moreover, by setting a data submission queue and a data completion queue in the host, different operations can also be isolated in different queues. This isolation mechanism can effectively prevent errors from affecting each other between requests and completion operations, thereby improving the reliability of the host.
[0117] Obviously, through the technical solution provided by this embodiment, the working performance of the host can be further improved.
[0118] Correspondingly, the embodiment of the present invention also provides a control method for a host bus adapter, which is applied to a processing module in the aforementioned disclosed host bus adapter, and includes:
[0119] Parse the target request to obtain target parsing data, and perform corresponding operations according to the target parsing data and the target protection information, and at the same time feedback the operation result to the host.
[0120] A control method for a host bus adapter provided by an embodiment of the present invention corresponds to the control logic executed by the processing module in the foregoing embodiment, which will not be elaborated here. For details, reference may be made to the content disclosed in the foregoing embodiment.
[0121] Based on the foregoing embodiment, this embodiment further illustrates and optimizes the technical solution. Please refer to Figure 5 , Figure 5 which is a flowchart when the processing module in the host bus adapter processes a target request. As a preferred implementation manner, the above steps: parsing the target request to obtain target parsing data, and performing corresponding operations according to the target parsing data and target protection information, and at the same time feeding back an operation result to the host, include:
[0122] Step S11: When the first controller stores the target request in the cache module, parse the command control word in the target request to obtain a parsing result.
[0123] Step S12: If it is determined according to the parsing result that the target request is a write request, write the original data in the target request to the serial hard disk according to the command control word in the target request, store the protection information in the target request in the target cache area, and at the same time feed back a corresponding write operation result to the host.
[0124] Step S13: If it is determined according to the parsing result that the target request is a read request, read data from the serial hard disk according to the command control word in the target request to obtain target read data, and read protection information from the target cache area to obtain first protection information, and at the same time feed back a corresponding read operation result to the host according to the target read data and the first protection information.
[0125] In this embodiment, the execution logic of the processing module in the host bus adapter is specifically described. As the management center of the host bus adapter, the processing module is not only responsible for identifying and initializing the serial hard disk connected downstream of the host bus adapter, planning the target cache area on the host side, and establishing the mapping relationship between each logical data block in the serial hard disk and its protection information, but also responsible for decomposing, scheduling, and converting the requests received by the first controller.
[0126] Specifically, when the first controller stores the target request in the cache module, the processing module will parse the command control word in the target request to obtain a parsing result. Among them, the host will write the target request into the data submission queue of the host and notify the first controller that there is a new request waiting to be processed. At this time, the first controller will store the target request in the cache module for the processing module to process.
[0127] When the processing module determines that the target request is a write request according to the parsing result, it indicates that the target request contains the command control word, the original data, and the protection information of the target request. At this time, the processing module will write the original data in the target request to the corresponding address of the serial hard disk according to the command control word in the target request, and store the protection information in the target request in the target cache area on the host side according to the command control word in the target request. At the same time, it will also feedback the corresponding write operation result to the host, that is, the processing module will feedback to the host whether the original data and the protection information in the target request are successfully written to the serial hard disk and the target cache area on the host side respectively.
[0128] If the processing module determines that the target request is a read request according to the parsing result, it indicates that the target request only contains the command control word of the target request. At this time, the processing module will read data from the serial hard disk according to the command control word in the target request to obtain the target read data, so as to feedback the target read data to the host. And, the processing module will also read the protection information from the target cache area according to the command control word in the target request to obtain the first protection information, and judge whether there is an error or abnormality in the target read data during the data transmission process according to the first protection information. At the same time, the processing module will also feedback the corresponding read operation result to the host, that is, the processing module will feedback to the host whether the target read data and the first protection information are successfully returned to the host.
[0129] Obviously, through the technical solution provided by this embodiment, the host bus adapter can successfully respond to the request sent by the host.
[0130] As a preferred implementation manner, the above steps: writing the original data in the target request to the serial hard disk according to the command control word in the target request, storing the protection information in the target request in the target cache area, and at the same time feedbacking the corresponding write operation result to the host, include:
[0131] Generate a first write operation command and a second write operation command, and respond to the first write operation command and the second write operation command; wherein, the first write operation command is used to instruct the second controller to write the original data in the target request to the serial hard disk according to the command control word in the target request; the second write operation command is used to instruct the first controller to store the protection information in the target request in the target cache area according to the command control word in the target request.
[0132] When the first write operation command and the second write operation command are executed, generate a first completion response word, and write the first completion response word to the cache module, so that the first controller returns the first completion response word in the cache module to the host.
[0133] In this embodiment, the operation process of the write request sent by the host by the processing module is specifically described. When the processing module determines that the target request is a write request according to the parsing result, the processing module first generates a first write operation command and a second write operation command, and responds to the first write operation command and the second write operation command. Among them, the first write operation command is used to instruct the second controller to write the original data in the target request to the serial hard disk according to the command control word in the target request, and the second write operation command is used to instruct the first controller to store the protection information in the target request in the target cache area on the host side according to the command control word in the target request.
[0134] It should be noted that when the target request is a write request, the processing module will obtain two addresses by parsing the command control word in the target request. One address is the storage address of the original data in the target request in the serial hard disk, and the other address is the storage address of the protection information in the target request in the target cache area on the host side. Therefore, the processing module can write the original data and protection information in the target request to the corresponding addresses in the serial hard disk and the target cache area respectively according to the command control word in the target request.
[0135] Since there is a corresponding mapping relationship between the original data and the protection information in the target request, when the processing module writes the original data in the target request to the serial hard disk, it can use the protection information in the target request to verify the data written to the serial hard disk and ensure the integrity and accuracy of the data written to the serial hard disk.
[0136] When the processing module finishes executing the first write operation command and the second write operation command, the processing module generates a first completion response word and writes the first completion response word to the cache module. When the processing module writes the first completion response word to the cache module, the first controller will return the first completion response word in the cache module to the data completion queue of the host, so that the host can clearly know the operation response result of the write request. Thus, the processing flow of the write request with end-to-end protection function ends.
[0137] It should be noted that if the processing module successfully responds to the write request, the processing module will set the value corresponding to the first response word to zero; if the processing module does not successfully respond to the write request, the processing module will set the value corresponding to the first response word to a non-zero value, so that the host side can accurately know the response execution result of the host bus adapter to the write request.
[0138] Obviously, through the technical solution provided by this embodiment, not only can the host bus adapter successfully respond to the write request sent by the host side, but also the data written to the serial hard disk can be accurate and error-free.
[0139] As a preferred embodiment, the above step of generating the first completion response word includes:
[0140] Generating the first completion response word according to the message format specified by the non-volatile memory standard.
[0141] In this embodiment, when the processing module generates the first completion response word, it will generate the first completion response word according to the message format specified by the non-volatile memory standard (NVMe standard). Since the first controller in the host bus adapter establishes a communication connection with the host through the PCIe bus, the host bus adapter will fully support the NVMe standard protocol. Then, when the processing module returns the first response word to the host, it will generate the first completion response word based on the message format specified by the NVMe standard.
[0142] Obviously, through the technical solution provided by this embodiment, it can be ensured that data interaction between the host bus adapter and the host can proceed smoothly.
[0143] Based on the above embodiment, this embodiment further describes and optimizes the technical solution. As a preferred embodiment, the above step of reading data from the serial hard disk according to the command control word in the target request to obtain the target read data, reading the protection information from the target buffer area to obtain the first protection information, and simultaneously feeding back the corresponding read operation result to the host according to the target read data and the first protection information includes:
[0144] Generating a first read operation command and a second read operation command; wherein, the first read operation command is used to instruct the second controller to read data from the serial hard disk according to the command control word of the target request to obtain the target read data; the second read operation command is used to instruct the first controller to read the protection information from the target buffer area according to the command control word of the target request to obtain the first protection information.
[0145] When the first read operation command and the second read operation command are executed, generate a second response word.
[0146] Obtain the target read data and the first protection information.
[0147] Calculate the protection information corresponding to the target read data according to the preset rule and the target read data to obtain the second protection information.
[0148] Judge whether the first protection information and the second protection information are consistent.
[0149] If the first protection information and the second protection information are consistent, it is determined that the target read data is not damaged.
[0150] If the first protection information and the second protection information are inconsistent, it is determined that the target read data is damaged.
[0151] Set the value corresponding to the second response word according to the damage determination result of the data read from the target, and write the second response word into the cache module, so that the first controller returns the second completion response word in the cache module to the host.
[0152] In this embodiment, the operation process of the read request sent by the host by the processing module is specifically described. When the processing module determines that the target request is a read request according to the parsing result, it will first generate a first read operation command and a second read operation command; among them, the first read operation command is used to instruct the second controller to read data from the serial hard disk according to the command control word of the target request to obtain the target read data; and the second read operation command is used to instruct the first controller to read the protection information from the target cache area on the host side according to the command control word of the target request to obtain the first protection information.
[0153] It should be noted that when the target request is a read request, after the processing module parses the command control word of the target request, two addresses will be obtained. One address is the storage location of the data corresponding to the read request in the serial hard disk, and the other address is the storage location of the protection information of the data corresponding to the read request in the target cache area on the host side. Therefore, after the processing module parses the command control word of the target request, it can read the target read data from the serial hard disk and read the first protection information from the target cache area on the host side.
[0154] When the processing module finishes executing the first read operation command and the second read operation command, it will generate a second response word, and will obtain the target read data and the first protection information. Then, the processing module will calculate the protection information corresponding to the target read data according to the preset rules and the target read data set in advance to obtain the second protection information, and will judge whether the first protection information and the second protection information are consistent. If the first protection information and the second protection information are consistent, it means that the target read data has not been damaged during the data transmission process and is complete and error-free. If the first protection information and the second protection information are inconsistent, it means that the target read data has been damaged during the data transmission process.
[0155] In this case, the value corresponding to the second response word can be set according to the damage determination result of the target read data, so that the second response word can accurately represent whether the host bus adapter has successfully responded to the read request sent by the host. After the processing module sets the value corresponding to the second response word according to the damage determination result of the target read data, the processing module can write the second response word to the cache module, so that the first controller can return the second response word in the cache module to the data completion queue of the host, and then the host can clearly know the operation response result of the read request, and the entire processing flow of the read request with end-to-end protection function ends.
[0156] Obviously, the technical solution provided by this embodiment can not only enable the host bus adapter to successfully respond to the read request sent by the host side, but also ensure that the data read from the serial port hard disk is accurate and complete.
[0157] As a preferred implementation, the above step of setting the value corresponding to the second response word according to the damage determination result of the target read data includes:
[0158] If it is determined that the target read data is not damaged, the value corresponding to the second response word is set to zero.
[0159] If it is determined that the target read data is damaged, the value corresponding to the second response word is set to a non-zero value.
[0160] In this embodiment, when the processing module sets the value corresponding to the second response word according to the damage determination result of the target read data, if the processing module determines that the target read data is not damaged, that is, the first protection information and the second protection information are consistent, the processing module can set the value corresponding to the second response word to zero. If the processing module determines that the target read data is damaged, that is, the first protection information and the second protection information are inconsistent, the processing module can set the value corresponding to the second response word to a non-zero value.
[0161] In this setting mode, the host can clearly know the operation response result of the read request through the second response word returned by the first controller in the host bus adapter. In addition, this setting mode of the second response word has simple execution logic and is easy to operate, which can further improve the processing performance of the host bus adapter.
[0162] As a preferred implementation, the above step of calculating the protection information corresponding to the target read data according to the preset rule and the target read data to obtain the second protection information includes:
[0163] If the first protection information includes two types of verification data, namely cyclic redundancy check code and application label, then calculate the protection information corresponding to the target read data based on the cyclic redundancy check code, application label and target read data to obtain the second protection information.
[0164] In this embodiment, if the first protection information includes two types of verification data, namely cyclic redundancy check (CRC) and application label, it indicates that the protection information stored in the target cache area is only used to protect user data and is applicable to application scenarios with relatively low requirements for data integrity.
[0165] In this case, the protection information corresponding to the target read data can be calculated based on the target read data and the cyclic redundancy check code and application label in the first protection information to obtain the second protection information, and the first protection information and the second protection information are used to determine whether the target read data is damaged during transmission.
[0166] As a preferred implementation manner, the above step: calculating the protection information corresponding to the target read data according to the preset rule and the target read data to obtain the second protection information includes:
[0167] If the first protection information includes three types of verification data, namely cyclic redundancy check code, application label and address verification code, then calculate the protection information corresponding to the target read data based on the cyclic redundancy check code, application label, address verification code and target read data to obtain the second protection information.
[0168] If the first protection information includes three types of verification data, namely cyclic redundancy check code, application label and logical block address (LBA), it indicates that the protection information stored in the target cache area can not only be used to protect user data, but also prevent user data from being written to the wrong address, and is applicable to application scenarios with relatively high requirements for data integrity.
[0169] In this case, the protection information corresponding to the target read data can be calculated based on the target read data and the cyclic redundancy check code, application label and address verification code in the first protection information to obtain the second protection information, and the first protection information and the second protection information are used to determine whether the target read data is damaged during transmission.
[0170] As a preferred implementation manner, the above step: calculating the protection information corresponding to the target read data according to the preset rule and the target read data to obtain the second protection information includes:
[0171] If the first protection information includes four types of verification data, namely cyclic redundancy check code, application label, address verification code, and digital signature, then calculate the protection information corresponding to the target read data based on the cyclic redundancy check code, application label, address verification code, digital signature, and target read data to obtain the second protection information.
[0172] If the first protection information includes four types of verification data, namely cyclic redundancy check code, application label, address verification code, and digital signature, it indicates that the protection information stored in the target cache area can not only prevent user data from being written to the wrong address in addition to protecting user data, but also calculate the digital signature of the user data and the address verification code through an encryption mechanism, thereby preventing data from being tampered with during transmission. It is applicable to application scenarios with relatively high requirements for data integrity. For example: financial transactions and database operations, etc.
[0173] In this case, the protection information corresponding to the target read data can be calculated based on the target read data and the cyclic redundancy check code, application label, address verification code, and digital signature in the first protection information to obtain the second protection information, and the first protection information and the second protection information are used to determine whether the target read data is damaged during transmission.
[0174] For the above three calculation methods of the second protection information, reference can be made to the Type 1, Type 2, and Type 3 calculation and verification methods defined for the end-to-end data protection function in the NVMe specification, which will not be elaborated here.
[0175] Obviously, through the technical solution provided in this embodiment, the integrity and accuracy of the data read from the serial hard disk can be verified in different application scenarios.
[0176] Please refer to Figure 6 , Figure 6 which is the structural diagram of a control device for a host bus adapter provided by an embodiment of the present invention, including:
[0177] A memory 31 for storing computer programs.
[0178] A processor 32 for executing the computer program to implement the steps of a control method for a host bus adapter as disclosed above.
[0179] The control device for the host bus adapter provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer, etc.
[0180] Among them, the processor 32 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 32 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). The processor 32 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 32 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 32 may further include an artificial intelligence (AI) processor, and the AI processor is used to process computational operations related to machine learning.
[0181] The memory 31 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 31 may further include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In this embodiment, the memory 31 is at least used to store the following computer program 301. After the computer program is loaded and executed by the processor 32, it can implement the relevant steps of the control method of the host bus adapter disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 31 may further include an operating system 302 and data 303, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 302 may include Windows, Unix, Linux, etc. The data 303 may include, but is not limited to, the data involved in the control method of the host bus adapter.
[0182] In some embodiments, the control device of the host bus adapter may further include a display screen 33, an input / output interface 34, a communication interface 35, a power supply 36, and a communication bus 37.
[0183] Those skilled in the art can understand that Figure 6 the shown structure does not constitute a limitation on the control device of the host bus adapter, and it may include more or fewer components than shown in the figure.
[0184] It can be understood that if the methods in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the current technology, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods in the various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, magnetic disks, or optical discs that can store program codes.
[0185] The control device of a host bus adapter provided by an embodiment of the present invention has the beneficial effects of a control method of a host bus adapter disclosed above.
[0186] Correspondingly, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of a control method of a host bus adapter disclosed above.
[0187] The computer-readable storage medium provided by an embodiment of the present invention has the beneficial effects of a control method of a host bus adapter disclosed above.
[0188] Correspondingly, an embodiment of the present invention further provides a computer program product, including a computer program / instructions. When the computer program / instructions are executed by a processor, they implement the steps of a control method of a host bus adapter disclosed above.
[0189] The computer program product provided by an embodiment of the present invention has the beneficial effects of a control method of a host bus adapter disclosed above.
[0190] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0191] The above has introduced in detail a host bus adapter, a control method and related devices provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present invention, several improvements and modifications can still be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
Claims
1. A host bus adapter, characterized in that: include: A first controller is connected to the host through a peripheral component interconnect high-speed serial bus, and is used to receive a target request sent by the host, and request the host to allocate a target cache area, so as to use the target cache area to store target protection information; The target protection information is protection information corresponding to the serial port hard disk; A processing module, configured to parse the target request to obtain target parsing data, perform corresponding operations according to the target parsing data and the target protection information, and feed back the operation results to the host; The second controller is connected to the serial port hard disk via a serial bus, and is used for converting the target request into a request conforming to a serial data transmission protocol, so as to assist the processing module in responding to the target request.
2. A host bus adapter according to claim 1, characterized in that: Also includes: A cache module is used to temporarily store the data generated by the first controller, the processing module and the second controller and the target protection information.
3. A host bus adapter according to claim 2, characterized in that: The cache module comprises: A cache unit is used to temporarily store the target protection information.
4. A host bus adapter according to claim 3, characterized in that: The size of each cache line in the cache unit is set according to the maximum payload of the peripheral component interconnect fast link and the length of preset information; the length of the preset information is the length of the protection information corresponding to the target logical data block in the serial port hard disk; the length of the protection information corresponding to all logical data blocks in the serial port hard disk is equal; the target logical data block is any logical data block in the serial port hard disk.
5. A host bus adapter according to claim 4, characterized in that: The maximum effective load of the PCI Express link is obtained by reading the configuration parameters of the high-speed serial computer expansion bus standard configuration register.
6. The host bus adapter according to claim 3, characterized in that: Also includes: When the available storage space of the cache unit is less than a preset threshold, a cache elimination algorithm is used to delete the stored data in the cache unit so that the available storage space of the cache unit is greater than or equal to the preset threshold.
7. A host bus adapter according to claim 6, characterized in that: The cache elimination algorithm is specifically a least recently used algorithm.
8. The host bus adapter according to claim 1, wherein: The host comprises: a data submission queue, used to store the target request submitted to the first controller; The data completion queue is used to store the response execution result of the processing module to the target request.
9. A method for controlling a host bus adapter, characterized in that: A processing module used in a host bus adapter according to any one of claims 1 to 8, comprising: The target request is parsed to obtain target parsed data, and corresponding operations are performed according to the target parsed data and target protection information, and the operation results are fed back to the host.
10. The control method of a host bus adapter according to claim 9, characterized in that: The target request is parsed to obtain target parsed data, and corresponding operations are performed according to the target parsed data and target protection information, and the operation result is fed back to the host, including: When the first controller stores the target request in the cache module, the command control word in the target request is parsed to obtain a parsing result; If the target request is determined to be a write request according to the analysis result, the original data in the target request is written to the serial port hard disk according to the command control word in the target request, and the protection information in the target request is stored in the target cache area, and the corresponding write operation result is fed back to the host; If it is determined according to the analysis result that the target request is a read request, data is read from the serial port hard disk according to the command control word in the target request to obtain the target read data, and protection information is read from the target cache area to obtain the first protection information, and at the same time, the corresponding read operation result is fed back to the host according to the target read data and the first protection information.
11. The control method of a host bus adapter according to claim 10, characterized in that: The method of writing the original data in the target request to the serial port hard disk according to the command control word in the target request, storing the protection information in the target request to the target cache area, and feeding back the corresponding write operation result to the host includes: Generate a first write operation command and a second write operation command, and respond to the first write operation command and the second write operation command; wherein the first write operation command is used to instruct the second controller to write the original data in the target request to the serial port hard disk according to the command control word in the target request; the second write operation command is used to instruct the first controller to store the protection information in the target request to the target cache area according to the command control word in the target request; When the first write operation command and the second write operation command are executed, a first completion response word is generated and written to the cache module, so that the first controller returns the first completion response word in the cache module to the host.
12. The control method of a host bus adapter according to claim 11, characterized in that: The generating of the first completion response word comprises: The first completion response word is generated according to a message format specified by a non-volatile memory standard.
13. The control method of a host bus adapter according to claim 10, characterized in that: The method comprises: reading data from the serial port hard disk according to the command control word in the target request to obtain target read data, reading protection information from the target cache area to obtain first protection information, and feeding back corresponding read operation results to the host according to the target read data and the first protection information, including: Generate a first read operation command and a second read operation command; wherein the first read operation command is used to instruct the second controller to read data from the serial port hard disk according to the command control word of the target request to obtain the target read data; the second read operation command is used to instruct the first controller to read protection information from the target cache area according to the command control word of the target request to obtain first protection information; When the first read operation command and the second read operation command are executed, a second response word is generated; Acquire the target read data and the first protection information; Calculate protection information corresponding to the target read data according to a preset rule and the target read data to obtain second protection information; Determining whether the first protection information and the second protection information are consistent; If the first protection information is consistent with the second protection information, it is determined that the target read data is not damaged; If the first protection information and the second protection information are inconsistent, determining that the target read data is damaged; The value corresponding to the second response word is set according to the damage determination result of the target read data, and the second response word is written to the cache module, so that the first controller returns the second completion response word in the cache module to the host.
14. The control method of a host bus adapter according to claim 13, characterized in that: The step of setting the value corresponding to the second response word according to the damage determination result of the target read data includes: If it is determined that the target read data is not damaged, the value corresponding to the second response word is set to zero; If it is determined that the target read data is damaged, the value corresponding to the second response word is set to a non-zero value.
15. The control method of a host bus adapter according to claim 13, characterized in that: The calculating the protection information corresponding to the target read data according to the preset rule and the target read data to obtain the second protection information includes: If the first protection information includes two types of check data, namely a cyclic redundancy check code and an application tag, the protection information corresponding to the target read data is calculated according to the cyclic redundancy check code, the application tag and the target read data to obtain the second protection information.
16. The control method of a host bus adapter according to claim 13, characterized in that: The calculating the protection information corresponding to the target read data according to the preset rule and the target read data to obtain the second protection information includes: If the first protection information includes three types of verification data, namely, a cyclic redundancy check code, an application tag and an address check code, then the protection information corresponding to the target read data is calculated based on the cyclic redundancy check code, the application tag, the address check code and the target read data to obtain the second protection information.
17. The control method of a host bus adapter according to claim 13, characterized in that: The calculating the protection information corresponding to the target read data according to the preset rule and the target read data to obtain the second protection information includes: If the first protection information includes four types of verification data, namely, a cyclic redundancy check code, an application tag, an address check code and a digital signature, then the protection information corresponding to the target read data is calculated based on the cyclic redundancy check code, the application tag, the address check code, the digital signature and the target read data to obtain the second protection information.
18. A control device for a host bus adapter, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program to implement the steps of a host bus adapter control method as claimed in any one of claims 9 to 17.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the host bus adapter control method according to any one of claims 9 to 17 are implemented.
20. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of a host bus adapter control method as claimed in any one of claims 9 to 17 are implemented.
Citation Information
Patent Citations
NVMe-oF heterogeneous storage system and access method
CN112380151A
Method and storage equipment for quickly processing UECC
CN112579329A
Storage device for operating PI through DMA unit and method thereof
CN113448494A
Device for improving security of cache data of host and cache data reading and writing method and device
CN114117484A
Storing translation layer metadata in host memory buffer
CN115605852A