linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvme-rdma: Don't fail the controller if only part of the queues fail to connect
@ 2018-11-04 16:37 Israel Rukshin
  2018-11-04 17:09 ` [Suspected-Phishing][PATCH] " Max Gurtovoy
  2018-11-05 19:34 ` [PATCH] " James Smart
  0 siblings, 2 replies; 13+ messages in thread
From: Israel Rukshin @ 2018-11-04 16:37 UTC (permalink / raw)


From: Sagi Grimberg <sagi@grimberg.me>

blk-mq tells us to skip unmapped queues but we fail the controller altogether.

Signed-off-by: Israel Rukshin <israelr at mellanox.com>
Reviewed-by: Max Gurtovoy <maxg at mellanox.com>
---
 drivers/nvme/host/rdma.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 6f1bd79..c6dd1efe 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -643,20 +643,33 @@ static int nvme_rdma_start_queue(struct nvme_rdma_ctrl *ctrl, int idx)
 
 static int nvme_rdma_start_io_queues(struct nvme_rdma_ctrl *ctrl)
 {
-	int i, ret = 0;
+	int i, ret, count = 0;
 
 	for (i = 1; i < ctrl->ctrl.queue_count; i++) {
 		ret = nvme_rdma_start_queue(ctrl, i);
-		if (ret)
+		if (ret) {
+			if (ret == -EXDEV) {
+				/* unmapped queue, skip ... */
+				nvme_rdma_free_queue(&ctrl->queues[i]);
+				continue;
+			}
 			goto out_stop_queues;
+		}
+		count++;
 	}
 
+	if (!count)
+		/* no started queues, fail */
+		return -EIO;
+
+	dev_info(ctrl->ctrl.device, "connected %d I/O queues.\n", count);
+
 	return 0;
 
 out_stop_queues:
 	for (i--; i >= 1; i--)
 		nvme_rdma_stop_queue(&ctrl->queues[i]);
-	return ret;
+	return -EIO;
 }
 
 static int nvme_rdma_alloc_io_queues(struct nvme_rdma_ctrl *ctrl)
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-11-09 21:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-04 16:37 [PATCH] nvme-rdma: Don't fail the controller if only part of the queues fail to connect Israel Rukshin
2018-11-04 17:09 ` [Suspected-Phishing][PATCH] " Max Gurtovoy
2018-11-05 19:34 ` [PATCH] " James Smart
2018-11-06 11:10   ` Max Gurtovoy
2018-11-07  9:07     ` Christoph Hellwig
2018-11-07 18:31       ` Sagi Grimberg
2018-11-08  8:20       ` Max Gurtovoy
2018-11-08  8:37         ` Christoph Hellwig
2018-11-08 14:46           ` Max Gurtovoy
2018-11-08 14:58             ` Christoph Hellwig
2018-11-09  0:00           ` Sagi Grimberg
2018-11-09 18:55             ` James Smart
2018-11-09 21:52               ` Sagi Grimberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).