Feature #5752
closedio_uring support in libosmo-sigtran
100%
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.
Related issues
Updated by laforge about 1 year ago
- Related to Feature #5751: io_uring support in libosmocore added
Updated by laforge 9 months ago
- Related to Feature #5753: io_uring support in libosmo-netif added
Updated by laforge 15 days ago
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
- uses osmo_stream_srv_recv(), which in turn calls stream_sctp_recvmsg_wrapper() which in turn calls sctp_recvmsg()
- 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
Updated by laforge 15 days ago
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
.
- extend
struct iofd_msghdr
with achar 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
.
- extend
struct iofd_msghdr
with achar cmdsg[CMSG_SPACE(sizeof(struct sctp_sndrcvinfo))]
element - implement the
sctp_recvmsg()
function semantics on top of that
Updated by laforge 13 days ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Applied in changeset libosmo-sccp|1cf5d2ff3eb633ce2b132b5a1b4bf6da274ebb95.