Change in osmo-bsc[master]: Avoid selecting channels from administratively locked trx

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/.

pespin gerrit-no-reply at lists.osmocom.org
Tue Jun 23 14:21:20 UTC 2020


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/18965 )

Change subject: Avoid selecting channels from administratively locked trx
......................................................................

Avoid selecting channels from administratively locked trx

Found while playing with "rf_locked 1" on a 2TRX setup with channel
allocator descend. After applying the setting, the 1st TRX is still used
to allocate the channels. After this patch is applied, the BSC correctly
allocates channels from TRX0.

Change-Id: I5201d2749363c9cbd0706177bde09117b163cbe3
---
M src/osmo-bsc/abis_nm.c
M src/osmo-bsc/gsm_data.c
M src/osmo-bsc/osmo_bsc_main.c
M tests/handover/handover_test.c
4 files changed, 11 insertions(+), 8 deletions(-)

Approvals:
  laforge: 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
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c
index b6d1ec5..e17c6f5 100644
--- a/src/osmo-bsc/abis_nm.c
+++ b/src/osmo-bsc/abis_nm.c
@@ -848,9 +848,6 @@
 
 		if (!trx_is_usable(trx))
 			return false;
-
-		if (trx->mo.nm_state.administrative == NM_STATE_LOCKED)
-			return false;
 	}
 
 	return true;
diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index 2098f13..f790b90 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -1459,10 +1459,13 @@
 }
 
 bool nm_is_running(const struct gsm_nm_state *s) {
-	return (s->operational == NM_OPSTATE_ENABLED) && (
-		(s->availability == NM_AVSTATE_OK) ||
-		(s->availability == 0xff)
-	);
+	if (s->operational != NM_OPSTATE_ENABLED)
+		return false;
+	if ((s->availability != NM_AVSTATE_OK) && (s->availability != 0xff))
+		return false;
+	if (s->administrative != NM_STATE_UNLOCKED)
+		return false;
+	return true;
 }
 
 /* determine the logical channel type based on the physical channel type */
diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index 9eaaf2a..5fd02dd 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -306,7 +306,7 @@
 	 * This ensures that RACH control in system information is configured correctly.
 	 * TRX 0 should be usable and unlocked, otherwise starting ACC ramping is pointless.
 	 */
-	if (trx_is_usable(trx) && trx->mo.nm_state.administrative == NM_STATE_UNLOCKED)
+	if (trx_is_usable(trx))
 		acc_ramp_trigger(&trx->bts->acc_ramp);
 
 	gsm_bts_trx_set_system_infos(trx);
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index b08e2a3..1a756cd 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -197,14 +197,17 @@
 
 	bts->c0->mo.nm_state.operational = NM_OPSTATE_ENABLED;
 	bts->c0->mo.nm_state.availability = NM_AVSTATE_OK;
+	bts->c0->mo.nm_state.administrative = NM_STATE_UNLOCKED;
 	bts->c0->bb_transc.mo.nm_state.operational = NM_OPSTATE_ENABLED;
 	bts->c0->bb_transc.mo.nm_state.availability = NM_AVSTATE_OK;
+	bts->c0->bb_transc.mo.nm_state.administrative = NM_STATE_UNLOCKED;
 
 	/* 4 full rate and 4 half rate channels */
 	for (i = 1; i <= 6; i++) {
 		bts->c0->ts[i].pchan_from_config = (i < 5) ? GSM_PCHAN_TCH_F : GSM_PCHAN_TCH_H;
 		bts->c0->ts[i].mo.nm_state.operational = NM_OPSTATE_ENABLED;
 		bts->c0->ts[i].mo.nm_state.availability = NM_AVSTATE_OK;
+		bts->c0->ts[i].mo.nm_state.administrative = NM_STATE_UNLOCKED;
 	}
 
 	for (i = 0; i < ARRAY_SIZE(bts->c0->ts); i++) {

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I5201d2749363c9cbd0706177bde09117b163cbe3
Gerrit-Change-Number: 18965
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200623/8e735db6/attachment.htm>


More information about the gerrit-log mailing list