aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2014-09-26 19:20:05 -0400
committerJens Axboe <axboe@fb.com>2014-09-27 11:14:55 -0400
commitaae7df50190a640e51bfe11c93f94741ac82ff0b (patch)
tree5c10de05e0ebb21e83c5785b2d03ff10ea9e60dc /include/linux
parentb1f01388574c9329922f760fc2a7335c2d14b08b (diff)
block: Integrity checksum flag
Make the choice of checksum a per-I/O property by introducing a flag that can be inspected by the SCSI layer. There are several reasons for this: 1. It allows us to switch choice of checksum without unloading and reloading the HBA driver. 2. During error recovery we need to be able to tell the HBA that checksums read from disk should not be verified and converted to IP checksums. 3. For error injection purposes we need to be able to write a bad guard tag to storage. Since the storage device only supports T10 CRC we need to be able to disable IP checksum conversion on the HBA. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bio.h1
-rw-r--r--include/linux/blkdev.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index b508cf69206d..14bff3fe56d4 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -328,6 +328,7 @@ enum bip_flags {
328 BIP_MAPPED_INTEGRITY = 1 << 1, /* ref tag has been remapped */ 328 BIP_MAPPED_INTEGRITY = 1 << 1, /* ref tag has been remapped */
329 BIP_CTRL_NOCHECK = 1 << 2, /* disable HBA integrity checking */ 329 BIP_CTRL_NOCHECK = 1 << 2, /* disable HBA integrity checking */
330 BIP_DISK_NOCHECK = 1 << 3, /* disable disk integrity checking */ 330 BIP_DISK_NOCHECK = 1 << 3, /* disable disk integrity checking */
331 BIP_IP_CHECKSUM = 1 << 4, /* IP checksum */
331}; 332};
332 333
333static inline sector_t bip_get_seed(struct bio_integrity_payload *bip) 334static inline sector_t bip_get_seed(struct bio_integrity_payload *bip)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 4600fc63e3fc..773df190a4ee 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1462,6 +1462,7 @@ enum blk_integrity_flags {
1462 BLK_INTEGRITY_VERIFY = 1 << 0, 1462 BLK_INTEGRITY_VERIFY = 1 << 0,
1463 BLK_INTEGRITY_GENERATE = 1 << 1, 1463 BLK_INTEGRITY_GENERATE = 1 << 1,
1464 BLK_INTEGRITY_DEVICE_CAPABLE = 1 << 2, 1464 BLK_INTEGRITY_DEVICE_CAPABLE = 1 << 2,
1465 BLK_INTEGRITY_IP_CHECKSUM = 1 << 3,
1465}; 1466};
1466 1467
1467struct blk_integrity_iter { 1468struct blk_integrity_iter {