[PATCH 3/3] nvme-tcp: send quota for nvme_tcp_send_all()

Sagi Grimberg sagi at grimberg.me
Fri May 20 02:19:03 PDT 2022


> Add a send quota in nvme_tcp_send_all() to avoid stalls when sending
> large amounts of requests.
> 
> Signed-off-by: Daniel Wagner <dwagner at suse.de>
> Signed-off-by: Hannes Reinecke <hare at suse.de>
> ---
>   drivers/nvme/host/tcp.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
> index 606565a4c708..87d760dfa3a9 100644
> --- a/drivers/nvme/host/tcp.c
> +++ b/drivers/nvme/host/tcp.c
> @@ -308,11 +308,12 @@ static inline void nvme_tcp_advance_req(struct nvme_tcp_request *req,
>   static inline void nvme_tcp_send_all(struct nvme_tcp_queue *queue)
>   {
>   	int ret;
> +	unsigned long deadline = jiffies + msecs_to_jiffies(1);
>   
>   	/* drain the send queue as much as we can... */
>   	do {
>   		ret = nvme_tcp_try_send(queue);
> -	} while (ret > 0);
> +	} while (ret > 0 || !time_after(jiffies, deadline));

Umm, this will stay here a deadline period even if we don't have
anything to send?



More information about the Linux-nvme mailing list