aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-07-08 18:16:42 +0200
committerneels <nhofmeyr@sysmocom.de>2021-07-15 09:28:18 +0000
commitbe32e935138b9fb340432317a3b5124474b9bddf (patch)
treea7362dd99254b73cc060062ef119b9625cf4fc3e
parent12d80e89453bc31320143f2f02d9eb999903017d (diff)
hodec2: add low-rxqual-assignment penalty timer (2/2)
Hold off re-assignment after an intra-cell re-assignment due to low rxqual. Adjust test_amr_tch_h_to_f_rxqual.ho_vty to show the changed behaviour. Related: SYS#5198 Change-Id: Id00a07313fe04eec509b336c0637b59c707760e0
-rw-r--r--include/osmocom/bsc/handover_cfg.h7
-rw-r--r--src/osmo-bsc/handover_decision_2.c13
-rw-r--r--tests/handover/test_amr_tch_h_to_f_rxqual.ho_vty9
-rw-r--r--tests/handover_cfg.vty23
4 files changed, 39 insertions, 13 deletions
diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h
index 551ce8df5..2bd26812e 100644
--- a/include/osmocom/bsc/handover_cfg.h
+++ b/include/osmocom/bsc/handover_cfg.h
@@ -261,6 +261,13 @@ static inline int bool2i(bool arg)
" see also 'handover2 retries'\n" \
"Seconds\n") \
\
+ HO_CFG_ONE_MEMBER(int, hodec2_penalty_low_rxqual_as, 60, \
+ "handover2 ", "penalty-time low-rxqual-assignment", "<0-99999>", atoi, "%d", as_is, \
+ HO_CFG_STR_HANDOVER2 \
+ HO_CFG_STR_PENALTY_TIME \
+ "Time to suspend re-assignment after an lchan was re-assigned because of low RxQual\n" \
+ "Seconds\n") \
+ \
HO_CFG_ONE_MEMBER(int, hodec2_retries, 0, \
"handover2 ", "retries", "<0-9>", atoi, "%d", as_is, \
HO_CFG_STR_HANDOVER2 \
diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c
index af36c3189..d08173cb9 100644
--- a/src/osmo-bsc/handover_decision_2.c
+++ b/src/osmo-bsc/handover_decision_2.c
@@ -1410,10 +1410,21 @@ static int find_alternative_lchan(struct gsm_lchan *lchan, bool include_weaker_r
/* perform handover, if there is a candidate */
if (best_cand) {
+ int rc;
LOGPHOCAND(best_cand, LOGL_INFO, "Best candidate: RX level %d%s\n",
rxlev2dbm(best_cand->target.rxlev),
best_applied_afs_bias ? " (applied AHS -> AFS rxlev bias)" : "");
- return trigger_ho(best_cand, best_cand->requirements & REQUIREMENT_A_MASK);
+ rc = trigger_ho(best_cand, best_cand->requirements & REQUIREMENT_A_MASK);
+
+ /* After upgrading TCH/H to TCH/F due to bad RxQual, start penalty timer to avoid re-assignment within
+ * the same cell again, to avoid oscillation from RxQual noise combined with congestion resolution. */
+ if (!rc && is_upgrade_to_tchf(best_cand, REQUIREMENT_A_MASK)) {
+ struct gsm0808_cell_id bts_id;
+ gsm_bts_cell_id(&bts_id, best_cand->target.bts);
+ penalty_timers_add(lchan->conn, &lchan->conn->hodec2.penalty_timers, &bts_id,
+ ho_get_hodec2_penalty_low_rxqual_as(bts->ho));
+ }
+ return rc;
}
/* Damn, all is congested, has too low RXLEV or cannot service the voice call due to codec
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 32a95e16d..f3a2a9086 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
@@ -25,15 +25,12 @@ network
# The penalty timer is still active, no re-assignment from congestion of TCH/H
congestion-check
-# "FAIL": the penalty timer is not yet implemented
-#expect-no-chan
-#expect-ts-use trx 0 0 states * TCH/F - - - - - *
-expect-as from lchan 0 0 1 0 to lchan 0 0 4 0
-expect-ts-use trx 0 0 states * - - - TCH/H- - - *
+expect-no-chan
+expect-ts-use trx 0 0 states * TCH/F - - - - - *
# But handover to another cell is not held off
create-bts trx-count 1 timeslots c+s4 TCH/F TCH/F TCH/F TCH/H TCH/H TCH/H PDCH
-set-ts-use trx 0 0 states * TCH/F - - - - - *
+expect-ts-use trx 0 0 states * TCH/F - - - - - *
expect-ts-use trx 1 0 states * - - - - - - *
meas-rep lchan 0 0 1 0 rxlev 30 rxqual 5 ta 0 neighbors 35
diff --git a/tests/handover_cfg.vty b/tests/handover_cfg.vty
index ccb1a6b04..eb3ec3ed7 100644
--- a/tests/handover_cfg.vty
+++ b/tests/handover_cfg.vty
@@ -189,6 +189,7 @@ OsmoBSC(config-net)# list
handover2 penalty-time max-distance (<0-99999>|default)
handover2 penalty-time failed-ho (<0-99999>|default)
handover2 penalty-time failed-assignment (<0-99999>|default)
+ handover2 penalty-time low-rxqual-assignment (<0-99999>|default)
handover2 retries (<0-9>|default)
handover2 congestion-check (disabled|<1-999>|now)
...
@@ -384,9 +385,10 @@ OsmoBSC(config-net)# handover2 max-handovers ?
default Use default (9999), remove explicit setting on this node
OsmoBSC(config-net)# handover2 penalty-time ?
- max-distance Time to suspend handover for a subscriber after leaving this cell due to exceeding max distance; see also 'handover2 retries'
- failed-ho Time to suspend handover for a subscriber after a failed handover into this cell; see also 'handover2 retries'
- failed-assignment Time to suspend handover for a subscriber after a failed re-assignment within this cell; see also 'handover2 retries'
+ max-distance Time to suspend handover for a subscriber after leaving this cell due to exceeding max distance; see also 'handover2 retries'
+ failed-ho Time to suspend handover for a subscriber after a failed handover into this cell; see also 'handover2 retries'
+ failed-assignment Time to suspend handover for a subscriber after a failed re-assignment within this cell; see also 'handover2 retries'
+ low-rxqual-assignment Time to suspend re-assignment after an lchan was re-assigned because of low RxQual
OsmoBSC(config-net)# handover2 penalty-time max-distance ?
<0-99999> Seconds
@@ -400,6 +402,10 @@ OsmoBSC(config-net)# handover2 penalty-time failed-assignment ?
<0-99999> Seconds
default Use default (60), remove explicit setting on this node
+OsmoBSC(config-net)# handover2 penalty-time low-rxqual-assignment ?
+ <0-99999> Seconds
+ default Use default (60), remove explicit setting on this node
+
OsmoBSC(config-net)# handover2 retries ?
<0-9> Number of retries
default Use default (0), remove explicit setting on this node
@@ -603,9 +609,10 @@ OsmoBSC(config-net-bts)# handover2 max-handovers ?
default Use default (9999), remove explicit setting on this node
OsmoBSC(config-net-bts)# handover2 penalty-time ?
- max-distance Time to suspend handover for a subscriber after leaving this cell due to exceeding max distance; see also 'handover2 retries'
- failed-ho Time to suspend handover for a subscriber after a failed handover into this cell; see also 'handover2 retries'
- failed-assignment Time to suspend handover for a subscriber after a failed re-assignment within this cell; see also 'handover2 retries'
+ max-distance Time to suspend handover for a subscriber after leaving this cell due to exceeding max distance; see also 'handover2 retries'
+ failed-ho Time to suspend handover for a subscriber after a failed handover into this cell; see also 'handover2 retries'
+ failed-assignment Time to suspend handover for a subscriber after a failed re-assignment within this cell; see also 'handover2 retries'
+ low-rxqual-assignment Time to suspend re-assignment after an lchan was re-assigned because of low RxQual
OsmoBSC(config-net-bts)# handover2 penalty-time max-distance ?
<0-99999> Seconds
@@ -619,6 +626,10 @@ OsmoBSC(config-net-bts)# handover2 penalty-time failed-assignment ?
<0-99999> Seconds
default Use default (60), remove explicit setting on this node
+OsmoBSC(config-net-bts)# handover2 penalty-time low-rxqual-assignment ?
+ <0-99999> Seconds
+ default Use default (60), remove explicit setting on this node
+
OsmoBSC(config-net-bts)# handover2 retries ?
<0-9> Number of retries
default Use default (0), remove explicit setting on this node