Commit 15a22694 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

lib/nvme: only set qpair->transport once



If controller is reset with active IO qpairs, those
IO qpairs go back through nvme_transport_ctrlr_connect_qpair.
But if IO qpairs are allocated from different processes,
some qpairs will go through that function from a foreign
process.

That is generally fine, except that function also always
resets the transport object. But the transport objects
are process-specific since they contain function pointers.
We cannot point a qpair to a transport from a foreign process.
So just skip setting the transport if it is already set.

Signed-off-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: Ib9ae8b2d442206c2dad956e1ff2ffa2bced75b28
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21165


Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
parent e63da6d8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -466,7 +466,7 @@ nvme_transport_ctrlr_connect_qpair(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nv
	int rc;

	assert(transport != NULL);
	if (!nvme_qpair_is_admin_queue(qpair)) {
	if (!nvme_qpair_is_admin_queue(qpair) && qpair->transport == NULL) {
		qpair->transport = transport;
	}