6 #define FIO_HDR_MAGIC 0xacca
9 VERIFY_NONE = 0, /* no verification */
10 VERIFY_MD5, /* md5 sum data blocks */
11 VERIFY_CRC64, /* crc64 sum data blocks */
12 VERIFY_CRC32, /* crc32 sum data blocks */
13 VERIFY_CRC32C, /* crc32c sum data blocks */
14 VERIFY_CRC32C_INTEL, /* crc32c sum data blocks with hw */
15 VERIFY_CRC16, /* crc16 sum data blocks */
16 VERIFY_CRC7, /* crc7 sum data blocks */
17 VERIFY_SHA256, /* sha256 sum data blocks */
18 VERIFY_SHA512, /* sha512 sum data blocks */
19 VERIFY_XXHASH, /* xxhash sum data blocks */
20 VERIFY_META, /* block_num, timestamp etc. */
21 VERIFY_SHA1, /* sha1 sum data blocks */
22 VERIFY_PATTERN, /* verify specific patterns */
23 VERIFY_NULL, /* pretend to verify */
27 * A header structure associated with each checksummed data block. It is
28 * followed by a checksum specific header that contains the verification
31 struct verify_header {
40 uint32_t md5_digest[4];
66 unsigned short numberio;
67 unsigned long time_sec;
68 unsigned long time_usec;
77 extern void populate_verify_io_u(struct thread_data *, struct io_u *);
78 extern int __must_check get_next_verify(struct thread_data *td, struct io_u *);
79 extern int __must_check verify_io_u(struct thread_data *, struct io_u **);
80 extern int verify_io_u_async(struct thread_data *, struct io_u **);
81 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);
82 extern void fill_buffer_pattern(struct thread_data *td, void *p, unsigned int len);
83 extern void fio_verify_init(struct thread_data *td);
86 * Async verify offload
88 extern int verify_async_init(struct thread_data *);
89 extern void verify_async_exit(struct thread_data *);
91 struct thread_rand_state {
96 * For dumping current write state
98 struct thread_io_list {
103 struct thread_rand_state rand;
110 struct thread_io_list state[0];
113 #define VSTATE_HDR_VERSION 0x01
115 struct verify_state_hdr {
121 #define IO_LIST_ALL 0xffffffff
122 extern struct all_io_list *get_all_io_list(int, size_t *);
123 extern void __verify_save_state(struct all_io_list *, const char *);
124 extern void verify_save_state(void);
125 extern int verify_load_state(struct thread_data *, const char *);
126 extern void verify_free_state(struct thread_data *);
127 extern int verify_state_should_stop(struct thread_data *, struct io_u *);
128 extern void verify_convert_assign_state(struct thread_data *, struct thread_io_list *);
129 extern int verify_state_hdr(struct verify_state_hdr *, struct thread_io_list *);
131 static inline size_t thread_io_list_sz(struct thread_io_list *s)
133 return sizeof(*s) + le64_to_cpu(s->depth) * sizeof(uint64_t);
136 static inline struct thread_io_list *io_list_next(struct thread_io_list *s)
138 return (void *) s + thread_io_list_sz(s);
141 static inline void verify_state_gen_name(char *out, size_t size,
142 const char *name, const char *prefix,
145 snprintf(out, size, "%s-%s-%d-verify.state", prefix, name, num);
146 out[size - 1] = '\0';