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: Jim Harris <james.r.harris@intel.com> Change-Id: I22fcca560492f4e7cf5ffedd252e41a027d0dd79 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455286 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
a9b174e71e
commit
ef1f844395
@ -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. */
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -209,7 +209,7 @@ static void
|
||||
nvme_rdma_req_complete(struct nvme_request *req,
|
||||
struct spdk_nvme_cpl *rsp)
|
||||
{
|
||||
nvme_complete_request(req->cb_fn, req->cb_arg, req, rsp);
|
||||
nvme_complete_request(req->cb_fn, req->cb_arg, req->qpair, req, rsp);
|
||||
nvme_free_request(req);
|
||||
}
|
||||
|
||||
|
@ -743,7 +743,7 @@ static void
|
||||
nvme_tcp_req_complete(struct nvme_request *req,
|
||||
struct spdk_nvme_cpl *rsp)
|
||||
{
|
||||
nvme_complete_request(req->cb_fn, req->cb_arg, req, rsp);
|
||||
nvme_complete_request(req->cb_fn, req->cb_arg, req->qpair, req, rsp);
|
||||
nvme_free_request(req);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user