Change in osmo-bts[master]: osmo-bts-trx: fix resource leak in bts_model_trx_deact_rf()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Wed Aug 5 22:31:20 UTC 2020


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/19537 )


Change subject: osmo-bts-trx: fix resource leak in bts_model_trx_deact_rf()
......................................................................

osmo-bts-trx: fix resource leak in bts_model_trx_deact_rf()

I noticed that "RF-locking" a transceiver with active connections
(e.g. voice calls) leads to a resource leak: the BSC would continue
to consider the associated logical channels occupied, so the MSC
would also consider the CS connections active (if any).

The radio link timeout counter is expected prevent such cases, but
it's driven by either valid SACCH blocks, or bad frame indications
triggered by NOPE indications from transceiver.  The problem is
that we basically reset the scheduler in bts_model_trx_deact_rf(),
and stop sending / receiving bursts, so this counter would be lost.

Let's ensure that RSL Radio Link Failure indications are sent to
the BSC for all active logical channels that "survied" after the
ramping down.  This is exactly what the other BTS models do.

Change-Id: Id20d12f76b1aac5c81a79eb293e537ed41a1c28a
Related: OS#4694
---
M src/osmo-bts-trx/l1_if.c
1 file changed, 25 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/37/19537/1

diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index a2b3415..c4c743f 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -213,6 +213,31 @@
 	struct phy_instance *pinst = trx_phy_instance(trx);
 	struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
 	enum gsm_phys_chan_config pchan = trx->ts[0].pchan;
+	unsigned int tn, ln;
+
+	/* Send RSL Radio Link Failure for all active DCCHs */
+	for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++) {
+		const struct gsm_bts_trx_ts *ts = &trx->ts[tn];
+		if (ts->pchan == GSM_PCHAN_NONE)
+			continue;
+
+		for (ln = 0; ln < ARRAY_SIZE(ts->lchan); ln++) {
+			const struct gsm_lchan *lchan = &ts->lchan[ln];
+			if (lchan->state != LCHAN_S_ACTIVE)
+				continue;
+
+			switch (lchan->type) {
+			case GSM_LCHAN_SDCCH:
+			case GSM_LCHAN_TCH_F:
+			case GSM_LCHAN_TCH_H:
+				rsl_tx_conn_fail(lchan, RSL_ERR_RADIO_LINK_FAIL);
+				break;
+			default:
+				/* Make GCC happy */
+				continue;
+			}
+		}
+	}
 
 	/* close all logical channels and reset timeslots */
 	trx_sched_reset(&l1h->l1s);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/19537
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Id20d12f76b1aac5c81a79eb293e537ed41a1c28a
Gerrit-Change-Number: 19537
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200805/bb2e90ba/attachment.htm>


More information about the gerrit-log mailing list