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 @@ enum hnb_rate_ctr { 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 @@ enum hnb_rate_ctr { 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 @@ const struct rate_ctr_desc hnb_ctr_description[] = { [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 @@ const struct rate_ctr_desc hnb_ctr_description[] = { "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..c4460ff 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,15 +118,12 @@ static void kpi_ranap_process_dl_rab_ass_req(struct hnbgw_context_map *map, rana 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 = {}; RANAP_RAB_ReleaseItemIEs_t *rab_rel_item_ies = &_rab_rel_item_ies; RANAP_RAB_ReleaseItem_t *rab_rel_item; + unsigned int ctr_num; uint8_t rab_id; if (!release_list_ie) @@ -133,6 +142,15 @@ static void kpi_ranap_process_dl_rab_ass_req(struct hnbgw_context_map *map, rana switch (map->rab_state[rab_id]) { case RAB_STATE_ACTIVE: + 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,