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

Hannes Reinecke hare at suse.de
Fri May 20 02:59:56 PDT 2022


On 5/20/22 11:19, Sagi Grimberg wrote:
> 
>> 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?

Ah. Yeah, maybe. We can change it to '&&', which should solve it.
(I think)

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		           Kernel Storage Architect
hare at suse.de			                  +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), GF: Felix Imendörffer



More information about the Linux-nvme mailing list