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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">handover: apply meas report BS Power to RXLEV, fix ho oscillation<br><br>This fixes handover oscillation in the presence of power reduction on<br>the downlink: apply the reduced power to the cell's RXLEV in order to<br>not rate the current cell as weaker than it actually is.<br><br>Related: SYS#5339<br>Change-Id: Ifcf59964b5e2d550d79e4ba14d90962808f79dae<br>---<br>M src/osmo-bsc/meas_rep.c<br>M tests/handover/test_bs_power.ho_vty<br>2 files changed, 9 insertions(+), 10 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/meas_rep.c b/src/osmo-bsc/meas_rep.c</span><br><span>index 73d9a1f..9b2fca0 100644</span><br><span>--- a/src/osmo-bsc/meas_rep.c</span><br><span>+++ b/src/osmo-bsc/meas_rep.c</span><br><span>@@ -31,11 +31,15 @@</span><br><span>         case MEAS_REP_DL_RXLEV_FULL:</span><br><span>                 if (!(rep->flags & MEAS_REP_F_DL_VALID))</span><br><span>                      return -EINVAL;</span><br><span style="color: hsl(0, 100%, 40%);">-         return rep->dl.full.rx_lev;</span><br><span style="color: hsl(120, 100%, 40%);">+                /* Add BS Power value to rxlev: improve the RXLEV value by the amount of power that the BTS is reducing</span><br><span style="color: hsl(120, 100%, 40%);">+                * transmission. Note that bs_power is coded as dB/2, a positive value indicating the amount of power reduction</span><br><span style="color: hsl(120, 100%, 40%);">+                * on the downlink; rxlev is coded in dB, where a higher number means stronger signal. */</span><br><span style="color: hsl(120, 100%, 40%);">+             return rep->dl.full.rx_lev + (rep->bs_power * 2);</span><br><span>      case MEAS_REP_DL_RXLEV_SUB:</span><br><span>          if (!(rep->flags & MEAS_REP_F_DL_VALID))</span><br><span>                      return -EINVAL;</span><br><span style="color: hsl(0, 100%, 40%);">-         return rep->dl.sub.rx_lev;</span><br><span style="color: hsl(120, 100%, 40%);">+         /* Apply BS Power as explained above */</span><br><span style="color: hsl(120, 100%, 40%);">+               return rep->dl.sub.rx_lev + (rep->bs_power * 2);</span><br><span>       case MEAS_REP_DL_RXQUAL_FULL:</span><br><span>                if (!(rep->flags & MEAS_REP_F_DL_VALID))</span><br><span>                      return -EINVAL;</span><br><span>diff --git a/tests/handover/test_bs_power.ho_vty b/tests/handover/test_bs_power.ho_vty</span><br><span>index 2c68d57..5d8c278 100644</span><br><span>--- a/tests/handover/test_bs_power.ho_vty</span><br><span>+++ b/tests/handover/test_bs_power.ho_vty</span><br><span>@@ -6,11 +6,6 @@</span><br><span> set-ts-use trx 0 0 states        *    TCH/F -     -     -     -     -     *</span><br><span> </span><br><span> meas-rep repeat 10 bspower 20 lchan 0 0 1 0 rxlev 20 rxqual 0 ta 0 neighbors 30</span><br><span style="color: hsl(0, 100%, 40%);">-# FAIL: there should be no handover, because the bspower reduction of 20 with an rxlev of 20 (= 40) is stronger than the</span><br><span style="color: hsl(0, 100%, 40%);">-# neighbor at 30. But since osmo-bsc fails to take the BS Power into account, it hands over to the neighbor.</span><br><span style="color: hsl(0, 100%, 40%);">-#expect-no-chan</span><br><span style="color: hsl(0, 100%, 40%);">-expect-ho from lchan 0 0 1 0 to lchan 1 0 1 0</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-# When the neighbor then reports the stronger original cell, we get handover oscillation</span><br><span style="color: hsl(0, 100%, 40%);">-meas-rep repeat 10 bspower 0 lchan 1 0 1 0 rxlev 30 rxqual 0 ta 0 neighbors 40</span><br><span style="color: hsl(0, 100%, 40%);">-expect-ho from lchan 1 0 1 0 to lchan 0 0 1 0</span><br><span style="color: hsl(120, 100%, 40%);">+# there should be no handover, because the bspower reduction of 20 with an rxlev of 20 (= 40) is stronger than the</span><br><span style="color: hsl(120, 100%, 40%);">+# neighbor at 30.</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/+/24425">change 24425</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/+/24425"/><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: Ifcf59964b5e2d550d79e4ba14d90962808f79dae </div>
<div style="display:none"> Gerrit-Change-Number: 24425 </div>
<div style="display:none"> Gerrit-PatchSet: 7 </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-CC: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>