Commit | Line | Data |
---|---|---|
4f5af7b2 JA |
1 | #ifndef FIO_VERIFY_H |
2 | #define FIO_VERIFY_H | |
3 | ||
03e20d68 | 4 | #include <stdint.h> |
9e9d41d7 | 5 | #include "verify-state.h" |
03e20d68 | 6 | |
d3a173a9 | 7 | #define FIO_HDR_MAGIC 0xacca |
4f5af7b2 JA |
8 | |
9 | enum { | |
10 | VERIFY_NONE = 0, /* no verification */ | |
b638d82f RP |
11 | VERIFY_HDR_ONLY, /* verify header only, kept for sake of |
12 | * compatibility with old configurations | |
13 | * which use 'verify=meta' */ | |
4f5af7b2 JA |
14 | VERIFY_MD5, /* md5 sum data blocks */ |
15 | VERIFY_CRC64, /* crc64 sum data blocks */ | |
16 | VERIFY_CRC32, /* crc32 sum data blocks */ | |
17 | VERIFY_CRC32C, /* crc32c sum data blocks */ | |
18 | VERIFY_CRC32C_INTEL, /* crc32c sum data blocks with hw */ | |
19 | VERIFY_CRC16, /* crc16 sum data blocks */ | |
20 | VERIFY_CRC7, /* crc7 sum data blocks */ | |
21 | VERIFY_SHA256, /* sha256 sum data blocks */ | |
22 | VERIFY_SHA512, /* sha512 sum data blocks */ | |
844ea602 | 23 | VERIFY_XXHASH, /* xxhash sum data blocks */ |
7c353ceb | 24 | VERIFY_SHA1, /* sha1 sum data blocks */ |
92bf48d5 | 25 | VERIFY_PATTERN, /* verify specific patterns */ |
59245381 | 26 | VERIFY_PATTERN_NO_HDR, /* verify specific patterns, no hdr */ |
4f5af7b2 JA |
27 | VERIFY_NULL, /* pretend to verify */ |
28 | }; | |
29 | ||
30 | /* | |
31 | * A header structure associated with each checksummed data block. It is | |
32 | * followed by a checksum specific header that contains the verification | |
33 | * data. | |
34 | */ | |
35 | struct verify_header { | |
d3a173a9 JA |
36 | uint16_t magic; |
37 | uint16_t verify_type; | |
f65d1c26 | 38 | uint32_t len; |
f65d1c26 | 39 | uint64_t rand_seed; |
b638d82f RP |
40 | uint64_t offset; |
41 | uint32_t time_sec; | |
42 | uint32_t time_usec; | |
43 | uint16_t thread; | |
44 | uint16_t numberio; | |
f65d1c26 | 45 | uint32_t crc32; |
4f5af7b2 JA |
46 | }; |
47 | ||
48 | struct vhdr_md5 { | |
34644af5 | 49 | uint32_t md5_digest[4]; |
4f5af7b2 JA |
50 | }; |
51 | struct vhdr_sha512 { | |
52 | uint8_t sha512[128]; | |
53 | }; | |
54 | struct vhdr_sha256 { | |
bc77f56f | 55 | uint8_t sha256[64]; |
4f5af7b2 | 56 | }; |
7c353ceb JA |
57 | struct vhdr_sha1 { |
58 | uint32_t sha1[5]; | |
59 | }; | |
4f5af7b2 JA |
60 | struct vhdr_crc64 { |
61 | uint64_t crc64; | |
62 | }; | |
63 | struct vhdr_crc32 { | |
64 | uint32_t crc32; | |
65 | }; | |
66 | struct vhdr_crc16 { | |
67 | uint16_t crc16; | |
68 | }; | |
69 | struct vhdr_crc7 { | |
70 | uint8_t crc7; | |
71 | }; | |
844ea602 JA |
72 | struct vhdr_xxhash { |
73 | uint32_t hash; | |
74 | }; | |
4f5af7b2 JA |
75 | |
76 | /* | |
77 | * Verify helpers | |
78 | */ | |
79 | extern void populate_verify_io_u(struct thread_data *, struct io_u *); | |
80 | extern int __must_check get_next_verify(struct thread_data *td, struct io_u *); | |
f8b0bd10 JA |
81 | extern int __must_check verify_io_u(struct thread_data *, struct io_u **); |
82 | extern int verify_io_u_async(struct thread_data *, struct io_u **); | |
ce35b1ec JA |
83 | extern void fill_verify_pattern(struct thread_data *td, void *p, unsigned int len, struct io_u *io_u, unsigned long seed, int use_seed); |
84 | extern void fill_buffer_pattern(struct thread_data *td, void *p, unsigned int len); | |
dc5bfbb2 | 85 | extern void fio_verify_init(struct thread_data *td); |
e8462bd8 JA |
86 | |
87 | /* | |
88 | * Async verify offload | |
89 | */ | |
90 | extern int verify_async_init(struct thread_data *); | |
91 | extern void verify_async_exit(struct thread_data *); | |
4f5af7b2 | 92 | |
61b9861d RP |
93 | /* |
94 | * Callbacks for pasting formats in the pattern buffer | |
95 | */ | |
96 | extern int paste_blockoff(char *buf, unsigned int len, void *priv); | |
97 | ||
4f5af7b2 | 98 | #endif |