laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36498?usp=email )


Change subject: counters: Distinguish between normal and abnormal release cause
......................................................................

counters: Distinguish between normal and abnormal release cause

It is interesting to know if a release was normal (as expected/requested
by the NAS layer, typically indicating a user-requested call end) or
abnormal (radio failure, pre-emption or whatever other event that the
user did not expect).

Related: SYS#6773
Change-Id: Idd2f845b7db448064b693ac1efdc8db006a47a11
---
M include/osmocom/hnbgw/hnbgw.h
M src/osmo-hnbgw/hnbgw.c
M src/osmo-hnbgw/kpi_ranap.c
3 files changed, 54 insertions(+), 10 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/98/36498/1

diff --git a/include/osmocom/hnbgw/hnbgw.h b/include/osmocom/hnbgw/hnbgw.h
index b3ba3b2..8daf713 100644
--- a/include/osmocom/hnbgw/hnbgw.h
+++ b/include/osmocom/hnbgw/hnbgw.h
@@ -100,6 +100,8 @@

        HNB_CTR_RANAP_PS_RAB_REL_REQ,
        HNB_CTR_RANAP_CS_RAB_REL_REQ,
+       HNB_CTR_RANAP_PS_RAB_REL_REQ_ABNORMAL,
+       HNB_CTR_RANAP_CS_RAB_REL_REQ_ABNORMAL,

        HNB_CTR_RANAP_PS_RAB_REL_CNF,
        HNB_CTR_RANAP_CS_RAB_REL_CNF,
@@ -109,6 +111,8 @@

        HNB_CTR_RANAP_PS_RAB_REL_IMPLICIT,
        HNB_CTR_RANAP_CS_RAB_REL_IMPLICIT,
+       HNB_CTR_RANAP_PS_RAB_REL_IMPLICIT_ABNORMAL,
+       HNB_CTR_RANAP_CS_RAB_REL_IMPLICIT_ABNORMAL,

        HNB_CTR_RUA_ERR_IND,

diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c
index 64bb66f..fe29c29 100644
--- a/src/osmo-hnbgw/hnbgw.c
+++ b/src/osmo-hnbgw/hnbgw.c
@@ -398,11 +398,14 @@
        [HNB_CTR_RANAP_CS_RAB_MOD_FAIL] = {
                "ranap:cs:rab_mod:fail", "CS RAB Modifications failed" },

-
        [HNB_CTR_RANAP_PS_RAB_REL_REQ] = {
-               "ranap:ps:rab_rel:req", "PS RAB Release requested" },
+               "ranap:ps:rab_rel:req:normal", "PS RAB Release requested (by 
CN), normal" },
        [HNB_CTR_RANAP_CS_RAB_REL_REQ] = {
-               "ranap:cs:rab_rel:req", "CS RAB Release requested" },
+               "ranap:cs:rab_rel:req:normal", "CS RAB Release requested (by 
CN), normal" },
+       [HNB_CTR_RANAP_PS_RAB_REL_REQ_ABNORMAL] = {
+               "ranap:ps:rab_rel:req:abnormal", "PS RAB Release requested (by 
CN), abnormal" },
+       [HNB_CTR_RANAP_CS_RAB_REL_REQ_ABNORMAL] = {
+               "ranap:cs:rab_rel:req:abnormal", "CS RAB Release requested (by 
CN), abnormal" },

        [HNB_CTR_RANAP_PS_RAB_REL_CNF] = {
                "ranap:ps:rab_rel:cnf", "PS RAB Release confirmed" },
@@ -415,9 +418,13 @@
                "ranap:cs:rab_rel:fail", "CS RAB Release failed" },

        [HNB_CTR_RANAP_PS_RAB_REL_IMPLICIT] = {
-               "ranap:ps:rab_rel:implicit", "PS RAB Release implicit (during 
Iu Release)" },
+               "ranap:ps:rab_rel:implicit:normal", "PS RAB Release implicit 
(during Iu Release), normal" },
        [HNB_CTR_RANAP_CS_RAB_REL_IMPLICIT] = {
-               "ranap:cs:rab_rel:implicit", "CS RAB Release implicit (during 
Iu Release)" },
+               "ranap:cs:rab_rel:implicit:normal", "CS RAB Release implicit 
(during Iu Release), normal" },
+       [HNB_CTR_RANAP_PS_RAB_REL_IMPLICIT_ABNORMAL] = {
+               "ranap:ps:rab_rel:implicit:abnormal", "PS RAB Release implicit 
(during Iu Release), abnormal" },
+       [HNB_CTR_RANAP_CS_RAB_REL_IMPLICIT_ABNORMAL] = {
+               "ranap:cs:rab_rel:implicit:abnormal", "CS RAB Release implicit 
(during Iu Release), abnormal" },

        [HNB_CTR_RUA_ERR_IND] = {
                "rua:error_ind", "Received RUA Error Indications" },
diff --git a/src/osmo-hnbgw/kpi_ranap.c b/src/osmo-hnbgw/kpi_ranap.c
index 76f6e22..495fc34 100644
--- a/src/osmo-hnbgw/kpi_ranap.c
+++ b/src/osmo-hnbgw/kpi_ranap.c
@@ -36,14 +36,26 @@
 static void kpi_ranap_process_dl_iu_rel_cmd(struct hnbgw_context_map *map, 
const ranap_message *ranap)
 {
        struct hnb_persistent *hnbp = map->hnb_ctx->persistent;
+       const RANAP_Cause_t *cause;

        OSMO_ASSERT(ranap->procedureCode == RANAP_ProcedureCode_id_Iu_Release);

+       cause = &ranap->msg.iu_ReleaseCommandIEs.cause;
+
        /* When Iu is released, all RABs are released implicitly */
        for (unsigned int i = 0; i < ARRAY_SIZE(map->rab_state); i++) {
+               unsigned int ctr_num;
                switch (map->rab_state[i]) {
                case RAB_STATE_ACTIVE:
-                       HNBP_CTR_INC(hnbp, map->is_ps ? 
HNB_CTR_RANAP_PS_RAB_REL_IMPLICIT : HNB_CTR_RANAP_CS_RAB_REL_IMPLICIT);
+                       if (cause->present == RANAP_Cause_PR_nAS ||
+                           cause->choice.nAS == RANAP_CauseNAS_normal_release) 
{
+                               ctr_num = HNB_CTR_RANAP_PS_RAB_REL_IMPLICIT;
+                       } else {
+                               ctr_num = 
HNB_CTR_RANAP_PS_RAB_REL_IMPLICIT_ABNORMAL;
+                       }
+                       if (!map->is_ps)
+                               ctr_num++;
+                       HNBP_CTR_INC(hnbp, ctr_num);
                        break;
                }
        }
@@ -106,10 +118,6 @@

        if (ies->presenceMask & 
RAB_ASSIGNMENTREQUESTIES_RANAP_RAB_RELEASELIST_PRESENT) {
                RANAP_RAB_ReleaseList_t *r_list = &ies->raB_ReleaseList;
-               /* increment number of released RABs, we don't need to do that 
individually during iteration */
-               HNBP_CTR_ADD(hnbp, map->is_ps ? HNB_CTR_RANAP_PS_RAB_REL_REQ : 
HNB_CTR_RANAP_CS_RAB_REL_REQ,
-                            r_list->raB_ReleaseList_ies.list.count);
-
                for (unsigned int i = 0; i < 
r_list->raB_ReleaseList_ies.list.count; i++) {
                        RANAP_IE_t *release_list_ie = 
r_list->raB_ReleaseList_ies.list.array[i];
                        RANAP_RAB_ReleaseItemIEs_t _rab_rel_item_ies = {};
@@ -133,6 +141,16 @@

                        switch (map->rab_state[rab_id]) {
                        case RAB_STATE_ACTIVE:
+                               unsigned int ctr_num;
+                               if (rab_rel_item->cause.present == 
RANAP_Cause_PR_nAS &&
+                                   rab_rel_item->cause.choice.nAS == 
RANAP_CauseNAS_normal_release) {
+                                       ctr_num = HNB_CTR_RANAP_PS_RAB_REL_REQ;
+                               } else {
+                                       ctr_num = 
HNB_CTR_RANAP_PS_RAB_REL_REQ_ABNORMAL;
+                               }
+                               if (!map->is_ps)
+                                       ctr_num++;
+                               HNBP_CTR_INC(hnbp, ctr_num);
                                break;
                        default:
                                LOG_MAP(map, DRANAP, LOGL_NOTICE,

--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36498?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Idd2f845b7db448064b693ac1efdc8db006a47a11
Gerrit-Change-Number: 36498
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <[email protected]>
Gerrit-MessageType: newchange

Reply via email to