Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

io_uring_prep_recvmsg with sctp_recvmsg #1512

Unanswered
akm76 asked this question in Q&A
Dec 30, 2025 · 1 comments · 2 replies
Discussion options

How would I go about prepping an sctp specific RECV? sctp_recvmsg is a wrapper, sure, but what would be the right way of getting a hold of those sctp specific functions within liburing flow? Is there a snippet/example that demonstrates how to do it?

You must be logged in to vote

Replies: 1 comment 2 replies

Comment options

Please take what I say with a grain of salt: It seems SCTP is implemented on top of UDP, and the source seems to confirm this.

If that's true you can simply use the recvmsg opcode with the correct parameters. At least that's what I did to implement the QUIC protocol with io_uring.

In general for the syscalls that are not yet available it's worth to check if they are implemented by using more fundamental syscalls and some userland code in libc.

You must be logged in to vote
2 replies
Comment options

I see sctp_recvmsg is a wrapper for recvmsg call and also there isn't anything like io_uring_prep_sctp_recvmsg, so would I be wrong in concluding what I need to do is effectively repeat what sctp_recvmsg code is doing replacing its internal recvmsg call with io_uring_prep_recvmsg (and adding corresponding cqe parts to build struct sctp_sndrcvinfo)?

May I ask what code you refer to when you mention QUIC implementation with io_uring?

I've a followup question:
When using io_uring_prep_recvmsg_multishot with io_uring_buf_ring, which is brilliant, the part that's seems awkward is handling of returned struct msghdr. If it was somehow attached to the buffer all would be great, kernel selects buffer from buf_ring, fills it, etc. etc. But as in this api msghdr isn't attached to the buffer, especially in multishot case won't it overwrite msghdr over and over if user is too slow reacting and retrieving it when its ready?
Logically (esp for SCTP) the msghdr is kind of part of the message, so each time buffer fills it goes with its own header; having such a convenient component as buff_ring but requiring user to jump through hoops to retrieve and keep associated msghdr seems an odd choice. Am I completely missing something?

Comment options

Actually, looks like message header is attached to the buffer, as prepended struct io_uring_recvmsg_out. Haven't seen it in the docs, only in src, and still need to confirm that to be the case. Would be super nice if it was documented or a worked example provided though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /