The present invention relates generally to the data processing field, and more particularly, relates to a method and apparatus for maintaining data integrity when switching between different data protection methods.
When transmitting blocks of data from host applications to storage devices, for example, disk drives, it is common practice to protect each block of data with some form of checksum or cyclic redundant code (CRC). To provide end-to-end protection the protection should be generated close to the point of origin, checked at the destination during a write operation, and then checked again at the point of use when read back. Typically, to accomplish this, one type of protection is used throughout the send and return path.
A problem occurs in that the most common and powerful protection techniques used in data transports are processor intensive when calculated using software but are quick and simple using hardware. Typically two or more data protection techniques including one that is quick for software and another that is quick on hardware are used to solve this problem.
For example,
A resulting problem with this technique is that the data is not protected between the time it is checked using protection type 1 information to the time the new protection type 2 information is generated. During this gap, no matter how small, the data could be corrupted. If that happens the corrupted data is unknowingly used to generate the new protection and therefore looks like valid data from that point on.
A need exists for an effective mechanism and method for maintaining data integrity when switching between data protection methods.
Principal aspects of the present invention are to provide a method and apparatus for maintaining data integrity when switching between data protection methods. Other important aspects of the present invention are to provide such method and apparatus for maintaining data integrity when switching between data protection methods substantially without negative effect and that overcome many of the disadvantages of prior art arrangements.
In brief, a method and apparatus are provided for maintaining data integrity when switching between data protection methods. Data and a first protection type information are received. A second protection type information is generated. After generating the second protection type information, the data is checked using the first protection type information. An error indication is generated when the first protection type information check fails.
In accordance with features of the invention, maintaining data integrity is implemented using one of a plurality of methods. In one method, the first protection type information is stored. The second protection type information, such as a CRC is generated and simultaneously the data are verified using the saved first protection type information, such as a checksum, before transmitting the data. The second protection type information or checksum is stored. When the first protection type information check fails, the data source is notified of the error. When the first protection type information check does not fail, the data with the second protection type information or CRC are transmitted to a destination.
In accordance with features of the invention, in a second method, the first protection type information is stored. The second protection type information, such as a CRC is generated and simultaneously the data are verified using the saved first protection type information, such as a checksum, while transmitting the data. When the first protection type information check fails, an invalid second protection type information or CRC are transmitted to a destination, so a next data check will fail.
In accordance with features of the invention, in another method, data and the first protection type information are stored. The second protection type information, such as a CRC, is generated and placed in memory. Then data are checked using the saved first protection type information, such as a checksum. When the first protection type information check fails, the data source is notified of the error. When the first protection type information check does not fail, the data with the second protection type information or CRC are transmitted to a destination.
In accordance with features of the invention, in yet another method, data on receipt are checked using the first protection type information, such as a checksum and simultaneously second protection type information, such as a CRC, is generated, while transmitting the data. When the first protection type information check fails, an invalid second protection type information or CRC are transmitted to a destination, so a next data check will fail.
In accordance with features of the invention, in still another method, data on receipt are checked using the first protection type information, such as a checksum. When the first protection type information check fails, the data source is notified of the error. Otherwise when the first protection type information check does not fail, the data and the first protection type information are stored. The second protection type information, such as a CRC, is generated and placed in memory. Then data are checked using the saved first protection type information. When the first protection type information check fails, the data source is notified of the error. When the first protection type information check does not fail, the data with the second protection type information or CRC are transmitted to a destination.
The present invention together with the above and other objects and advantages may best be understood from the following detailed description of the preferred embodiments of the invention illustrated in the drawings, wherein:
In conventional arrangements when a device is converting from one protection technique to another, or has to regenerate the protection, that device checks that the data is valid using the received protection technique as the data is received and then generates the new protection as the data is transmitted, resulting in a time gap between data checking and the new protection being generated.
In accordance with features of the invention, enhanced methods are provided for maintaining data integrity when sending data from a source to a destination and switching between data protection methods. Methods of the preferred embodiments are provided to overlap different protection techniques to assure the data is protected 100% of the time while one protection technique, for example, checksum, is being transitioned to another protection technique, for example, cyclic redundant code (CRC).
In accordance with features of the invention, a receiving device is provided for saving the incoming protection information and then after the generation of the outgoing protection, a check of the data is performed using the incoming protection information.
Having reference now to the drawings,
As shown in
Next the received data is verified using the protection type 1 information as indicated in a block 202. Simultaneously with verifying the received data, protection type 2 information is generated for the received data as indicated in a block 204 and the generated protection type 2 information is stored into memory as indicated in a block 206.
Next determining whether the protection type 1 information check failed as indicated in a decision block 208. When the determined that the protection type 1 information check failed, then the data source is notified as indicated in a block 210. Otherwise when the determined that the protection type 1 information check has not failed, then the data and the generated protection type 2 information are transmitted to the destination as indicated in a block 212.
As shown in
One exemplary implementation of protection type 1 information is a checksum protection information technique, for example, Fletcher-32 checksum protection information that can be calculated very quickly in using standard software techniques at the application or source 216. Then, for example, on a write operation the protection type 1 information is stored into memory 222 and remains with the data that is received by the receiving device 214. Receiving device 214 is, for example, a host bus adapter (HBA), such as a PCI-X to Fibre Channel HBA.
HBA or receiving device 214 converts the protection type 1 information checksum to a different protection type 2 information technique for the data, such as CRC-32 or CRC-16. The different protection type 2 information, such as CRC-32 or CRC-16 is generated for the data at the protection type 2 generator function 224, and the data is checked using the saved protection type 1 information or checksum at the protection type 1 verification function 226. On a read operation the process is reversed.
Referring now to
Referring first to
Referring to
Next determining whether the protection type 1 information check failed as indicated in a decision block 308. When determined that the protection type 1 information check failed, then the destination is notified of the invalid transmitted data by transmitting invalid protection type 2 information as indicated in a block 310. Otherwise when determined that the protection type 1 information check has not failed, then the generated protection type 2 information are transmitted to the destination as indicated in a block 312.
Referring now to
Referring first to
Referring to
Next determining whether the protection type 1 information check failed as indicated in a decision block 408. When determined that the protection type 1 information check failed, then the data source 422 is notified of the protection type 1 error as indicated in a block 410. Otherwise when the determined that the protection type 1 information check has not failed, then the data and the generated protection type 2 information are transmitted to the destination 424 as indicated in a block 412.
Referring now to
Referring first to
Referring to
Next determining whether the protection type 1 information check failed as indicated in a decision block 506. When determined that the protection type 1 information check failed, then the destination is notified of the invalid transmitted data by transmitting invalid protection type 2 information as indicated in a block 508. Otherwise when determined that the protection type 1 information check has not failed, then the generated protection type 2 information are transmitted to the destination as indicated in a block 510.
Referring now to
Referring first to
Referring to
Otherwise when determined that the protection type 1 information check has not failed, then the data and the protection type 1 information from the first protection type 1 verification function 622 is placed into memory 624 as indicated in a block 606. Protection type 2 information is generated for the data placed into memory 624 from the first protection type 1 verification function 622 as indicated in a block 608. The protection type 2 information is placed into memory 624 as indicated in a block 610. The received data placed into memory 624 from the first protection type 1 verification function 622 is verified by the second protection type 1 verification function 628 as indicated in a block 612.
Next determining whether the second protection type 1 information check failed is performed as indicated in a decision block 614. When determined that this protection type 1 information check failed, then the data source 630 is notified of the protection type 1 error as indicated in a block 616. Otherwise when the determined that the protection type 1 information check has not failed, then the data and the generated protection type 2 information are transmitted to the destination 632 as indicated in a block 618.
While the present invention has been described with reference to the details of the embodiments of the invention shown in the drawing, these details are not intended to limit the scope of the invention as claimed in the appended claims.