Fix for crash with more than ~500 jobs
[fio.git] / verify.h
CommitLineData
4f5af7b2
JA
1#ifndef FIO_VERIFY_H
2#define FIO_VERIFY_H
3
03e20d68
BC
4#include <stdint.h>
5
d3a173a9 6#define FIO_HDR_MAGIC 0xacca
4f5af7b2
JA
7
8enum {
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_META, /* block_num, timestamp etc. */
7c353ceb 20 VERIFY_SHA1, /* sha1 sum data blocks */
92bf48d5 21 VERIFY_PATTERN, /* verify specific patterns */
4f5af7b2
JA
22 VERIFY_NULL, /* pretend to verify */
23};
24
25/*
26 * A header structure associated with each checksummed data block. It is
27 * followed by a checksum specific header that contains the verification
28 * data.
29 */
30struct verify_header {
d3a173a9
JA
31 uint16_t magic;
32 uint16_t verify_type;
f65d1c26 33 uint32_t len;
f65d1c26 34 uint64_t rand_seed;
f65d1c26 35 uint32_t crc32;
4f5af7b2
JA
36};
37
38struct vhdr_md5 {
34644af5 39 uint32_t md5_digest[4];
4f5af7b2
JA
40};
41struct vhdr_sha512 {
42 uint8_t sha512[128];
43};
44struct vhdr_sha256 {
bc77f56f 45 uint8_t sha256[64];
4f5af7b2 46};
7c353ceb
JA
47struct vhdr_sha1 {
48 uint32_t sha1[5];
49};
4f5af7b2
JA
50struct vhdr_crc64 {
51 uint64_t crc64;
52};
53struct vhdr_crc32 {
54 uint32_t crc32;
55};
56struct vhdr_crc16 {
57 uint16_t crc16;
58};
59struct vhdr_crc7 {
60 uint8_t crc7;
61};
62struct vhdr_meta {
63 uint64_t offset;
64 unsigned char thread;
65 unsigned short numberio;
66 unsigned long time_sec;
67 unsigned long time_usec;
68};
69
70/*
71 * Verify helpers
72 */
73extern void populate_verify_io_u(struct thread_data *, struct io_u *);
74extern int __must_check get_next_verify(struct thread_data *td, struct io_u *);
75extern int __must_check verify_io_u(struct thread_data *, struct io_u *);
e8462bd8 76extern int verify_io_u_async(struct thread_data *, struct io_u *);
7d9fb455 77extern void fill_pattern(struct thread_data *td, void *p, unsigned int len, struct io_u *io_u, unsigned long seed, int use_seed);
e8462bd8
JA
78
79/*
80 * Async verify offload
81 */
82extern int verify_async_init(struct thread_data *);
83extern void verify_async_exit(struct thread_data *);
4f5af7b2
JA
84
85#endif