Commit 8bc6e3c5 authored by Jim Harris's avatar Jim Harris
Browse files

nvme: simplify some tracker accesses



There are several places where we have the tracker
pointer, yet we go find the tracker again by getting
the tr->cid and using that index to find the tracker
again in the qpair's array.  That's really silly.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I54acd642a2c9821f2b95e17563904b859495081a

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450308


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 18b3e741
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1238,7 +1238,7 @@ nvme_pcie_qpair_submit_tracker(struct spdk_nvme_qpair *qpair, struct nvme_tracke
	req = tr->req;
	assert(req != NULL);

	pqpair->tr[tr->cid].active = true;
	tr->active = true;

	/* Copy the command from the tracker to the submission queue. */
	nvme_pcie_copy_command(&pqpair->cmd[pqpair->sq_tail], &req->cmd);
@@ -1278,8 +1278,8 @@ nvme_pcie_qpair_complete_tracker(struct spdk_nvme_qpair *qpair, struct nvme_trac
		nvme_qpair_print_completion(qpair, cpl);
	}

	was_active = pqpair->tr[cpl->cid].active;
	pqpair->tr[cpl->cid].active = false;
	was_active = tr->active;
	tr->active = false;

	assert(cpl->cid == req->cmd.cid);