Jens Axboe | 4f5af7b | 2009-06-03 08:45:40 +0200 | [diff] [blame] | 1 | #ifndef FIO_VERIFY_H |
| 2 | #define FIO_VERIFY_H |
| 3 | |
| 4 | #define FIO_HDR_MAGIC 0xf00baaef |
| 5 | |
| 6 | enum { |
| 7 | VERIFY_NONE = 0, /* no verification */ |
| 8 | VERIFY_MD5, /* md5 sum data blocks */ |
| 9 | VERIFY_CRC64, /* crc64 sum data blocks */ |
| 10 | VERIFY_CRC32, /* crc32 sum data blocks */ |
| 11 | VERIFY_CRC32C, /* crc32c sum data blocks */ |
| 12 | VERIFY_CRC32C_INTEL, /* crc32c sum data blocks with hw */ |
| 13 | VERIFY_CRC16, /* crc16 sum data blocks */ |
| 14 | VERIFY_CRC7, /* crc7 sum data blocks */ |
| 15 | VERIFY_SHA256, /* sha256 sum data blocks */ |
| 16 | VERIFY_SHA512, /* sha512 sum data blocks */ |
| 17 | VERIFY_META, /* block_num, timestamp etc. */ |
Jens Axboe | 7c353ce | 2009-08-09 22:40:33 +0200 | [diff] [blame] | 18 | VERIFY_SHA1, /* sha1 sum data blocks */ |
Jens Axboe | 4f5af7b | 2009-06-03 08:45:40 +0200 | [diff] [blame] | 19 | VERIFY_NULL, /* pretend to verify */ |
| 20 | }; |
| 21 | |
| 22 | /* |
| 23 | * A header structure associated with each checksummed data block. It is |
| 24 | * followed by a checksum specific header that contains the verification |
| 25 | * data. |
| 26 | */ |
| 27 | struct verify_header { |
| 28 | unsigned int fio_magic; |
| 29 | unsigned int len; |
| 30 | unsigned int verify_type; |
| 31 | }; |
| 32 | |
| 33 | struct vhdr_md5 { |
| 34 | uint32_t md5_digest[16]; |
| 35 | }; |
| 36 | struct vhdr_sha512 { |
| 37 | uint8_t sha512[128]; |
| 38 | }; |
| 39 | struct vhdr_sha256 { |
| 40 | uint8_t sha256[128]; |
| 41 | }; |
Jens Axboe | 7c353ce | 2009-08-09 22:40:33 +0200 | [diff] [blame] | 42 | struct vhdr_sha1 { |
| 43 | uint32_t sha1[5]; |
| 44 | }; |
Jens Axboe | 4f5af7b | 2009-06-03 08:45:40 +0200 | [diff] [blame] | 45 | struct vhdr_crc64 { |
| 46 | uint64_t crc64; |
| 47 | }; |
| 48 | struct vhdr_crc32 { |
| 49 | uint32_t crc32; |
| 50 | }; |
| 51 | struct vhdr_crc16 { |
| 52 | uint16_t crc16; |
| 53 | }; |
| 54 | struct vhdr_crc7 { |
| 55 | uint8_t crc7; |
| 56 | }; |
| 57 | struct vhdr_meta { |
| 58 | uint64_t offset; |
| 59 | unsigned char thread; |
| 60 | unsigned short numberio; |
| 61 | unsigned long time_sec; |
| 62 | unsigned long time_usec; |
| 63 | }; |
| 64 | |
| 65 | /* |
| 66 | * Verify helpers |
| 67 | */ |
| 68 | extern void populate_verify_io_u(struct thread_data *, struct io_u *); |
| 69 | extern int __must_check get_next_verify(struct thread_data *td, struct io_u *); |
| 70 | extern int __must_check verify_io_u(struct thread_data *, struct io_u *); |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 71 | extern int verify_io_u_async(struct thread_data *, struct io_u *); |
| 72 | |
| 73 | /* |
| 74 | * Async verify offload |
| 75 | */ |
| 76 | extern int verify_async_init(struct thread_data *); |
| 77 | extern void verify_async_exit(struct thread_data *); |
Jens Axboe | 4f5af7b | 2009-06-03 08:45:40 +0200 | [diff] [blame] | 78 | |
| 79 | #endif |