Multishot recv with Bundle Recv + Incremental Buffers - are they compatible? #1566
Replies: 5 comments 2 replies
-
|
I'm OOO for the next week, I'll take a look when I'm back. |
Beta Was this translation helpful? Give feedback.
-
|
Just to provide more context, it turns out that my guess(mentioned above) is wrong and when bundle recv is enabled, it is possible to get res such that the bytes are spanning across 2 buffers(and hence possibly more as well). Is this expected behaviour? If yes, then in this case the flag IORING_CQE_F_BUF_MORE is associated with which buffer id? The buffer id present in the cqe->flags or the buffer id we get after traversing res bytes from the cqe's buffer-id? |
Beta Was this translation helpful? Give feedback.
-
|
@axboe I apologize for tagging you Jens. I would be grateful if you could help provide answers to above questions or just point me in right direction. |
Beta Was this translation helpful? Give feedback.
-
|
I think that there is something wrong with setting Here is an example where I use buf ring with 4 buffers of 8 bytes size. Then I write 2 bytes 10 times in the loop then 3 bytes 10 times and so on. Each loop step is write to the one side of tcp connection then recv on the other side (no multishot recv). Here is buffers content after each loop. I reset all buffers to the 0xff and the data I write are 0,1,2... so I can inspect what part of the buffer is used. After this state of the io_uring_buf structures are: Buffer 3 is now in both slot 0 and slot 3, slot 3 is unusable because len is 0. Look at the loop step 12, 3 bytes are received across 2 buffers, If I change release logic to ignore Kernel 7.0.3. |
Beta Was this translation helpful? Give feedback.
-
|
There have been more discussions about this from a slightly different angle recently here: #1433 (comment)
(the entire thread is worth reading for context) (sorry for spam I put this answer in the wrong textbox woops!) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
[UPDATED - for better understanding of the issue]
Hi,
I have already gone through issues 1409 and 1423.
My setup(kernel version 6.17)
io_uring_setup_buf_ring(ring_, nr_bufs, bgid, IOU_PBUF_RING_INC, &ret);sqe->ioprio |= IORING_RECVSEND_BUNDLE;My question is that can a given cqe span-across/use 2 buffers in above setting(because bundle recv is enabled)? From the assertion in test recv-inc-ooo.c. It seems that with incremental buffers a given cqe won't copy more than buffer_size len but can this still use 2 buffers?
i.e is the following sequence of cqes possible?
My guess is no, since we have this comment
Questions
Beta Was this translation helpful? Give feedback.
All reactions