laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36083?usp=email )

Change subject: Various new per-hnb RANAP and RUA counters
......................................................................

Various new per-hnb RANAP and RUA counters

example output while running HNBGW_Tests.ttcn:

OsmoHNBGW# show rate-counters skip-zero
hNodeB 0 (001-01-L2-R3-S4-C1):
          iuh:established:         17 (0/s 4/m 0/h 0/d) Number of times Iuh 
link was established
        rua:ps:connect:ul:          3 (0/s 0/m 0/h 0/d) Received RUA Connect 
requests (PS Domain)
        rua:cs:connect:ul:          9 (0/s 4/m 0/h 0/d) Received RUA Connect 
requests (CS Domain)
     rua:cs:disconnect:ul:          1 (0/s 0/m 0/h 0/d) Received RUA Disconnect 
requests in uplink (CS Domain)
     rua:ps:disconnect:dl:          2 (0/s 0/m 0/h 0/d) Transmitted RUA 
Disconnect requests in downlink (PS Domain)
     rua:cs:disconnect:dl:          6 (0/s 3/m 0/h 0/d) Transmitted RUA 
Disconnect requests in downlink (CS Domain)
rua:ps:direct_transfer:ul:          1 (0/s 0/m 0/h 0/d) Received RUA 
DirectTransfer in uplink (PS Domain)
rua:cs:direct_transfer:ul:         10 (0/s 5/m 0/h 0/d) Received RUA 
DirectTransfer in uplink (CS Domain)
rua:ps:direct_transfer:dl:          2 (0/s 0/m 0/h 0/d) Transmitted RUA 
DirectTransfer in downlink (PS Domain)
rua:cs:direct_transfer:dl:         12 (0/s 6/m 0/h 0/d) Transmitted RUA 
DirectTransfer in downlink (CS Domain)

Related: SYS#6773
Change-Id: I61bd4f51ec88fd93d8640d39228ac85f5ac5b69b
---
M include/osmocom/hnbgw/hnbgw.h
M src/osmo-hnbgw/hnbgw.c
M src/osmo-hnbgw/hnbgw_ranap.c
M src/osmo-hnbgw/hnbgw_rua.c
4 files changed, 105 insertions(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  osmith: Looks good to me, but someone else must approve
  Jenkins Builder: Verified




diff --git a/include/osmocom/hnbgw/hnbgw.h b/include/osmocom/hnbgw/hnbgw.h
index b3a6aae..3653838 100644
--- a/include/osmocom/hnbgw/hnbgw.h
+++ b/include/osmocom/hnbgw/hnbgw.h
@@ -74,6 +74,28 @@

 enum hnb_rate_ctr {
        HNB_CTR_IUH_ESTABLISHED,
+       HNB_CTR_RANAP_PS_ERR_IND_UL,
+       HNB_CTR_RANAP_CS_ERR_IND_UL,
+       HNB_CTR_RANAP_PS_RESET_REQ_UL,
+       HNB_CTR_RANAP_CS_RESET_REQ_UL,
+
+       HNB_CTR_RUA_ERR_IND,
+
+       HNB_CTR_RUA_PS_CONNECT_UL,
+       HNB_CTR_RUA_CS_CONNECT_UL,
+
+       HNB_CTR_RUA_PS_DISCONNECT_UL,
+       HNB_CTR_RUA_CS_DISCONNECT_UL,
+       HNB_CTR_RUA_PS_DISCONNECT_DL,
+       HNB_CTR_RUA_CS_DISCONNECT_DL,
+
+       HNB_CTR_RUA_PS_DT_UL,
+       HNB_CTR_RUA_CS_DT_UL,
+       HNB_CTR_RUA_PS_DT_DL,
+       HNB_CTR_RUA_CS_DT_DL,
+
+       HNB_CTR_RUA_UDT_UL,
+       HNB_CTR_RUA_UDT_DL,
 };

 enum hnb_stat {
diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c
index 927d824..418742e 100644
--- a/src/osmo-hnbgw/hnbgw.c
+++ b/src/osmo-hnbgw/hnbgw.c
@@ -317,6 +317,47 @@
 const struct rate_ctr_desc hnb_ctr_description[] = {
        [HNB_CTR_IUH_ESTABLISHED] = {
                "iuh:established", "Number of times Iuh link was established" },
+
+       [HNB_CTR_RANAP_PS_ERR_IND_UL] = {
+               "ranap:ps:error_ind:ul", "Received ERROR Indications in Uplink 
(PS Domain)" },
+       [HNB_CTR_RANAP_CS_ERR_IND_UL] = {
+               "ranap:cs:error_ind:ul", "Received ERROR Indications in Uplink 
(PS Domain)" },
+
+       [HNB_CTR_RANAP_PS_RESET_REQ_UL] = {
+               "ranap:ps:reset_req:ul", "Received RESET Requests in Uplink (PS 
Domain)" },
+       [HNB_CTR_RANAP_CS_RESET_REQ_UL] = {
+               "ranap:cs:reset_req:ul", "Received RESET Requests in Uplink (CS 
Domain)" },
+
+       [HNB_CTR_RUA_ERR_IND] = {
+               "rua:error_ind", "Received RUA Error Indications" },
+
+       [HNB_CTR_RUA_PS_CONNECT_UL] = {
+               "rua:ps:connect:ul", "Received RUA Connect requests (PS 
Domain)" },
+       [HNB_CTR_RUA_CS_CONNECT_UL] = {
+               "rua:cs:connect:ul", "Received RUA Connect requests (CS 
Domain)" },
+
+       [HNB_CTR_RUA_PS_DISCONNECT_UL] = {
+               "rua:ps:disconnect:ul", "Received RUA Disconnect requests in 
uplink (PS Domain)" },
+       [HNB_CTR_RUA_CS_DISCONNECT_UL] = {
+               "rua:cs:disconnect:ul", "Received RUA Disconnect requests in 
uplink (CS Domain)" },
+       [HNB_CTR_RUA_PS_DISCONNECT_DL] = {
+               "rua:ps:disconnect:dl", "Transmitted RUA Disconnect requests in 
downlink (PS Domain)" },
+       [HNB_CTR_RUA_CS_DISCONNECT_DL] = {
+               "rua:cs:disconnect:dl", "Transmitted RUA Disconnect requests in 
downlink (CS Domain)" },
+
+       [HNB_CTR_RUA_PS_DT_UL] = {
+               "rua:ps:direct_transfer:ul", "Received RUA DirectTransfer in 
uplink (PS Domain)" },
+       [HNB_CTR_RUA_CS_DT_UL] = {
+               "rua:cs:direct_transfer:ul", "Received RUA DirectTransfer in 
uplink (CS Domain)" },
+       [HNB_CTR_RUA_PS_DT_DL] = {
+               "rua:ps:direct_transfer:dl", "Transmitted RUA DirectTransfer in 
downlink (PS Domain)" },
+       [HNB_CTR_RUA_CS_DT_DL] = {
+               "rua:cs:direct_transfer:dl", "Transmitted RUA DirectTransfer in 
downlink (CS Domain)" },
+
+       [HNB_CTR_RUA_UDT_UL] = {
+               "rua:unit_data:ul", "Received RUA UnitData (UDT) in uplink" },
+       [HNB_CTR_RUA_UDT_DL] = {
+               "rua:unit_data:dl", "Transmitted RUA UnitData (UDT) in 
downlink" },
 };

 const struct rate_ctr_group_desc hnb_ctrg_desc = {
diff --git a/src/osmo-hnbgw/hnbgw_ranap.c b/src/osmo-hnbgw/hnbgw_ranap.c
index 73b5018..2977730 100644
--- a/src/osmo-hnbgw/hnbgw_ranap.c
+++ b/src/osmo-hnbgw/hnbgw_ranap.c
@@ -66,6 +66,7 @@

        LOGHNB(hnb, DRANAP, LOGL_INFO, "Rx RESET.req(%s,%s)\n", is_ps ? "ps" : 
"cs",
                ranap_cause_str(&ies.cause));
+       HNBP_CTR_INC(hnb->persistent, is_ps ? HNB_CTR_RANAP_PS_RESET_REQ_UL : 
HNB_CTR_RANAP_CS_RESET_REQ_UL);

        /* FIXME: Actually we have to wait for some guard time? */
        /* FIXME: Reset all resources related to this HNB/RNC */
@@ -78,15 +79,20 @@
 {
        RANAP_ErrorIndicationIEs_t ies;
        int rc;
+       bool is_ps = false;

        rc = ranap_decode_errorindicationies(&ies, in);
        if (rc < 0)
                return rc;

+       if (ies.cN_DomainIndicator == RANAP_CN_DomainIndicator_ps_domain)
+               is_ps = true;
+
        if (ies.presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) {
                LOGHNB(hnb, DRANAP, LOGL_ERROR, "Rx ERROR.ind(%s)\n", 
ranap_cause_str(&ies.cause));
        } else
                LOGHNB(hnb, DRANAP, LOGL_ERROR, "Rx ERROR.ind\n");
+       HNBP_CTR_INC(hnb->persistent, is_ps ? HNB_CTR_RANAP_PS_ERR_IND_UL : 
HNB_CTR_RANAP_CS_ERR_IND_UL);

        return 0;
 }
diff --git a/src/osmo-hnbgw/hnbgw_rua.c b/src/osmo-hnbgw/hnbgw_rua.c
index 76e3231..f07c186 100644
--- a/src/osmo-hnbgw/hnbgw_rua.c
+++ b/src/osmo-hnbgw/hnbgw_rua.c
@@ -83,6 +83,7 @@
        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RUA_ConnectionlessTransfer, &out);

        LOGHNB(hnb, DRUA, LOGL_DEBUG, "transmitting RUA payload of %u bytes\n", 
msgb_length(msg));
+       HNBP_CTR_INC(hnb->persistent, HNB_CTR_RUA_UDT_DL);

        return hnbgw_rua_tx(hnb, msg);
 }
@@ -120,6 +121,7 @@

        LOGHNB(hnb, DRUA, LOGL_DEBUG, "transmitting RUA DirectTransfer (cn=%s) 
payload of %u bytes\n",
                is_ps ? "ps" : "cs", msgb_length(msg));
+       HNBP_CTR_INC(hnb->persistent, is_ps ? HNB_CTR_RUA_PS_DT_DL : 
HNB_CTR_RUA_CS_DT_DL);

        return hnbgw_rua_tx(hnb, msg);
 }
@@ -157,9 +159,9 @@
                                              &out);
        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RUA_Disconnect, &out);

-
        LOGHNB(hnb, DRUA, LOGL_DEBUG, "transmitting RUA Disconnect (cn=%s) 
payload of %u bytes\n",
               is_ps ? "ps" : "cs", msgb_length(msg));
+       HNBP_CTR_INC(hnb->persistent, is_ps ? HNB_CTR_RUA_PS_DISCONNECT_DL : 
HNB_CTR_RUA_CS_DISCONNECT_DL);

        return hnbgw_rua_tx(hnb, msg);
 }
@@ -386,6 +388,8 @@
        LOGHNB(hnb, DRUA, LOGL_DEBUG, "RUA %s Connect.req(ctx=0x%x, %s)\n",
                ranap_domain_name(ies.cN_DomainIndicator), context_id,
                ies.establishment_Cause == 
RUA_Establishment_Cause_emergency_call ? "emergency" : "normal");
+       HNBP_CTR_INC(hnb->persistent, ies.cN_DomainIndicator == DOMAIN_PS ?
+                    HNB_CTR_RUA_PS_CONNECT_UL : HNB_CTR_RUA_CS_CONNECT_UL);

        rc = rua_to_scu(hnb, ies.cN_DomainIndicator, 
RUA_ProcedureCode_id_Connect,
                        context_id, 0, ies.ranaP_Message.buf,
@@ -415,6 +419,8 @@

        LOGHNB(hnb, DRUA, LOGL_DEBUG, "RUA 
Disconnect.req(ctx=0x%x,cause=%s)\n", context_id,
                rua_cause_str(&ies.cause));
+       HNBP_CTR_INC(hnb->persistent, ies.cN_DomainIndicator == DOMAIN_PS ?
+                    HNB_CTR_RUA_PS_DISCONNECT_UL : 
HNB_CTR_RUA_CS_DISCONNECT_UL);

        if (ies.presenceMask & DISCONNECTIES_RUA_RANAP_MESSAGE_PRESENT) {
                ranap_data = ies.ranaP_Message.buf;
@@ -444,6 +450,8 @@
        context_id = asn1bitstr_to_u24(&ies.context_ID);

        LOGHNB(hnb, DRUA, LOGL_DEBUG, "RUA Data.req(ctx=0x%x)\n", context_id);
+       HNBP_CTR_INC(hnb->persistent, ies.cN_DomainIndicator == DOMAIN_PS ?
+                    HNB_CTR_RUA_PS_DT_UL : HNB_CTR_RUA_CS_DT_UL);

        rc = rua_to_scu(hnb,
                        ies.cN_DomainIndicator,
@@ -467,6 +475,7 @@
                return rc;

        LOGHNB(hnb, DRUA, LOGL_DEBUG, "RUA UData.req()\n");
+       HNBP_CTR_INC(hnb->persistent, HNB_CTR_RUA_UDT_UL);

        /* according tot the spec, we can primarily receive Overload,
         * Reset, Reset ACK, Error Indication, reset Resource, Reset
@@ -493,6 +502,7 @@
                return rc;

        LOGHNB(hnb, DRUA, LOGL_ERROR, "RUA UData.ErrorInd(%s)\n", 
rua_cause_str(&ies.cause));
+       HNBP_CTR_INC(hnb->persistent, HNB_CTR_RUA_ERR_IND);

        rua_free_errorindicationies(&ies);
        return rc;

--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36083?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: I61bd4f51ec88fd93d8640d39228ac85f5ac5b69b
Gerrit-Change-Number: 36083
Gerrit-PatchSet: 5
Gerrit-Owner: laforge <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to