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

September 2026

  • 1 participants
  • 1894 discussions
[L] Change in osmo-trx[master]: osmo-trx-proxy: initial app skeleton
by fixeria 13 Sep '26

13 Sep '26
Attention is currently required from: laforge, pespin. fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmo-trx/+/43603?usp=email ) Change subject: osmo-trx-proxy: initial app skeleton ...................................................................... Patch Set 2: (2 comments) File proxy/include/osmocom/proxy/proxy.h: https://gerrit.osmocom.org/c/osmo-trx/+/43603/comment/a9d8a2df_3b1a8017?usp… : PS1, Line 23: struct proxy_ctx *proxy_ctx_alloc(void *talloc_ctx); > no _free()? No. We do allocate only one instance of this struct and never free() it while the program is running. I could add the _free() counterpart for the sake of completeness, but at the moment it's not really needed. File proxy/src/proxy.c: https://gerrit.osmocom.org/c/osmo-trx/+/43603/comment/32f42b79_68fe329d?usp… : PS1, Line 56: bool proxy_ctx_add_defaults_if_empty(struct proxy_ctx *proxy) > weird returning a bool here instead of return code. Acknowledged -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/43603?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: Id2b12e5e7d053eea53338fbabc48131b9c46c82a Gerrit-Change-Number: 43603 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Sun, 13 Sep 2026 19:28:57 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: bts: expect TC_data_rtp_tchh{48,24} to fail
by pespin 13 Sep '26

13 Sep '26
Attention is currently required from: fixeria. pespin has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43626?usp=email ) Change subject: bts: expect TC_data_rtp_tchh{48,24} to fail ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43626?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ib8116689817798187f4f6b96bd5cb8b6dff7a6b1 Gerrit-Change-Number: 43626 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Sun, 13 Sep 2026 19:19:22 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in osmo-trx[master]: proxy: queue BURST.req and dispatch per TDMA frame tick
by fixeria 13 Sep '26

13 Sep '26
Attention is currently required from: laforge. fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmo-trx/+/43612?usp=email ) Change subject: proxy: queue BURST.req and dispatch per TDMA frame tick ...................................................................... Patch Set 2: (1 comment) This change is ready for review. File proxy/src/burst_fwd.c: https://gerrit.osmocom.org/c/osmo-trx/+/43612/comment/75a77745_1be6113a?usp… : PS1, Line 138: > basically it's a trade-off whether we want more computationally expensive enqueue or dequeue. […] Done -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/43612?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: Ib147983e97638d2a2e487ccf76184912caf0941d Gerrit-Change-Number: 43612 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Sun, 13 Sep 2026 19:05:02 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
1 0
0 0
[L] Change in osmo-trx[master]: libosmo-trx/ep: flush pending TRXC messages on endpoint teardown
by fixeria 13 Sep '26

13 Sep '26
Attention is currently required from: pespin. fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmo-trx/+/43112?usp=email ) Change subject: libosmo-trx/ep: flush pending TRXC messages on endpoint teardown ...................................................................... Patch Set 7: (3 comments) File libosmo-trx/src/trx_ep.c: https://gerrit.osmocom.org/c/osmo-trx/+/43112/comment/626c06db_5dca6482?usp… : PS6, Line 348: flush = talloc(iofd, struct trx_ep_ctrl_flush); > Because the caller may call `osmo_trx_ep_free()` right after `osmo_trx_ep_close()`. […] Implemented postponed free()ing the whole `struct osmo_trx_ep`. https://gerrit.osmocom.org/c/osmo-trx/+/43112/comment/647c3a7c_079eefdf?usp… : PS6, Line 552: * finish flushing on its own, since it may outlive the endpoint. */ > I don't really see why would you like the ctrl socket to outlive the endpoint. […] Done https://gerrit.osmocom.org/c/osmo-trx/+/43112/comment/77ea756a_7d7e4b77?usp… : PS6, Line 581: return !llist_empty(&ep->closing_flushes); > The list exists to let `osmo_trx_ep_free()` find outstanding flushes and sever their back-pointer, s […] Done -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/43112?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I69e6a3bcf49afc3cfca4a72afdf459625cb91e56 Gerrit-Change-Number: 43112 Gerrit-PatchSet: 7 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Sun, 13 Sep 2026 18:39:31 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-trx[master]: proxy: make max TRXD PDU version VTY-configurable
by fixeria 13 Sep '26

13 Sep '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/43631?usp=email ) Change subject: proxy: make max TRXD PDU version VTY-configurable ...................................................................... proxy: make max TRXD PDU version VTY-configurable Change-Id: Ibd384ee57a728b709b1e43726b46c8c3840b5535 Related: OS#6672 --- M proxy/include/osmocom/proxy/trx.h M proxy/src/ctrl_cmd.c M proxy/src/trx.c M proxy/src/vty.c 4 files changed, 21 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/31/43631/1 diff --git a/proxy/include/osmocom/proxy/trx.h b/proxy/include/osmocom/proxy/trx.h index de46e9a..13ca697 100644 --- a/proxy/include/osmocom/proxy/trx.h +++ b/proxy/include/osmocom/proxy/trx.h @@ -70,6 +70,7 @@ struct osmo_trx_ep *ep; bool powered; /*!< POWERON/POWEROFF applies to all channels at once */ int tx_power; /*!< dBm, nominal Tx power (path_sim_state::tx_power) */ + uint8_t trxd_max_ver; /*!< highest TRXD PDU version SETFORMAT may negotiate */ unsigned int num_chans; /*!< mirrors osmo_trx_ep_get_num_chans(ep) */ struct proxy_trx_chan *chans; /*!< array of num_chans entries, allocated on open */ }; diff --git a/proxy/src/ctrl_cmd.c b/proxy/src/ctrl_cmd.c index fb163e7..8f123f1 100644 --- a/proxy/src/ctrl_cmd.c +++ b/proxy/src/ctrl_cmd.c @@ -281,8 +281,8 @@ return; } - if (ver_req > OSMO_TRXD_PDU_VER_MAX) - ver_req = OSMO_TRXD_PDU_VER_MAX; + if (ver_req > trx->trxd_max_ver) + ver_req = trx->trxd_max_ver; osmo_trx_ep_set_pdu_ver(trx->ep, chan, ver_req); rsp->status = ver_req; diff --git a/proxy/src/trx.c b/proxy/src/trx.c index 96e9fea..ffcd2c2 100644 --- a/proxy/src/trx.c +++ b/proxy/src/trx.c @@ -53,6 +53,7 @@ trx->name = talloc_strdup(trx, name); trx->tx_power = PROXY_TRX_DEFAULT_TX_POWER; + trx->trxd_max_ver = OSMO_TRXD_PDU_VER_MAX; trx->ep = osmo_trx_ep_alloc(trx, num_chans); if (trx->ep == NULL) { talloc_free(trx); diff --git a/proxy/src/vty.c b/proxy/src/vty.c index ab53147..c5fe6b7 100644 --- a/proxy/src/vty.c +++ b/proxy/src/vty.c @@ -292,6 +292,20 @@ return CMD_SUCCESS; } +DEFUN(cfg_ep_trxd_max_version, + cfg_ep_trxd_max_version_cmd, + "trxd-max-version <0-" OSMO_STRINGIFY_VAL(OSMO_TRXD_PDU_VER_MAX) ">", + "Set the highest TRXD PDU version SETFORMAT may negotiate " + "(default: " OSMO_STRINGIFY_VAL(OSMO_TRXD_PDU_VER_MAX) ")\n" + "TRXD PDU version\n") +{ + struct proxy_trx *trx = vty->index; + + trx->trxd_max_ver = atoi(argv[0]); + + return CMD_SUCCESS; +} + DEFUN(cfg_ep_clock_socket, cfg_ep_clock_socket_cmd, "clock-socket", @@ -345,6 +359,8 @@ vty_out(vty, " base-port %u%s", osmo_trx_ep_get_base_port(trx->ep), VTY_NEWLINE); vty_out(vty, " num-chans %u%s", trx->num_chans, VTY_NEWLINE); vty_out(vty, " tx-power %d%s", trx->tx_power, VTY_NEWLINE); + if (trx->trxd_max_ver < OSMO_TRXD_PDU_VER_MAX) + vty_out(vty, " trxd-max-version %u%s", trx->trxd_max_ver, VTY_NEWLINE); if (!osmo_trx_ep_get_clock_socket(trx->ep)) vty_out(vty, " no clock-socket%s", VTY_NEWLINE); @@ -450,6 +466,7 @@ install_element(EP_NODE, &cfg_ep_base_port_cmd); install_element(EP_NODE, &cfg_ep_num_chans_cmd); install_element(EP_NODE, &cfg_ep_tx_power_cmd); + install_element(EP_NODE, &cfg_ep_trxd_max_version_cmd); install_element(EP_NODE, &cfg_ep_clock_socket_cmd); install_element(EP_NODE, &cfg_ep_no_clock_socket_cmd); -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/43631?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: Ibd384ee57a728b709b1e43726b46c8c3840b5535 Gerrit-Change-Number: 43631 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-trx[master]: proxy: make TRXDv2+ PDU batching VTY-configurable
by fixeria 13 Sep '26

13 Sep '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/43632?usp=email ) Change subject: proxy: make TRXDv2+ PDU batching VTY-configurable ...................................................................... proxy: make TRXDv2+ PDU batching VTY-configurable Change-Id: I56c27db81d03bfbe58b4960e031a2f805df6e21b Related: OS#6672 --- M proxy/src/vty.c 1 file changed, 30 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/32/43632/1 diff --git a/proxy/src/vty.c b/proxy/src/vty.c index c5fe6b7..83f41da 100644 --- a/proxy/src/vty.c +++ b/proxy/src/vty.c @@ -306,6 +306,32 @@ return CMD_SUCCESS; } +DEFUN(cfg_ep_trxd_pdu_batch, + cfg_ep_trxd_pdu_batch_cmd, + "trxd-pdu-batch", + "Batch all BURST.ind PDUs of a TDMA frame into one datagram " + "(TRXDv2 and higher, default)\n") +{ + struct proxy_trx *trx = vty->index; + + osmo_trx_ep_set_pdu_batch(trx->ep, true); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ep_no_trxd_pdu_batch, + cfg_ep_no_trxd_pdu_batch_cmd, + "no trxd-pdu-batch", + NO_STR "Send one datagram per BURST.ind PDU instead of batching a " + "TDMA frame's worth into one\n") +{ + struct proxy_trx *trx = vty->index; + + osmo_trx_ep_set_pdu_batch(trx->ep, false); + + return CMD_SUCCESS; +} + DEFUN(cfg_ep_clock_socket, cfg_ep_clock_socket_cmd, "clock-socket", @@ -361,6 +387,8 @@ vty_out(vty, " tx-power %d%s", trx->tx_power, VTY_NEWLINE); if (trx->trxd_max_ver < OSMO_TRXD_PDU_VER_MAX) vty_out(vty, " trxd-max-version %u%s", trx->trxd_max_ver, VTY_NEWLINE); + if (!osmo_trx_ep_get_pdu_batch(trx->ep)) + vty_out(vty, " no trxd-pdu-batch%s", VTY_NEWLINE); if (!osmo_trx_ep_get_clock_socket(trx->ep)) vty_out(vty, " no clock-socket%s", VTY_NEWLINE); @@ -467,6 +495,8 @@ install_element(EP_NODE, &cfg_ep_num_chans_cmd); install_element(EP_NODE, &cfg_ep_tx_power_cmd); install_element(EP_NODE, &cfg_ep_trxd_max_version_cmd); + install_element(EP_NODE, &cfg_ep_trxd_pdu_batch_cmd); + install_element(EP_NODE, &cfg_ep_no_trxd_pdu_batch_cmd); install_element(EP_NODE, &cfg_ep_clock_socket_cmd); install_element(EP_NODE, &cfg_ep_no_clock_socket_cmd); -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/43632?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I56c27db81d03bfbe58b4960e031a2f805df6e21b Gerrit-Change-Number: 43632 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-trx[master]: proxy: check for PC clock skew
by fixeria 13 Sep '26

13 Sep '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/43633?usp=email ) Change subject: proxy: check for PC clock skew ...................................................................... proxy: check for PC clock skew This replicates the clock skew detection logic that exists in osmo-bts-trx (see trx_fn_timer_cb()). Change-Id: I256ff6a4f4a05ea5507b5d9395a946672ff4e306 Related: OS#6672 --- M proxy/src/clck_gen.c 1 file changed, 37 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/33/43633/1 diff --git a/proxy/src/clck_gen.c b/proxy/src/clck_gen.c index 6f7c4ed..d43b60f 100644 --- a/proxy/src/clck_gen.c +++ b/proxy/src/clck_gen.c @@ -27,9 +27,12 @@ #include <unistd.h> #include <stdint.h> #include <stdlib.h> +#include <time.h> +#include <inttypes.h> #include <osmocom/core/linuxlist.h> #include <osmocom/core/select.h> +#include <osmocom/core/timer_compat.h> #include <osmocom/gsm/gsm0502.h> #include <osmocom/trx/ep.h> @@ -43,27 +46,59 @@ /*! Default "IND CLOCK" period, in frames */ #define CLCK_GEN_IND_PERIOD 102 +/*! Maximum number of 'missed' frame periods we can tolerate before assuming + * the PC clock skewed (e.g. someone changed the system time, or the process + * got stuck/suspended for a while). */ +#define CLCK_GEN_MAX_FN_SKEW 50 + struct clck_gen { struct osmo_fd timerfd; uint32_t fn; bool running; int start_fn; /*!< CLCK_GEN_START_FN_RANDOM, or a fixed FN */ uint32_t ind_period; /*!< send "IND CLOCK" every N frames */ + struct timespec last_tick; /*!< CLOCK_MONOTONIC time of the last timer_cb() */ }; +/*! Number of micro-seconds elapsed between \a last and \a now */ +static int64_t compute_elapsed_us(const struct timespec *last, const struct timespec *now) +{ + struct timespec elapsed; + + timespecsub(now, last, &elapsed); + return (int64_t)(elapsed.tv_sec * 1000000) + (elapsed.tv_nsec / 1000); +} + static struct clck_gen g_clck_gen = { .start_fn = CLCK_GEN_START_FN_RANDOM, .ind_period = CLCK_GEN_IND_PERIOD, }; +static void clck_gen_stop(struct clck_gen *gen); + static int clck_gen_timer_cb(struct osmo_fd *ofd, unsigned int what) { struct clck_gen *gen = ofd->data; + struct timespec tv_now; uint64_t expire_count; + int64_t elapsed_us; if (read(ofd->fd, &expire_count, sizeof(expire_count)) != sizeof(expire_count)) return 0; + /* check for PC clock skew (system time change, process stalled/suspended, ...) */ + clock_gettime(CLOCK_MONOTONIC, &tv_now); + elapsed_us = compute_elapsed_us(&gen->last_tick, &tv_now); + gen->last_tick = tv_now; + if (elapsed_us > GSM_TDMA_FN_DURATION_uS * CLCK_GEN_MAX_FN_SKEW || elapsed_us < 0) { + LOGP(DTRXC, LOGL_FATAL, + "PC clock skew too high (elapsed %" PRId64 " us): " + "stopping the TDMA clock generator\n", + elapsed_us); + clck_gen_stop(gen); + return 0; + } + while (expire_count-- > 0) { const struct proxy_trx *trx; @@ -100,6 +135,8 @@ else gen->fn = (uint32_t)gen->start_fn; + clock_gettime(CLOCK_MONOTONIC, &gen->last_tick); + if (osmo_timerfd_schedule(&gen->timerfd, &first, &interval) < 0) { LOGP(DTRXC, LOGL_ERROR, "Failed to start the TDMA clock generator\n"); return; -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/43633?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I256ff6a4f4a05ea5507b5d9395a946672ff4e306 Gerrit-Change-Number: 43633 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-trx[master]: libosmo-trx/ep: make TRXDv2+ PDU batching configurable
by fixeria 13 Sep '26

13 Sep '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/43627?usp=email ) Change subject: libosmo-trx/ep: make TRXDv2+ PDU batching configurable ...................................................................... libosmo-trx/ep: make TRXDv2+ PDU batching configurable Change-Id: I60b8337db4ec8e70d37b2d9c0b75da338386ec47 Related: OS#6672 --- M libosmo-trx/include/osmocom/trx/ep.h M libosmo-trx/src/trx_ep.c M tests/libosmo-trx/trx_ep_test.c M tests/libosmo-trx/trx_ep_test.ok 4 files changed, 57 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/27/43627/1 diff --git a/libosmo-trx/include/osmocom/trx/ep.h b/libosmo-trx/include/osmocom/trx/ep.h index 9f1e589..26d8154 100644 --- a/libosmo-trx/include/osmocom/trx/ep.h +++ b/libosmo-trx/include/osmocom/trx/ep.h @@ -110,6 +110,9 @@ int osmo_trx_ep_set_ctrl_promisc(struct osmo_trx_ep *ep, bool enable); bool osmo_trx_ep_get_ctrl_promisc(const struct osmo_trx_ep *ep); +void osmo_trx_ep_set_pdu_batch(struct osmo_trx_ep *ep, bool enable); +bool osmo_trx_ep_get_pdu_batch(const struct osmo_trx_ep *ep); + /*! Per-channel TRXD PDU version in use (set after SETFORMAT negotiation) */ int osmo_trx_ep_set_pdu_ver(struct osmo_trx_ep *ep, unsigned int chan, uint8_t ver); int osmo_trx_ep_get_pdu_ver(const struct osmo_trx_ep *ep, unsigned int chan); diff --git a/libosmo-trx/src/trx_ep.c b/libosmo-trx/src/trx_ep.c index e08e61a..074d4ad 100644 --- a/libosmo-trx/src/trx_ep.c +++ b/libosmo-trx/src/trx_ep.c @@ -82,6 +82,9 @@ #define OSMO_TRX_EP_F_PENDING_FREE (1 << 2) /*! Leave the ctrl socket unconnected, accepting/replying to any peer */ #define OSMO_TRX_EP_F_CTRL_PROMISC (1 << 3) +/*! Send one datagram per PDU instead of batching a TDMA frame's worth of + * BURST.ind/req PDUs into one, even if TRXDv2+ is negotiated */ +#define OSMO_TRX_EP_F_NO_PDU_BATCH (1 << 4) struct osmo_trx_ep { uint32_t flags; /* see OSMO_TRX_EP_F_* */ @@ -800,6 +803,26 @@ return ep->flags & OSMO_TRX_EP_F_CTRL_PROMISC; } +/*! Enable/disable batching BURST.ind/req PDUs on the data sockets (default: + * true): when enabled and TRXDv2 (or higher) is negotiated on a channel, a + * TDMA frame's worth of PDUs is accumulated and sent in a single datagram + * (see osmo_trx_ep_send_burst_ind()/_req()); when disabled, every PDU is + * sent in its own datagram regardless of the negotiated TRXD PDU version, + * trading datagram count for latency. May be changed at any time. */ +void osmo_trx_ep_set_pdu_batch(struct osmo_trx_ep *ep, bool enable) +{ + if (enable) + ep->flags &= ~OSMO_TRX_EP_F_NO_PDU_BATCH; + else + ep->flags |= OSMO_TRX_EP_F_NO_PDU_BATCH; +} + +/*! Whether batching BURST.ind/req PDUs on the data sockets is enabled */ +bool osmo_trx_ep_get_pdu_batch(const struct osmo_trx_ep *ep) +{ + return ~ep->flags & OSMO_TRX_EP_F_NO_PDU_BATCH; +} + /*! Set the name (log prefix) of the given instance, e.g. "phy0" */ int osmo_trx_ep_set_name(struct osmo_trx_ep *ep, const char *fmt, ...) { @@ -960,8 +983,8 @@ return rc; } - /* TRXDv2 and higher: wait for the batching breaker */ - if (c->pdu_ver >= 2) { + /* TRXDv2 and higher: wait for the batching breaker (unless disabled) */ + if (c->pdu_ver >= 2 && (~ep->flags & OSMO_TRX_EP_F_NO_PDU_BATCH)) { c->tx_msg = msg; return 0; } @@ -1022,8 +1045,8 @@ return rc; } - /* TRXDv2 and higher: wait for the batching breaker */ - if (c->pdu_ver >= 2) { + /* TRXDv2 and higher: wait for the batching breaker (unless disabled) */ + if (c->pdu_ver >= 2 && (~ep->flags & OSMO_TRX_EP_F_NO_PDU_BATCH)) { c->tx_msg = msg; return 0; } diff --git a/tests/libosmo-trx/trx_ep_test.c b/tests/libosmo-trx/trx_ep_test.c index cd57ba8..a4227f0 100644 --- a/tests/libosmo-trx/trx_ep_test.c +++ b/tests/libosmo-trx/trx_ep_test.c @@ -279,6 +279,18 @@ printf("BURST.req batch breaker\n"); flush_io(); + printf("=== %s(): BURST.req, TRXDv2 with batching disabled (BTS -> TRX) ===\n", __func__); + OSMO_ASSERT(osmo_trx_ep_get_pdu_batch(ep_bts) == true); + osmo_trx_ep_set_pdu_batch(ep_bts, false); + OSMO_ASSERT(osmo_trx_ep_get_pdu_batch(ep_bts) == false); + fill_burst_req(&br, 300000); + br.tn = 1; + OSMO_ASSERT(osmo_trx_ep_send_burst_req(ep_bts, 0, &br) == 0); + /* nothing was accumulated: the breaker has nothing to flush */ + OSMO_ASSERT(osmo_trx_ep_send_burst_req(ep_bts, 0, NULL) == -ENOMSG); + flush_io(); + osmo_trx_ep_set_pdu_batch(ep_bts, true); /* restore default */ + printf("=== %s(): BURST.ind batch, TRXDv2 with NOPE (TRX -> BTS) ===\n", __func__); /* an empty batch cannot be flushed */ OSMO_ASSERT(osmo_trx_ep_send_burst_ind(ep_trx, 0, NULL) == -ENOMSG); @@ -295,6 +307,17 @@ printf("BURST.ind batch breaker\n"); flush_io(); + printf("=== %s(): BURST.ind, TRXDv2 with batching disabled (TRX -> BTS) ===\n", __func__); + OSMO_ASSERT(osmo_trx_ep_get_pdu_batch(ep_trx) == true); + osmo_trx_ep_set_pdu_batch(ep_trx, false); + OSMO_ASSERT(osmo_trx_ep_get_pdu_batch(ep_trx) == false); + fill_burst_ind(&bi, 300005); + OSMO_ASSERT(osmo_trx_ep_send_burst_ind(ep_trx, 0, &bi) == 0); + /* nothing was accumulated: the breaker has nothing to flush */ + OSMO_ASSERT(osmo_trx_ep_send_burst_ind(ep_trx, 0, NULL) == -ENOMSG); + flush_io(); + osmo_trx_ep_set_pdu_batch(ep_trx, true); /* restore default */ + ep_close_free(ep_trx); ep_close_free(ep_bts); } diff --git a/tests/libosmo-trx/trx_ep_test.ok b/tests/libosmo-trx/trx_ep_test.ok index eb39457..84de3c7 100644 --- a/tests/libosmo-trx/trx_ep_test.ok +++ b/tests/libosmo-trx/trx_ep_test.ok @@ -22,10 +22,14 @@ BURST.req batch breaker trx: rx_burst_req(chan=0): BURST.req tn=1 fn=200000 att=10 trx_num=0 mod=GMSK set=0 tsc=7 burst_len=148 trx: rx_burst_req(chan=0): BURST.req tn=2 fn=200000 att=10 trx_num=0 mod=GMSK set=0 tsc=7 burst_len=148 +=== test_burst_req_ind(): BURST.req, TRXDv2 with batching disabled (BTS -> TRX) === +trx: rx_burst_req(chan=0): BURST.req tn=1 fn=300000 att=10 trx_num=0 mod=GMSK set=0 tsc=7 burst_len=148 === test_burst_req_ind(): BURST.ind batch, TRXDv2 with NOPE (TRX -> BTS) === BURST.ind batch breaker bts: rx_burst_ind(chan=0): NOPE.ind tn=5 fn=200005 trx_num=0 rssi=-63 toa256=-512 C/I=-150 cB bts: rx_burst_ind(chan=0): BURST.ind tn=6 fn=200005 trx_num=0 rssi=-63 toa256=-512 C/I=-150 cB mod=GMSK set=0 tsc=7 burst_len=148 +=== test_burst_req_ind(): BURST.ind, TRXDv2 with batching disabled (TRX -> BTS) === +bts: rx_burst_ind(chan=0): BURST.ind tn=5 fn=300005 trx_num=0 rssi=-63 toa256=-512 C/I=-150 cB mod=GMSK set=0 tsc=7 burst_len=148 === test_ctrl_close_flush(do_free=0): starting testcase === === test_ctrl_close_flush(): TRXC CMDs sent right before osmo_trx_ep_close() (BTS -> TRX) === bts: closed_cb() -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/43627?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I60b8337db4ec8e70d37b2d9c0b75da338386ec47 Gerrit-Change-Number: 43627 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-trx[master]: proxy: make clck_gen start Fn and period configurable
by fixeria 13 Sep '26

13 Sep '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/43628?usp=email ) Change subject: proxy: make clck_gen start Fn and period configurable ...................................................................... proxy: make clck_gen start Fn and period configurable Change-Id: I85bc0a1e4674685c7ddcf6627d139f4b8268f7a6 --- M proxy/include/osmocom/proxy/clck_gen.h M proxy/src/clck_gen.c M proxy/src/vty.c 3 files changed, 109 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/28/43628/1 diff --git a/proxy/include/osmocom/proxy/clck_gen.h b/proxy/include/osmocom/proxy/clck_gen.h index 7bc5e74..b60827c 100644 --- a/proxy/include/osmocom/proxy/clck_gen.h +++ b/proxy/include/osmocom/proxy/clck_gen.h @@ -1,5 +1,9 @@ #pragma once +/*! Special value for clck_gen_{get,set}_start_fn() meaning + * a random starting TDMA frame number (default). */ +#define CLCK_GEN_START_FN_RANDOM (-1) + int clck_gen_init(void); /*! Re-evaluate g_proxy_ctx->trx_list and (re)start or stop the (single, @@ -7,3 +11,20 @@ * currently powered on. Call this after changing any struct proxy_trx's * ->powered field. */ void clck_gen_trx_list_updated(void); + +/*! Set the frame number the clock generator starts counting from the next + * time it (re)starts: either a fixed FN, or CLCK_GEN_START_FN_RANDOM to + * pick a random one (default). Returns 0 on success, -EINVAL if fn is + * neither CLCK_GEN_START_FN_RANDOM nor a valid FN. */ +int clck_gen_set_start_fn(int fn); + +/*! Get the currently configured starting frame number, or + * CLCK_GEN_START_FN_RANDOM if set to pick a random one. */ +int clck_gen_get_start_fn(void); + +/*! Set how many frames apart "IND CLOCK" is sent (default: 102). Returns 0 + * on success, -EINVAL if period is 0 or exceeds the TDMA hyperframe length. */ +int clck_gen_set_ind_period(unsigned int period); + +/*! Get the currently configured "IND CLOCK" period, in frames. */ +unsigned int clck_gen_get_ind_period(void); diff --git a/proxy/src/clck_gen.c b/proxy/src/clck_gen.c index 39c0c03..acafab0 100644 --- a/proxy/src/clck_gen.c +++ b/proxy/src/clck_gen.c @@ -23,8 +23,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <errno.h> #include <unistd.h> #include <stdint.h> +#include <stdlib.h> #include <osmocom/core/linuxlist.h> #include <osmocom/core/select.h> @@ -37,16 +39,21 @@ #include <osmocom/proxy/clck_gen.h> #include <osmocom/proxy/logging.h> -/*! Send "IND CLOCK" every N frames (matches fake_trx.py's CLCKGen default) */ +/*! Default "IND CLOCK" period, in frames */ #define CLCK_GEN_IND_PERIOD 102 struct clck_gen { struct osmo_fd timerfd; uint32_t fn; bool running; + int start_fn; /*!< CLCK_GEN_START_FN_RANDOM, or a fixed FN */ + uint32_t ind_period; /*!< send "IND CLOCK" every N frames */ }; -static struct clck_gen g_clck_gen; +static struct clck_gen g_clck_gen = { + .start_fn = CLCK_GEN_START_FN_RANDOM, + .ind_period = CLCK_GEN_IND_PERIOD, +}; static int clck_gen_timer_cb(struct osmo_fd *ofd, unsigned int what) { @@ -59,7 +66,7 @@ while (expire_count-- > 0) { const struct proxy_trx *trx; - if (gen->fn % CLCK_GEN_IND_PERIOD == 0) { + if (gen->fn % gen->ind_period == 0) { llist_for_each_entry(trx, &g_proxy_ctx->trx_list, list) { if (!trx->powered) continue; @@ -87,14 +94,19 @@ if (gen->running) return; - gen->fn = 0; + if (gen->start_fn == CLCK_GEN_START_FN_RANDOM) + gen->fn = rand() % GSM_TDMA_HYPERFRAME; + else + gen->fn = (uint32_t)gen->start_fn; + if (osmo_timerfd_schedule(&gen->timerfd, &first, &interval) < 0) { LOGP(DTRXC, LOGL_ERROR, "Failed to start the TDMA clock generator\n"); return; } gen->running = true; - LOGP(DTRXC, LOGL_NOTICE, "TDMA clock generator started\n"); + LOGP(DTRXC, LOGL_NOTICE, "TDMA clock generator started (fn=%u, period=%u)\n", + gen->fn, gen->ind_period); } static void clck_gen_stop(struct clck_gen *gen) @@ -129,3 +141,31 @@ &clck_gen_timer_cb, &g_clck_gen); } + +int clck_gen_set_start_fn(int fn) +{ + if (fn < CLCK_GEN_START_FN_RANDOM || fn >= GSM_TDMA_HYPERFRAME) + return -EINVAL; + + g_clck_gen.start_fn = fn; + return 0; +} + +int clck_gen_get_start_fn(void) +{ + return g_clck_gen.start_fn; +} + +int clck_gen_set_ind_period(unsigned int period) +{ + if (period == 0 || period > GSM_TDMA_HYPERFRAME) + return -EINVAL; + + g_clck_gen.ind_period = period; + return 0; +} + +unsigned int clck_gen_get_ind_period(void) +{ + return g_clck_gen.ind_period; +} diff --git a/proxy/src/vty.c b/proxy/src/vty.c index 7b863c4..ab53147 100644 --- a/proxy/src/vty.c +++ b/proxy/src/vty.c @@ -42,6 +42,7 @@ #include <osmocom/proxy/vty.h> #include <osmocom/proxy/trx.h> #include <osmocom/proxy/path_sim.h> +#include <osmocom/proxy/clck_gen.h> extern void *g_talloc_ctx; @@ -144,6 +145,41 @@ return CMD_SUCCESS; } +DEFUN(cfg_proxy_clck_gen_start_fn, + cfg_proxy_clck_gen_start_fn_cmd, + "clck-gen start-fn (random|<0-2715647>)", + "Configure the shared TDMA clock generator\n" + "Set the frame number the clock generator starts counting from\n" + "Start from a random frame number every time it (re)starts (default)\n" + "Start from this fixed frame number\n") +{ + int fn = !strcmp(argv[0], "random") ? CLCK_GEN_START_FN_RANDOM : atoi(argv[0]); + + if (clck_gen_set_start_fn(fn) < 0) { + vty_out(vty, "%% Invalid starting frame number: %d%s", fn, VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + +DEFUN(cfg_proxy_clck_gen_ind_period, + cfg_proxy_clck_gen_ind_period_cmd, + "clck-gen ind-period <1-2715648>", + "Configure the shared TDMA clock generator\n" + "Set how many frames apart \"IND CLOCK\" is sent (default: 102)\n" + "Period in frames\n") +{ + unsigned int period = atoi(argv[0]); + + if (clck_gen_set_ind_period(period) < 0) { + vty_out(vty, "%% Invalid IND CLOCK period: %u%s", period, VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + DEFUN(cfg_proxy_ep, cfg_proxy_ep_cmd, "ep NAME", @@ -287,6 +323,11 @@ vty_out(vty, "proxy%s", VTY_NEWLINE); if (g_proxy_ctx->bind_addr) vty_out(vty, " bind-addr %s%s", g_proxy_ctx->bind_addr, VTY_NEWLINE); + if (clck_gen_get_start_fn() == CLCK_GEN_START_FN_RANDOM) + vty_out(vty, " clck-gen start-fn random%s", VTY_NEWLINE); + else + vty_out(vty, " clck-gen start-fn %d%s", clck_gen_get_start_fn(), VTY_NEWLINE); + vty_out(vty, " clck-gen ind-period %u%s", clck_gen_get_ind_period(), VTY_NEWLINE); vty_out(vty, " pm-rssi-noise %d%s", path_sim_cfg_get_noise_dbm(g_proxy_ctx->path_sim), VTY_NEWLINE); vty_out(vty, " path-loss %d%s", path_sim_cfg_get_path_loss_db(g_proxy_ctx->path_sim), VTY_NEWLINE); vty_out(vty, " nominal-toa256 %d%s", path_sim_cfg_get_nom_toa256(g_proxy_ctx->path_sim), VTY_NEWLINE); @@ -398,6 +439,8 @@ install_element(PROXY_NODE, &cfg_proxy_path_loss_cmd); install_element(PROXY_NODE, &cfg_proxy_nom_toa256_cmd); install_element(PROXY_NODE, &cfg_proxy_nom_ci_cmd); + install_element(PROXY_NODE, &cfg_proxy_clck_gen_start_fn_cmd); + install_element(PROXY_NODE, &cfg_proxy_clck_gen_ind_period_cmd); install_element(PROXY_NODE, &cfg_proxy_ep_cmd); install_element(PROXY_NODE, &cfg_no_proxy_ep_cmd); -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/43628?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I85bc0a1e4674685c7ddcf6627d139f4b8268f7a6 Gerrit-Change-Number: 43628 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-trx[master]: proxy: reset all per-chan parameters on POWEROFF
by fixeria 13 Sep '26

13 Sep '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/43630?usp=email ) Change subject: proxy: reset all per-chan parameters on POWEROFF ...................................................................... proxy: reset all per-chan parameters on POWEROFF Change-Id: Ife14ed20614d39c385531ba0fe4fd728cebc6675 Related: OS#6672 --- M proxy/src/trx.c 1 file changed, 24 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/30/43630/1 diff --git a/proxy/src/trx.c b/proxy/src/trx.c index 0c4176b..96e9fea 100644 --- a/proxy/src/trx.c +++ b/proxy/src/trx.c @@ -29,6 +29,7 @@ #include <osmocom/core/utils.h> #include <osmocom/core/talloc.h> #include <osmocom/core/linuxlist.h> +#include <osmocom/core/msgb.h> #include <osmocom/gsm/gsm_utils.h> #include <osmocom/gsm/gsm0502.h> @@ -101,6 +102,22 @@ talloc_free(trx); } +static void proxy_trx_chan_reset_params(struct proxy_trx *trx, unsigned int chan) +{ + struct proxy_trx_chan *c = &trx->chans[chan]; + + c->rx_freq = 0; + c->tx_freq = 0; + c->rf_muted = false; + talloc_free(c->fh); + c->fh = NULL; + path_sim_state_reset(&c->path_sim, trx->tx_power, + path_sim_cfg_get_nom_toa256(g_proxy_ctx->path_sim), + path_sim_cfg_get_nom_ci_cb(g_proxy_ctx->path_sim)); + memset(c->ts, 0, sizeof(c->ts)); + msgb_queue_free(&c->tx_burst_queue); +} + void proxy_trx_set_power(struct proxy_trx *trx, bool on) { if (trx->powered == on) @@ -109,7 +126,14 @@ LOGP_TRX(trx, DTRXC, LOGL_INFO, "Power %s\n", on ? "on" : "off"); + /* reset all per-chan parameters on POWEROFF */ + if (!on) { + for (unsigned int chan = 0; chan < trx->num_chans; chan++) + proxy_trx_chan_reset_params(trx, chan); + } + trx->powered = on; + clck_gen_trx_list_updated(); } -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/43630?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: Ife14ed20614d39c385531ba0fe4fd728cebc6675 Gerrit-Change-Number: 43630 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • ...
  • 190
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.