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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">fix 'handover:*' counters: remove bogus increments<br><br>To handle cases of unknown handover type (like failure to find the target<br>cell), return -1 as counter code; treat -1 as skipping in ho_count_bsc() and<br>ho_count_bts().<br><br>The handover:* counters indicate overall counts, without knowing whether inter-<br>or intra-BSC, or whether the target ARFCN even exists. So they need to be<br>counted separately, and must not serve as fallback category in<br>result_counter_bsc() and result_counter_bts().<br><br>Related: OS#4736<br>Change-Id: Ie311e599d7bd35d33cf471c6c63e649246e8396a<br>---<br>M src/osmo-bsc/handover_fsm.c<br>1 file changed, 8 insertions(+), 10 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c</span><br><span>index 9ab96e3..7e46147 100644</span><br><span>--- a/src/osmo-bsc/handover_fsm.c</span><br><span>+++ b/src/osmo-bsc/handover_fsm.c</span><br><span>@@ -81,6 +81,9 @@</span><br><span> /* Assume presence of local var 'conn' as struct gsm_subscriber_connection.</span><br><span>  * This is a macro to preserve the source file and line number in logging. */</span><br><span> #define ho_count_bsc(counter) do { \</span><br><span style="color: hsl(120, 100%, 40%);">+            /* If a handover target could not be found, the counter index may be -1. */ \</span><br><span style="color: hsl(120, 100%, 40%);">+         if (counter < 0) \</span><br><span style="color: hsl(120, 100%, 40%);">+                 break; \</span><br><span>             LOG_HO(conn, LOGL_DEBUG, "(BSC) incrementing rate counter: %s %s\n", \</span><br><span>                    bsc_ctr_description[counter].name, \</span><br><span>                 bsc_ctr_description[counter].description); \</span><br><span>@@ -91,6 +94,9 @@</span><br><span>  * Handles bts == NULL gracefully</span><br><span>  * This is a macro to preserve the source file and line number in logging. */</span><br><span> #define ho_count_bts(bts, counter) do { \</span><br><span style="color: hsl(120, 100%, 40%);">+            /* If a handover target could not be found, the counter index may be -1. */ \</span><br><span style="color: hsl(120, 100%, 40%);">+         if (counter < 0) \</span><br><span style="color: hsl(120, 100%, 40%);">+                 break; \</span><br><span>             LOG_HO(conn, LOGL_DEBUG, "(BTS) incrementing rate counter: %s %s\n", \</span><br><span>                    bts_ctr_description[counter].name, \</span><br><span>                 bts_ctr_description[counter].description); \</span><br><span>@@ -724,11 +730,7 @@</span><br><span> {</span><br><span>      switch (scope) {</span><br><span>     default:</span><br><span style="color: hsl(0, 100%, 40%);">-                LOGP(DHO, LOGL_ERROR, "invalid enum handover_scope value: %s\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                   handover_scope_name(scope));</span><br><span style="color: hsl(0, 100%, 40%);">-               /* use "normal" HO counter... */</span><br><span style="color: hsl(0, 100%, 40%);">-      case HO_NO_HANDOVER:</span><br><span style="color: hsl(0, 100%, 40%);">-            return result_counter_BSC_HANDOVER(result);</span><br><span style="color: hsl(120, 100%, 40%);">+           return -1;</span><br><span>   case HO_INTRA_CELL:</span><br><span>          return result_counter_BSC_INTRA_CELL_HO(result);</span><br><span>     case HO_INTRA_BSC:</span><br><span>@@ -763,11 +765,7 @@</span><br><span> {</span><br><span>       switch (scope) {</span><br><span>     default:</span><br><span style="color: hsl(0, 100%, 40%);">-                LOGP(DHO, LOGL_ERROR, "invalid enum handover_scope value: %s\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                   handover_scope_name(scope));</span><br><span style="color: hsl(0, 100%, 40%);">-               /* use "normal" HO counter... */</span><br><span style="color: hsl(0, 100%, 40%);">-      case HO_NO_HANDOVER:</span><br><span style="color: hsl(0, 100%, 40%);">-            return result_counter_BTS_HANDOVER(result);</span><br><span style="color: hsl(120, 100%, 40%);">+           return -1;</span><br><span>   case HO_INTRA_CELL:</span><br><span>          return result_counter_BTS_INTRA_CELL_HO(result);</span><br><span>     case HO_INTRA_BSC:</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/19895">change 19895</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/+/19895"/><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: Ie311e599d7bd35d33cf471c6c63e649246e8396a </div>
<div style="display:none"> Gerrit-Change-Number: 19895 </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: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>