io_uring/net: fix overexcessive retries
PATCH RESEND 1/1 io_uring/net: fix overexcessive retries
Length parameter of io_sg_from_iter() can be smaller than the iterator's size, as it's with TCP, so when we set from->count at the end of the function we truncate the iterator forcing TCP to return preliminary with a short send. It affects zerocopy sends with large payload sizes and leads to retries and possible request failures.
--- io_uring/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/net.c +1 -1
@@ -956,7 +956,7 @@ static int io_sg_from_iter(struct sock *sk, struct sk_buff *skb, shinfo->nr_frags = frag; from->bvec += bi.bi_idx; from->nr_segs -= bi.bi_idx; - from->count = bi.bi_size; + from->count -= copied; from->iov_offset = bi.bi_bvec_done; skb->data_len += copied;
Signature · 1 line
2.37.2
Quoted 8 lines · Pavel Begunkov
Length parameter of
io_sg_from_iter()can be smaller than the iterator's size, as it's with TCP, so when we setfrom->countat the end of the function we truncate the iterator forcing TCP to return preliminary with a short send. It affects zerocopy sends with large payload sizes and leads to retries and possible request failures.[...]
Applied, thanks!
[1/1] io_uring/net: fix overexcessive retries
(no commit info)
Best regards,
Signature · 1 line
Jens Axboe