X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=options.c;h=fb187489766205d64a15e08b7d86b7a1edb04f2e;hp=2369191ca748fe3572a3b816c597431c58aac987;hb=0539d7581388289367f77f2b800d0581ee34fb4c;hpb=17af15d46a9bfa3109321ecddfd4a649e36ffac9 diff --git a/options.c b/options.c index 2369191c..fb187489 100644 --- a/options.c +++ b/options.c @@ -16,6 +16,8 @@ #include "lib/fls.h" #include "options.h" +#include "crc/crc32c.h" + /* * Check if mmap/mmaphuge has a :/foo/bar/file at the end. If so, return that. */ @@ -225,6 +227,21 @@ static int str_mem_cb(void *data, const char *mem) return 0; } +static int str_verify_cb(void *data, const char *mem) +{ + struct thread_data *td = data; + + if (td->o.verify != VERIFY_CRC32C_INTEL) + return 0; + + if (!crc32c_intel_works()) { + log_info("fio: System does not support hw accelerated crc32c. Falling back to sw crc32c.\n"); + td->o.verify = VERIFY_CRC32C; + } + + return 0; +} + static int fio_clock_source_cb(void *data, const char *str) { struct thread_data *td = data; @@ -1298,6 +1315,7 @@ static struct fio_option options[FIO_MAX_OPTS] = { .type = FIO_OPT_STR, .off1 = td_var_offset(verify), .help = "Verify data written", + .cb = str_verify_cb, .def = "0", .posval = { { .ival = "0", @@ -1410,6 +1428,20 @@ static struct fio_option options[FIO_MAX_OPTS] = { .help = "Number of async verifier threads to use", .parent = "verify", }, + { + .name = "verify_backlog", + .type = FIO_OPT_STR_VAL, + .off1 = td_var_offset(verify_backlog), + .help = "Verify after this number of blocks are written", + .parent = "verify", + }, + { + .name = "verify_backlog_batch", + .type = FIO_OPT_INT, + .off1 = td_var_offset(verify_batch), + .help = "Verify this number of IO blocks", + .parent = "verify_backlog", + }, #ifdef FIO_HAVE_CPU_AFFINITY { .name = "verify_async_cpus",