liburing icon indicating copy to clipboard operation
liburing copied to clipboard

io_uring_prep_send_bundle should not have len argument

Open yaroslavros opened this issue 1 year ago • 5 comments

For some reason io_uring_prep_send_bundle accepts len argument, however io_sendmsg_prep in kernel returns -EINVAL for non-zero len.

I guess io_uring_prep_send_bundle should not have len as an argument since 0 is the only valid value.

Or is it something that might be implemented in the future to send bundles with a partially full final buffer? At the moment there does not seem to be a way to do that.

yaroslavros avatar Aug 05 '24 23:08 yaroslavros

It has 'len' as an argument to avoid the inevitable need to add another helper just to pass in the length as well. And yes, partial send would be the use case, or capping the send at least.

axboe avatar Aug 06 '24 14:08 axboe

Intent of the future use of len argument makes sense but as of today it does not actually work because of https://github.com/torvalds/linux/blob/b446a2dae984fa5bd56dd7c3a02a426f87e05813/io_uring/net.c#L437C1-L439C1

Do I get that correct?

yaroslavros avatar Aug 06 '24 14:08 yaroslavros

Right, it's not currently supported, which is why it returns -EINVAL right now.

axboe avatar Aug 06 '24 14:08 axboe

Would be great to update man that len is for future use and must be currently set to 0.

yaroslavros avatar Aug 06 '24 22:08 yaroslavros

Agree, I can do that. FWIW, we do accept patches and contributions.

axboe avatar Aug 06 '24 22:08 axboe