lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

November 2024

  • 1 participants
  • 2209 discussions
[XS] Change in osmo-ci[master]: jobs/ttcn3-ns-test{,-sns}: tweak timer
by pespin 28 Nov '24

28 Nov '24
Attention is currently required from: osmith. pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ci/+/38971?usp=email ) Change subject: jobs/ttcn3-ns-test{,-sns}: tweak timer ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/38971?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I4f61013661d5de5382c3431650051989200fd785 Gerrit-Change-Number: 38971 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Thu, 28 Nov 2024 12:16:49 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in osmo-bsc[master]: pcu_sock: do not receive a TXT ind. with PCU_VERSION for a specific BTS
by pespin 28 Nov '24

28 Nov '24
Attention is currently required from: dexter, fixeria, laforge. pespin has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/osmo-bsc/+/38957?usp=email ) Change subject: pcu_sock: do not receive a TXT ind. with PCU_VERSION for a specific BTS ...................................................................... Patch Set 4: Code-Review-1 (1 comment) Patchset: PS4: param still not passed. -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/38957?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I3fbf5430db8b8ea29efb147bd162706990453fc5 Gerrit-Change-Number: 38957 Gerrit-PatchSet: 4 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Thu, 28 Nov 2024 12:16:17 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in osmo-bts[master]: pcu_sock: do not receive a TXT ind. with PCU_VERSION for a specific BTS
by pespin 28 Nov '24

28 Nov '24
Attention is currently required from: dexter. pespin has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/osmo-bts/+/38958?usp=email ) Change subject: pcu_sock: do not receive a TXT ind. with PCU_VERSION for a specific BTS ...................................................................... Patch Set 2: (1 comment) File src/common/pcu_sock.c: https://gerrit.osmocom.org/c/osmo-bts/+/38958/comment/8793c385_96ceb644?usp… : PS1, Line 947: #define ENSURE_BTS_OBJECT() \ > shouldn't we better have something like this?: […] I prefer having the bts pointer param as an inout param. Otherwise you end up with a ninja assignment to bts pointer without showing up in code... -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/38958?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I1bb8d0ec5e8d4b9f822f94249a75d8dc477144a3 Gerrit-Change-Number: 38958 Gerrit-PatchSet: 2 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Thu, 28 Nov 2024 12:15:09 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
1 0
0 0
[XS] Change in libasn1c[master]: debian/control: Build-Depends: add pkg-config
by pespin 28 Nov '24

28 Nov '24
Attention is currently required from: osmith. pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/libasn1c/+/38970?usp=email ) Change subject: debian/control: Build-Depends: add pkg-config ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libasn1c/+/38970?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Change-Id: I5b26c8c81b9e94f1af11294d4fac0194f9a21aa8 Gerrit-Change-Number: 38970 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Thu, 28 Nov 2024 12:14:08 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in osmo-bts[master]: abis: Log line and ts nr of signal
by pespin 28 Nov '24

28 Nov '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/38966?usp=email ) Change subject: abis: Log line and ts nr of signal ...................................................................... abis: Log line and ts nr of signal Change-Id: I322633a90566dbd4fae10ab6b1fbbedf55907e8b --- M src/common/abis.c 1 file changed, 5 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/src/common/abis.c b/src/common/abis.c index 5629cf2..3e0f6dc 100644 --- a/src/common/abis.c +++ b/src/common/abis.c @@ -476,8 +476,11 @@ return 0; struct input_signal_data *isd = signal_data; - DEBUGP(DABIS, "Input Signal %s received for link_type=%s\n", - get_value_string(e1inp_signal_names, signal), e1inp_signtype_name(isd->link_type)); + DEBUGP(DABIS, "Input Signal %s received for ts-%u-%u link_type=%s\n", + get_value_string(e1inp_signal_names, signal), + isd->line ? isd->line->num : -1, + isd->ts_nr, + e1inp_signtype_name(isd->link_type)); return 0; } -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/38966?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I322633a90566dbd4fae10ab6b1fbbedf55907e8b Gerrit-Change-Number: 38966 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-bts[master]: abis: Fix reusing bts->*_link while it is being destroyed
by pespin 28 Nov '24

28 Nov '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/38967?usp=email ) Change subject: abis: Fix reusing bts->*_link while it is being destroyed ...................................................................... abis: Fix reusing bts->*_link while it is being destroyed Call to e1inp_sign_link_destroy() may trigger a sign_down() callback, which if happening synchronously, could end up reentring the same code path we are in before bts->*_link was set to NULL. Avoid it by marking the pointer as NULL immediatelly before calling e1inp_sign_link_destroy(). Change-Id: Ibc06cdc2d2cd2028b7676fa0c3211ae251cca587 --- M src/common/abis.c 1 file changed, 16 insertions(+), 4 deletions(-) Approvals: fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified osmith: Looks good to me, approved diff --git a/src/common/abis.c b/src/common/abis.c index 3e0f6dc..e619ec8 100644 --- a/src/common/abis.c +++ b/src/common/abis.c @@ -87,10 +87,17 @@ static void reset_oml_link(struct gsm_bts *bts) { + struct e1inp_sign_link *link; + if (bts->oml_link) { struct timespec now; - e1inp_sign_link_destroy(bts->oml_link); + /* Mark bts->oml_link ptr null before calling sign_link_destroy, + * to avoid a callback triggering this same code path. */ + link = bts->oml_link; + bts->oml_link = NULL; + + e1inp_sign_link_destroy(link); /* Log a special notice if the OML connection was dropped relatively quickly. */ if (bts->oml_conn_established_timestamp.tv_sec != 0 && clock_gettime(CLOCK_MONOTONIC, &now) == 0 && @@ -100,14 +107,16 @@ "A common error is a mismatch between unit_id configuration parameters of BTS and BSC.\n", (uint64_t) (now.tv_sec - bts->oml_conn_established_timestamp.tv_sec)); } - bts->oml_link = NULL; } memset(&bts->oml_conn_established_timestamp, 0, sizeof(bts->oml_conn_established_timestamp)); /* Same for IPAC_PROTO_OSMO on the same ipa connection: */ if (bts->osmo_link) { - e1inp_sign_link_destroy(bts->osmo_link); + /* Mark bts->osmo_link ptr null before calling sign_link_destroy, + * to avoid a callback triggering this same code path. */ + link = bts->osmo_link; bts->osmo_link = NULL; + e1inp_sign_link_destroy(link); } } @@ -226,8 +235,11 @@ /* Then iterate over the RSL signalling links */ llist_for_each_entry(trx, &bts->trx_list, list) { if (trx->bb_transc.rsl.link) { - e1inp_sign_link_destroy(trx->bb_transc.rsl.link); + /* Mark link ptr null before calling sign_link_destroy, + * to avoid a callback triggering this same code path. */ + struct e1inp_sign_link *link = trx->bb_transc.rsl.link; trx->bb_transc.rsl.link = NULL; + e1inp_sign_link_destroy(link); if (trx == trx->bts->c0) load_timer_stop(trx->bts); } else { -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/38967?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: Ibc06cdc2d2cd2028b7676fa0c3211ae251cca587 Gerrit-Change-Number: 38967 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-bts[master]: abis: Log line and ts nr of signal
by pespin 28 Nov '24

28 Nov '24
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-bts/+/38966?usp=email ) Change subject: abis: Log line and ts nr of signal ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/38966?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I322633a90566dbd4fae10ab6b1fbbedf55907e8b Gerrit-Change-Number: 38966 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 28 Nov 2024 12:13:26 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in libosmo-netif[master]: stream_cli: Add API osmo_stream_cli_set_tx_queue_max_length()
by pespin 28 Nov '24

28 Nov '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/38955?usp=email ) Change subject: stream_cli: Add API osmo_stream_cli_set_tx_queue_max_length() ...................................................................... stream_cli: Add API osmo_stream_cli_set_tx_queue_max_length() Change-Id: I3935fb933fe6136d68a9403eebbaf2616c2e5578 --- M TODO-RELEASE M include/osmocom/netif/stream.h M src/stream_cli.c 3 files changed, 37 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/TODO-RELEASE b/TODO-RELEASE index 4f59788..74a0abb 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -8,3 +8,4 @@ # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line libosmo-netif add API osmo_stream_cli_set_{ip_dscp,priority}(), osmo_stream_srv_link_set_{ip_dscp,priority}() +libosmo-netif add API osmo-stream_cli_set_tx_queue_max_length() diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h index 6edf915..3b3e04e 100644 --- a/include/osmocom/netif/stream.h +++ b/include/osmocom/netif/stream.h @@ -208,6 +208,7 @@ void osmo_stream_cli_set_data(struct osmo_stream_cli *cli, void *data); void osmo_stream_cli_set_reconnect_timeout(struct osmo_stream_cli *cli, int timeout); void *osmo_stream_cli_get_data(struct osmo_stream_cli *cli); +int osmo_stream_cli_set_tx_queue_max_length(struct osmo_stream_cli *cli, unsigned int size); char *osmo_stream_cli_get_sockname(const struct osmo_stream_cli *cli); struct osmo_fd *osmo_stream_cli_get_ofd(struct osmo_stream_cli *cli); int osmo_stream_cli_get_fd(const struct osmo_stream_cli *cli); diff --git a/src/stream_cli.c b/src/stream_cli.c index 88d5f9e..a00f32a 100644 --- a/src/stream_cli.c +++ b/src/stream_cli.c @@ -96,7 +96,9 @@ struct osmo_fd ofd; struct osmo_io_fd *iofd; }; - struct llist_head tx_queue; + struct llist_head tx_queue; /* osmo_ofd mode (only): Queue of msgbs */ + unsigned int tx_queue_count; /* osmo_ofd mode (only): Current amount of msgbs queued */ + unsigned int tx_queue_max_length; /* Max amount of msgbs which can be enqueued */ struct osmo_timer_list timer; enum osmo_stream_cli_state state; char *addr[OSMO_STREAM_MAX_ADDRS]; @@ -321,12 +323,11 @@ struct msgb *msg; int ret; - if (llist_empty(&cli->tx_queue)) { + msg = msgb_dequeue_count(&cli->tx_queue, &cli->tx_queue_count); + if (!msg) { /* done, tx_queue empty */ osmo_fd_write_disable(&cli->ofd); return 0; } - msg = llist_first_entry(&cli->tx_queue, struct msgb, list); - llist_del(&msg->list); if (!osmo_stream_cli_is_connected(cli)) { LOGSCLI(cli, LOGL_ERROR, "send: not connected, dropping data!\n"); @@ -367,6 +368,7 @@ /* Update msgb and re-add it at the start of the queue: */ msgb_pull(msg, ret); llist_add(&msg->list, &cli->tx_queue); + cli->tx_queue_count++; return 0; } @@ -376,6 +378,7 @@ if (err == EAGAIN) { /* Re-add at the start of the queue to re-attempt: */ llist_add(&msg->list, &cli->tx_queue); + cli->tx_queue_count++; return 0; } msgb_free(msg); @@ -510,6 +513,7 @@ cli->reconnect_timeout = 5; /* default is 5 seconds. */ cli->segmentation_cb = NULL; INIT_LLIST_HEAD(&cli->tx_queue); + cli->tx_queue_max_length = 1024; /* Default tx queue size, msgbs. */ cli->ma_pars.sctp.version = 0; @@ -863,6 +867,24 @@ return cli->data; } +/*! Set the maximum length queue of the stream client. + * \param[in] cli Stream Client to modify + * \param[in] size maximum amount of msgbs which can be queued in the internal tx queue. + * \returns 0 on success, negative on error. + * + * The maximum length queue default value is 1024 msgbs. */ +int osmo_stream_cli_set_tx_queue_max_length(struct osmo_stream_cli *cli, unsigned int size) +{ + cli->tx_queue_max_length = size; + + if (cli->iofd) /* Otherwise, this will be done in osmo_stream_cli_open() */ + osmo_iofd_set_txqueue_max_length(cli->iofd, cli->tx_queue_max_length); + + /* XXX: Here, in OSMO_STREAM_MODE_OSMO_FD mode we could check current + * size of cli->tx_queue and shrink it from the front or back... */ + return 0; +} + /*! Retrieve the stream client socket description. * Calling this function will build a string that describes the socket in terms of its local/remote * address/port. The returned name is stored in a static buffer; it is hence not re-entrant or thread-safe. @@ -944,6 +966,7 @@ OSMO_ASSERT(!stream_cli_close(cli)); osmo_timer_del(&cli->timer); msgb_queue_free(&cli->tx_queue); + cli->tx_queue_count = 0; /* if we are in a user callback, delay freeing. */ if (cli->in_cb_mask != 0) { LOGSCLI(cli, LOGL_DEBUG, "delay free() in_cb_mask=0x%02x\n", cli->in_cb_mask); @@ -1204,8 +1227,8 @@ if (!cli->iofd) goto error_close_socket; + osmo_iofd_set_txqueue_max_length(cli->iofd, cli->tx_queue_max_length); osmo_iofd_notify_connected(cli->iofd); - configure_cli_segmentation_cb(cli, cli->segmentation_cb); if (osmo_iofd_register(cli->iofd, fd) < 0) @@ -1253,7 +1276,12 @@ switch (cli->mode) { case OSMO_STREAM_MODE_OSMO_FD: - msgb_enqueue(&cli->tx_queue, msg); + if (cli->tx_queue_count >= cli->tx_queue_max_length) { + LOGSCLI(cli, LOGL_ERROR, "send: tx queue full, dropping msg!\n"); + msgb_free(msg); + return; + } + msgb_enqueue_count(&cli->tx_queue, msg, &cli->tx_queue_count); osmo_fd_write_enable(&cli->ofd); break; case OSMO_STREAM_MODE_OSMO_IO: @@ -1350,6 +1378,7 @@ switch (cli->mode) { case OSMO_STREAM_MODE_OSMO_FD: msgb_queue_free(&cli->tx_queue); + cli->tx_queue_count = 0; /* If in state 'connecting', keep WRITE flag up to receive * socket connection signal and then transition to STATE_CONNECTED: */ if (cli->state == STREAM_CLI_STATE_CONNECTED) -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/38955?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I3935fb933fe6136d68a9403eebbaf2616c2e5578 Gerrit-Change-Number: 38955 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in libosmo-netif[master]: stream_srv: Add API osmo_stream_srv_link_set_tx_queue_max_length()
by pespin 28 Nov '24

28 Nov '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/38956?usp=email ) Change subject: stream_srv: Add API osmo_stream_srv_link_set_tx_queue_max_length() ...................................................................... stream_srv: Add API osmo_stream_srv_link_set_tx_queue_max_length() Change-Id: I3c2deac7f7be0cf838834135a548cce70367a905 --- M TODO-RELEASE M include/osmocom/netif/stream.h M src/stream_srv.c 3 files changed, 33 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved laforge: Looks good to me, but someone else must approve diff --git a/TODO-RELEASE b/TODO-RELEASE index 74a0abb..268b142 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -8,4 +8,4 @@ # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line libosmo-netif add API osmo_stream_cli_set_{ip_dscp,priority}(), osmo_stream_srv_link_set_{ip_dscp,priority}() -libosmo-netif add API osmo-stream_cli_set_tx_queue_max_length() +libosmo-netif add API osmo-stream_cli_set_tx_queue_max_length(), osmo_stream_srv_link_set_tx_queue_max_length() diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h index 3b3e04e..a132a27 100644 --- a/include/osmocom/netif/stream.h +++ b/include/osmocom/netif/stream.h @@ -81,6 +81,7 @@ void osmo_stream_srv_link_set_accept_cb(struct osmo_stream_srv_link *link, osmo_stream_srv_link_accept_cb_t accept_cb); void osmo_stream_srv_link_set_data(struct osmo_stream_srv_link *link, void *data); void *osmo_stream_srv_link_get_data(struct osmo_stream_srv_link *link); +int osmo_stream_srv_link_set_tx_queue_max_length(struct osmo_stream_srv_link *link, unsigned int size); char *osmo_stream_srv_link_get_sockname(const struct osmo_stream_srv_link *link); struct osmo_fd *osmo_stream_srv_link_get_ofd(struct osmo_stream_srv_link *link); int osmo_stream_srv_link_get_fd(const struct osmo_stream_srv_link *link); diff --git a/src/stream_srv.c b/src/stream_srv.c index aa7edbf..4f9323b 100644 --- a/src/stream_srv.c +++ b/src/stream_srv.c @@ -87,6 +87,7 @@ osmo_stream_srv_link_accept_cb_t accept_cb; void *data; int flags; + unsigned int tx_queue_max_length; /* Max amount of msgbs which can be enqueued */ struct osmo_sock_init2_multiaddr_pars ma_pars; }; @@ -203,6 +204,7 @@ link->sk_domain = AF_UNSPEC; link->sk_type = SOCK_STREAM; link->proto = IPPROTO_TCP; + link->tx_queue_max_length = 1024; /* Default tx queue size, msgbs. */ osmo_fd_setup(&link->ofd, -1, OSMO_FD_READ | OSMO_FD_WRITE, osmo_stream_srv_link_ofd_cb, link, 0); link->ma_pars.sctp.version = 0; @@ -394,6 +396,18 @@ return link->data; } +/*! Set the maximum length queue of the stream servers accepted and allocated from this server link. + * \param[in] link Stream Server Link to modify + * \param[in] size maximum amount of msgbs which can be queued in the internal tx queue. + * \returns 0 on success, negative on error. + * + * The maximum length queue default value is 1024 msgbs. */ +int osmo_stream_srv_link_set_tx_queue_max_length(struct osmo_stream_srv_link *link, unsigned int size) +{ + link->tx_queue_max_length = size; + return 0; +} + /* Similar to osmo_sock_multiaddr_get_name_buf(), but aimed at listening sockets (only local part): */ static char *get_local_sockname_buf(char *buf, size_t buf_len, const struct osmo_stream_srv_link *link) { @@ -643,7 +657,8 @@ struct osmo_fd ofd; struct osmo_io_fd *iofd; }; - struct llist_head tx_queue; + struct llist_head tx_queue; /* osmo_ofd mode (only): Queue of msgbs */ + unsigned int tx_queue_count; /* osmo_ofd mode (only): Current amount of msgbs queued */ osmo_stream_srv_closed_cb_t closed_cb; osmo_stream_srv_read_cb_t read_cb; osmo_stream_srv_read_cb2_t iofd_read_cb; @@ -769,12 +784,11 @@ struct msgb *msg; int ret; - if (llist_empty(&conn->tx_queue)) { + msg = msgb_dequeue_count(&conn->tx_queue, &conn->tx_queue_count); + if (!msg) { /* done, tx_queue empty */ osmo_fd_write_disable(&conn->ofd); return; } - msg = llist_first_entry(&conn->tx_queue, struct msgb, list); - llist_del(&msg->list); LOGSSRV(conn, LOGL_DEBUG, "sending %u bytes of data\n", msg->len); @@ -811,6 +825,7 @@ /* Update msgb and re-add it at the start of the queue: */ msgb_pull(msg, ret); llist_add(&msg->list, &conn->tx_queue); + conn->tx_queue_count++; return; } @@ -820,6 +835,7 @@ if (err == EAGAIN) { /* Re-add at the start of the queue to re-attempt: */ llist_add(&msg->list, &conn->tx_queue); + conn->tx_queue_count++; return; } msgb_free(msg); @@ -923,6 +939,7 @@ conn->mode = OSMO_STREAM_MODE_OSMO_IO; conn->srv = link; + conn->data = data; osmo_sock_get_name_buf(conn->sockname, sizeof(conn->sockname), fd); @@ -939,7 +956,8 @@ talloc_free(conn); return NULL; } - conn->data = data; + + osmo_iofd_set_txqueue_max_length(conn->iofd, conn->srv->tx_queue_max_length); if (osmo_iofd_register(conn->iofd, fd) < 0) { LOGSSRV(conn, LOGL_ERROR, "could not register FD %d\n", fd); @@ -1127,6 +1145,7 @@ osmo_fd_unregister(&conn->ofd); close(conn->ofd.fd); msgb_queue_free(&conn->tx_queue); + conn->tx_queue_count = 0; conn->ofd.fd = -1; break; case OSMO_STREAM_MODE_OSMO_IO: @@ -1158,7 +1177,12 @@ switch (conn->mode) { case OSMO_STREAM_MODE_OSMO_FD: - msgb_enqueue(&conn->tx_queue, msg); + if (conn->tx_queue_count >= conn->srv->tx_queue_max_length) { + LOGSSRV(conn, LOGL_ERROR, "send: tx queue full, dropping msg!\n"); + msgb_free(msg); + return; + } + msgb_enqueue_count(&conn->tx_queue, msg, &conn->tx_queue_count); osmo_fd_write_enable(&conn->ofd); break; case OSMO_STREAM_MODE_OSMO_IO: @@ -1249,6 +1273,7 @@ switch (conn->mode) { case OSMO_STREAM_MODE_OSMO_FD: msgb_queue_free(&conn->tx_queue); + conn->tx_queue_count = 0; osmo_fd_write_disable(&conn->ofd); break; case OSMO_STREAM_MODE_OSMO_IO: -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/38956?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I3c2deac7f7be0cf838834135a548cce70367a905 Gerrit-Change-Number: 38956 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in libosmo-netif[master]: stream_srv: Add API osmo_stream_srv_link_set_tx_queue_max_length()
by pespin 28 Nov '24

28 Nov '24
Attention is currently required from: daniel. pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-netif/+/38956?usp=email ) Change subject: stream_srv: Add API osmo_stream_srv_link_set_tx_queue_max_length() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/38956?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I3c2deac7f7be0cf838834135a548cce70367a905 Gerrit-Change-Number: 38956 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Thu, 28 Nov 2024 12:10:45 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • ...
  • 221
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.