From c3eac3435a35d6a89f26ba3077ec4041eeaa0c5d Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Wed, 15 Apr 2020 19:52:09 -0700 Subject: [PATCH] nvme/rdma: send an rdma_disconnect during disconnect. The rdma_disconnect call triggers an RDMA_CM_EVENT_DISCONNECTED message on the target side. The hope is that the target side will reply with the same message in a reasonable amount of time. If the target doesn't have that mechanism implemented, print an error message and continue with the process. Signed-off-by: Seth Howell Change-Id: I164a3538714fa3adfc306ea0c88220ea710e7c39 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1879 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Aleksey Marchuk Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto --- lib/nvme/nvme_rdma.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/nvme/nvme_rdma.c b/lib/nvme/nvme_rdma.c index e7167bfc2..a32ce491e 100644 --- a/lib/nvme/nvme_rdma.c +++ b/lib/nvme/nvme_rdma.c @@ -1657,6 +1657,14 @@ nvme_rdma_ctrlr_disconnect_qpair(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme } if (rqpair->cm_id) { + rdma_disconnect(rqpair->cm_id); + if (qpair->ctrlr != NULL) { + + if (nvme_rdma_process_event(rqpair, rctrlr->cm_channel, RDMA_CM_EVENT_DISCONNECTED)) { + SPDK_DEBUGLOG(SPDK_LOG_NVME, "Target did not respond to qpair disconnect.\n"); + } + } + if (rqpair->cm_id->qp) { rdma_destroy_qp(rqpair->cm_id); }