bdev_malloc: exit early in case of no acceleration task

If acceleration tasks are exhausted, then we can exit
the submission loop earlier, also print number of IOVs
for each R/W request.

Change-Id: Ia98ed43b0bb2be229b7c0054f3ade0ad39337b09
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10836
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Changpeng Liu 2021-12-23 20:29:46 +08:00 committed by Tomasz Zawadzki
parent 8313dbf9a0
commit 31d684d759

View File

@ -167,18 +167,20 @@ bdev_malloc_readv(struct malloc_disk *mdisk, struct spdk_io_channel *ch,
return;
}
SPDK_DEBUGLOG(bdev_malloc, "read %zu bytes from offset %#" PRIx64 "\n",
len, offset);
SPDK_DEBUGLOG(bdev_malloc, "read %zu bytes from offset %#" PRIx64 ", iovcnt=%d\n",
len, offset, iovcnt);
task->status = SPDK_BDEV_IO_STATUS_SUCCESS;
task->num_outstanding = iovcnt;
task->num_outstanding = 0;
for (i = 0; i < iovcnt; i++) {
task->num_outstanding++;
res = spdk_accel_submit_copy(ch, iov[i].iov_base,
src, iov[i].iov_len, malloc_done, task);
if (res != 0) {
malloc_done(task, res);
break;
}
src += iov[i].iov_len;
@ -201,18 +203,20 @@ bdev_malloc_writev(struct malloc_disk *mdisk, struct spdk_io_channel *ch,
return;
}
SPDK_DEBUGLOG(bdev_malloc, "wrote %zu bytes to offset %#" PRIx64 "\n",
len, offset);
SPDK_DEBUGLOG(bdev_malloc, "wrote %zu bytes to offset %#" PRIx64 ", iovcnt=%d\n",
len, offset, iovcnt);
task->status = SPDK_BDEV_IO_STATUS_SUCCESS;
task->num_outstanding = iovcnt;
task->num_outstanding = 0;
for (i = 0; i < iovcnt; i++) {
task->num_outstanding++;
res = spdk_accel_submit_copy(ch, dst, iov[i].iov_base,
iov[i].iov_len, malloc_done, task);
if (res != 0) {
malloc_done(task, res);
break;
}
dst += iov[i].iov_len;