[MERGED] openbsc[master]: LU counters: count completion and failure, not messages sent

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 Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Mar 31 20:02:35 UTC 2017


Neels Hofmeyr has submitted this change and it was merged.

Change subject: LU counters: count completion and failure, not messages sent
......................................................................


LU counters: count completion and failure, not messages sent

>From a human admin viewpoint it doesn't make sense to count the messages sent:

When we use TMSIs, we first send a LU Accept with a new TMSI, and then expect
the MS to respond with a TMSI Realloc Complete message. When that fails to come
through, the LU actually ends in failure, even though a LU Accept was sent.

If a conn breaks/vanishes during LU, we cancel the LU without sending any reply
at all, so the failed LU would not be counted.

Instead, count Location Updating results, i.e. completion and failures.

(With the new VLR developments, LU counters need to be triggered in completely
different places, and this patch prepares for that by providing sensible
counters.)

Change-Id: I03f14c6a2f7ec5e1d3ba401e32082476fc7b0cc6
---
M openbsc/include/openbsc/gsm_data.h
M openbsc/src/libmsc/gsm_04_08.c
M openbsc/src/libmsc/vty_interface_layer3.c
3 files changed, 38 insertions(+), 20 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index e9ba173..17cc804 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -218,8 +218,8 @@
 	MSC_CTR_LOC_UPDATE_TYPE_NORMAL,
 	MSC_CTR_LOC_UPDATE_TYPE_PERIODIC,
 	MSC_CTR_LOC_UPDATE_TYPE_DETACH,
-	MSC_CTR_LOC_UPDATE_RESP_REJECT,
-	MSC_CTR_LOC_UPDATE_RESP_ACCEPT,
+	MSC_CTR_LOC_UPDATE_FAILED,
+	MSC_CTR_LOC_UPDATE_COMPLETED,
 	MSC_CTR_SMS_SUBMITTED,
 	MSC_CTR_SMS_NO_RECEIVER,
 	MSC_CTR_SMS_DELIVERED,
@@ -240,8 +240,8 @@
 	[MSC_CTR_LOC_UPDATE_TYPE_NORMAL] = 		{"loc_update_type.normal", "Received location update normal requests."},
 	[MSC_CTR_LOC_UPDATE_TYPE_PERIODIC] = 		{"loc_update_type.periodic", "Received location update periodic requests."},
 	[MSC_CTR_LOC_UPDATE_TYPE_DETACH] = 		{"loc_update_type.detach", "Received location update detach indication."},
-	[MSC_CTR_LOC_UPDATE_RESP_REJECT] = 		{"loc_update_resp.reject", "Sent location update reject responses."},
-	[MSC_CTR_LOC_UPDATE_RESP_ACCEPT] = 		{"loc_update_resp.accept", "Sent location update accept responses."},
+	[MSC_CTR_LOC_UPDATE_FAILED] = 		{"loc_update_resp.failed", "Rejected location updates."},
+	[MSC_CTR_LOC_UPDATE_COMPLETED] = 	{"loc_update_resp.completed", "Successful location updates."},
 	[MSC_CTR_SMS_SUBMITTED] = 		{"sms.submitted", "Received a RPDU from a MS (MO)."},
 	[MSC_CTR_SMS_NO_RECEIVER] = 		{"sms.no_receiver", "Counts SMS which couldn't routed because no receiver found."},
 	[MSC_CTR_SMS_DELIVERED] = 		{"sms.delivered", "Global SMS Deliver attempts."},
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index c910d71..31392f3 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -295,7 +295,7 @@
 	}
 }
 
-static void release_loc_updating_req(struct gsm_subscriber_connection *conn, int release)
+static void _release_loc_updating_req(struct gsm_subscriber_connection *conn, int release)
 {
 	if (!conn->loc_operation)
 		return;
@@ -310,11 +310,31 @@
 		msc_release_connection(conn);
 }
 
+static void loc_updating_failure(struct gsm_subscriber_connection *conn, int release)
+{
+	if (!conn->loc_operation)
+		return;
+	LOGP(DMM, LOGL_ERROR, "Location Updating failed for %s\n",
+	     subscr_name(conn->subscr));
+	rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_FAILED]);
+	_release_loc_updating_req(conn, release);
+}
+
+static void loc_updating_success(struct gsm_subscriber_connection *conn, int release)
+{
+	if (!conn->loc_operation)
+		return;
+	LOGP(DMM, LOGL_INFO, "Location Updating completed for %s\n",
+	     subscr_name(conn->subscr));
+	rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_COMPLETED]);
+	_release_loc_updating_req(conn, release);
+}
+
 static void allocate_loc_updating_req(struct gsm_subscriber_connection *conn)
 {
 	if (conn->loc_operation)
 		LOGP(DMM, LOGL_ERROR, "Connection already had operation.\n");
-	release_loc_updating_req(conn, 0);
+	loc_updating_failure(conn, 0);
 
 	conn->loc_operation = talloc_zero(tall_locop_ctx,
 					   struct gsm_loc_updating_operation);
@@ -349,9 +369,11 @@
 	 * The gsm0408_loc_upd_acc sends a MI with the TMSI. The
 	 * MS needs to respond with a TMSI REALLOCATION COMPLETE
 	 * (even if the TMSI is the same).
+	 * If avoid_tmsi == true, we don't send a TMSI, we don't
+	 * expect a reply and Location Updating is done.
 	 */
 	if (avoid_tmsi)
-		release_loc_updating_req(conn, 1);
+		loc_updating_success(conn, 1);
 
 	return rc;
 }
@@ -364,7 +386,7 @@
 
 	switch (event) {
 		case GSM_SECURITY_AUTH_FAILED:
-			release_loc_updating_req(conn, 1);
+			loc_updating_failure(conn, 1);
 			break;
 
 		case GSM_SECURITY_ALREADY:
@@ -407,7 +429,7 @@
 	 * Cancel any outstanding location updating request
 	 * operation taking place on the subscriber connection.
 	 */
-	release_loc_updating_req(conn, 0);
+	loc_updating_failure(conn, 0);
 
 	/* We might need to cancel the paging response or such. */
 	if (conn->sec_operation && conn->sec_operation->cb) {
@@ -459,8 +481,6 @@
 	struct gsm_bts *bts = conn->bts;
 	struct msgb *msg;
 
-	rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_RESP_REJECT]);
-
 	msg = gsm48_create_loc_upd_rej(cause);
 	if (!msg) {
 		LOGP(DMM, LOGL_ERROR, "Failed to create msg for LOCATION UPDATING REJECT.\n");
@@ -507,8 +527,6 @@
 	}
 
 	DEBUGP(DMM, "-> LOCATION UPDATE ACCEPT\n");
-
-	rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_RESP_ACCEPT]);
 
 	return gsm48_conn_sendmsg(msg, conn, NULL);
 }
@@ -566,7 +584,7 @@
 		}
 		if (!conn->subscr && conn->loc_operation) {
 			gsm0408_loc_upd_rej(conn, net->reject_cause);
-			release_loc_updating_req(conn, 1);
+			loc_updating_failure(conn, 1);
 			return 0;
 		}
 		if (conn->loc_operation)
@@ -595,7 +613,7 @@
 
 	LOGP(DMM, LOGL_DEBUG, "Location Updating Request procedure timedout.\n");
 	gsm0408_loc_upd_rej(conn, conn->network->reject_cause);
-	release_loc_updating_req(conn, 1);
+	loc_updating_failure(conn, 1);
 }
 
 static void schedule_reject(struct gsm_subscriber_connection *conn)
@@ -672,7 +690,7 @@
 			subscr = subscr_create(conn->network, mi_string);
 		if (!subscr) {
 			gsm0408_loc_upd_rej(conn, conn->network->reject_cause);
-			release_loc_updating_req(conn, 0);
+			loc_updating_failure(conn, 0); /* FIXME: set release == true? */
 			return 0;
 		}
 		break;
@@ -1401,7 +1419,7 @@
 	case GSM48_MT_MM_TMSI_REALL_COMPL:
 		DEBUGP(DMM, "TMSI Reallocation Completed. Subscriber: %s\n",
 		       subscr_name(conn->subscr));
-		release_loc_updating_req(conn, 1);
+		loc_updating_success(conn, 1);
 		break;
 	case GSM48_MT_MM_IMSI_DETACH_IND:
 		rc = gsm48_rx_mm_imsi_detach_ind(conn, msg);
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c
index 1bc9372..f631bcc 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -827,9 +827,9 @@
 	vty_out(vty, "IMSI Detach Indications : %lu%s",
 		net->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_DETACH].current,
 		VTY_NEWLINE);
-	vty_out(vty, "Location Update Response: %lu accept, %lu reject%s",
-		net->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_RESP_ACCEPT].current,
-		net->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_RESP_REJECT].current,
+	vty_out(vty, "Location Updating Results: %lu completed, %lu failed%s",
+		net->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_COMPLETED].current,
+		net->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_FAILED].current,
 		VTY_NEWLINE);
 	vty_out(vty, "Handover                : %lu attempted, %lu no_channel, %lu timeout, "
 		"%lu completed, %lu failed%s",

-- 
To view, visit https://gerrit.osmocom.org/2097
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I03f14c6a2f7ec5e1d3ba401e32082476fc7b0cc6
Gerrit-PatchSet: 3
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list