Commit ef1f8443 authored by Jim Harris's avatar Jim Harris
Browse files

nvme: add qpair parameter to nvme_complete_request



In some cases we have the qpair already when calling
this function.  So pass the qpair to avoid having
to get it from the request.  This shows about a 3%
performance improvement for high IOPs single core
tests.

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

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent a9b174e7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -554,7 +554,7 @@ spdk_nvme_ctrlr_cmd_abort_cpl(void *ctx, const struct spdk_nvme_cpl *cpl)
			next->cpl.status.sct = SPDK_NVME_SCT_GENERIC;
			next->cpl.status.sc = SPDK_NVME_SC_INTERNAL_DEVICE_ERROR;
			next->cpl.status.dnr = 1;
			nvme_complete_request(next->cb_fn, next->cb_arg, next, &req->cpl);
			nvme_complete_request(next->cb_fn, next->cb_arg, next->qpair, next, &req->cpl);
			nvme_free_request(next);
		} else {
			/* If the first abort succeeds, stop iterating. */
+1 −2
Original line number Diff line number Diff line
@@ -915,10 +915,9 @@ struct nvme_request *nvme_allocate_request_user_copy(struct spdk_nvme_qpair *qpa
		spdk_nvme_cmd_cb cb_fn, void *cb_arg, bool host_to_controller);

static inline void
nvme_complete_request(spdk_nvme_cmd_cb cb_fn, void *cb_arg,
nvme_complete_request(spdk_nvme_cmd_cb cb_fn, void *cb_arg, struct spdk_nvme_qpair *qpair,
		      struct nvme_request *req, struct spdk_nvme_cpl *cpl)
{
	struct spdk_nvme_qpair          *qpair = req->qpair;
	struct spdk_nvme_cpl            err_cpl;
	struct nvme_error_cmd           *cmd;

+2 −1
Original line number Diff line number Diff line
@@ -74,7 +74,8 @@ nvme_cb_complete_child(void *child_arg, const struct spdk_nvme_cpl *cpl)
	}

	if (parent->num_children == 0) {
		nvme_complete_request(parent->cb_fn, parent->cb_arg, parent, &parent->parent_status);
		nvme_complete_request(parent->cb_fn, parent->cb_arg, parent->qpair,
				      parent, &parent->parent_status);
		nvme_free_request(parent);
	}
}
+2 −2
Original line number Diff line number Diff line
@@ -1179,7 +1179,7 @@ nvme_pcie_qpair_complete_pending_admin_request(struct spdk_nvme_qpair *qpair)

		assert(req->pid == pid);

		nvme_complete_request(req->cb_fn, req->cb_arg, req, &req->cpl);
		nvme_complete_request(req->cb_fn, req->cb_arg, qpair, req, &req->cpl);
		nvme_free_request(req);
	}
}
@@ -1312,7 +1312,7 @@ nvme_pcie_qpair_complete_tracker(struct spdk_nvme_qpair *qpair, struct nvme_trac
			req_from_current_proc = false;
			nvme_pcie_qpair_insert_pending_admin_request(qpair, req, cpl);
		} else {
			nvme_complete_request(tr->cb_fn, tr->cb_arg, req, cpl);
			nvme_complete_request(tr->cb_fn, tr->cb_arg, qpair, req, cpl);
		}

		if (req_from_current_proc == true) {
+1 −1
Original line number Diff line number Diff line
@@ -383,7 +383,7 @@ nvme_qpair_manual_complete_request(struct spdk_nvme_qpair *qpair,
		nvme_qpair_print_completion(qpair, &cpl);
	}

	nvme_complete_request(req->cb_fn, req->cb_arg, req, &cpl);
	nvme_complete_request(req->cb_fn, req->cb_arg, qpair, req, &cpl);
	nvme_free_request(req);
}

Loading