From 8bc6e3c595d93c788aa5d4b442060cab9b301236 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Fri, 5 Apr 2019 07:45:37 -0700 Subject: [PATCH] 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: Jim Harris Change-Id: I54acd642a2c9821f2b95e17563904b859495081a Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450308 Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Ben Walker --- lib/nvme/nvme_pcie.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/nvme/nvme_pcie.c b/lib/nvme/nvme_pcie.c index 2408395fe..b391291af 100644 --- a/lib/nvme/nvme_pcie.c +++ b/lib/nvme/nvme_pcie.c @@ -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);