All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme-tcp: always fail a request when sending it failed
@ 2022-06-26  9:24 Sagi Grimberg
  2022-06-27  6:48 ` Daniel Wagner
  2022-06-29 14:16 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Sagi Grimberg @ 2022-06-26  9:24 UTC (permalink / raw)
  To: linux-nvme
  Cc: Christoph Hellwig, Keith Busch, Chaitanya Kulkarni, Daniel Wagner

queue stoppage and inflight requests cancellation is fully fenced from
io_work and thus failing a request from this context. Hence we don't
need to try to guess from the socket retcode if this failure is because
the queue is about to be torn down or not.

We are perfectly safe to just fail it, the request will not be cancelled
later on.

This solves possible very long shutdown delays when the users issues a
'nvme disconnect-all'

Reported-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
---
 drivers/nvme/host/tcp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index bb67538d241b..009c2cf3f106 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -1180,8 +1180,7 @@ static int nvme_tcp_try_send(struct nvme_tcp_queue *queue)
 	} else if (ret < 0) {
 		dev_err(queue->ctrl->ctrl.device,
 			"failed to send request %d\n", ret);
-		if (ret != -EPIPE && ret != -ECONNRESET)
-			nvme_tcp_fail_request(queue->request);
+		nvme_tcp_fail_request(queue->request);
 		nvme_tcp_done_send_req(queue);
 	}
 	return ret;
-- 
2.34.1



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

* Re: [PATCH] nvme-tcp: always fail a request when sending it failed
  2022-06-26  9:24 [PATCH] nvme-tcp: always fail a request when sending it failed Sagi Grimberg
@ 2022-06-27  6:48 ` Daniel Wagner
  2022-06-29 14:16 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Wagner @ 2022-06-27  6:48 UTC (permalink / raw)
  To: Sagi Grimberg
  Cc: linux-nvme, Christoph Hellwig, Keith Busch, Chaitanya Kulkarni

On Sun, Jun 26, 2022 at 12:24:51PM +0300, Sagi Grimberg wrote:
> queue stoppage and inflight requests cancellation is fully fenced from
> io_work and thus failing a request from this context. Hence we don't
> need to try to guess from the socket retcode if this failure is because
> the queue is about to be torn down or not.
> 
> We are perfectly safe to just fail it, the request will not be cancelled
> later on.
> 
> This solves possible very long shutdown delays when the users issues a
> 'nvme disconnect-all'
> 
> Reported-by: Daniel Wagner <dwagner@suse.de>
> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>

I've tested the case where we disconnect all controllers in a multipath
setup. In this scenario we reliable ended up waiting for a register
read/write in the shutdown path. With this path, the I/O fails
immediately and we don't wait the extra time out time for the I/O to fail
eventually.

Tested-by: Daniel Wagner <dwagner@suse.de>

> ---
>  drivers/nvme/host/tcp.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
> index bb67538d241b..009c2cf3f106 100644
> --- a/drivers/nvme/host/tcp.c
> +++ b/drivers/nvme/host/tcp.c
> @@ -1180,8 +1180,7 @@ static int nvme_tcp_try_send(struct nvme_tcp_queue *queue)
>  	} else if (ret < 0) {
>  		dev_err(queue->ctrl->ctrl.device,
>  			"failed to send request %d\n", ret);
> -		if (ret != -EPIPE && ret != -ECONNRESET)
> -			nvme_tcp_fail_request(queue->request);
> +		nvme_tcp_fail_request(queue->request);
>  		nvme_tcp_done_send_req(queue);
>  	}
>  	return ret;
> -- 
> 2.34.1
> 


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

* Re: [PATCH] nvme-tcp: always fail a request when sending it failed
  2022-06-26  9:24 [PATCH] nvme-tcp: always fail a request when sending it failed Sagi Grimberg
  2022-06-27  6:48 ` Daniel Wagner
@ 2022-06-29 14:16 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2022-06-29 14:16 UTC (permalink / raw)
  To: Sagi Grimberg
  Cc: linux-nvme, Christoph Hellwig, Keith Busch, Chaitanya Kulkarni,
	Daniel Wagner

Thanks,

added to nvme-5.19.



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

end of thread, other threads:[~2022-06-29 14:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-26  9:24 [PATCH] nvme-tcp: always fail a request when sending it failed Sagi Grimberg
2022-06-27  6:48 ` Daniel Wagner
2022-06-29 14:16 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.