-
Generally the presence of For example, there is now a completion event with the
So I have a question, at this point the kernel has already given the buffer to the application, how does the kernel write to the same buffer again on the next completion event |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
If Now you get another 1024b completion for the same buffer, that data is available as specified above. The next receive point is now Also see the original kernel commit for incremental buffers, it explains it as well: |
Beta Was this translation helpful? Give feedback.
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 withBUFFER|BUF_MORE
set andcqe->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 bebuf->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…