laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33686 )
Change subject: osmo_io: Add function to change the maximum length of the tx_queue ......................................................................
osmo_io: Add function to change the maximum length of the tx_queue
Change-Id: If3d1de8bffe1123002515878655ea9e02b482888 --- M include/osmocom/core/osmo_io.h M src/core/libosmocore.map M src/core/osmo_io.c 3 files changed, 20 insertions(+), 0 deletions(-)
Approvals: daniel: Looks good to me, approved Jenkins Builder: Verified
diff --git a/include/osmocom/core/osmo_io.h b/include/osmocom/core/osmo_io.h index 3715f93..8f3c060 100644 --- a/include/osmocom/core/osmo_io.h +++ b/include/osmocom/core/osmo_io.h @@ -86,6 +86,7 @@ const struct osmo_sockaddr *dest);
void osmo_iofd_set_alloc_info(struct osmo_io_fd *iofd, unsigned int size, unsigned int headroom); +void osmo_iofd_set_txqueue_max_length(struct osmo_io_fd *iofd, unsigned int size); void *osmo_iofd_get_data(const struct osmo_io_fd *iofd); void osmo_iofd_set_data(struct osmo_io_fd *iofd, void *data);
diff --git a/src/core/libosmocore.map b/src/core/libosmocore.map index 50be67c..99be86c 100644 --- a/src/core/libosmocore.map +++ b/src/core/libosmocore.map @@ -268,6 +268,7 @@ osmo_iofd_set_data; osmo_iofd_set_ioops; osmo_iofd_set_priv_nr; +osmo_iofd_set_txqueue_max_length; osmo_iofd_setup; osmo_iofd_txqueue_clear; osmo_iofd_txqueue_len; diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c index 8217316..90ea674 100644 --- a/src/core/osmo_io.c +++ b/src/core/osmo_io.c @@ -542,6 +542,15 @@ iofd->msgb_alloc.size = size; }
+/*! Set the maximum number of messages enqueued for sending. + * \param[in] iofd the file descriptor + * \param[in] size the maximum size of the transmit queue + */ +void osmo_iofd_set_txqueue_max_length(struct osmo_io_fd *iofd, unsigned int max_length) +{ + iofd->tx_queue.max_length = max_length; +} + /*! Get the associated user-data from an iofd * \param[in] iofd the file descriptor * \returns the data that was previously set with \ref osmo_iofd_setup()