-
Notifications
You must be signed in to change notification settings - Fork 521
-
Currently I don't see way to send multiple UDP diagrams, rather bytes get mushed into single UDP packet with IORING_RECVSEND_BUNDLE + send. I get errno 95 with sendmsg + RECVSEND_BUNDLE, so I assume it's not supported.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 3 comments
-
errno 95 is EOPNOTSUPP - This looks like the kernel you are running doesn't yet support.
However, I wanted to follow up on this question - Looking at the kernel code, IORING_RECVSEND_BUNDLE isn't supported with recvmsg - https://elixir.bootlin.com/linux/v6.15-rc2/source/io_uring/net.c#L800
It looks like @axboe did mention this in the patch: https://lore.kernel.org/io-uring/20240308235045.1014125-1-axboe@kernel.dk/T/
Unfortunately, recvmsg multishot is just not as efficient as recv, as it carries additional
data that needs copying. recv multishot with bundles provide a good
alternative to recvmsg, if all you need is more than one range of data.
I'll compare these too soon as well.
Per my understanding, the ancillary data struct msghdr associated with each payload is allocated on the fly in io_msg_alloc_async and unlike payload buffer getting picked from registered buffers, this additional data needs explicit copying.
This would indeed be a nice feature given IORING_RECVSEND_BUNDLE flag significantly cuts down the networking stack overhead in the I/O path.
Similar to registering buffers for payload data, is it possible to pre-register the buffers for struct msghdr as well ? Any inputs here would be much appreciated. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions
-
Linux kernel has GSO/GRO which let you sendmsg/recvmsg multiple UDP diagrams in one syscall. The limitations are that the diagrams have to be the same size (except last diagram) and you can only send maximum 64 diagrams.
https://docs.kernel.org/networking/segmentation-offloads.html
However, it would be interesting if you could also do something similar with RECVSEND_BUNDLE alone.
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi,
I wanted to follow up on this as I had few questions related to IORING_RECVSEND_BUNDLE
I see that IORING_RECVSEND_BUNDLE tests are disabled for UDP in liburing tests.
test/recvsend_bundle: enable UDP tests
The reason why UDP don't work reliably is that the bundles get in their
way. For example, if we bundle send 4 128b segments as one 512b segment,
then a 128b recv will just get 128b and a followup recv will not get
anything as that message is now done.
Just disable bundle testing for UDP.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Per the above message, it looks like IORING_RECVSEND_BUNDLE may not be supported reliably with UDP.
However, if I understand correctly, the above problem is primarily because of sending the packets in bundle. Wouldn't the receive (with bundle) still work if the sender just sending the packets without bundling.
Beta Was this translation helpful? Give feedback.