engines/io_uring_cmd: do not send data buffer for write zeroes
authorVincent Fu <vincent.fu@samsung.com>
Fri, 11 Oct 2024 22:01:26 +0000 (22:01 +0000)
committerVincent Fu <vincent.fu@samsung.com>
Mon, 28 Oct 2024 16:25:15 +0000 (12:25 -0400)
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 <vincent.fu@samsung.com>
engines/nvme.c

index 18010c0b5573049786e8f985cf1350d615e5784c..37a31e2ff765bbb05548f579cce1241dcc350e87 100644 (file)
@@ -406,7 +406,11 @@ int fio_nvme_uring_cmd_prep(struct nvme_uring_cmd *cmd, struct io_u *io_u,
                cmd->addr = (__u64)(uintptr_t)iov;
                cmd->data_len = 1;
        } else {
-               cmd->addr = (__u64)(uintptr_t)io_u->xfer_buf;
+               /* no buffer for write zeroes */
+               if (cmd->opcode != nvme_cmd_write_zeroes)
+                       cmd->addr = (__u64)(uintptr_t)io_u->xfer_buf;
+               else
+                       cmd->addr = (__u64)(uintptr_t)NULL;
                cmd->data_len = io_u->xfer_buflen;
        }
        if (data->lba_shift && data->ms) {