Lines Matching defs:vc

298 static void __dump_verify_buffers(struct verify_header *hdr, struct vcont *vc)
300 struct thread_data *td = vc->td;
301 struct io_u *io_u = vc->io_u;
312 hdr_offset = vc->hdr_num * hdr->len;
315 "received", vc->io_u->file);
330 "expected", vc->io_u->file);
334 static void dump_verify_buffers(struct verify_header *hdr, struct vcont *vc)
336 struct thread_data *td = vc->td;
340 __fill_hdr(td, vc->io_u, &shdr, 0, vc->io_u->buflen, 0);
344 __dump_verify_buffers(hdr, vc);
347 static void log_verify_failure(struct verify_header *hdr, struct vcont *vc)
351 offset = vc->io_u->offset;
352 offset += vc->hdr_num * hdr->len;
354 vc->name, vc->io_u->file->file_name, offset, hdr->len);
356 if (vc->good_crc && vc->bad_crc) {
358 hexdump(vc->good_crc, vc->crc_len);
360 hexdump(vc->bad_crc, vc->crc_len);
363 dump_verify_buffers(hdr, vc);
369 static inline void *io_u_verify_off(struct verify_header *hdr, struct vcont *vc)
371 return vc->io_u->buf + vc->hdr_num * hdr->len + hdr_size(vc->td, hdr);
374 static int verify_io_u_pattern(struct verify_header *hdr, struct vcont *vc)
376 struct thread_data *td = vc->td;
377 struct io_u *io_u = vc->io_u;
392 mod = (get_hdr_inc(td, io_u) * vc->hdr_num + header_size) % pattern_size;
409 vc->name = "pattern";
410 log_verify_failure(hdr, vc);
423 static int verify_io_u_xxhash(struct verify_header *hdr, struct vcont *vc)
425 void *p = io_u_verify_off(hdr, vc);
430 dprint(FD_VERIFY, "xxhash verify io_u %p, len %u\n", vc->io_u, hdr->len);
433 XXH32_update(state, p, hdr->len - hdr_size(vc->td, hdr));
439 vc->name = "xxhash";
440 vc->good_crc = &vh->hash;
441 vc->bad_crc = &hash;
442 vc->crc_len = sizeof(hash);
443 log_verify_failure(hdr, vc);
447 static int verify_io_u_sha3(struct verify_header *hdr, struct vcont *vc,
451 void *p = io_u_verify_off(hdr, vc);
453 dprint(FD_VERIFY, "%s verify io_u %p, len %u\n", name, vc->io_u, hdr->len);
455 fio_sha3_update(sha3_ctx, p, hdr->len - hdr_size(vc->td, hdr));
461 vc->name = name;
462 vc->good_crc = sha;
463 vc->bad_crc = sha3_ctx->sha;
464 vc->crc_len = sha_size;
465 log_verify_failure(hdr, vc);
469 static int verify_io_u_sha3_224(struct verify_header *hdr, struct vcont *vc)
479 return verify_io_u_sha3(hdr, vc, &sha3_ctx, vh->sha,
483 static int verify_io_u_sha3_256(struct verify_header *hdr, struct vcont *vc)
493 return verify_io_u_sha3(hdr, vc, &sha3_ctx, vh->sha,
497 static int verify_io_u_sha3_384(struct verify_header *hdr, struct vcont *vc)
507 return verify_io_u_sha3(hdr, vc, &sha3_ctx, vh->sha,
511 static int verify_io_u_sha3_512(struct verify_header *hdr, struct vcont *vc)
521 return verify_io_u_sha3(hdr, vc, &sha3_ctx, vh->sha,
525 static int verify_io_u_sha512(struct verify_header *hdr, struct vcont *vc)
527 void *p = io_u_verify_off(hdr, vc);
534 dprint(FD_VERIFY, "sha512 verify io_u %p, len %u\n", vc->io_u, hdr->len);
537 fio_sha512_update(&sha512_ctx, p, hdr->len - hdr_size(vc->td, hdr));
542 vc->name = "sha512";
543 vc->good_crc = vh->sha512;
544 vc->bad_crc = sha512_ctx.buf;
545 vc->crc_len = sizeof(vh->sha512);
546 log_verify_failure(hdr, vc);
550 static int verify_io_u_sha256(struct verify_header *hdr, struct vcont *vc)
552 void *p = io_u_verify_off(hdr, vc);
559 dprint(FD_VERIFY, "sha256 verify io_u %p, len %u\n", vc->io_u, hdr->len);
562 fio_sha256_update(&sha256_ctx, p, hdr->len - hdr_size(vc->td, hdr));
568 vc->name = "sha256";
569 vc->good_crc = vh->sha256;
570 vc->bad_crc = sha256_ctx.buf;
571 vc->crc_len = sizeof(vh->sha256);
572 log_verify_failure(hdr, vc);
576 static int verify_io_u_sha1(struct verify_header *hdr, struct vcont *vc)
578 void *p = io_u_verify_off(hdr, vc);
585 dprint(FD_VERIFY, "sha1 verify io_u %p, len %u\n", vc->io_u, hdr->len);
588 fio_sha1_update(&sha1_ctx, p, hdr->len - hdr_size(vc->td, hdr));
594 vc->name = "sha1";
595 vc->good_crc = vh->sha1;
596 vc->bad_crc = sha1_ctx.H;
597 vc->crc_len = sizeof(vh->sha1);
598 log_verify_failure(hdr, vc);
602 static int verify_io_u_crc7(struct verify_header *hdr, struct vcont *vc)
604 void *p = io_u_verify_off(hdr, vc);
608 dprint(FD_VERIFY, "crc7 verify io_u %p, len %u\n", vc->io_u, hdr->len);
610 c = fio_crc7(p, hdr->len - hdr_size(vc->td, hdr));
615 vc->name = "crc7";
616 vc->good_crc = &vh->crc7;
617 vc->bad_crc = &c;
618 vc->crc_len = 1;
619 log_verify_failure(hdr, vc);
623 static int verify_io_u_crc16(struct verify_header *hdr, struct vcont *vc)
625 void *p = io_u_verify_off(hdr, vc);
629 dprint(FD_VERIFY, "crc16 verify io_u %p, len %u\n", vc->io_u, hdr->len);
631 c = fio_crc16(p, hdr->len - hdr_size(vc->td, hdr));
636 vc->name = "crc16";
637 vc->good_crc = &vh->crc16;
638 vc->bad_crc = &c;
639 vc->crc_len = 2;
640 log_verify_failure(hdr, vc);
644 static int verify_io_u_crc64(struct verify_header *hdr, struct vcont *vc)
646 void *p = io_u_verify_off(hdr, vc);
650 dprint(FD_VERIFY, "crc64 verify io_u %p, len %u\n", vc->io_u, hdr->len);
652 c = fio_crc64(p, hdr->len - hdr_size(vc->td, hdr));
657 vc->name = "crc64";
658 vc->good_crc = &vh->crc64;
659 vc->bad_crc = &c;
660 vc->crc_len = 8;
661 log_verify_failure(hdr, vc);
665 static int verify_io_u_crc32(struct verify_header *hdr, struct vcont *vc)
667 void *p = io_u_verify_off(hdr, vc);
671 dprint(FD_VERIFY, "crc32 verify io_u %p, len %u\n", vc->io_u, hdr->len);
673 c = fio_crc32(p, hdr->len - hdr_size(vc->td, hdr));
678 vc->name = "crc32";
679 vc->good_crc = &vh->crc32;
680 vc->bad_crc = &c;
681 vc->crc_len = 4;
682 log_verify_failure(hdr, vc);
686 static int verify_io_u_crc32c(struct verify_header *hdr, struct vcont *vc)
688 void *p = io_u_verify_off(hdr, vc);
692 dprint(FD_VERIFY, "crc32c verify io_u %p, len %u\n", vc->io_u, hdr->len);
694 c = fio_crc32c(p, hdr->len - hdr_size(vc->td, hdr));
699 vc->name = "crc32c";
700 vc->good_crc = &vh->crc32;
701 vc->bad_crc = &c;
702 vc->crc_len = 4;
703 log_verify_failure(hdr, vc);
707 static int verify_io_u_md5(struct verify_header *hdr, struct vcont *vc)
709 void *p = io_u_verify_off(hdr, vc);
716 dprint(FD_VERIFY, "md5 verify io_u %p, len %u\n", vc->io_u, hdr->len);
719 fio_md5_update(&md5_ctx, p, hdr->len - hdr_size(vc->td, hdr));
725 vc->name = "md5";
726 vc->good_crc = vh->md5_digest;
727 vc->bad_crc = md5_ctx.hash;
728 vc->crc_len = sizeof(hash);
729 log_verify_failure(hdr, vc);
911 struct vcont vc = {
949 ret = verify_io_u_pattern(hdr, &vc);
952 ret = verify_io_u_md5(hdr, &vc);
955 ret = verify_io_u_crc64(hdr, &vc);
959 ret = verify_io_u_crc32c(hdr, &vc);
962 ret = verify_io_u_crc32(hdr, &vc);
965 ret = verify_io_u_crc16(hdr, &vc);
968 ret = verify_io_u_crc7(hdr, &vc);
971 ret = verify_io_u_sha256(hdr, &vc);
974 ret = verify_io_u_sha512(hdr, &vc);
977 ret = verify_io_u_sha3_224(hdr, &vc);
980 ret = verify_io_u_sha3_256(hdr, &vc);
983 ret = verify_io_u_sha3_384(hdr, &vc);
986 ret = verify_io_u_sha3_512(hdr, &vc);
989 ret = verify_io_u_xxhash(hdr, &vc);
992 ret = verify_io_u_sha1(hdr, &vc);
996 ret = verify_io_u_pattern(hdr, &vc);