Skip to content

Commit

Permalink
io_uring/net: fix notif cqe reordering
Browse files Browse the repository at this point in the history
[ upstream commit 108893d ]

send zc is not restricted to !IO_URING_F_UNLOCKED anymore and so
we can't use task-tw ordering trick to order notification cqes
with requests completions. In this case leave it alone and let
io_send_zc_cleanup() flush it.

Cc: stable@vger.kernel.org
Fixes: 53bdc88 ("io_uring/notif: order notif vs send CQEs")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/0031f3a00d492e814a4a0935a2029a46d9c9ba06.1664486545.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
isilence authored and gregkh committed Oct 21, 2022
1 parent 9dc0dcb commit 5156958
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions io_uring/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1073,8 +1073,14 @@ int io_send_zc(struct io_kiocb *req, unsigned int issue_flags)
else if (zc->done_io)
ret = zc->done_io;

io_notif_flush(zc->notif);
req->flags &= ~REQ_F_NEED_CLEANUP;
/*
* If we're in io-wq we can't rely on tw ordering guarantees, defer
* flushing notif to io_send_zc_cleanup()
*/
if (!(issue_flags & IO_URING_F_UNLOCKED)) {
io_notif_flush(zc->notif);
req->flags &= ~REQ_F_NEED_CLEANUP;
}
io_req_set_res(req, ret, IORING_CQE_F_MORE);
return IOU_OK;
}
Expand Down

0 comments on commit 5156958

Please sign in to comment.