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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">hodec2: don't apply AFS bias to same-cell lchans<br><br>The AFS bias actually should not apply to local cell lchans, because it<br>makes no sense for intra-cell considerations:<br><br>- same-cell lchans obviously have identical rxlev;<br>- any nonzero AFS bias thus always raises the TCH/F above the TCH/H;<br>- for intra-cell reassignment, the power budget hysteresis is,<br>  naturally, not applied.<br><br>So, before this patch, setting AFS bias even to only 1 would<br>unconditionally move all (AMR) TCH/H lchans over to free TCH/F lchans in<br>the same cell.<br><br>Recent patch Id40d1cf8b58410c7d4eb87407fe8b8106e352438 implements<br>explicit upgrade from TCH/H to TCH/F *if* the TCH/H is experiencing low<br>rxqual or low rxlev, as a proper replacement for intra-cell AFS bias.<br><br>Related: SYS#5198 SYS#5365<br>Change-Id: I315f24123ae016887ab91666870ce252e096f90f<br>---<br>M src/osmo-bsc/handover_decision_2.c<br>M tests/handover/test_amr_tch_h_and_afs_bias.ho_vty<br>2 files changed, 9 insertions(+), 12 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 9d4f1e9..d4ebc41 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>@@ -1295,9 +1295,10 @@</span><br><span>                   continue;</span><br><span> </span><br><span>                better = clist[i].target.rxlev - clist[i].current.rxlev;</span><br><span style="color: hsl(0, 100%, 40%);">-                /* Apply AFS bias? */</span><br><span style="color: hsl(120, 100%, 40%);">+         /* Apply AFS bias? Skip AFS bias for all intra-cell candidates. */</span><br><span>           afs_bias = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-           if (ahs && (clist[i].requirements & REQUIREMENT_B_TCHF))</span><br><span style="color: hsl(120, 100%, 40%);">+          if (clist[i].target.bts != bts</span><br><span style="color: hsl(120, 100%, 40%);">+                    && ahs && (clist[i].requirements & REQUIREMENT_B_TCHF))</span><br><span>                      afs_bias = ho_get_hodec2_afs_bias_rxlev(clist[i].target.bts->ho);</span><br><span>                 better += afs_bias;</span><br><span>          if (better > best_better_db) {</span><br><span>@@ -1328,9 +1329,10 @@</span><br><span>                   continue;</span><br><span> </span><br><span>                better = clist[i].target.rxlev - clist[i].current.rxlev;</span><br><span style="color: hsl(0, 100%, 40%);">-                /* Apply AFS bias? */</span><br><span style="color: hsl(120, 100%, 40%);">+         /* Apply AFS bias? Skip AFS bias for all intra-cell candidates. */</span><br><span>           afs_bias = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-           if (ahs && (clist[i].requirements & REQUIREMENT_C_TCHF))</span><br><span style="color: hsl(120, 100%, 40%);">+          if (clist[i].target.bts != bts</span><br><span style="color: hsl(120, 100%, 40%);">+                    && ahs && (clist[i].requirements & REQUIREMENT_C_TCHF))</span><br><span>                      afs_bias = ho_get_hodec2_afs_bias_rxlev(clist[i].target.bts->ho);</span><br><span>                 better += afs_bias;</span><br><span>          if (better > best_better_db) {</span><br><span>@@ -1365,11 +1367,11 @@</span><br><span>                  continue;</span><br><span> </span><br><span>                better = clist[i].target.rxlev - clist[i].current.rxlev;</span><br><span style="color: hsl(0, 100%, 40%);">-                /* Apply AFS bias?</span><br><span style="color: hsl(120, 100%, 40%);">+            /* Apply AFS bias? Skip AFS bias for all intra-cell candidates.</span><br><span>               * (never to remote-BSS neighbors, since we will not change the lchan type for those.) */</span><br><span>            afs_bias = 0;</span><br><span>                if (ahs && (clist[i].requirements & REQUIREMENT_A_TCHF)</span><br><span style="color: hsl(0, 100%, 40%);">-                 && clist[i].target.bts)</span><br><span style="color: hsl(120, 100%, 40%);">+               && clist[i].target.bts && clist[i].target.bts != bts)</span><br><span>                    afs_bias = ho_get_hodec2_afs_bias_rxlev(clist[i].target.bts->ho);</span><br><span>                 better += afs_bias;</span><br><span>          if (better > best_better_db</span><br><span>diff --git a/tests/handover/test_amr_tch_h_and_afs_bias.ho_vty b/tests/handover/test_amr_tch_h_and_afs_bias.ho_vty</span><br><span>index 127727f..462cb0d 100644</span><br><span>--- a/tests/handover/test_amr_tch_h_and_afs_bias.ho_vty</span><br><span>+++ b/tests/handover/test_amr_tch_h_and_afs_bias.ho_vty</span><br><span>@@ -10,9 +10,4 @@</span><br><span> set-ts-use trx 0 0 states        *    -     -     -     TCH/H- -     -     *</span><br><span> meas-rep lchan 0 0 4 0 rxlev 50 rxqual 1 ta 0</span><br><span> # The TCH/H should stay where it is, because its levels are fine.</span><br><span style="color: hsl(0, 100%, 40%);">-#expect-no-chan</span><br><span style="color: hsl(0, 100%, 40%);">-# FAIL: osmo-bsc applies AFS bias to the intra-cell move from TCH/H to TCH/F.</span><br><span style="color: hsl(0, 100%, 40%);">-# but intra-cell re-assignment does not employ a bower budget hysteresis.</span><br><span style="color: hsl(0, 100%, 40%);">-# So in the presence of afs-bias, all TCH/H *always* move over to TCH/F.</span><br><span style="color: hsl(0, 100%, 40%);">-# That should only happen when rxlev or rxqual ratings are too low.</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(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/+/24608">change 24608</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/+/24608"/><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: I315f24123ae016887ab91666870ce252e096f90f </div>
<div style="display:none"> Gerrit-Change-Number: 24608 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Hoernchen <ewild@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: dexter <pmaier@sysmocom.de> </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: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>