Max has uploaded this change for review. ( https://gerrit.osmocom.org/12448


Change subject: IPA: log OML/RSL link drop reason
......................................................................

IPA: log OML/RSL link drop reason

There could multiple reason for OML or RSL link towards BTS to be
dropped: ctrl command, vty, new link etc. Introduce "reason" parameter
to corresponding functions and log it on link drop to simplify
troubleshooting issues with more complex setups.

Change-Id: I8c8d8132ba67c31e40dbecdfe2e09be08c744899
---
M include/osmocom/bsc/ipaccess.h
M src/osmo-bsc/bsc_ctrl_commands.c
M src/osmo-bsc/bsc_rf_ctrl.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts_ipaccess_nanobts.c
5 files changed, 17 insertions(+), 17 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/48/12448/1

diff --git a/include/osmocom/bsc/ipaccess.h b/include/osmocom/bsc/ipaccess.h
index 692e795..3853270 100644
--- a/include/osmocom/bsc/ipaccess.h
+++ b/include/osmocom/bsc/ipaccess.h
@@ -30,9 +30,9 @@
        uint8_t data[0];
 } __attribute__((packed));

-void ipaccess_drop_oml(struct gsm_bts *bts);
+void ipaccess_drop_oml(struct gsm_bts *bts, const char *reason);
 void ipaccess_drop_oml_deferred(struct gsm_bts *bts);
-void ipaccess_drop_rsl(struct gsm_bts_trx *trx);
+void ipaccess_drop_rsl(struct gsm_bts_trx *trx, const char *reason);

 struct sdp_header_item {
        struct sdp_header_entry header_entry;
diff --git a/src/osmo-bsc/bsc_ctrl_commands.c b/src/osmo-bsc/bsc_ctrl_commands.c
index 171feaf..ca182d7 100644
--- a/src/osmo-bsc/bsc_ctrl_commands.c
+++ b/src/osmo-bsc/bsc_ctrl_commands.c
@@ -106,7 +106,7 @@
                        llist_for_each_entry_reverse(trx, &bts->trx_list, list)
                                abis_nm_ipaccess_restart(trx);
                } else
-                       ipaccess_drop_oml(bts);
+                       ipaccess_drop_oml(bts, "ctrl net.apply-configuration");
        }

        cmd->reply = "Tried to drop the BTS";
@@ -189,7 +189,7 @@
                return CTRL_CMD_ERROR;
        }

-       ipaccess_drop_oml(bts);
+       ipaccess_drop_oml(bts, "ctrl bts.apply-configuration");
        cmd->reply = "Tried to drop the BTS";
        return CTRL_CMD_REPLY;
 }
diff --git a/src/osmo-bsc/bsc_rf_ctrl.c b/src/osmo-bsc/bsc_rf_ctrl.c
index 791abf6..0aa8e49 100644
--- a/src/osmo-bsc/bsc_rf_ctrl.c
+++ b/src/osmo-bsc/bsc_rf_ctrl.c
@@ -227,7 +227,7 @@
                            trx->mo.nm_state.operational != NM_OPSTATE_ENABLED 
||
                            trx->mo.nm_state.administrative != 
NM_STATE_UNLOCKED) {
                                LOGP(DNM, LOGL_ERROR, "RF activation failed. 
Starting again.\n");
-                               ipaccess_drop_oml(bts);
+                               ipaccess_drop_oml(bts, "rf check");
                                break;
                        }
                }
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 032305e..876273e 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -4433,11 +4433,11 @@

        /* close all connections */
        if (strcmp(argv[1], "oml") == 0) {
-               ipaccess_drop_oml(bts);
+               ipaccess_drop_oml(bts, "vty");
        } else if (strcmp(argv[1], "rsl") == 0) {
                /* close all rsl connections */
                llist_for_each_entry(trx, &bts->trx_list, list) {
-                       ipaccess_drop_rsl(trx);
+                       ipaccess_drop_rsl(trx, "vty");
                }
        } else {
                vty_out(vty, "Argument must be 'oml# or 'rsl'.%s", VTY_NEWLINE);
diff --git a/src/osmo-bsc/bts_ipaccess_nanobts.c 
b/src/osmo-bsc/bts_ipaccess_nanobts.c
index cf81a22..56103b6 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts.c
@@ -389,12 +389,12 @@
 }

 /* These are exported because they are used by the VTY interface. */
-void ipaccess_drop_rsl(struct gsm_bts_trx *trx)
+void ipaccess_drop_rsl(struct gsm_bts_trx *trx, const char *reason)
 {
        if (!trx->rsl_link)
                return;

-       LOGP(DLINP, LOGL_NOTICE, "(bts=%d,trx=%d) Dropping RSL link.\n", 
trx->bts->nr, trx->nr);
+       LOGP(DLINP, LOGL_NOTICE, "(bts=%d,trx=%d) Dropping RSL link: %s\n", 
trx->bts->nr, trx->nr, reason);
        e1inp_sign_link_destroy(trx->rsl_link);
        trx->rsl_link = NULL;

@@ -402,7 +402,7 @@
                paging_flush_bts(trx->bts, NULL);
 }

-void ipaccess_drop_oml(struct gsm_bts *bts)
+void ipaccess_drop_oml(struct gsm_bts *bts, const char *reason)
 {
        struct gsm_bts *rdep_bts;
        struct gsm_bts_trx *trx;
@@ -413,14 +413,14 @@
        if (!bts->oml_link)
                return;

-       LOGP(DLINP, LOGL_NOTICE, "(bts=%d) Dropping OML link.\n", bts->nr);
+       LOGP(DLINP, LOGL_NOTICE, "(bts=%d) Dropping OML link: %s\n", bts->nr, 
reason);
        e1inp_sign_link_destroy(bts->oml_link);
        bts->oml_link = NULL;
        bts->uptime = 0;

        /* we have issues reconnecting RSL, drop everything. */
        llist_for_each_entry(trx, &bts->trx_list, list)
-               ipaccess_drop_rsl(trx);
+               ipaccess_drop_rsl(trx, "OML link drop");

        gsm_bts_all_ts_dispatch(bts, TS_EV_OML_DOWN, NULL);

@@ -438,7 +438,7 @@
                        continue;
                LOGP(DLINP, LOGL_NOTICE, "Dropping BTS(%u) due BTS(%u).\n",
                        rdep_bts->nr, bts->nr);
-               ipaccess_drop_oml(rdep_bts);
+               ipaccess_drop_oml(rdep_bts, "Dependency link drop");
        }
 }

@@ -447,7 +447,7 @@
 static void ipaccess_drop_oml_deferred_cb(void *data)
 {
        struct gsm_bts *bts = (struct gsm_bts *) data;
-       ipaccess_drop_oml(bts);
+       ipaccess_drop_oml(bts, "Deferred link drop");
 }
 /*! Deferr \ref ipacces_drop_oml through a timer to avoid dropping structures 
in
  *  current code context. This may be needed if we want to destroy the OML link
@@ -537,7 +537,7 @@
        switch(type) {
        case E1INP_SIGN_OML:
                /* remove old OML signal link for this BTS. */
-               ipaccess_drop_oml(bts);
+               ipaccess_drop_oml(bts, "new OML link");

                if (!bts_depend_check(bts)) {
                        LOGP(DLINP, LOGL_NOTICE,
@@ -568,7 +568,7 @@
                        return NULL;

                /* remove old RSL link for this TRX. */
-               ipaccess_drop_rsl(trx);
+               ipaccess_drop_rsl(trx, "new RSL link");

                /* set new RSL link for this TRX. */
                line = bts->oml_link->ts->line;
@@ -609,7 +609,7 @@
                        osmo_timer_del(&link->trx->rsl_connect_timeout);
        }
        if (bts != NULL)
-               ipaccess_drop_oml(bts);
+               ipaccess_drop_oml(bts, "link down");
 }

 /* This function is called if we receive one OML/RSL message. */

--
To view, visit https://gerrit.osmocom.org/12448
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c8d8132ba67c31e40dbecdfe2e09be08c744899
Gerrit-Change-Number: 12448
Gerrit-PatchSet: 1
Gerrit-Owner: Max <[email protected]>

Reply via email to