Home | History | Annotate | Download | only in fio

Lines Matching refs:io_u

30 static void populate_hdr(struct thread_data *td, struct io_u *io_u,
33 static void fill_hdr(struct thread_data *td, struct io_u *io_u,
36 static void __fill_hdr(struct thread_data *td, struct io_u *io_u,
61 struct io_u *io_u, unsigned long seed, int use_seed)
71 io_u->rand_seed = fill_buffer(td, p, len);
77 if (!td->o.verify_fmt_sz && io_u->buf_filled_len >= len) {
85 p, len, io_u);
86 io_u->buf_filled_len = len;
89 static unsigned int get_hdr_inc(struct thread_data *td, struct io_u *io_u)
93 hdr_inc = io_u->buflen;
94 if (td->o.verify_interval && td->o.verify_interval <= io_u->buflen)
100 static void fill_pattern_headers(struct thread_data *td, struct io_u *io_u,
105 void *p = io_u->buf;
107 fill_verify_pattern(td, p, io_u->buflen, io_u, seed, use_seed);
109 hdr_inc = get_hdr_inc(td, io_u);
111 for (; p < io_u->buf + io_u->buflen; p += hdr_inc) {
113 populate_hdr(td, io_u, hdr, header_num, hdr_inc);
228 struct io_u *io_u;
301 struct io_u *io_u = vc->io_u;
303 struct io_u dummy;
314 dump_buf(io_u->buf + hdr_offset, hdr->len, io_u->offset + hdr_offset,
315 "received", vc->io_u->file);
320 buf = malloc(io_u->buflen);
321 dummy = *io_u;
325 dummy.buflen = io_u->buflen;
329 dump_buf(buf + hdr_offset, hdr->len, io_u->offset + hdr_offset,
330 "expected", vc->io_u->file);
340 __fill_hdr(td, vc->io_u, &shdr, 0, vc->io_u->buflen, 0);
351 offset = vc->io_u->offset;
354 vc->name, vc->io_u->file->file_name, offset, hdr->len);
371 return vc->io_u->buf + vc->hdr_num * hdr->len + hdr_size(vc->td, hdr);
377 struct io_u *io_u = vc->io_u;
388 td->o.verify_fmt, td->o.verify_fmt_sz, io_u);
391 len = get_hdr_inc(td, io_u) - header_size;
392 mod = (get_hdr_inc(td, io_u) * vc->hdr_num + header_size) % pattern_size;
430 dprint(FD_VERIFY, "xxhash verify io_u %p, len %u\n", vc->io_u, hdr->len);
453 dprint(FD_VERIFY, "%s verify io_u %p, len %u\n", name, vc->io_u, hdr->len);
534 dprint(FD_VERIFY, "sha512 verify io_u %p, len %u\n", vc->io_u, hdr->len);
559 dprint(FD_VERIFY, "sha256 verify io_u %p, len %u\n", vc->io_u, hdr->len);
585 dprint(FD_VERIFY, "sha1 verify io_u %p, len %u\n", vc->io_u, hdr->len);
608 dprint(FD_VERIFY, "crc7 verify io_u %p, len %u\n", vc->io_u, hdr->len);
629 dprint(FD_VERIFY, "crc16 verify io_u %p, len %u\n", vc->io_u, hdr->len);
650 dprint(FD_VERIFY, "crc64 verify io_u %p, len %u\n", vc->io_u, hdr->len);
671 dprint(FD_VERIFY, "crc32 verify io_u %p, len %u\n", vc->io_u, hdr->len);
692 dprint(FD_VERIFY, "crc32c verify io_u %p, len %u\n", vc->io_u, hdr->len);
716 dprint(FD_VERIFY, "md5 verify io_u %p, len %u\n", vc->io_u, hdr->len);
736 int verify_io_u_async(struct thread_data *td, struct io_u **io_u_ptr)
738 struct io_u *io_u = *io_u_ptr;
742 if (io_u->file)
743 put_file_log(td, io_u->file);
745 if (io_u->flags & IO_U_F_IN_CUR_DEPTH) {
747 io_u_clear(td, io_u, IO_U_F_IN_CUR_DEPTH);
749 flist_add_tail(&io_u->verify_list, &td->verify_list);
797 static int verify_trimmed_io_u(struct thread_data *td, struct io_u *io_u)
804 if (mem_is_zero(io_u->buf, io_u->buflen))
807 mem_is_zero_slow(io_u->buf, io_u->buflen, &offset);
811 io_u->file->file_name, io_u->offset, io_u->buflen,
816 static int verify_header(struct io_u *io_u, struct thread_data *td,
833 if (hdr->rand_seed != io_u->rand_seed) {
836 hdr->rand_seed, io_u->rand_seed);
839 if (hdr->offset != io_u->offset + hdr_num * td->o.verify_interval) {
842 hdr->offset, io_u->offset);
857 if (hdr->numberio != io_u->numberio) {
860 hdr->numberio, io_u->numberio);
874 io_u->file->file_name,
875 io_u->offset + hdr_num * hdr_len, hdr_len);
878 dump_buf(p, hdr_len, io_u->offset + hdr_num * hdr_len,
879 "hdr_fail", io_u->file);
884 int verify_io_u(struct thread_data *td, struct io_u **io_u_ptr)
887 struct io_u *io_u = *io_u_ptr;
892 if (td->o.verify == VERIFY_NULL || io_u->ddir != DDIR_READ)
901 if (io_u->flags & IO_U_F_TRIMMED) {
902 ret = verify_trimmed_io_u(td, io_u);
906 hdr_inc = get_hdr_inc(td, io_u);
909 for (p = io_u->buf; p < io_u->buf + io_u->buflen;
912 .io_u = io_u,
931 io_u->rand_seed = hdr->rand_seed;
934 ret = verify_header(io_u, td, hdr, hdr_num, hdr_inc);
1157 static void __fill_hdr(struct thread_data *td, struct io_u *io_u,
1167 hdr->offset = io_u->offset + header_num * td->o.verify_interval;
1168 hdr->time_sec = io_u->start_time.tv_sec;
1169 hdr->time_usec = io_u->start_time.tv_usec;
1171 hdr->numberio = io_u->numberio;
1176 static void fill_hdr(struct thread_data *td, struct io_u *io_u,
1182 __fill_hdr(td, io_u, hdr, header_num, header_len, rand_seed);
1185 static void populate_hdr(struct thread_data *td, struct io_u *io_u,
1194 fill_hdr(td, io_u, hdr, header_num, header_len, io_u->rand_seed);
1201 dprint(FD_VERIFY, "fill md5 io_u %p, len %u\n",
1202 io_u, hdr->len);
1206 dprint(FD_VERIFY, "fill crc64 io_u %p, len %u\n",
1207 io_u, hdr->len);
1212 dprint(FD_VERIFY, "fill crc32c io_u %p, len %u\n",
1213 io_u, hdr->len);
1217 dprint(FD_VERIFY, "fill crc32 io_u %p, len %u\n",
1218 io_u, hdr->len);
1222 dprint(FD_VERIFY, "fill crc16 io_u %p, len %u\n",
1223 io_u, hdr->len);
1227 dprint(FD_VERIFY, "fill crc7 io_u %p, len %u\n",
1228 io_u, hdr->len);
1232 dprint(FD_VERIFY, "fill sha256 io_u %p, len %u\n",
1233 io_u, hdr->len);
1237 dprint(FD_VERIFY, "fill sha512 io_u %p, len %u\n",
1238 io_u, hdr->len);
1242 dprint(FD_VERIFY, "fill sha3-224 io_u %p, len %u\n",
1243 io_u, hdr->len);
1247 dprint(FD_VERIFY, "fill sha3-256 io_u %p, len %u\n",
1248 io_u, hdr->len);
1252 dprint(FD_VERIFY, "fill sha3-384 io_u %p, len %u\n",
1253 io_u, hdr->len);
1257 dprint(FD_VERIFY, "fill sha3-512 io_u %p, len %u\n",
1258 io_u, hdr->len);
1262 dprint(FD_VERIFY, "fill xxhash io_u %p, len %u\n",
1263 io_u, hdr->len);
1267 dprint(FD_VERIFY, "fill sha1 io_u %p, len %u\n",
1268 io_u, hdr->len);
1286 * fill body of io_u->buf with random data and add a header with the
1289 void populate_verify_io_u(struct thread_data *td, struct io_u *io_u)
1294 io_u->numberio = td->io_issues[io_u->ddir];
1296 fill_pattern_headers(td, io_u, 0, 0);
1299 int get_next_verify(struct thread_data *td, struct io_u *io_u)
1304 * this io_u is from a requeue, we already filled the offsets
1306 if (io_u->file)
1342 io_u->offset = ipo->offset;
1343 io_u->buflen = ipo->len;
1344 io_u->numberio = ipo->numberio;
1345 io_u->file = ipo->file;
1346 io_u_set(td, io_u, IO_U_F_VER_LIST);
1349 io_u_set(td, io_u, IO_U_F_TRIMMED);
1351 if (!fio_file_open(io_u->file)) {
1352 int r = td_io_open_file(td, io_u->file);
1356 io_u->file->file_name);
1362 assert(fio_file_open(io_u->file));
1363 io_u->ddir = DDIR_READ;
1364 io_u->xfer_buf = io_u->buf;
1365 io_u->xfer_buflen = io_u->buflen;
1369 dprint(FD_VERIFY, "get_next_verify: ret io_u %p\n", io_u);
1372 io_u->rand_seed = __rand(&td->verify_state);
1374 io_u->rand_seed *= __rand(&td->verify_state);
1396 struct io_u *io_u;
1431 io_u = flist_first_entry(&list, struct io_u, verify_list);
1432 flist_del_init(&io_u->verify_list);
1434 io_u_set(td, io_u, IO_U_F_NO_FILE_PUT);
1435 ret = verify_io_u(td, &io_u);
1437 put_io_u(td, io_u);
1522 struct io_u *io = priv;
1849 int verify_state_should_stop(struct thread_data *td, struct io_u *io_u)
1852 struct fio_file *f = io_u->file;
1875 if (io_u->offset == s->comps[i].offset)