Skip to content

Commit dfc79b1

Browse files
committed
engines/io_uring_cmd: add option to set DEAC bit for write zeroes
Add an option for fio to set the DEAC bit for write zeroes commands. This instructs the device to also deallocate the specified logical blocks in the course of completing the write zeroes operation. This only has an effect when write_mode=zeroes is specified. Signed-off-by: Vincent Fu <[email protected]>
1 parent 86fc77a commit dfc79b1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

engines/io_uring.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ struct ioring_options {
104104
unsigned int hipri;
105105
unsigned int readfua;
106106
unsigned int writefua;
107+
unsigned int deac;
107108
unsigned int write_mode;
108109
unsigned int verify_mode;
109110
struct cmdprio_options cmdprio_options;
@@ -357,6 +358,16 @@ static struct fio_option options[] = {
357358
.category = FIO_OPT_C_ENGINE,
358359
.group = FIO_OPT_G_IOURING,
359360
},
361+
{
362+
.name = "deac",
363+
.lname = "Deallocate bit for write zeroes command",
364+
.type = FIO_OPT_BOOL,
365+
.off1 = offsetof(struct ioring_options, deac),
366+
.help = "Set DEAC (deallocate) flag for write zeroes command",
367+
.def = "0",
368+
.category = FIO_OPT_C_ENGINE,
369+
.group = FIO_OPT_G_IOURING,
370+
},
360371
{
361372
.name = NULL,
362373
},
@@ -1388,6 +1399,8 @@ static int fio_ioring_init(struct thread_data *td)
13881399
break;
13891400
case FIO_URING_CMD_WMODE_ZEROES:
13901401
ld->write_opcode = nvme_cmd_write_zeroes;
1402+
if (o->deac)
1403+
ld->cdw12_flags[DDIR_WRITE] = 1 << 25;
13911404
break;
13921405
case FIO_URING_CMD_WMODE_VERIFY:
13931406
ld->write_opcode = nvme_cmd_verify;

0 commit comments

Comments
 (0)