With writefua option set to 1, write operations include
the force unit access (fua) flag. Default is 0.
+.. option:: write_mode=str : [io_uring_cmd]
+
+ Specifies the type of write operation. Defaults to 'write'.
+
+ **write**
+ Use Write commands for write operations
+
+ **uncor**
+ Use Write Uncorrectable commands for write opreations
+
+ **zeroes**
+ Use Write Zeroes commands for write operations
+
+ **verify**
+ Use Verify commands for write operations
+
.. option:: sg_write_mode=str : [sg]
Specify the type of write commands to issue. This option can take ten values:
FIO_URING_CMD_NVME = 1,
};
+enum uring_cmd_write_mode {
+ FIO_URING_CMD_WMODE_WRITE = 1,
+ FIO_URING_CMD_WMODE_UNCOR,
+ FIO_URING_CMD_WMODE_ZEROES,
+ FIO_URING_CMD_WMODE_VERIFY,
+};
+
struct io_sq_ring {
unsigned *head;
unsigned *tail;
struct nvme_dsm *dsm;
uint32_t cdw12_flags[DDIR_RWDIR_CNT];
+ uint8_t write_opcode;
};
struct ioring_options {
unsigned int hipri;
unsigned int readfua;
unsigned int writefua;
+ unsigned int write_mode;
struct cmdprio_options cmdprio_options;
unsigned int fixedbufs;
unsigned int registerfiles;
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_IOURING,
},
+ {
+ .name = "write_mode",
+ .lname = "Additional Write commands support (Write Uncorrectable, Write Zeores)",
+ .type = FIO_OPT_STR,
+ .off1 = offsetof(struct ioring_options, write_mode),
+ .help = "Issue Write Uncorrectable or Zeroes command instaed of Write command",
+ .def = "write",
+ .posval = {
+ { .ival = "write",
+ .oval = FIO_URING_CMD_WMODE_WRITE,
+ .help = "Issue Write commands for write operations"
+ },
+ { .ival = "uncor",
+ .oval = FIO_URING_CMD_WMODE_UNCOR,
+ .help = "Issue Write Uncorrectable commands for write operations"
+ },
+ { .ival = "zeroes",
+ .oval = FIO_URING_CMD_WMODE_ZEROES,
+ .help = "Issue Write Zeroes commands for write operations"
+ },
+ { .ival = "verify",
+ .oval = FIO_URING_CMD_WMODE_VERIFY,
+ .help = "Issue Verify commands for write operations"
+ },
+ },
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_IOURING,
+ },
{
.name = "fixedbufs",
.lname = "Fixed (pre-mapped) IO buffers",
return fio_nvme_uring_cmd_prep(cmd, io_u,
o->nonvectored ? NULL : &ld->iovecs[io_u->index],
- dsm, ld->cdw12_flags[io_u->ddir]);
+ dsm, ld->write_opcode, ld->cdw12_flags[io_u->ddir]);
}
static struct io_u *fio_ioring_event(struct thread_data *td, int event)
}
if (!strcmp(td->io_ops->name, "io_uring_cmd")) {
+ if (td_write(td)) {
+ switch (o->write_mode) {
+ case FIO_URING_CMD_WMODE_UNCOR:
+ ld->write_opcode = nvme_cmd_write_uncor;
+ break;
+ case FIO_URING_CMD_WMODE_ZEROES:
+ ld->write_opcode = nvme_cmd_write_zeroes;
+ break;
+ case FIO_URING_CMD_WMODE_VERIFY:
+ ld->write_opcode = nvme_cmd_verify;
+ break;
+ default:
+ ld->write_opcode = nvme_cmd_write;
+ break;
+ }
+ }
+
if (o->readfua)
ld->cdw12_flags[DDIR_READ] = 1 << 30;
if (o->writefua)
td_verror(td, EINVAL, "fio_ioring_cmd_open_file");
return 1;
}
+
+ if (o->write_mode != FIO_URING_CMD_WMODE_WRITE &&
+ !td_write(td)) {
+ log_err("%s: 'readwrite=|rw=' has no write\n",
+ f->file_name);
+ td_verror(td, EINVAL, "fio_ioring_cmd_open_file");
+ return 1;
+ }
}
if (!ld || !o->registerfiles)
return generic_open_file(td, f);
int fio_nvme_uring_cmd_prep(struct nvme_uring_cmd *cmd, struct io_u *io_u,
struct iovec *iov, struct nvme_dsm *dsm,
- unsigned int cdw12_flags)
+ uint8_t write_opcode, unsigned int cdw12_flags)
{
struct nvme_data *data = FILE_ENG_DATA(io_u->file);
__u64 slba;
cmd->opcode = nvme_cmd_read;
break;
case DDIR_WRITE:
- cmd->opcode = nvme_cmd_write;
+ cmd->opcode = write_opcode;
break;
case DDIR_TRIM:
fio_nvme_uring_cmd_trim_prep(cmd, io_u, dsm);
enum nvme_io_opcode {
nvme_cmd_write = 0x01,
nvme_cmd_read = 0x02,
+ nvme_cmd_write_uncor = 0x04,
+ nvme_cmd_write_zeroes = 0x08,
nvme_cmd_dsm = 0x09,
+ nvme_cmd_verify = 0x0c,
nvme_cmd_io_mgmt_recv = 0x12,
nvme_zns_cmd_mgmt_send = 0x79,
nvme_zns_cmd_mgmt_recv = 0x7a,
int fio_nvme_uring_cmd_prep(struct nvme_uring_cmd *cmd, struct io_u *io_u,
struct iovec *iov, struct nvme_dsm *dsm,
- unsigned int cdw12_flags);
+ uint8_t write_opcode, unsigned int cdw12_flags);
void fio_nvme_pi_fill(struct nvme_uring_cmd *cmd, struct io_u *io_u,
struct nvme_cmd_ext_io_opts *opts);
With writefua option set to 1, write operations include the force
unit access (fua) flag. Default: 0.
.TP
+.BI (io_uring_cmd)write_mode \fR=\fPstr
+Specifies the type of write operation. Defaults to 'write'.
+.RS
+.RS
+.TP
+.B write
+Use Write commands for write operations
+.TP
+.B uncor
+Use Write Uncorrectable commands for write opreations
+.TP
+.B zeroes
+Use Write Zeroes commands for write operations
+.TP
+.B verify
+Use Verify commands for write operations
+.TP
+.RE
+.RE
+.TP
.BI (sg)sg_write_mode \fR=\fPstr
Specify the type of write commands to issue. This option can take multiple
values: