summaryrefslogtreecommitdiff
path: root/drivers/nvme/target/rdma.c
diff options
context:
space:
mode:
authorSagi Grimberg <sagi@grimberg.me>2016-11-06 12:03:59 +0300
committerSagi Grimberg <sagi@grimberg.me>2016-11-14 03:08:53 +0300
commit14c862dbb0a0e0a9baec20480d441e32cb54b2b9 (patch)
tree18cc13ffb25ab02c05f50a09f2b4d63fff77144a /drivers/nvme/target/rdma.c
parentc8dbc37cd81d4705fce51123f5d81ea3267a5b88 (diff)
downloadlinux-14c862dbb0a0e0a9baec20480d441e32cb54b2b9.tar.xz
nvmet-rdma: drain the queue-pair just before freeing it
draining the qp right after disconnect might not suffice because the nvmet sq is not fully drained (in nvmet_sq_destroy) and we might see completions after the drain. Instead, drain right before the qp destroy which comes after the sq destruction and we can be sure that no posts come after the drain. Tested-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Diffstat (limited to 'drivers/nvme/target/rdma.c')
-rw-r--r--drivers/nvme/target/rdma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index 8c06675c2305..005ef5d17a19 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -951,6 +951,7 @@ err_destroy_cq:
static void nvmet_rdma_destroy_queue_ib(struct nvmet_rdma_queue *queue)
{
+ ib_drain_qp(queue->cm_id->qp);
rdma_destroy_qp(queue->cm_id);
ib_free_cq(queue->cq);
}
@@ -1245,7 +1246,6 @@ static void __nvmet_rdma_queue_disconnect(struct nvmet_rdma_queue *queue)
if (disconnect) {
rdma_disconnect(queue->cm_id);
- ib_drain_qp(queue->cm_id->qp);
schedule_work(&queue->release_work);
}
}