Skip to content

Commit 806ae93

Browse files
committed
io_uring/net: don't continue send bundle if poll was required for retry
If a send bundle has picked a bunch of buffers, then it needs to send all of those to be complete. This may require poll arming, if the send buffer ends up being full. Once a send bundle has been poll armed, no further bundles should be attempted. This allows a current bundle to complete even though it needs to go through polling to do so, but it will not allow another bundle to be started once that has happened. Ideally we would abort a bundle if it was only partially sent, but as some parts of it already went out on the wire, this obviously isn't feasible. Not continuing more bundle attempts post encountering a full socket buffer is the second best thing. Cc: stable@vger.kernel.org Fixes: a05d1f6 ("io_uring/net: support bundles for send") Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent e26f51f commit 806ae93

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

io_uring/net.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,11 @@ static inline bool io_send_finish(struct io_kiocb *req,
515515

516516
cflags = io_put_kbufs(req, sel->val, sel->buf_list, io_bundle_nbufs(kmsg, sel->val));
517517

518-
if (bundle_finished || req->flags & REQ_F_BL_EMPTY)
518+
/*
519+
* Don't start new bundles if the buffer list is empty, or if the
520+
* current operation needed to go through polling to complete.
521+
*/
522+
if (bundle_finished || req->flags & (REQ_F_BL_EMPTY | REQ_F_POLLED))
519523
goto finish;
520524

521525
/*

0 commit comments

Comments
 (0)