nvmf: allow abort of AER requests

These are trivial to abort: since we just hold on to aer_req until an
event is triggered, we just need to set aer_req back to NULL and
complete the request.

Change-Id: I74ffe7a227fcaf816c0c584fe5c82a940475687f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/412881
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Daniel Verkamp 2018-05-29 18:24:44 -07:00 committed by Changpeng Liu
parent c5f3ab7a73
commit 40b6f761b2

View File

@ -1455,6 +1455,18 @@ invalid_cns:
static struct spdk_nvmf_request * static struct spdk_nvmf_request *
spdk_nvmf_qpair_abort(struct spdk_nvmf_qpair *qpair, uint16_t cid) spdk_nvmf_qpair_abort(struct spdk_nvmf_qpair *qpair, uint16_t cid)
{ {
struct spdk_nvmf_ctrlr *ctrlr = qpair->ctrlr;
struct spdk_nvmf_request *req;
if (spdk_nvmf_qpair_is_admin_queue(qpair)) {
if (ctrlr->aer_req && ctrlr->aer_req->cmd->nvme_cmd.cid == cid) {
SPDK_DEBUGLOG(SPDK_LOG_NVMF, "Aborting AER request\n");
req = ctrlr->aer_req;
ctrlr->aer_req = NULL;
return req;
}
}
/* TODO: track list of outstanding requests in qpair? */ /* TODO: track list of outstanding requests in qpair? */
return NULL; return NULL;
} }