Skip to content

How does IORING_CQE_F_BUF_MORE work? #1319

Answered by axboe
AomaYple asked this question in Q&A
Discussion options

You must be logged in to vote

If IORING_CQE_F_BUF_MORE is set, the kernel has not returned the full buffer back to the application yet. More completions will be coming to this buffer. Let's say the buffer is 8k in size, and you get a completion with BUFFER|BUF_MORE set and cqe->res being 1024. This means that there's 1k of data available from the start of the buffer, buf->addr. The next receive point for this buffer will be buf->addr + 1024.

Now you get another 1024b completion for the same buffer, that data is available as specified above. The next receive point is now buf->addr + 2048, as that is how much has been received so far.

Also see the original kernel commit for incremental buffers, it explains it as well:

h…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@AomaYple
Comment options

@axboe
Comment options

axboe Jan 5, 2025
Maintainer

Answer selected by AomaYple
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants