diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2021-06-29 15:33:13 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2021-06-29 22:24:24 +0200 |
commit | c44a27c6728efe005d10de8b9a1b1e6da9bfece0 (patch) | |
tree | f8f5c23e0d07547410dcb59cfbcbdd213aa67fc4 | |
parent | 4011c5462002f30be7aa9e12bd6e380590d4aab5 (diff) |
hodec2: fix low rxqual tch/h<->tch/f oscillation
Related: SYS#5198
Change-Id: I96cd5a494e661ba3bb0b6d22d25a9968d2a6813c
-rw-r--r-- | src/osmo-bsc/handover_decision_2.c | 13 | ||||
-rw-r--r-- | tests/handover/test_amr_tch_h_to_f_rxqual_oscillation.ho_vty | 11 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c index 7a14f06ae..0966583eb 100644 --- a/src/osmo-bsc/handover_decision_2.c +++ b/src/osmo-bsc/handover_decision_2.c @@ -265,6 +265,15 @@ static bool is_low_rxlev(int rxlev_current, struct handover_cfg *neigh_cfg) && rxlev2dbm(rxlev_current) < ho_get_hodec2_min_rxlev(neigh_cfg); } +static bool is_low_rxqual(int rxqual_current, struct handover_cfg *neigh_cfg) +{ + /* min_rxqual is actually a bit of a misnomer, low quality is a high number. So the "min" refers to the minimum + * acceptable level of quality, and "min or better" here means "rxqual number must be SMALLER-or-equal than the + * min-rxqual setting". */ + return rxqual_current >= 0 + && rxqual_current > ho_get_hodec2_min_rxqual(neigh_cfg); +} + /* obtain averaged rxlev for given neighbor */ static int neigh_meas_avg(struct neigh_meas_proc *nmp, int window) { @@ -1203,7 +1212,9 @@ static void collect_candidates_for_lchan(struct gsm_lchan *lchan, /* See if re-assignment within the same cell can resolve congestion. * But: when TCH/F has low rxlev, do not re-assign. If a low rxlev TCH/F were re-assigned to TCH/H, we would * subsequently oscillate back to TCH/F due to low rxlev. So skip TCH/F with low rxlev. */ - if (assignment && !(lchan->type == GSM_LCHAN_TCH_F && is_low_rxlev(rxlev_current, bts->ho))) + if (assignment + && !(lchan->type == GSM_LCHAN_TCH_F + && (is_low_rxlev(rxlev_current, bts->ho) || is_low_rxqual(current_rxqual(lchan), bts->ho)))) collect_assignment_candidate(lchan, clist, candidates, rxlev_current); if (handover) { diff --git a/tests/handover/test_amr_tch_h_to_f_rxqual_oscillation.ho_vty b/tests/handover/test_amr_tch_h_to_f_rxqual_oscillation.ho_vty index a98e91773..e628f032a 100644 --- a/tests/handover/test_amr_tch_h_to_f_rxqual_oscillation.ho_vty +++ b/tests/handover/test_amr_tch_h_to_f_rxqual_oscillation.ho_vty @@ -17,13 +17,4 @@ expect-ts-use trx 0 0 states * TCH/F - - - - - * meas-rep lchan 0 0 1 0 rxlev 30 rxqual 6 ta 0 congestion-check -# FAIL: should stay on TCH/F because rxqual is low, do not oscillate between TCH/F and /H. -expect-as from lchan 0 0 1 0 to lchan 0 0 4 0 -expect-ts-use trx 0 0 states * - - - TCH/H- - - * -meas-rep lchan 0 0 4 0 rxlev 30 rxqual 6 ta 0 -expect-as from lchan 0 0 4 0 to lchan 0 0 1 0 -expect-ts-use trx 0 0 states * TCH/F - - - - - * -meas-rep lchan 0 0 1 0 rxlev 30 rxqual 6 ta 0 -congestion-check -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 |