summaryrefslogtreecommitdiff
path: root/io_uring/net.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2026-01-27 21:01:41 -0700
committerSasha Levin <sashal@kernel.org>2026-03-04 07:21:50 -0500
commitd1d07cbeca04944d9cac50fbc1112e1d0fbd8654 (patch)
treef58e6571726c6730d5dbd84552bb9cf193b1ab50 /io_uring/net.c
parent37b14e59db5d2d7bde6ee2a57006954ff40c96fe (diff)
downloadlinux-d1d07cbeca04944d9cac50fbc1112e1d0fbd8654.tar.gz
linux-d1d07cbeca04944d9cac50fbc1112e1d0fbd8654.tar.bz2
linux-d1d07cbeca04944d9cac50fbc1112e1d0fbd8654.zip
io_uring/net: don't continue send bundle if poll was required for retry
[ Upstream commit 806ae939c41e5da1d94a1e2b31f5702e96b6c3e3 ] 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: a05d1f625c7a ("io_uring/net: support bundles for send") Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'io_uring/net.c')
-rw-r--r--io_uring/net.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/io_uring/net.c b/io_uring/net.c
index b7c93765fcff..56a0acc0894c 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -522,7 +522,11 @@ static inline bool io_send_finish(struct io_kiocb *req, int *ret,
cflags = io_put_kbufs(req, *ret, io_bundle_nbufs(kmsg, *ret), issue_flags);
- if (bundle_finished || req->flags & REQ_F_BL_EMPTY)
+ /*
+ * Don't start new bundles if the buffer list is empty, or if the
+ * current operation needed to go through polling to complete.
+ */
+ if (bundle_finished || req->flags & (REQ_F_BL_EMPTY | REQ_F_POLLED))
goto finish;
/*