Feature #5752
closed
io_uring support in libosmo-sigtran
Added by laforge over 1 year ago.
Updated 3 months ago.
Description
Once libosmocore provides the new API for the upcoming io_uring backend (#5751) we will need to port libosmo-sccp over to this new API.
Currently we're using the following code-paths for I/O
libosmo-sigtran function |
I/O function |
provided by |
xua_srv_conn_cb |
sctp_recvmsg |
libsctp |
ipa_cli_read_cb |
ipa_msg_recv_buffered |
libosmocore |
osmo_ss7_asp_send |
osmo_stream_srv_send |
libosmo-netif |
osmo_ss7_asp_send |
osmo_stream_cli_send |
libosmo-netif |
We need to analyze each of those and migrate, if possible.
- Description updated (diff)
- Priority changed from Normal to High
- Priority changed from High to Urgent
- Related to Feature #5753: io_uring support in libosmo-netif added
code paths we have to cover:
- ss7_asp_xua_srv_conn_cb()
- uses osmo_stream_srv_recv(), which in turn calls stream_sctp_recvmsg_wrapper() which in turn calls sctp_recvmsg()
- sets msgb_sctp_ppid/msgb_sctp_stream to data from sctp_sndrcvinfo
- performs processing (well, actually really just logging) of flags / MSG_NOTIFICATION
- xua_cli_read_cb()
- uses osmo_stream_cli_recv(), which in turn calls stream_sctp_recvmsg_wrapper() which in turn calls sctp_recvmsg() [see above]
- osmo_ss7_asp_send()
- set msgb_sctp_ppid [and possibly stream?]
- uses osmo_stream_{srv,cli})_send(), which in turn uses (via write_queue) osmo_stream_cli_write()
- osmo_stream_{cli,srv}_write(), which uses sctp_send() with sctp_streaminfo
sctp_send
¶
sctp_send()
in libsctp is turning the data+len bytes and the sctp_sndrecvinfo into a sendmsg()
call whose msghdr contains one io_vector and one cmsg header. In order to do the cmsg trick, it needs to have a memory buffer of CMSG_SPACE(sizeof(struct sctp_sndrcvinfo))
- a macro that aligns/pads to size_t
.
So we'd have to
- extend
struct iofd_msghdr
with a char cmdsg[CMSG_SPACE(sizeof(struct sctp_sndrcvinfo))]
element
- implement the
sctp_send()
function semantics on top of that
sctp_recvmsg
¶
The naming is really confusing. Normally, recvmsg
is something that deals with struct msghdr
but in the case of sctp_recvmsg
it actually does not. The user can only pass one buffer, and not an io_vector to it.
sctp_recvmsg
is turning the data+len bytes and the sctp_sndrcvinfo into a recvmsg
call whose msghdr contains one io_vector and one cmsg header. In order to do the cmsg trick, it needs to have a memory buffer of CMSG_SPACE(sizeof(struct sctp_sndrcvinfo))
- a macro that aligns/pads to size_t
.
So we'd have to
- extend
struct iofd_msghdr
with a char cmdsg[CMSG_SPACE(sizeof(struct sctp_sndrcvinfo))]
element
- implement the
sctp_recvmsg()
function semantics on top of that
- Status changed from New to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Stalled
- Assignee changed from daniel to Hoernchen
- % Done changed from 100 to 70
the latest WIP code is in laforge/osmo_io_sctp
branch.
- Related to Feature #6357: run (some?) tests with io_uring backend for osmo_io added
- Assignee changed from Hoernchen to jolly
- Status changed from Stalled to Resolved
- % Done changed from 70 to 100
Also available in: Atom
PDF