fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/42911?usp=email )
Change subject: common: stop buffering UL measurements when SACCH is deactivated ......................................................................
common: stop buffering UL measurements when SACCH is deactivated
When the BSC sends RSL DEACT SACCH, the per-SACCH UL measurement drain stops (it runs on SACCH timing), but the producer in lchan_new_ul_meas() keeps appending the measurement contributions from every received TCH/SDCCH burst. After one SACCH period (104 frames) the 104-slot uplink measurement buffer fills up, yielding a flood of:
NOTICE measurement.c:336 no space for uplink measurement, num_ul_meas=104
Add a bool sacch_active flag to gsm_lchan, set to true in the common l1sap_chan_act() and clear in l1sap_chan_deact_sacch(). Guard lchan_new_ul_meas() with this flag so that measurements are silently discarded while SACCH is inactive - there is nothing to drain the buffer and no SACCH channel on which to report the results to the BSC.
Change-Id: I3943c788cab5d2411b06ac681d4d412852bac0a7 AI-Assisted: yes (Claude) --- M include/osmo-bts/lchan.h M src/common/l1sap.c M src/common/measurement.c 3 files changed, 9 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/11/42911/1
diff --git a/include/osmo-bts/lchan.h b/include/osmo-bts/lchan.h index 071197d..909768d 100644 --- a/include/osmo-bts/lchan.h +++ b/include/osmo-bts/lchan.h @@ -210,6 +210,7 @@ * want_dl_sacch_active indicates whether dl SACCH should be activated on CHAN ACT. */ bool want_dl_sacch_active; + bool ul_sacch_active; /* UL SACCH measurements active (cleared by RSL DEACT SACCH) */
/* Number of different GsmL1_Sapi_t used in osmo_bts_sysmo is 23. * Currently we don't share these headers so this is a magic number. */ diff --git a/src/common/l1sap.c b/src/common/l1sap.c index f11bb2c..ae89d23 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -2982,6 +2982,7 @@ LOGPLCHAN(lchan, DL1C, LOGL_INFO, "Activating channel %s\n", rsl_chan_nr_str(chan_nr));
radio_link_timeout_reset(lchan); + lchan->ul_sacch_active = true;
rc = l1sap_chan_act_dact_modify(trx, chan_nr, PRIM_INFO_ACTIVATE, 0); if (rc) @@ -3055,6 +3056,8 @@ LOGPLCHAN(lchan, DL1C, LOGL_INFO, "Deactivating SACCH on channel %s\n", rsl_chan_nr_str(chan_nr));
+ lchan->ul_sacch_active = false; + return l1sap_chan_act_dact_modify(trx, chan_nr, PRIM_INFO_DEACTIVATE, 1); } diff --git a/src/common/measurement.c b/src/common/measurement.c index afbdc84..8bb3e6e 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -332,6 +332,11 @@ gsm_lchans_name(lchan->state), lchan->meas.num_ul_meas, fn_mod); }
+ /* No point buffering measurements when SACCH is deactivated: the drain + * runs on SACCH timing, so the buffer would fill up and overflow. */ + if (!lchan->ul_sacch_active) + return 0; + if (lchan->meas.num_ul_meas >= ARRAY_SIZE(lchan->meas.uplink)) { LOGPLCFN(lchan, fn, DMEAS, LOGL_NOTICE, "no space for uplink measurement, num_ul_meas=%d, fn_mod=%u\n", lchan->meas.num_ul_meas,