Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/net: use struct io_br_sel->val as the send finish value

Currently a pointer is passed in to the 'ret' in the send mshot handler,
but since we already have a value field in io_br_sel, just use that.
This is also in preparation for needing to pass in struct io_br_sel
to io_send_finish() anyway.

Link: https://lore.kernel.org/r/20250821020750.598432-11-axboe@kernel.dk
Signed-off-by: Jens Axboe <axboe@kernel.dk>

+12 -10
+12 -10
io_uring/net.c
··· 503 503 return IOU_RETRY; 504 504 } 505 505 506 - static inline bool io_send_finish(struct io_kiocb *req, int *ret, 507 - struct io_async_msghdr *kmsg) 506 + static inline bool io_send_finish(struct io_kiocb *req, 507 + struct io_async_msghdr *kmsg, 508 + struct io_br_sel *sel) 508 509 { 509 510 struct io_sr_msg *sr = io_kiocb_to_cmd(req, struct io_sr_msg); 510 - bool bundle_finished = *ret <= 0; 511 + bool bundle_finished = sel->val <= 0; 511 512 unsigned int cflags; 512 513 513 514 if (!(sr->flags & IORING_RECVSEND_BUNDLE)) { 514 - cflags = io_put_kbuf(req, *ret, req->buf_list); 515 + cflags = io_put_kbuf(req, sel->val, req->buf_list); 515 516 goto finish; 516 517 } 517 518 518 - cflags = io_put_kbufs(req, *ret, req->buf_list, io_bundle_nbufs(kmsg, *ret)); 519 + cflags = io_put_kbufs(req, sel->val, req->buf_list, io_bundle_nbufs(kmsg, sel->val)); 519 520 520 521 if (bundle_finished || req->flags & REQ_F_BL_EMPTY) 521 522 goto finish; ··· 525 524 * Fill CQE for this receive and see if we should keep trying to 526 525 * receive from this socket. 527 526 */ 528 - if (io_req_post_cqe(req, *ret, cflags | IORING_CQE_F_MORE)) { 527 + if (io_req_post_cqe(req, sel->val, cflags | IORING_CQE_F_MORE)) { 529 528 io_mshot_prep_retry(req, kmsg); 530 529 return false; 531 530 } 532 531 533 532 /* Otherwise stop bundle and use the current result. */ 534 533 finish: 535 - io_req_set_res(req, *ret, cflags); 536 - *ret = IOU_COMPLETE; 534 + io_req_set_res(req, sel->val, cflags); 535 + sel->val = IOU_COMPLETE; 537 536 return true; 538 537 } 539 538 ··· 693 692 else if (sr->done_io) 694 693 ret = sr->done_io; 695 694 696 - if (!io_send_finish(req, &ret, kmsg)) 695 + sel.val = ret; 696 + if (!io_send_finish(req, kmsg, &sel)) 697 697 goto retry_bundle; 698 698 699 699 io_req_msg_cleanup(req, issue_flags); 700 - return ret; 700 + return sel.val; 701 701 } 702 702 703 703 static int io_recvmsg_mshot_prep(struct io_kiocb *req,