aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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