diff mbox

[11/11] nvme-fabrics: pass non-blocking flag to connect request allocation

Message ID 1465389066-19119-12-git-send-email-hch@lst.de
State New, archived
Headers show

Commit Message

Christoph Hellwig June 8, 2016, 12:31 p.m. UTC
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/nvme/host/fabrics.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

Comments

Sagi Grimberg June 8, 2016, 1:55 p.m. UTC | #1
Looks fine,

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>

Would be nice to reduce the number of arguments
passed to __nvme_submit_sync_cmd() at some point..
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig June 8, 2016, 2:09 p.m. UTC | #2
On Wed, Jun 08, 2016 at 04:55:41PM +0300, Sagi Grimberg wrote:
> Looks fine,
>
> Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
>
> Would be nice to reduce the number of arguments
> passed to __nvme_submit_sync_cmd() at some point..

We're only adding them in our series..  But I agree that the number
of arguments is a bit of a mess, but I couldn't really come up with
something better.
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index ee4b7f1..225a732 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -378,11 +378,10 @@  int nvmf_connect_admin_queue(struct nvme_ctrl *ctrl)
 
 	ret = __nvme_submit_sync_cmd(ctrl->admin_q, &cmd, &cqe,
 			data, sizeof(*data), 0, NVME_QID_ANY, 1,
-			BLK_MQ_REQ_RESERVED);
+			BLK_MQ_REQ_RESERVED | BLK_MQ_REQ_NOWAIT);
 	if (ret) {
-		nvmf_log_connect_error(ctrl,
-					 ret, le32_to_cpu(cqe.result),
-					 &cmd, data);
+		nvmf_log_connect_error(ctrl, ret, le32_to_cpu(cqe.result),
+				       &cmd, data);
 		goto out_free_data;
 	}
 
@@ -437,12 +436,12 @@  int nvmf_connect_io_queue(struct nvme_ctrl *ctrl, u16 qid)
 	strncpy(data->hostnqn, ctrl->opts->host->nqn, NVMF_NQN_SIZE);
 
 	ret = __nvme_submit_sync_cmd(ctrl->connect_q, &cmd, &cqe,
-			data, sizeof(*data), 0, qid, 1, BLK_MQ_REQ_RESERVED);
-	if (ret)
-		nvmf_log_connect_error(ctrl,
-					 ret, le32_to_cpu(cqe.result),
-					 &cmd, data);
-
+			data, sizeof(*data), 0, qid, 1,
+			BLK_MQ_REQ_RESERVED | BLK_MQ_REQ_NOWAIT);
+	if (ret) {
+		nvmf_log_connect_error(ctrl, ret, le32_to_cpu(cqe.result),
+				       &cmd, data);
+	}
 	kfree(data);
 	return ret;
 }