nvme/fio_plugin: fix ->queue() error reporting

FIO backends are supposed to return a negative value on error.

Add special handling for -ENOMEM (out of requests) case to return
FIO_Q_BUSY, indicating that FIO should resubmit the request later.

This is part of the fix for issue #169, which is related to high queue
depths with large I/Os causing the NVMe library to run out of request
objects.

Change-Id: I4fa4001b078b07c42fcd4d1357434575b2c84023
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/369664
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Daniel Verkamp 2017-07-14 13:32:50 -07:00 committed by Jim Harris
parent b9244352b0
commit 37962990e4

View File

@ -371,7 +371,7 @@ static int spdk_fio_queue(struct thread_data *td, struct io_u *io_u)
fio_qpair = fio_qpair->next;
}
if (fio_qpair == NULL || ns == NULL) {
return FIO_Q_COMPLETED;
return -ENXIO;
}
block_size = spdk_nvme_ns_get_sector_size(ns);
@ -392,9 +392,16 @@ static int spdk_fio_queue(struct thread_data *td, struct io_u *io_u)
break;
}
assert(rc == 0);
/* NVMe read/write functions return -ENOMEM if there are no free requests. */
if (rc == -ENOMEM) {
return FIO_Q_BUSY;
}
return rc ? FIO_Q_COMPLETED : FIO_Q_QUEUED;
if (rc != 0) {
return -abs(rc);
}
return FIO_Q_QUEUED;
}
static struct io_u *spdk_fio_event(struct thread_data *td, int event)