linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv3 0/4] block and nvme passthrough error handling
@ 2021-05-21 20:21 Keith Busch
  2021-05-21 20:21 ` [PATCHv3 1/4] block: support polling through blk_execute_rq Keith Busch
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Keith Busch @ 2021-05-21 20:21 UTC (permalink / raw)
  To: linux-nvme, sagi, hch, axboe, linux-block
  Cc: Yuanyuan Zhong, Casey Chen, Ming Lei, Keith Busch

This series gets blk_execute_rq() to process polled requests and return
queueing errors so the caller may know if their request wasn't
dispatched.

Changes since v2:

  Dropped patch 5 (ioctl polling flag) since there is currently no real
  use case.

  Move blk_execute_rq's poll handling to a small helper function
  (patch 1)

  Return blk_status_t instead of errno (patch 3)

  Removed "extern" header declaration, and named the parameters (patch 3)

  Initialize nvme status to 0 (patch 4)

  Add helper function for blk_status_t to nvme passthrough return code
  (patch 4)

Keith Busch (4):
  block: support polling through blk_execute_rq
  nvme: use blk_execute_rq() for passthrough commands
  block: return errors from blk_execute_rq()
  nvme: use return value from blk_execute_rq()

 block/blk-exec.c               | 25 ++++++++++++--
 drivers/nvme/host/core.c       | 63 ++++++++++++++--------------------
 drivers/nvme/host/fabrics.c    | 13 ++++---
 drivers/nvme/host/fabrics.h    |  2 +-
 drivers/nvme/host/fc.c         |  2 +-
 drivers/nvme/host/ioctl.c      |  6 +---
 drivers/nvme/host/nvme.h       |  4 +--
 drivers/nvme/host/rdma.c       |  3 +-
 drivers/nvme/host/tcp.c        |  2 +-
 drivers/nvme/target/loop.c     |  2 +-
 drivers/nvme/target/passthru.c |  8 ++---
 include/linux/blkdev.h         |  4 ++-
 12 files changed, 69 insertions(+), 65 deletions(-)

-- 
2.25.4


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

* [PATCHv3 1/4] block: support polling through blk_execute_rq
  2021-05-21 20:21 [PATCHv3 0/4] block and nvme passthrough error handling Keith Busch
@ 2021-05-21 20:21 ` Keith Busch
  2021-05-24  7:38   ` Christoph Hellwig
  2021-05-26  8:16   ` Ming Lei
  2021-05-21 20:21 ` [PATCHv3 2/4] nvme: use blk_execute_rq() for passthrough commands Keith Busch
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 17+ messages in thread
From: Keith Busch @ 2021-05-21 20:21 UTC (permalink / raw)
  To: linux-nvme, sagi, hch, axboe, linux-block
  Cc: Yuanyuan Zhong, Casey Chen, Ming Lei, Keith Busch

Poll for completions if the request's hctx is a polling type.

Signed-off-by: Keith Busch <kbusch@kernel.org>
---
v1->v2:

  Moved blk_execute_rq's poll handling into a small helper function

 block/blk-exec.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/block/blk-exec.c b/block/blk-exec.c
index beae70a0e5e5..38f88552aa31 100644
--- a/block/blk-exec.c
+++ b/block/blk-exec.c
@@ -63,6 +63,19 @@ void blk_execute_rq_nowait(struct gendisk *bd_disk, struct request *rq,
 }
 EXPORT_SYMBOL_GPL(blk_execute_rq_nowait);
 
+static bool blk_rq_is_poll(struct request *rq)
+{
+	return rq->mq_hctx && rq->mq_hctx->type == HCTX_TYPE_POLL;
+}
+
+static void blk_rq_poll_completion(struct request *rq, struct completion *wait)
+{
+	do {
+		blk_poll(rq->q, request_to_qc_t(rq->mq_hctx, rq), true);
+		cond_resched();
+	} while (!completion_done(wait));
+}
+
 /**
  * blk_execute_rq - insert a request into queue for execution
  * @bd_disk:	matching gendisk
@@ -83,7 +96,10 @@ void blk_execute_rq(struct gendisk *bd_disk, struct request *rq, int at_head)
 
 	/* Prevent hang_check timer from firing at us during very long I/O */
 	hang_check = sysctl_hung_task_timeout_secs;
-	if (hang_check)
+
+	if (blk_rq_is_poll(rq))
+		blk_rq_poll_completion(rq, &wait);
+	else if (hang_check)
 		while (!wait_for_completion_io_timeout(&wait, hang_check * (HZ/2)));
 	else
 		wait_for_completion_io(&wait);
-- 
2.25.4


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

* [PATCHv3 2/4] nvme: use blk_execute_rq() for passthrough commands
  2021-05-21 20:21 [PATCHv3 0/4] block and nvme passthrough error handling Keith Busch
  2021-05-21 20:21 ` [PATCHv3 1/4] block: support polling through blk_execute_rq Keith Busch
@ 2021-05-21 20:21 ` Keith Busch
  2021-05-24  7:38   ` Christoph Hellwig
                     ` (2 more replies)
  2021-05-21 20:21 ` [PATCHv3 3/4] block: return errors from blk_execute_rq() Keith Busch
  2021-05-21 20:21 ` [PATCHv3 4/4] nvme: use return value " Keith Busch
  3 siblings, 3 replies; 17+ messages in thread
From: Keith Busch @ 2021-05-21 20:21 UTC (permalink / raw)
  To: linux-nvme, sagi, hch, axboe, linux-block
  Cc: Yuanyuan Zhong, Casey Chen, Ming Lei, Keith Busch

The generic blk_execute_rq() knows how to handle polled completions. Use
that instead of implementing an nvme specific handler.

Signed-off-by: Keith Busch <kbusch@kernel.org>
---
No changes since v2

 drivers/nvme/host/core.c    | 38 +++++--------------------------------
 drivers/nvme/host/fabrics.c | 13 ++++++-------
 drivers/nvme/host/fabrics.h |  2 +-
 drivers/nvme/host/fc.c      |  2 +-
 drivers/nvme/host/nvme.h    |  2 +-
 drivers/nvme/host/rdma.c    |  3 +--
 drivers/nvme/host/tcp.c     |  2 +-
 drivers/nvme/target/loop.c  |  2 +-
 8 files changed, 17 insertions(+), 47 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 762125f2905f..1a73eed61eee 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1012,31 +1012,6 @@ blk_status_t nvme_setup_cmd(struct nvme_ns *ns, struct request *req)
 }
 EXPORT_SYMBOL_GPL(nvme_setup_cmd);
 
-static void nvme_end_sync_rq(struct request *rq, blk_status_t error)
-{
-	struct completion *waiting = rq->end_io_data;
-
-	rq->end_io_data = NULL;
-	complete(waiting);
-}
-
-static void nvme_execute_rq_polled(struct request_queue *q,
-		struct gendisk *bd_disk, struct request *rq, int at_head)
-{
-	DECLARE_COMPLETION_ONSTACK(wait);
-
-	WARN_ON_ONCE(!test_bit(QUEUE_FLAG_POLL, &q->queue_flags));
-
-	rq->cmd_flags |= REQ_HIPRI;
-	rq->end_io_data = &wait;
-	blk_execute_rq_nowait(bd_disk, rq, at_head, nvme_end_sync_rq);
-
-	while (!completion_done(&wait)) {
-		blk_poll(q, request_to_qc_t(rq->mq_hctx, rq), true);
-		cond_resched();
-	}
-}
-
 /*
  * Returns 0 on success.  If the result is negative, it's a Linux error code;
  * if the result is positive, it's an NVM Express status code
@@ -1044,7 +1019,7 @@ static void nvme_execute_rq_polled(struct request_queue *q,
 int __nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
 		union nvme_result *result, void *buffer, unsigned bufflen,
 		unsigned timeout, int qid, int at_head,
-		blk_mq_req_flags_t flags, bool poll)
+		blk_mq_req_flags_t flags)
 {
 	struct request *req;
 	int ret;
@@ -1065,10 +1040,7 @@ int __nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
 			goto out;
 	}
 
-	if (poll)
-		nvme_execute_rq_polled(req->q, NULL, req, at_head);
-	else
-		blk_execute_rq(NULL, req, at_head);
+	blk_execute_rq(NULL, req, at_head);
 	if (result)
 		*result = nvme_req(req)->result;
 	if (nvme_req(req)->flags & NVME_REQ_CANCELLED)
@@ -1085,7 +1057,7 @@ int nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
 		void *buffer, unsigned bufflen)
 {
 	return __nvme_submit_sync_cmd(q, cmd, NULL, buffer, bufflen, 0,
-			NVME_QID_ANY, 0, 0, false);
+			NVME_QID_ANY, 0, 0);
 }
 EXPORT_SYMBOL_GPL(nvme_submit_sync_cmd);
 
@@ -1449,7 +1421,7 @@ static int nvme_features(struct nvme_ctrl *dev, u8 op, unsigned int fid,
 	c.features.dword11 = cpu_to_le32(dword11);
 
 	ret = __nvme_submit_sync_cmd(dev->admin_q, &c, &res,
-			buffer, buflen, 0, NVME_QID_ANY, 0, 0, false);
+			buffer, buflen, 0, NVME_QID_ANY, 0, 0);
 	if (ret >= 0 && result)
 		*result = le32_to_cpu(res.u32);
 	return ret;
@@ -2048,7 +2020,7 @@ int nvme_sec_submit(void *data, u16 spsp, u8 secp, void *buffer, size_t len,
 	cmd.common.cdw11 = cpu_to_le32(len);
 
 	return __nvme_submit_sync_cmd(ctrl->admin_q, &cmd, NULL, buffer, len, 0,
-			NVME_QID_ANY, 1, 0, false);
+			NVME_QID_ANY, 1, 0);
 }
 EXPORT_SYMBOL_GPL(nvme_sec_submit);
 #endif /* CONFIG_BLK_SED_OPAL */
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index a2bb7fc63a73..133ef9a62f53 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -151,7 +151,7 @@ int nvmf_reg_read32(struct nvme_ctrl *ctrl, u32 off, u32 *val)
 	cmd.prop_get.offset = cpu_to_le32(off);
 
 	ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, &cmd, &res, NULL, 0, 0,
-			NVME_QID_ANY, 0, 0, false);
+			NVME_QID_ANY, 0, 0);
 
 	if (ret >= 0)
 		*val = le64_to_cpu(res.u64);
@@ -198,7 +198,7 @@ int nvmf_reg_read64(struct nvme_ctrl *ctrl, u32 off, u64 *val)
 	cmd.prop_get.offset = cpu_to_le32(off);
 
 	ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, &cmd, &res, NULL, 0, 0,
-			NVME_QID_ANY, 0, 0, false);
+			NVME_QID_ANY, 0, 0);
 
 	if (ret >= 0)
 		*val = le64_to_cpu(res.u64);
@@ -244,7 +244,7 @@ int nvmf_reg_write32(struct nvme_ctrl *ctrl, u32 off, u32 val)
 	cmd.prop_set.value = cpu_to_le64(val);
 
 	ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, &cmd, NULL, NULL, 0, 0,
-			NVME_QID_ANY, 0, 0, false);
+			NVME_QID_ANY, 0, 0);
 	if (unlikely(ret))
 		dev_err(ctrl->device,
 			"Property Set error: %d, offset %#x\n",
@@ -396,7 +396,7 @@ int nvmf_connect_admin_queue(struct nvme_ctrl *ctrl)
 
 	ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, &cmd, &res,
 			data, sizeof(*data), 0, NVME_QID_ANY, 1,
-			BLK_MQ_REQ_RESERVED | BLK_MQ_REQ_NOWAIT, false);
+			BLK_MQ_REQ_RESERVED | BLK_MQ_REQ_NOWAIT);
 	if (ret) {
 		nvmf_log_connect_error(ctrl, ret, le32_to_cpu(res.u32),
 				       &cmd, data);
@@ -420,7 +420,6 @@ EXPORT_SYMBOL_GPL(nvmf_connect_admin_queue);
  * @qid:	NVMe I/O queue number for the new I/O connection between
  *		host and target (note qid == 0 is illegal as this is
  *		the Admin queue, per NVMe standard).
- * @poll:	Whether or not to poll for the completion of the connect cmd.
  *
  * This function issues a fabrics-protocol connection
  * of a NVMe I/O queue (via NVMe Fabrics "Connect" command)
@@ -432,7 +431,7 @@ EXPORT_SYMBOL_GPL(nvmf_connect_admin_queue);
  *	> 0: NVMe error status code
  *	< 0: Linux errno error code
  */
-int nvmf_connect_io_queue(struct nvme_ctrl *ctrl, u16 qid, bool poll)
+int nvmf_connect_io_queue(struct nvme_ctrl *ctrl, u16 qid)
 {
 	struct nvme_command cmd;
 	struct nvmf_connect_data *data;
@@ -459,7 +458,7 @@ int nvmf_connect_io_queue(struct nvme_ctrl *ctrl, u16 qid, bool poll)
 
 	ret = __nvme_submit_sync_cmd(ctrl->connect_q, &cmd, &res,
 			data, sizeof(*data), 0, qid, 1,
-			BLK_MQ_REQ_RESERVED | BLK_MQ_REQ_NOWAIT, poll);
+			BLK_MQ_REQ_RESERVED | BLK_MQ_REQ_NOWAIT);
 	if (ret) {
 		nvmf_log_connect_error(ctrl, ret, le32_to_cpu(res.u32),
 				       &cmd, data);
diff --git a/drivers/nvme/host/fabrics.h b/drivers/nvme/host/fabrics.h
index d7f7974dc208..b698a3e5cb35 100644
--- a/drivers/nvme/host/fabrics.h
+++ b/drivers/nvme/host/fabrics.h
@@ -178,7 +178,7 @@ int nvmf_reg_read32(struct nvme_ctrl *ctrl, u32 off, u32 *val);
 int nvmf_reg_read64(struct nvme_ctrl *ctrl, u32 off, u64 *val);
 int nvmf_reg_write32(struct nvme_ctrl *ctrl, u32 off, u32 val);
 int nvmf_connect_admin_queue(struct nvme_ctrl *ctrl);
-int nvmf_connect_io_queue(struct nvme_ctrl *ctrl, u16 qid, bool poll);
+int nvmf_connect_io_queue(struct nvme_ctrl *ctrl, u16 qid);
 int nvmf_register_transport(struct nvmf_transport_ops *ops);
 void nvmf_unregister_transport(struct nvmf_transport_ops *ops);
 void nvmf_free_options(struct nvmf_ctrl_options *opts);
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index d9ab9e7871d0..e4495ee55552 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -2346,7 +2346,7 @@ nvme_fc_connect_io_queues(struct nvme_fc_ctrl *ctrl, u16 qsize)
 					(qsize / 5));
 		if (ret)
 			break;
-		ret = nvmf_connect_io_queue(&ctrl->ctrl, i, false);
+		ret = nvmf_connect_io_queue(&ctrl->ctrl, i);
 		if (ret)
 			break;
 
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 0015860ec12b..84bff995a308 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -658,7 +658,7 @@ int nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
 int __nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
 		union nvme_result *result, void *buffer, unsigned bufflen,
 		unsigned timeout, int qid, int at_head,
-		blk_mq_req_flags_t flags, bool poll);
+		blk_mq_req_flags_t flags);
 int nvme_set_features(struct nvme_ctrl *dev, unsigned int fid,
 		      unsigned int dword11, void *buffer, size_t buflen,
 		      u32 *result);
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 37943dc4c2c1..36c018762701 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -680,11 +680,10 @@ static void nvme_rdma_stop_io_queues(struct nvme_rdma_ctrl *ctrl)
 static int nvme_rdma_start_queue(struct nvme_rdma_ctrl *ctrl, int idx)
 {
 	struct nvme_rdma_queue *queue = &ctrl->queues[idx];
-	bool poll = nvme_rdma_poll_queue(queue);
 	int ret;
 
 	if (idx)
-		ret = nvmf_connect_io_queue(&ctrl->ctrl, idx, poll);
+		ret = nvmf_connect_io_queue(&ctrl->ctrl, idx);
 	else
 		ret = nvmf_connect_admin_queue(&ctrl->ctrl);
 
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index d07eb13d8713..f18e2beceed1 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -1559,7 +1559,7 @@ static int nvme_tcp_start_queue(struct nvme_ctrl *nctrl, int idx)
 	int ret;
 
 	if (idx)
-		ret = nvmf_connect_io_queue(nctrl, idx, false);
+		ret = nvmf_connect_io_queue(nctrl, idx);
 	else
 		ret = nvmf_connect_admin_queue(nctrl);
 
diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
index 74b3b150e1a5..9718c06abe38 100644
--- a/drivers/nvme/target/loop.c
+++ b/drivers/nvme/target/loop.c
@@ -335,7 +335,7 @@ static int nvme_loop_connect_io_queues(struct nvme_loop_ctrl *ctrl)
 	int i, ret;
 
 	for (i = 1; i < ctrl->ctrl.queue_count; i++) {
-		ret = nvmf_connect_io_queue(&ctrl->ctrl, i, false);
+		ret = nvmf_connect_io_queue(&ctrl->ctrl, i);
 		if (ret)
 			return ret;
 		set_bit(NVME_LOOP_Q_LIVE, &ctrl->queues[i].flags);
-- 
2.25.4


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

* [PATCHv3 3/4] block: return errors from blk_execute_rq()
  2021-05-21 20:21 [PATCHv3 0/4] block and nvme passthrough error handling Keith Busch
  2021-05-21 20:21 ` [PATCHv3 1/4] block: support polling through blk_execute_rq Keith Busch
  2021-05-21 20:21 ` [PATCHv3 2/4] nvme: use blk_execute_rq() for passthrough commands Keith Busch
@ 2021-05-21 20:21 ` Keith Busch
  2021-05-24  7:39   ` Christoph Hellwig
  2021-05-26  8:26   ` Ming Lei
  2021-05-21 20:21 ` [PATCHv3 4/4] nvme: use return value " Keith Busch
  3 siblings, 2 replies; 17+ messages in thread
From: Keith Busch @ 2021-05-21 20:21 UTC (permalink / raw)
  To: linux-nvme, sagi, hch, axboe, linux-block
  Cc: Yuanyuan Zhong, Casey Chen, Ming Lei, Keith Busch

The synchronous blk_execute_rq() had not provided a way for its callers
to know if its request was successful or not. Return the blk_status_t
result of the request.

Signed-off-by: Keith Busch <kbusch@kernel.org>
---
v2->v3:

  Return blk_status_t instead of errno.

  Removed "extern" header declaration, and named the parameters.

 block/blk-exec.c       | 7 +++++--
 include/linux/blkdev.h | 4 +++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/block/blk-exec.c b/block/blk-exec.c
index 38f88552aa31..d6cd501c0d34 100644
--- a/block/blk-exec.c
+++ b/block/blk-exec.c
@@ -21,7 +21,7 @@ static void blk_end_sync_rq(struct request *rq, blk_status_t error)
 {
 	struct completion *waiting = rq->end_io_data;
 
-	rq->end_io_data = NULL;
+	rq->end_io_data = (void *)(uintptr_t)error;
 
 	/*
 	 * complete last, if this is a stack request the process (and thus
@@ -85,8 +85,9 @@ static void blk_rq_poll_completion(struct request *rq, struct completion *wait)
  * Description:
  *    Insert a fully prepared request at the back of the I/O scheduler queue
  *    for execution and wait for completion.
+ * Return: The blk_status_t result provided to blk_mq_end_request().
  */
-void blk_execute_rq(struct gendisk *bd_disk, struct request *rq, int at_head)
+blk_status_t blk_execute_rq(struct gendisk *bd_disk, struct request *rq, int at_head)
 {
 	DECLARE_COMPLETION_ONSTACK(wait);
 	unsigned long hang_check;
@@ -103,5 +104,7 @@ void blk_execute_rq(struct gendisk *bd_disk, struct request *rq, int at_head)
 		while (!wait_for_completion_io_timeout(&wait, hang_check * (HZ/2)));
 	else
 		wait_for_completion_io(&wait);
+
+	return (blk_status_t)(uintptr_t)rq->end_io_data;
 }
 EXPORT_SYMBOL(blk_execute_rq);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 2c28577b50f4..2d2b477241ba 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -936,10 +936,12 @@ extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, uns
 extern int blk_rq_map_user_iov(struct request_queue *, struct request *,
 			       struct rq_map_data *, const struct iov_iter *,
 			       gfp_t);
-extern void blk_execute_rq(struct gendisk *, struct request *, int);
 extern void blk_execute_rq_nowait(struct gendisk *,
 				  struct request *, int, rq_end_io_fn *);
 
+blk_status_t blk_execute_rq(struct gendisk *bd_disk, struct request *rq,
+			    int at_head);
+
 /* Helper to convert REQ_OP_XXX to its string format XXX */
 extern const char *blk_op_str(unsigned int op);
 
-- 
2.25.4


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

* [PATCHv3 4/4] nvme: use return value from blk_execute_rq()
  2021-05-21 20:21 [PATCHv3 0/4] block and nvme passthrough error handling Keith Busch
                   ` (2 preceding siblings ...)
  2021-05-21 20:21 ` [PATCHv3 3/4] block: return errors from blk_execute_rq() Keith Busch
@ 2021-05-21 20:21 ` Keith Busch
  2021-05-24  8:04   ` Christoph Hellwig
  3 siblings, 1 reply; 17+ messages in thread
From: Keith Busch @ 2021-05-21 20:21 UTC (permalink / raw)
  To: linux-nvme, sagi, hch, axboe, linux-block
  Cc: Yuanyuan Zhong, Casey Chen, Ming Lei, Keith Busch

We don't have an nvme status to report if the driver's .queue_rq()
returns an error without dispatching the requested nvme command. Check
the return value from blk_execute_rq() for all passthrough commands so
the caller may know their command was not successful.

If the command is from the target passthrough interface and fails to
dispatch, synthesize the response back to the host as a internal target
error.

Signed-off-by: Keith Busch <kbusch@kernel.org>
---
v2->v3:

  Initialize nvme status to 0

  Add helper function for blk_status_t to nvme passthrough return code

 drivers/nvme/host/core.c       | 33 +++++++++++++++++++++++++--------
 drivers/nvme/host/ioctl.c      |  6 +-----
 drivers/nvme/host/nvme.h       |  2 +-
 drivers/nvme/target/passthru.c |  8 ++++----
 4 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 1a73eed61eee..99e10476f377 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -589,6 +589,7 @@ EXPORT_SYMBOL_NS_GPL(nvme_put_ns, NVME_TARGET_PASSTHRU);
 
 static inline void nvme_clear_nvme_request(struct request *req)
 {
+	nvme_req(req)->status = 0;
 	nvme_req(req)->retries = 0;
 	nvme_req(req)->flags = 0;
 	req->rq_flags |= RQF_DONTPREP;
@@ -1012,6 +1013,21 @@ blk_status_t nvme_setup_cmd(struct nvme_ns *ns, struct request *req)
 }
 EXPORT_SYMBOL_GPL(nvme_setup_cmd);
 
+/*
+ * Return values:
+ * 0:  success
+ * >0: nvme controller's cqe status response
+ * <0: kernel error in lieu of controller response
+ */
+static int nvme_passthrough_status(struct request *rq, blk_status_t status)
+{
+	if (nvme_req(rq)->flags & NVME_REQ_CANCELLED)
+		return -EINTR;
+	else if (nvme_req(rq)->status)
+		return nvme_req(rq)->status;
+	return blk_status_to_errno(status);
+}
+
 /*
  * Returns 0 on success.  If the result is negative, it's a Linux error code;
  * if the result is positive, it's an NVM Express status code
@@ -1022,6 +1038,7 @@ int __nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
 		blk_mq_req_flags_t flags)
 {
 	struct request *req;
+	blk_status_t status;
 	int ret;
 
 	if (qid == NVME_QID_ANY)
@@ -1040,13 +1057,10 @@ int __nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
 			goto out;
 	}
 
-	blk_execute_rq(NULL, req, at_head);
-	if (result)
+	status = blk_execute_rq(NULL, req, at_head);
+	ret = nvme_passthrough_status(req, status);
+	if (result && ret >= 0)
 		*result = nvme_req(req)->result;
-	if (nvme_req(req)->flags & NVME_REQ_CANCELLED)
-		ret = -EINTR;
-	else
-		ret = nvme_req(req)->status;
  out:
 	blk_mq_free_request(req);
 	return ret;
@@ -1134,18 +1148,21 @@ static void nvme_passthru_end(struct nvme_ctrl *ctrl, u32 effects)
 	}
 }
 
-void nvme_execute_passthru_rq(struct request *rq)
+int nvme_execute_passthru_rq(struct request *rq)
 {
 	struct nvme_command *cmd = nvme_req(rq)->cmd;
 	struct nvme_ctrl *ctrl = nvme_req(rq)->ctrl;
 	struct nvme_ns *ns = rq->q->queuedata;
 	struct gendisk *disk = ns ? ns->disk : NULL;
+	blk_status_t status;
 	u32 effects;
 
 	effects = nvme_passthru_start(ctrl, ns, cmd->common.opcode);
-	blk_execute_rq(disk, rq, 0);
+	status = blk_execute_rq(disk, rq, 0);
 	if (effects) /* nothing to be done for zero cmd effects */
 		nvme_passthru_end(ctrl, effects);
+
+	return nvme_passthrough_status(rq, status);
 }
 EXPORT_SYMBOL_NS_GPL(nvme_execute_passthru_rq, NVME_TARGET_PASSTHRU);
 
diff --git a/drivers/nvme/host/ioctl.c b/drivers/nvme/host/ioctl.c
index 9557ead02de1..4e6bcc3c1c0d 100644
--- a/drivers/nvme/host/ioctl.c
+++ b/drivers/nvme/host/ioctl.c
@@ -93,11 +93,7 @@ static int nvme_submit_user_cmd(struct request_queue *q,
 		}
 	}
 
-	nvme_execute_passthru_rq(req);
-	if (nvme_req(req)->flags & NVME_REQ_CANCELLED)
-		ret = -EINTR;
-	else
-		ret = nvme_req(req)->status;
+	ret = nvme_execute_passthru_rq(req);
 	if (result)
 		*result = le64_to_cpu(nvme_req(req)->result.u64);
 	if (meta && !ret && !write) {
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 84bff995a308..9ea827871d67 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -877,7 +877,7 @@ static inline void nvme_hwmon_exit(struct nvme_ctrl *ctrl)
 
 u32 nvme_command_effects(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
 			 u8 opcode);
-void nvme_execute_passthru_rq(struct request *rq);
+int nvme_execute_passthru_rq(struct request *rq);
 struct nvme_ctrl *nvme_ctrl_from_file(struct file *file);
 struct nvme_ns *nvme_find_get_ns(struct nvme_ctrl *ctrl, unsigned nsid);
 void nvme_put_ns(struct nvme_ns *ns);
diff --git a/drivers/nvme/target/passthru.c b/drivers/nvme/target/passthru.c
index 39b1473f7204..ba28ce42cb55 100644
--- a/drivers/nvme/target/passthru.c
+++ b/drivers/nvme/target/passthru.c
@@ -153,11 +153,10 @@ static void nvmet_passthru_execute_cmd_work(struct work_struct *w)
 {
 	struct nvmet_req *req = container_of(w, struct nvmet_req, p.work);
 	struct request *rq = req->p.rq;
-	u16 status;
+	int status;
 
-	nvme_execute_passthru_rq(rq);
+	status = nvme_execute_passthru_rq(rq);
 
-	status = nvme_req(rq)->status;
 	if (status == NVME_SC_SUCCESS &&
 	    req->cmd->common.opcode == nvme_admin_identify) {
 		switch (req->cmd->identify.cns) {
@@ -168,7 +167,8 @@ static void nvmet_passthru_execute_cmd_work(struct work_struct *w)
 			nvmet_passthru_override_id_ns(req);
 			break;
 		}
-	}
+	} else if (status < 0)
+		status = NVME_SC_INTERNAL;
 
 	req->cqe->result = nvme_req(rq)->result;
 	nvmet_req_complete(req, status);
-- 
2.25.4


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

* Re: [PATCHv3 1/4] block: support polling through blk_execute_rq
  2021-05-21 20:21 ` [PATCHv3 1/4] block: support polling through blk_execute_rq Keith Busch
@ 2021-05-24  7:38   ` Christoph Hellwig
  2021-05-26  8:16   ` Ming Lei
  1 sibling, 0 replies; 17+ messages in thread
From: Christoph Hellwig @ 2021-05-24  7:38 UTC (permalink / raw)
  To: Keith Busch
  Cc: linux-nvme, sagi, hch, axboe, linux-block, Yuanyuan Zhong,
	Casey Chen, Ming Lei

On Fri, May 21, 2021 at 01:21:42PM -0700, Keith Busch wrote:
> Poll for completions if the request's hctx is a polling type.
> 
> Signed-off-by: Keith Busch <kbusch@kernel.org>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCHv3 2/4] nvme: use blk_execute_rq() for passthrough commands
  2021-05-21 20:21 ` [PATCHv3 2/4] nvme: use blk_execute_rq() for passthrough commands Keith Busch
@ 2021-05-24  7:38   ` Christoph Hellwig
  2021-05-26  8:24   ` Ming Lei
  2021-05-26  8:47   ` Kanchan Joshi
  2 siblings, 0 replies; 17+ messages in thread
From: Christoph Hellwig @ 2021-05-24  7:38 UTC (permalink / raw)
  To: Keith Busch
  Cc: linux-nvme, sagi, hch, axboe, linux-block, Yuanyuan Zhong,
	Casey Chen, Ming Lei

On Fri, May 21, 2021 at 01:21:43PM -0700, Keith Busch wrote:
> The generic blk_execute_rq() knows how to handle polled completions. Use
> that instead of implementing an nvme specific handler.

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCHv3 3/4] block: return errors from blk_execute_rq()
  2021-05-21 20:21 ` [PATCHv3 3/4] block: return errors from blk_execute_rq() Keith Busch
@ 2021-05-24  7:39   ` Christoph Hellwig
  2021-05-26  8:26   ` Ming Lei
  1 sibling, 0 replies; 17+ messages in thread
From: Christoph Hellwig @ 2021-05-24  7:39 UTC (permalink / raw)
  To: Keith Busch
  Cc: linux-nvme, sagi, hch, axboe, linux-block, Yuanyuan Zhong,
	Casey Chen, Ming Lei

On Fri, May 21, 2021 at 01:21:44PM -0700, Keith Busch wrote:
> The synchronous blk_execute_rq() had not provided a way for its callers
> to know if its request was successful or not. Return the blk_status_t
> result of the request.
> 
> Signed-off-by: Keith Busch <kbusch@kernel.org>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCHv3 4/4] nvme: use return value from blk_execute_rq()
  2021-05-21 20:21 ` [PATCHv3 4/4] nvme: use return value " Keith Busch
@ 2021-05-24  8:04   ` Christoph Hellwig
  2021-06-07 16:58     ` Keith Busch
  0 siblings, 1 reply; 17+ messages in thread
From: Christoph Hellwig @ 2021-05-24  8:04 UTC (permalink / raw)
  To: Keith Busch
  Cc: linux-nvme, sagi, hch, axboe, linux-block, Yuanyuan Zhong,
	Casey Chen, Ming Lei

> +/*
> + * Return values:
> + * 0:  success
> + * >0: nvme controller's cqe status response
> + * <0: kernel error in lieu of controller response
> + */

For better reading flow I'd reformat this as:

/*
 * Return value:
 *   0:	success
 * > 0:	nvme controller's cqe status response
 * < 0: kernel error in lieu of controller response
 */

> +static int nvme_passthrough_status(struct request *rq, blk_status_t status)
> +{
> +	if (nvme_req(rq)->flags & NVME_REQ_CANCELLED)
> +		return -EINTR;
> +	else if (nvme_req(rq)->status)
> +		return nvme_req(rq)->status;
> +	return blk_status_to_errno(status);
> +}

I find this a little odd disconnected from the actual execure call.
What about a helper like this instead:

static int nvme_execute_rq(struct gendisk *disk, struct request *rq,
		bool at_head)
{
	blk_status_t status;

	status = blk_execute_rq(disk, req, at_head);
	if (nvme_req(rq)->flags & NVME_REQ_CANCELLED)
		return -EINTR;
	if (nvme_req(rq)->status)
		return nvme_req(rq)->status;
	return blk_status_to_errno(status);
}

> -	nvme_execute_passthru_rq(rq);
> +	status = nvme_execute_passthru_rq(rq);
>  
> -	status = nvme_req(rq)->status;
>  	if (status == NVME_SC_SUCCESS &&
>  	    req->cmd->common.opcode == nvme_admin_identify) {
>  		switch (req->cmd->identify.cns) {
> @@ -168,7 +167,8 @@ static void nvmet_passthru_execute_cmd_work(struct work_struct *w)
>  			nvmet_passthru_override_id_ns(req);
>  			break;
>  		}
> -	}
> +	} else if (status < 0)
> +		status = NVME_SC_INTERNAL;

Don't we need a better translation here?

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

* Re: [PATCHv3 1/4] block: support polling through blk_execute_rq
  2021-05-21 20:21 ` [PATCHv3 1/4] block: support polling through blk_execute_rq Keith Busch
  2021-05-24  7:38   ` Christoph Hellwig
@ 2021-05-26  8:16   ` Ming Lei
  1 sibling, 0 replies; 17+ messages in thread
From: Ming Lei @ 2021-05-26  8:16 UTC (permalink / raw)
  To: Keith Busch
  Cc: linux-nvme, sagi, hch, axboe, linux-block, Yuanyuan Zhong, Casey Chen

On Fri, May 21, 2021 at 01:21:42PM -0700, Keith Busch wrote:
> Poll for completions if the request's hctx is a polling type.
> 
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> v1->v2:
> 
>   Moved blk_execute_rq's poll handling into a small helper function

Reviewed-by: Ming Lei <ming.lei@redhat.com>

-- 
Ming


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

* Re: [PATCHv3 2/4] nvme: use blk_execute_rq() for passthrough commands
  2021-05-21 20:21 ` [PATCHv3 2/4] nvme: use blk_execute_rq() for passthrough commands Keith Busch
  2021-05-24  7:38   ` Christoph Hellwig
@ 2021-05-26  8:24   ` Ming Lei
  2021-05-26  8:47   ` Kanchan Joshi
  2 siblings, 0 replies; 17+ messages in thread
From: Ming Lei @ 2021-05-26  8:24 UTC (permalink / raw)
  To: Keith Busch
  Cc: linux-nvme, sagi, hch, axboe, linux-block, Yuanyuan Zhong, Casey Chen

On Fri, May 21, 2021 at 01:21:43PM -0700, Keith Busch wrote:
> The generic blk_execute_rq() knows how to handle polled completions. Use
> that instead of implementing an nvme specific handler.
> 
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> No changes since v2

Looks fine, one thing need to pay attention is that this nvme polled
request won't be marked as REQ_HIPRI.

Reviewed-by: Ming Lei <ming.lei@redhat.com>

-- 
Ming


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

* Re: [PATCHv3 3/4] block: return errors from blk_execute_rq()
  2021-05-21 20:21 ` [PATCHv3 3/4] block: return errors from blk_execute_rq() Keith Busch
  2021-05-24  7:39   ` Christoph Hellwig
@ 2021-05-26  8:26   ` Ming Lei
  1 sibling, 0 replies; 17+ messages in thread
From: Ming Lei @ 2021-05-26  8:26 UTC (permalink / raw)
  To: Keith Busch
  Cc: linux-nvme, sagi, hch, axboe, linux-block, Yuanyuan Zhong, Casey Chen

On Fri, May 21, 2021 at 01:21:44PM -0700, Keith Busch wrote:
> The synchronous blk_execute_rq() had not provided a way for its callers
> to know if its request was successful or not. Return the blk_status_t
> result of the request.
> 
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> v2->v3:
> 
>   Return blk_status_t instead of errno.
> 
>   Removed "extern" header declaration, and named the parameters.

Reviewed-by: Ming Lei <ming.lei@redhat.com>

-- 
Ming


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

* Re: [PATCHv3 2/4] nvme: use blk_execute_rq() for passthrough commands
  2021-05-21 20:21 ` [PATCHv3 2/4] nvme: use blk_execute_rq() for passthrough commands Keith Busch
  2021-05-24  7:38   ` Christoph Hellwig
  2021-05-26  8:24   ` Ming Lei
@ 2021-05-26  8:47   ` Kanchan Joshi
  2021-06-07 16:15     ` Keith Busch
  2 siblings, 1 reply; 17+ messages in thread
From: Kanchan Joshi @ 2021-05-26  8:47 UTC (permalink / raw)
  To: Keith Busch
  Cc: linux-nvme, Sagi Grimberg, Christoph Hellwig, Jens Axboe,
	linux-block, Yuanyuan Zhong, Casey Chen, Ming Lei

On Sat, May 22, 2021 at 2:05 AM Keith Busch <kbusch@kernel.org> wrote:
>
> The generic blk_execute_rq() knows how to handle polled completions. Use
> that instead of implementing an nvme specific handler.
>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> No changes since v2
>
>  drivers/nvme/host/core.c    | 38 +++++--------------------------------
>  drivers/nvme/host/fabrics.c | 13 ++++++-------
>  drivers/nvme/host/fabrics.h |  2 +-
>  drivers/nvme/host/fc.c      |  2 +-
>  drivers/nvme/host/nvme.h    |  2 +-
>  drivers/nvme/host/rdma.c    |  3 +--
>  drivers/nvme/host/tcp.c     |  2 +-
>  drivers/nvme/target/loop.c  |  2 +-
>  8 files changed, 17 insertions(+), 47 deletions(-)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 762125f2905f..1a73eed61eee 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -1012,31 +1012,6 @@ blk_status_t nvme_setup_cmd(struct nvme_ns *ns, struct request *req)
>  }
>  EXPORT_SYMBOL_GPL(nvme_setup_cmd);
>
> -static void nvme_end_sync_rq(struct request *rq, blk_status_t error)
> -{
> -       struct completion *waiting = rq->end_io_data;
> -
> -       rq->end_io_data = NULL;
> -       complete(waiting);
> -}
> -
> -static void nvme_execute_rq_polled(struct request_queue *q,
> -               struct gendisk *bd_disk, struct request *rq, int at_head)
> -{
> -       DECLARE_COMPLETION_ONSTACK(wait);
> -
> -       WARN_ON_ONCE(!test_bit(QUEUE_FLAG_POLL, &q->queue_flags));
> -
> -       rq->cmd_flags |= REQ_HIPRI;

The new code doesn't retain this flag.
Looks good otherwise.

Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>.


-- 
Kanchan

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

* Re: [PATCHv3 2/4] nvme: use blk_execute_rq() for passthrough commands
  2021-05-26  8:47   ` Kanchan Joshi
@ 2021-06-07 16:15     ` Keith Busch
  2021-06-08  5:26       ` Christoph Hellwig
  0 siblings, 1 reply; 17+ messages in thread
From: Keith Busch @ 2021-06-07 16:15 UTC (permalink / raw)
  To: Kanchan Joshi
  Cc: linux-nvme, Sagi Grimberg, Christoph Hellwig, Jens Axboe,
	linux-block, Yuanyuan Zhong, Casey Chen, Ming Lei

On Wed, May 26, 2021 at 02:17:23PM +0530, Kanchan Joshi wrote:
> On Sat, May 22, 2021 at 2:05 AM Keith Busch <kbusch@kernel.org> wrote:
> >
> > The generic blk_execute_rq() knows how to handle polled completions. Use
> > that instead of implementing an nvme specific handler.
> >
> > Signed-off-by: Keith Busch <kbusch@kernel.org>
> > ---
> > No changes since v2
> >
> >  drivers/nvme/host/core.c    | 38 +++++--------------------------------
> >  drivers/nvme/host/fabrics.c | 13 ++++++-------
> >  drivers/nvme/host/fabrics.h |  2 +-
> >  drivers/nvme/host/fc.c      |  2 +-
> >  drivers/nvme/host/nvme.h    |  2 +-
> >  drivers/nvme/host/rdma.c    |  3 +--
> >  drivers/nvme/host/tcp.c     |  2 +-
> >  drivers/nvme/target/loop.c  |  2 +-
> >  8 files changed, 17 insertions(+), 47 deletions(-)
> >
> > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> > index 762125f2905f..1a73eed61eee 100644
> > --- a/drivers/nvme/host/core.c
> > +++ b/drivers/nvme/host/core.c
> > @@ -1012,31 +1012,6 @@ blk_status_t nvme_setup_cmd(struct nvme_ns *ns, struct request *req)
> >  }
> >  EXPORT_SYMBOL_GPL(nvme_setup_cmd);
> >
> > -static void nvme_end_sync_rq(struct request *rq, blk_status_t error)
> > -{
> > -       struct completion *waiting = rq->end_io_data;
> > -
> > -       rq->end_io_data = NULL;
> > -       complete(waiting);
> > -}
> > -
> > -static void nvme_execute_rq_polled(struct request_queue *q,
> > -               struct gendisk *bd_disk, struct request *rq, int at_head)
> > -{
> > -       DECLARE_COMPLETION_ONSTACK(wait);
> > -
> > -       WARN_ON_ONCE(!test_bit(QUEUE_FLAG_POLL, &q->queue_flags));
> > -
> > -       rq->cmd_flags |= REQ_HIPRI;
> 
> The new code doesn't retain this flag.
> Looks good otherwise.

The flag is only used to select an apporpriate hctx. We've explicitly
selected a polling hctx in this path already, so the flag is
unnecessary.

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

* Re: [PATCHv3 4/4] nvme: use return value from blk_execute_rq()
  2021-05-24  8:04   ` Christoph Hellwig
@ 2021-06-07 16:58     ` Keith Busch
  2021-06-08  5:26       ` Christoph Hellwig
  0 siblings, 1 reply; 17+ messages in thread
From: Keith Busch @ 2021-06-07 16:58 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-nvme, sagi, axboe, linux-block, Yuanyuan Zhong, Casey Chen,
	Ming Lei

On Mon, May 24, 2021 at 10:04:28AM +0200, Christoph Hellwig wrote:
> > @@ -168,7 +167,8 @@ static void nvmet_passthru_execute_cmd_work(struct work_struct *w)
> >  			nvmet_passthru_override_id_ns(req);
> >  			break;
> >  		}
> > -	}
> > +	} else if (status < 0)
> > +		status = NVME_SC_INTERNAL;
> 
> Don't we need a better translation here?

Did you have something in mind? I couldn't think of anything more
appropriate than the generic internal error. The errno's we get here are
-EINTR or -EIO. Both indicate we can't communicate with the back-end
device, but these problems are internal to the target from the host's
perspective.

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

* Re: [PATCHv3 4/4] nvme: use return value from blk_execute_rq()
  2021-06-07 16:58     ` Keith Busch
@ 2021-06-08  5:26       ` Christoph Hellwig
  0 siblings, 0 replies; 17+ messages in thread
From: Christoph Hellwig @ 2021-06-08  5:26 UTC (permalink / raw)
  To: Keith Busch
  Cc: Christoph Hellwig, linux-nvme, sagi, axboe, linux-block,
	Yuanyuan Zhong, Casey Chen, Ming Lei

On Tue, Jun 08, 2021 at 01:58:27AM +0900, Keith Busch wrote:
> On Mon, May 24, 2021 at 10:04:28AM +0200, Christoph Hellwig wrote:
> > > @@ -168,7 +167,8 @@ static void nvmet_passthru_execute_cmd_work(struct work_struct *w)
> > >  			nvmet_passthru_override_id_ns(req);
> > >  			break;
> > >  		}
> > > -	}
> > > +	} else if (status < 0)
> > > +		status = NVME_SC_INTERNAL;
> > 
> > Don't we need a better translation here?
> 
> Did you have something in mind? I couldn't think of anything more
> appropriate than the generic internal error. The errno's we get here are
> -EINTR or -EIO. Both indicate we can't communicate with the back-end
> device, but these problems are internal to the target from the host's
> perspective.

Ok.

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

* Re: [PATCHv3 2/4] nvme: use blk_execute_rq() for passthrough commands
  2021-06-07 16:15     ` Keith Busch
@ 2021-06-08  5:26       ` Christoph Hellwig
  0 siblings, 0 replies; 17+ messages in thread
From: Christoph Hellwig @ 2021-06-08  5:26 UTC (permalink / raw)
  To: Keith Busch
  Cc: Kanchan Joshi, linux-nvme, Sagi Grimberg, Christoph Hellwig,
	Jens Axboe, linux-block, Yuanyuan Zhong, Casey Chen, Ming Lei

On Tue, Jun 08, 2021 at 01:15:12AM +0900, Keith Busch wrote:
> > The new code doesn't retain this flag.
> > Looks good otherwise.
> 
> The flag is only used to select an apporpriate hctx. We've explicitly
> selected a polling hctx in this path already, so the flag is
> unnecessary.

I think setting the flag would still be useful, if only to prevent issues
with new callers and/or better document what we are doing.

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

end of thread, other threads:[~2021-06-08  5:26 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 20:21 [PATCHv3 0/4] block and nvme passthrough error handling Keith Busch
2021-05-21 20:21 ` [PATCHv3 1/4] block: support polling through blk_execute_rq Keith Busch
2021-05-24  7:38   ` Christoph Hellwig
2021-05-26  8:16   ` Ming Lei
2021-05-21 20:21 ` [PATCHv3 2/4] nvme: use blk_execute_rq() for passthrough commands Keith Busch
2021-05-24  7:38   ` Christoph Hellwig
2021-05-26  8:24   ` Ming Lei
2021-05-26  8:47   ` Kanchan Joshi
2021-06-07 16:15     ` Keith Busch
2021-06-08  5:26       ` Christoph Hellwig
2021-05-21 20:21 ` [PATCHv3 3/4] block: return errors from blk_execute_rq() Keith Busch
2021-05-24  7:39   ` Christoph Hellwig
2021-05-26  8:26   ` Ming Lei
2021-05-21 20:21 ` [PATCHv3 4/4] nvme: use return value " Keith Busch
2021-05-24  8:04   ` Christoph Hellwig
2021-06-07 16:58     ` Keith Busch
2021-06-08  5:26       ` Christoph Hellwig

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).