Skip to content

Commit a191635

Browse files
committed
engines/io_uring_cmd: do not send data buffer for write zeroes
For write zeroes commands, do not send a data bufffer address. If we do send an address, the driver will try to carry out DMA mapping and encounter driver mdts limitations which do not apply to write zeroes commands. This lets us send large write zeroes commands to deallocate the device with the deac=1. This is only done for the non-vectored IO case. For the vectored IO case, the driver requires data buffer addresses to be sent. Regardless it does not make sense to use vectored IO for write zeroes. Signed-off-by: Vincent Fu <[email protected]>
1 parent dfc79b1 commit a191635

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

engines/nvme.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,11 @@ int fio_nvme_uring_cmd_prep(struct nvme_uring_cmd *cmd, struct io_u *io_u,
406406
cmd->addr = (__u64)(uintptr_t)iov;
407407
cmd->data_len = 1;
408408
} else {
409-
cmd->addr = (__u64)(uintptr_t)io_u->xfer_buf;
409+
/* no buffer for write zeroes */
410+
if (cmd->opcode != nvme_cmd_write_zeroes)
411+
cmd->addr = (__u64)(uintptr_t)io_u->xfer_buf;
412+
else
413+
cmd->addr = (__u64)(uintptr_t)NULL;
410414
cmd->data_len = io_u->xfer_buflen;
411415
}
412416
if (data->lba_shift && data->ms) {

0 commit comments

Comments
 (0)