lib/nvme: force qpair disconnect before aborting rdma requests.

This is needed for shared completion queues which can still give us
successful completions on aborted requests if the qpair hasn't been
disconnected.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I85cf1a81ef563d8c02d684b09d2f7ad5008e38cb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1961
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Seth Howell 2020-04-21 16:19:02 -07:00 committed by Tomasz Zawadzki
parent b4e060b560
commit 6d18ea425b

View File

@ -2011,6 +2011,16 @@ nvme_rdma_qpair_abort_reqs(struct spdk_nvme_qpair *qpair, uint32_t dnr)
cpl.status.sct = SPDK_NVME_SCT_GENERIC;
cpl.status.dnr = dnr;
/*
* We cannot abort requests at the RDMA layer without
* unregistering them. If we do, we can still get error
* free completions on the shared completion queue.
*/
if (nvme_qpair_get_state(qpair) > NVME_QPAIR_DISCONNECTING &&
nvme_qpair_get_state(qpair) != NVME_QPAIR_DESTROYING) {
nvme_ctrlr_disconnect_qpair(qpair);
}
TAILQ_FOREACH_SAFE(rdma_req, &rqpair->outstanding_reqs, link, tmp) {
assert(rdma_req->req != NULL);
req = rdma_req->req;