Replies: 4 comments 2 replies
-
|
I'll take a look, but it looks like you're frantically dumping a ton of sends in there. That's not really the best way to do it. Or are you just doing that to show the issue? Can you explain the logic of the reproducer? |
Beta Was this translation helpful? Give feedback.
-
|
Two fixes here: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git/log/?h=io_uring-6.19 but even with that, I don't believe it can work reliably like that - if you get a short send on one of the sends, then the receiving side will still see reordering as the gap between bufferN - some_bytes and bufferN+1 will not have been sent in order. |
Beta Was this translation helpful? Give feedback.
-
|
OK took a closer look - the way you do it can't ever work reliably, as you have multiple sends active on the socket. It's quite possible that one send will be partial because the socket buffer fills up, and then you have another send pick the next buffer in the range. You cannot rely on that kind of ordering. The test case should work with bundles as long as you only keep a single send active at the time. I did make a tweak on the kernel side, as I noticed that the bundle sends will keep retrying even past a full socket buffer. If we run into a full socket buffer, we should continue the current bundle, but not start any new ones. |
Beta Was this translation helpful? Give feedback.
-
|
So is my interpretation of the man incorrect?
https://man7.org/linux/man-pages/man3/io_uring_prep_send.3.html What can an application do, to prevent reordering, with send bundles, other than serializing sends (my understanding: that means not having multiple sends active on a socket at the same time)? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
If I understand the man correctly, if I populate a single bufring, and submit multiple send bundle operations, buffers should go out in-order (the order they were pushed to the buf ring). However, it doesn't seem to be the case?
Repro: https://github.com/erenon/sendbundle_reorder
Is my code broken, or my understanding of how send bundle works incorrect?
Beta Was this translation helpful? Give feedback.
All reactions