{
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;
+ if (td->o.verify == VERIFY_CRC32C_INTEL ||
+ td->o.verify == VERIFY_CRC32C) {
+ crc32c_intel_probe();
}
return 0;
}
}
}
+
+ /*
+ * Fill the pattern all the way to the end. This greatly reduces
+ * the number of memcpy's we have to do when verifying the IO.
+ */
+ while (i > 1 && i * 2 <= MAX_PATTERN_SIZE) {
+ memcpy(&td->o.verify_pattern[i], &td->o.verify_pattern[0], i);
+ i *= 2;
+ }
+ if (i == 1) {
+ /*
+ * The code in verify_io_u_pattern assumes a single byte pattern
+ * fills the whole verify pattern buffer.
+ */
+ memset(td->o.verify_pattern, td->o.verify_pattern[0],
+ MAX_PATTERN_SIZE);
+ }
+
td->o.verify_pattern_bytes = i;
+
/*
* VERIFY_META could already be set
*/
if (td->o.verify == VERIFY_NONE)
td->o.verify = VERIFY_PATTERN;
+
return 0;
}
.help = "Use crc32 checksums for verification",
},
{ .ival = "crc32c-intel",
- .oval = VERIFY_CRC32C_INTEL,
- .help = "Use hw crc32c checksums for verification",
+ .oval = VERIFY_CRC32C,
+ .help = "Use crc32c checksums for verification (hw assisted, if available)",
},
{ .ival = "crc32c",
.oval = VERIFY_CRC32C,
- .help = "Use crc32c checksums for verification",
+ .help = "Use crc32c checksums for verification (hw assisted, if available)",
},
{ .ival = "crc16",
.oval = VERIFY_CRC16,
.name = "zonesize",
.type = FIO_OPT_STR_VAL,
.off1 = td_var_offset(zone_size),
+ .help = "Amount of data to read per zone",
+ .def = "0",
+ },
+ {
+ .name = "zonerange",
+ .type = FIO_OPT_STR_VAL,
+ .off1 = td_var_offset(zone_range),
.help = "Give size of an IO zone",
.def = "0",
},
.cb = str_write_iops_log_cb,
.help = "Write log of IOPS during run",
},
+ {
+ .name = "log_avg_msec",
+ .type = FIO_OPT_INT,
+ .off1 = td_var_offset(log_avg_msec),
+ .help = "Average bw/iops/lat logs over this period of time",
+ .def = "0",
+ },
{
.name = "hugepage-size",
.type = FIO_OPT_INT,
},
{
.name = "continue_on_error",
- .type = FIO_OPT_BOOL,
+ .type = FIO_OPT_STR,
.off1 = td_var_offset(continue_on_error),
.help = "Continue on non-fatal errors during IO",
- .def = "0",
+ .def = "none",
+ .posval = {
+ { .ival = "none",
+ .oval = ERROR_TYPE_NONE,
+ .help = "Exit when an error is encountered",
+ },
+ { .ival = "read",
+ .oval = ERROR_TYPE_READ,
+ .help = "Continue on read errors only",
+ },
+ { .ival = "write",
+ .oval = ERROR_TYPE_WRITE,
+ .help = "Continue on write errors only",
+ },
+ { .ival = "io",
+ .oval = ERROR_TYPE_READ | ERROR_TYPE_WRITE,
+ .help = "Continue on any IO errors",
+ },
+ { .ival = "verify",
+ .oval = ERROR_TYPE_VERIFY,
+ .help = "Continue on verify errors only",
+ },
+ { .ival = "all",
+ .oval = ERROR_TYPE_ANY,
+ .help = "Continue on all io and verify errors",
+ },
+ { .ival = "0",
+ .oval = ERROR_TYPE_NONE,
+ .help = "Alias for 'none'",
+ },
+ { .ival = "1",
+ .oval = ERROR_TYPE_ANY,
+ .help = "Alias for 'all'",
+ },
+ },
},
{
.name = "profile",
.off1 = td_var_offset(gid),
.help = "Run job with this group ID",
},
+ {
+ .name = "flow_id",
+ .type = FIO_OPT_INT,
+ .off1 = td_var_offset(flow_id),
+ .help = "The flow index ID to use",
+ .def = "0",
+ },
+ {
+ .name = "flow",
+ .type = FIO_OPT_INT,
+ .off1 = td_var_offset(flow),
+ .help = "Weight for flow control of this job",
+ .parent = "flow_id",
+ .def = "0",
+ },
+ {
+ .name = "flow_watermark",
+ .type = FIO_OPT_INT,
+ .off1 = td_var_offset(flow_watermark),
+ .help = "High watermark for flow control. This option"
+ " should be set to the same value for all threads"
+ " with non-zero flow.",
+ .parent = "flow_id",
+ .def = "1024",
+ },
+ {
+ .name = "flow_sleep",
+ .type = FIO_OPT_INT,
+ .off1 = td_var_offset(flow_sleep),
+ .help = "How many microseconds to sleep after being held"
+ " back by the flow control mechanism",
+ .parent = "flow_id",
+ .def = "0",
+ },
{
.name = NULL,
},
void fio_options_mem_dupe(struct thread_data *td)
{
options_mem_dupe(&td->o, options);
- if (td->eo) {
+
+ if (td->eo && td->io_ops) {
void *oldeo = td->eo;
+
td->eo = malloc(td->io_ops->option_struct_size);
memcpy(td->eo, oldeo, td->io_ops->option_struct_size);
options_mem_dupe(td->eo, td->io_ops->options);