Change in osmo-bsc[master]: fix 'handover:*' counters: remove bogus increments

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Mon Aug 31 16:39:45 UTC 2020


neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/19895 )

Change subject: fix 'handover:*' counters: remove bogus increments
......................................................................

fix 'handover:*' counters: remove bogus increments

To handle cases of unknown handover type (like failure to find the target
cell), return -1 as counter code; treat -1 as skipping in ho_count_bsc() and
ho_count_bts().

The handover:* counters indicate overall counts, without knowing whether inter-
or intra-BSC, or whether the target ARFCN even exists. So they need to be
counted separately, and must not serve as fallback category in
result_counter_bsc() and result_counter_bts().

Related: OS#4736
Change-Id: Ie311e599d7bd35d33cf471c6c63e649246e8396a
---
M src/osmo-bsc/handover_fsm.c
1 file changed, 8 insertions(+), 10 deletions(-)

Approvals:
  neels: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c
index 9ab96e3..7e46147 100644
--- a/src/osmo-bsc/handover_fsm.c
+++ b/src/osmo-bsc/handover_fsm.c
@@ -81,6 +81,9 @@
 /* Assume presence of local var 'conn' as struct gsm_subscriber_connection.
  * This is a macro to preserve the source file and line number in logging. */
 #define ho_count_bsc(counter) do { \
+		/* If a handover target could not be found, the counter index may be -1. */ \
+		if (counter < 0) \
+			break; \
 		LOG_HO(conn, LOGL_DEBUG, "(BSC) incrementing rate counter: %s %s\n", \
 		       bsc_ctr_description[counter].name, \
 		       bsc_ctr_description[counter].description); \
@@ -91,6 +94,9 @@
  * Handles bts == NULL gracefully
  * This is a macro to preserve the source file and line number in logging. */
 #define ho_count_bts(bts, counter) do { \
+		/* If a handover target could not be found, the counter index may be -1. */ \
+		if (counter < 0) \
+			break; \
 		LOG_HO(conn, LOGL_DEBUG, "(BTS) incrementing rate counter: %s %s\n", \
 		       bts_ctr_description[counter].name, \
 		       bts_ctr_description[counter].description); \
@@ -724,11 +730,7 @@
 {
 	switch (scope) {
 	default:
-		LOGP(DHO, LOGL_ERROR, "invalid enum handover_scope value: %s\n",
-		     handover_scope_name(scope));
-		/* use "normal" HO counter... */
-	case HO_NO_HANDOVER:
-		return result_counter_BSC_HANDOVER(result);
+		return -1;
 	case HO_INTRA_CELL:
 		return result_counter_BSC_INTRA_CELL_HO(result);
 	case HO_INTRA_BSC:
@@ -763,11 +765,7 @@
 {
 	switch (scope) {
 	default:
-		LOGP(DHO, LOGL_ERROR, "invalid enum handover_scope value: %s\n",
-		     handover_scope_name(scope));
-		/* use "normal" HO counter... */
-	case HO_NO_HANDOVER:
-		return result_counter_BTS_HANDOVER(result);
+		return -1;
 	case HO_INTRA_CELL:
 		return result_counter_BTS_INTRA_CELL_HO(result);
 	case HO_INTRA_BSC:

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/19895
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ie311e599d7bd35d33cf471c6c63e649246e8396a
Gerrit-Change-Number: 19895
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200831/6d3a8f36/attachment.htm>


More information about the gerrit-log mailing list