<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24797">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">hodec2: fix low rxqual tch/h<->tch/f oscillation<br><br>Related: SYS#5198<br>Change-Id: I96cd5a494e661ba3bb0b6d22d25a9968d2a6813c<br>---<br>M src/osmo-bsc/handover_decision_2.c<br>M tests/handover/test_amr_tch_h_to_f_rxqual_oscillation.ho_vty<br>2 files changed, 13 insertions(+), 11 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c</span><br><span>index 7a14f06..0966583 100644</span><br><span>--- a/src/osmo-bsc/handover_decision_2.c</span><br><span>+++ b/src/osmo-bsc/handover_decision_2.c</span><br><span>@@ -265,6 +265,15 @@</span><br><span>                && rxlev2dbm(rxlev_current) < ho_get_hodec2_min_rxlev(neigh_cfg);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static bool is_low_rxqual(int rxqual_current, struct handover_cfg *neigh_cfg)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+       /* min_rxqual is actually a bit of a misnomer, low quality is a high number. So the "min" refers to the minimum</span><br><span style="color: hsl(120, 100%, 40%);">+      * acceptable level of quality, and "min or better" here means "rxqual number must be SMALLER-or-equal than the</span><br><span style="color: hsl(120, 100%, 40%);">+         * min-rxqual setting". */</span><br><span style="color: hsl(120, 100%, 40%);">+       return rxqual_current >= 0</span><br><span style="color: hsl(120, 100%, 40%);">+         && rxqual_current > ho_get_hodec2_min_rxqual(neigh_cfg);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* obtain averaged rxlev for given neighbor */</span><br><span> static int neigh_meas_avg(struct neigh_meas_proc *nmp, int window)</span><br><span> {</span><br><span>@@ -1203,7 +1212,9 @@</span><br><span>        /* See if re-assignment within the same cell can resolve congestion.</span><br><span>          * 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</span><br><span>          * subsequently oscillate back to TCH/F due to low rxlev. So skip TCH/F with low rxlev. */</span><br><span style="color: hsl(0, 100%, 40%);">-      if (assignment && !(lchan->type == GSM_LCHAN_TCH_F && is_low_rxlev(rxlev_current, bts->ho)))</span><br><span style="color: hsl(120, 100%, 40%);">+    if (assignment</span><br><span style="color: hsl(120, 100%, 40%);">+            && !(lchan->type == GSM_LCHAN_TCH_F</span><br><span style="color: hsl(120, 100%, 40%);">+             && (is_low_rxlev(rxlev_current, bts->ho) || is_low_rxqual(current_rxqual(lchan), bts->ho))))</span><br><span>          collect_assignment_candidate(lchan, clist, candidates, rxlev_current);</span><br><span> </span><br><span>   if (handover) {</span><br><span>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</span><br><span>index a98e917..e628f03 100644</span><br><span>--- a/tests/handover/test_amr_tch_h_to_f_rxqual_oscillation.ho_vty</span><br><span>+++ b/tests/handover/test_amr_tch_h_to_f_rxqual_oscillation.ho_vty</span><br><span>@@ -17,13 +17,4 @@</span><br><span> </span><br><span> meas-rep lchan 0 0 1 0 rxlev 30 rxqual 6 ta 0</span><br><span> congestion-check</span><br><span style="color: hsl(0, 100%, 40%);">-# FAIL: should stay on TCH/F because rxqual is low, do not oscillate between TCH/F and /H.</span><br><span style="color: hsl(0, 100%, 40%);">-expect-as from lchan 0 0 1 0 to lchan 0 0 4 0</span><br><span style="color: hsl(0, 100%, 40%);">-expect-ts-use trx 0 0 states * - - - TCH/H- - - *</span><br><span style="color: hsl(0, 100%, 40%);">-meas-rep lchan 0 0 4 0 rxlev 30 rxqual 6 ta 0</span><br><span style="color: hsl(0, 100%, 40%);">-expect-as from lchan 0 0 4 0 to lchan 0 0 1 0</span><br><span style="color: hsl(0, 100%, 40%);">-expect-ts-use trx 0 0 states * TCH/F - - - - - *</span><br><span style="color: hsl(0, 100%, 40%);">-meas-rep lchan 0 0 1 0 rxlev 30 rxqual 6 ta 0</span><br><span style="color: hsl(0, 100%, 40%);">-congestion-check</span><br><span style="color: hsl(0, 100%, 40%);">-expect-as from lchan 0 0 1 0 to lchan 0 0 4 0</span><br><span style="color: hsl(0, 100%, 40%);">-expect-ts-use trx 0 0 states * - - - TCH/H- - - *</span><br><span style="color: hsl(120, 100%, 40%);">+expect-no-chan</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24797">change 24797</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bsc/+/24797"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I96cd5a494e661ba3bb0b6d22d25a9968d2a6813c </div>
<div style="display:none"> Gerrit-Change-Number: 24797 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>