Replies: 3 comments 2 replies
-
To answer my own question... I can probably do it before the first |
Beta Was this translation helpful? Give feedback.
-
Think of io_uring as a more efficient way to make sys calls. Semantic of each operation is pretty much the same as of a syscall. Partial sends and writes are norm and app should cater for it. |
Beta Was this translation helpful? Give feedback.
-
Not sure what the question is here - you are the one allocating and filling those buffers before adding them to the buffer group for io_uring to consume. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Assume that boilerplate code with setting up uring (
io_uring_queue_init_params()
,io_uring_setup_buf_ring()
,io_uring_buf_ring_add()
+io_uring_buf_ring_advance()
, etc...) and networking is done.In a scenario where we receive data, we prepare a multi-shot receive request, add
IOSQE_BUFFER_SELECT
flag and submit it. The completed CQE will give us a buffer ID that holds received data. Once we consume it, we mark buffers as "ready to be reused" withio_uring_buf_ring_add()
+io_uring_buf_ring_advance()
.How to achieve the same functionality when sending data?
I guess the required steps are:
io_uring_prep_send_bundle()
+io_uring_submit (anything else?)io_uring_buf_ring_add()
+io_uring_buf_ring_advance()
, so we can reuse themOne more thing; from the documentation for
io_uring_prep_send()
, the quote below says "with the result being how many bytes were sent, on success". Does that mean that successful sending can result in less bytes sent than it was provided for sending?Beta Was this translation helpful? Give feedback.
All reactions