Commit a99dd775 authored by Ziye Yang's avatar Ziye Yang Committed by Jim Harris
Browse files

fio_plugin: Fix the performance issue on testing multiple remote nvme subsystem



The reason is that we create duplicated qpair on same subsystem many times,
thus the performance is influenced. And this patch can fix this issue.

Change-Id: I075b028b15e0d34857a89510710642f2d9520235
Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/375782


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 9e885395
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ struct spdk_fio_qpair {
	struct spdk_nvme_qpair	*qpair;
	struct spdk_nvme_ns	*ns;
	struct spdk_fio_qpair 	*next;
	struct spdk_fio_ctrlr   *fio_ctrlr;
};

struct spdk_fio_thread {
@@ -156,7 +157,9 @@ attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,

	fio_qpair = fio_thread->fio_qpair;
	while (fio_qpair != NULL) {
		if (fio_qpair->f == f) {
		if ((fio_qpair->f == f) ||
		    ((spdk_nvme_transport_id_compare(trid, &fio_qpair->fio_ctrlr->tr_id) == 0) &&
		     (spdk_nvme_ns_get_id(fio_qpair->ns) == ns_id))) {
			return;
		}
		fio_qpair = fio_qpair->next;
@@ -171,6 +174,7 @@ attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
	fio_qpair->qpair = spdk_nvme_ctrlr_alloc_io_qpair(fio_ctrlr->ctrlr, NULL, 0);
	fio_qpair->ns = ns;
	fio_qpair->f = f;
	fio_qpair->fio_ctrlr = fio_ctrlr;
	fio_qpair->next = fio_thread->fio_qpair;
	fio_thread->fio_qpair = fio_qpair;