Change in osmo-bsc[master]: hodec2: implement upgrade TCH/H -> TCH/F (without AFS bias)

neels gerrit-no-reply at lists.osmocom.org
Tue Jun 8 01:04:27 UTC 2021


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/24607 )


Change subject: hodec2: implement upgrade TCH/H -> TCH/F (without AFS bias)
......................................................................

hodec2: implement upgrade TCH/H -> TCH/F (without AFS bias)

Pass flag into find_alternative_lchan() indicating that a TCH/H channel
has low ratings (rxqual or rxlev, doesn't matter).

Heed this flag in the last round, the requirement A check, and allow
candidates that have equal rxlev, if they result in an upgrade from
TCH/H to TCH/F. This allows intra-cell upgrades to TCH/F.

An important point is that this patch allows upgrade to TCH/F *without*
the AFS bias setting. See also I315f24123ae016887ab91666870ce252e096f90f.

Related: SYS#5198 SYS#5365
Change-Id: Id40d1cf8b58410c7d4eb87407fe8b8106e352438
---
M src/osmo-bsc/handover_decision_2.c
M tests/handover/test_amr_tch_h_to_f_rxlev.ho_vty
M tests/handover/test_amr_tch_h_to_f_rxlev_congested.ho_vty
M tests/handover/test_amr_tch_h_to_f_rxqual.ho_vty
M tests/handover/test_amr_tch_h_to_f_rxqual_congested.ho_vty
5 files changed, 34 insertions(+), 54 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/07/24607/1

diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c
index a866293..9d4f1e9 100644
--- a/src/osmo-bsc/handover_decision_2.c
+++ b/src/osmo-bsc/handover_decision_2.c
@@ -1251,7 +1251,7 @@
  * If minimum RXLEV, minimum RXQUAL or maximum TA are exceeded, the caller should pass
  * include_weaker_rxlev=true so that handover is performed despite congestion.
  */
-static int find_alternative_lchan(struct gsm_lchan *lchan, bool include_weaker_rxlev)
+static int find_alternative_lchan(struct gsm_lchan *lchan, bool include_weaker_rxlev, bool request_upgrade_to_tch_f)
 {
 	struct gsm_bts *bts = lchan->ts->trx->bts;
 	int ahs = (gsm48_chan_mode_to_non_vamos(lchan->current_ch_mode_rate.chan_mode) == GSM48_CMODE_SPEECH_AMR
@@ -1372,7 +1372,11 @@
 		    && clist[i].target.bts)
 			afs_bias = ho_get_hodec2_afs_bias_rxlev(clist[i].target.bts->ho);
 		better += afs_bias;
-		if (better > best_better_db) {
+		if (better > best_better_db
+		    || (better >= best_better_db /* Upgrade from TCH/H to TCH/F: allow for equal rxlev */
+			&& request_upgrade_to_tch_f
+			&& is_upgrade_to_tchf(&clist[i], REQUIREMENT_A_MASK))) {
+
 			best_cand = &clist[i];
 			best_better_db = better;
 			best_applied_afs_bias = afs_bias? true : false;
@@ -1494,7 +1498,7 @@
 			global_ho_reason = HO_REASON_BAD_QUALITY;
 			LOGPHOLCHAN(lchan, LOGL_INFO, "Trying handover/assignment due to bad quality\n");
 		}
-		find_alternative_lchan(lchan, true);
+		find_alternative_lchan(lchan, true, true);
 		return;
 	}
 
@@ -1503,7 +1507,7 @@
 		global_ho_reason = HO_REASON_LOW_RXLEVEL;
 		LOGPHOLCHAN(lchan, LOGL_NOTICE, "RX level is TOO LOW: %d < %d\n",
 			    rxlev2dbm(av_rxlev), ho_get_hodec2_min_rxlev(bts->ho));
-		find_alternative_lchan(lchan, true);
+		find_alternative_lchan(lchan, true, true);
 		return;
 	}
 
@@ -1521,7 +1525,7 @@
 		gsm_bts_cell_id(&bts_id, bts);
 		penalty_timers_add(lchan->conn, &lchan->conn->hodec2.penalty_timers, &bts_id,
 				   ho_get_hodec2_penalty_max_dist(bts->ho));
-		find_alternative_lchan(lchan, true);
+		find_alternative_lchan(lchan, true, false);
 		return;
 	}
 
@@ -1532,7 +1536,7 @@
 	/* try handover to a better cell */
 	if (av_rxlev >= 0 && (mr->nr % pwr_interval) == 0) {
 		global_ho_reason = HO_REASON_BETTER_CELL;
-		find_alternative_lchan(lchan, false);
+		find_alternative_lchan(lchan, false, false);
 	}
 }
 
diff --git a/tests/handover/test_amr_tch_h_to_f_rxlev.ho_vty b/tests/handover/test_amr_tch_h_to_f_rxlev.ho_vty
index 34fb5e6..a22ad6d 100644
--- a/tests/handover/test_amr_tch_h_to_f_rxlev.ho_vty
+++ b/tests/handover/test_amr_tch_h_to_f_rxlev.ho_vty
@@ -12,7 +12,5 @@
 expect-no-chan
 meas-rep lchan 0 0 4 0 rxlev 23 rxqual 1 ta 0
 # average rxlev is now -110 + 23 = -87 < -80: reassign to TCH/F due to bad rxlev
-#expect-as from lchan 0 0 4 0 to lchan 0 0 1 0
-#expect-ts-use trx 0 0 states * TCH/F - - - - - *
-# FAIL: osmo-bsc does not move to TCH/F from bad rxlev
-expect-no-chan
+expect-as from lchan 0 0 4 0 to lchan 0 0 1 0
+expect-ts-use trx 0 0 states * TCH/F - - - - - *
diff --git a/tests/handover/test_amr_tch_h_to_f_rxlev_congested.ho_vty b/tests/handover/test_amr_tch_h_to_f_rxlev_congested.ho_vty
index a463387..776b093 100644
--- a/tests/handover/test_amr_tch_h_to_f_rxlev_congested.ho_vty
+++ b/tests/handover/test_amr_tch_h_to_f_rxlev_congested.ho_vty
@@ -14,10 +14,8 @@
 expect-no-chan
 meas-rep lchan 0 0 4 0 rxlev 23 rxqual 1 ta 0
 # average rxlev is now -110 + 23 = -87 < -80: reassign to TCH/F due to bad rxlev
-#expect-as from lchan 0 0 4 0 to lchan 0 0 1 0
-#expect-ts-use trx 0 0 states     *    TCH/F -     -     TCH/-H TCH/HH *    *
-# FAIL: osmo-bsc does not move to TCH/F from bad rxlev
-expect-no-chan
+expect-as from lchan 0 0 4 0 to lchan 0 0 1 0
+expect-ts-use trx 0 0 states     *    TCH/F -     -     TCH/-H TCH/HH *    *
 
 
 # This situation actually balances congestion
@@ -27,10 +25,8 @@
 expect-no-chan
 meas-rep lchan 0 0 4 0 rxlev 23 rxqual 1 ta 0
 # average rxlev is now -110 + 23 = -87 < -80: reassign to TCH/F due to bad rxlev
-#expect-as from lchan 0 0 4 0 to lchan 0 0 2 0
-#expect-ts-use trx 0 0 states     *    TCH/F TCH/F -     TCH/-H TCH/HH *    *
-# FAIL: osmo-bsc does not move to TCH/F from bad rxlev
-expect-no-chan
+expect-as from lchan 0 0 4 0 to lchan 0 0 2 0
+expect-ts-use trx 0 0 states     *    TCH/F TCH/F -     TCH/-H TCH/HH *    *
 
 # This situation moves congestion from TCH/H to TCH/F (TCH/H was 100% congested, then makes TCH/F 100% congested)
 # The congestion requirements would normally forbid this, but since this is an "RxQual emergency", we should reassign.
@@ -40,10 +36,8 @@
 expect-no-chan
 meas-rep lchan 0 0 4 0 rxlev 23 rxqual 1 ta 0
 # average rxlev is now -110 + 23 = -87 < -80: reassign to TCH/F due to bad rxlev
-#expect-as from lchan 0 0 4 0 to lchan 0 0 3 0
-#expect-ts-use trx 0 0 states     *    TCH/F TCH/F TCH/F TCH/-H TCH/HH *    *
-# FAIL: osmo-bsc does not move to TCH/F from bad rxlev
-expect-no-chan
+expect-as from lchan 0 0 4 0 to lchan 0 0 3 0
+expect-ts-use trx 0 0 states     *    TCH/F TCH/F TCH/F TCH/-H TCH/HH *    *
 
 # This situation worsens congestion (TCH/H was 50% congested, then makes TCH/F 100% congested)
 # The congestion requirements would normally forbid this, but since this is an "RxQual emergency", we should reassign.
@@ -53,10 +47,8 @@
 expect-no-chan
 meas-rep lchan 0 0 4 0 rxlev 23 rxqual 1 ta 0
 # average rxlev is now -110 + 23 = -87 < -80: reassign to TCH/F due to bad rxlev
-#expect-as from lchan 0 0 4 0 to lchan 0 0 3 0
-#expect-ts-use trx 0 0 states     *    TCH/F TCH/F TCH/F -      TCH/HH *    *
-# FAIL: osmo-bsc does not move to TCH/F from bad rxlev
-expect-no-chan
+expect-as from lchan 0 0 4 0 to lchan 0 0 3 0
+expect-ts-use trx 0 0 states     *    TCH/F TCH/F TCH/F -      TCH/HH *    *
 
 
 # This situation creates congestion (TCH/H was not congested, then makes TCH/F 50% congested)
@@ -67,7 +59,5 @@
 expect-no-chan
 meas-rep lchan 0 0 4 0 rxlev 23 rxqual 1 ta 0
 # average rxlev is now -110 + 23 = -87 < -80: reassign to TCH/F due to bad rxlev
-#expect-as from lchan 0 0 4 0 to lchan 0 0 2 0
-#expect-ts-use trx 0 0 states     *    TCH/F TCH/F -     -      -      *    *
-# FAIL: osmo-bsc does not move to TCH/F from bad rxlev
-expect-no-chan
+expect-as from lchan 0 0 4 0 to lchan 0 0 2 0
+expect-ts-use trx 0 0 states     *    TCH/F TCH/F -     -      -      *    *
diff --git a/tests/handover/test_amr_tch_h_to_f_rxqual.ho_vty b/tests/handover/test_amr_tch_h_to_f_rxqual.ho_vty
index 414a5fd..10db404 100644
--- a/tests/handover/test_amr_tch_h_to_f_rxqual.ho_vty
+++ b/tests/handover/test_amr_tch_h_to_f_rxqual.ho_vty
@@ -12,7 +12,5 @@
 expect-no-chan
 meas-rep lchan 0 0 4 0 rxlev 30 rxqual 6 ta 0
 # average rxqual now at 6 which is worse than 5, reassign to TCH/F due to bad rxqual.
-#expect-as from lchan 0 0 4 0 to lchan 0 0 1 0
-#expect-ts-use trx 0 0 states * TCH/F - - - - - *
-# FAIL: osmo-bsc does not move to TCH/F from bad rxqual
-expect-no-chan
+expect-as from lchan 0 0 4 0 to lchan 0 0 1 0
+expect-ts-use trx 0 0 states * TCH/F - - - - - *
diff --git a/tests/handover/test_amr_tch_h_to_f_rxqual_congested.ho_vty b/tests/handover/test_amr_tch_h_to_f_rxqual_congested.ho_vty
index 30c2c67..79ff0a7 100644
--- a/tests/handover/test_amr_tch_h_to_f_rxqual_congested.ho_vty
+++ b/tests/handover/test_amr_tch_h_to_f_rxqual_congested.ho_vty
@@ -17,10 +17,8 @@
 expect-no-chan
 meas-rep lchan 0 0 4 0 rxlev 50 rxqual 6 ta 0
 # average rxqual now at 6 which is worse than 5, reassign to TCH/F due to bad rxqual.
-#expect-as from lchan 0 0 4 0 to lchan 0 0 1 0
-#expect-ts-use trx 0 0 states     *    TCH/F -     -     TCH/-H TCH/HH *    *
-# FAIL: osmo-bsc does not move to TCH/F from bad rxqual
-expect-no-chan
+expect-as from lchan 0 0 4 0 to lchan 0 0 1 0
+expect-ts-use trx 0 0 states     *    TCH/F -     -     TCH/-H TCH/HH *    *
 
 
 # This situation actually balances congestion
@@ -30,10 +28,8 @@
 expect-no-chan
 meas-rep lchan 0 0 4 0 rxlev 50 rxqual 6 ta 0
 # average rxqual now at 6 which is worse than 5, reassign to TCH/F due to bad rxqual.
-#expect-as from lchan 0 0 4 0 to lchan 0 0 2 0
-#expect-ts-use trx 0 0 states     *    TCH/F TCH/F -     TCH/-H TCH/HH *    *
-# FAIL: osmo-bsc does not move to TCH/F from bad rxqual
-expect-no-chan
+expect-as from lchan 0 0 4 0 to lchan 0 0 2 0
+expect-ts-use trx 0 0 states     *    TCH/F TCH/F -     TCH/-H TCH/HH *    *
 
 
 # This situation moves congestion from TCH/H to TCH/F (TCH/H was 100% congested, then makes TCH/F 100% congested)
@@ -44,10 +40,8 @@
 expect-no-chan
 meas-rep lchan 0 0 4 0 rxlev 50 rxqual 6 ta 0
 # average rxqual now at 6 which is worse than 5, reassign to TCH/F due to bad rxqual.
-#expect-as from lchan 0 0 4 0 to lchan 0 0 3 0
-#expect-ts-use trx 0 0 states     *    TCH/F TCH/F TCH/F TCH/-H TCH/HH *    *
-# FAIL: osmo-bsc does not move to TCH/F from bad rxqual
-expect-no-chan
+expect-as from lchan 0 0 4 0 to lchan 0 0 3 0
+expect-ts-use trx 0 0 states     *    TCH/F TCH/F TCH/F TCH/-H TCH/HH *    *
 
 
 # This situation worsens congestion (TCH/H was 50% congested, then makes TCH/F 100% congested)
@@ -58,10 +52,8 @@
 expect-no-chan
 meas-rep lchan 0 0 4 0 rxlev 50 rxqual 6 ta 0
 # average rxqual now at 6 which is worse than 5, reassign to TCH/F due to bad rxqual.
-#expect-as from lchan 0 0 4 0 to lchan 0 0 3 0
-#expect-ts-use trx 0 0 states     *    TCH/F TCH/F TCH/F -      TCH/HH *    *
-# FAIL: osmo-bsc does not move to TCH/F from bad rxqual
-expect-no-chan
+expect-as from lchan 0 0 4 0 to lchan 0 0 3 0
+expect-ts-use trx 0 0 states     *    TCH/F TCH/F TCH/F -      TCH/HH *    *
 
 
 # This situation creates congestion (TCH/H was not congested, then makes TCH/F 50% congested)
@@ -72,7 +64,5 @@
 expect-no-chan
 meas-rep lchan 0 0 4 0 rxlev 50 rxqual 6 ta 0
 # average rxqual now at 6 which is worse than 5, reassign to TCH/F due to bad rxqual.
-#expect-as from lchan 0 0 4 0 to lchan 0 0 2 0
-#expect-ts-use trx 0 0 states     *    TCH/F TCH/F -     -      -      *    *
-# FAIL: osmo-bsc does not move to TCH/F from bad rxqual
-expect-no-chan
+expect-as from lchan 0 0 4 0 to lchan 0 0 2 0
+expect-ts-use trx 0 0 states     *    TCH/F TCH/F -     -      -      *    *

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Id40d1cf8b58410c7d4eb87407fe8b8106e352438
Gerrit-Change-Number: 24607
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210608/427a7224/attachment.htm>


More information about the gerrit-log mailing list