Commit 37962990 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Jim Harris
Browse files

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: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/369664


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent b9244352
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -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;
	}

	if (rc != 0) {
		return -abs(rc);
	}

	return rc ? FIO_Q_COMPLETED : FIO_Q_QUEUED;
	return FIO_Q_QUEUED;
}

static struct io_u *spdk_fio_event(struct thread_data *td, int event)