Skip to content

Commit

Permalink
io_uring/net: cleanup io_recv_finish() bundle handling
Browse files Browse the repository at this point in the history
Combine the two cases that check for whether or not this is a bundle,
rather than having them as separate checks. This is easier to reduce,
and it reduces the text associated with it as well.

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Jul 2, 2024
1 parent 3b7c16b commit 93d8032
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions io_uring/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,20 +827,20 @@ static inline bool io_recv_finish(struct io_kiocb *req, int *ret,
bool mshot_finished, unsigned issue_flags)
{
struct io_sr_msg *sr = io_kiocb_to_cmd(req, struct io_sr_msg);
unsigned int cflags;

if (sr->flags & IORING_RECVSEND_BUNDLE)
cflags = io_put_kbufs(req, io_bundle_nbufs(kmsg, *ret),
issue_flags);
else
cflags = io_put_kbuf(req, issue_flags);
unsigned int cflags = 0;

if (kmsg->msg.msg_inq > 0)
cflags |= IORING_CQE_F_SOCK_NONEMPTY;

/* bundle with no more immediate buffers, we're done */
if (sr->flags & IORING_RECVSEND_BUNDLE && req->flags & REQ_F_BL_EMPTY)
goto finish;
if (sr->flags & IORING_RECVSEND_BUNDLE) {
cflags |= io_put_kbufs(req, io_bundle_nbufs(kmsg, *ret),
issue_flags);
/* bundle with no more immediate buffers, we're done */
if (req->flags & REQ_F_BL_EMPTY)
goto finish;
} else {
cflags |= io_put_kbuf(req, issue_flags);
}

/*
* Fill CQE for this receive and see if we should keep trying to
Expand Down

0 comments on commit 93d8032

Please sign in to comment.