fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/42909?usp=email )
Change subject: common: reset lchan meas state in gsm_lchan_release() ......................................................................
common: reset lchan meas state in gsm_lchan_release()
lchan->meas (including interf_meas_num and num_ul_meas) is normally only reset by lchan_meas_reset() called from rsl_tx_chan_act_ack() on RSL CHANNEL ACTIVATION. Idle logical channels are never RSL-activated, so their measurement state is never reset via that path.
On an OML link re-establishment, osmo-bts does not exit: abis.c tears down the signalling links, the bts_shutdown FSM powers down all TRXs, and then waits for reconnect. The gsm_bts/trx/ts/lchan structures remain in memory, so stale interf_meas_num survives the reconnect.
This is why we're seeing these ERRORs while running ttcn3-bts-test:
(bts=0,trx=2,ts=4,ss=6) Not enough room to store interference report (0dBm)
Add a lchan_meas_reset() call to gsm_lchan_release(), which is called from gsm_ts_release() when the nm_channel_fsm enters state NM_CHAN_ST_OP_DISABLED_NOTINSTALLED. This is exactly the right moment: the radio is fully stopped, so no new samples arrive.
Change-Id: I18dc9d30417b0c5b2e579660d4a087d93445f956 AI-Assisted: yes (Claude) --- M src/common/lchan.c 1 file changed, 6 insertions(+), 0 deletions(-)
Approvals: laforge: Looks good to me, but someone else must approve pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified fixeria: Looks good to me, approved
diff --git a/src/common/lchan.c b/src/common/lchan.c index 1fdb3f1..65be89f 100644 --- a/src/common/lchan.c +++ b/src/common/lchan.c @@ -34,6 +34,7 @@ #include <osmo-bts/bts_model.h> #include <osmo-bts/asci.h> #include <osmo-bts/ta_control.h> +#include <osmo-bts/measurement.h> #include <errno.h>
static const struct value_string lchan_s_names[] = { @@ -224,6 +225,11 @@ /* reset all Abis related config: */ memset(&lchan->abis_ip, 0, sizeof(lchan->abis_ip));
+ /* Unconditionally reset measurement state to prevent stale + * interf_meas_num/num_ul_meas from accumulating across an OML + * link re-establishment (idle lchans skip RSL activation). */ + lchan_meas_reset(lchan); + /* FIXME: right now we allow creating the rtp_socket even if chan is not * activated... Once we check for that, we can move this check at the * start of the function */