aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2019-01-02 15:28:17 +0100
committerMax <msuraev@sysmocom.de>2019-01-03 19:10:58 +0000
commit45867378f1def5ce15d09c8ad9a32dc9cc4aa57d (patch)
tree02fb81bb592389fb9ec8d3c8ac97b72253e2726a
parent38134eac8bfe55fab5d3f3af2b77445f14f3966c (diff)
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
-rw-r--r--include/osmocom/bsc/ipaccess.h4
-rw-r--r--src/osmo-bsc/bsc_ctrl_commands.c4
-rw-r--r--src/osmo-bsc/bsc_rf_ctrl.c2
-rw-r--r--src/osmo-bsc/bsc_vty.c4
-rw-r--r--src/osmo-bsc/bts_ipaccess_nanobts.c20
5 files changed, 17 insertions, 17 deletions
diff --git a/include/osmocom/bsc/ipaccess.h b/include/osmocom/bsc/ipaccess.h
index 692e79576..3853270ac 100644
--- a/include/osmocom/bsc/ipaccess.h
+++ b/include/osmocom/bsc/ipaccess.h
@@ -30,9 +30,9 @@ struct ipac_ext_lac_cmd {
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 171feaff0..ca182d7d1 100644
--- a/src/osmo-bsc/bsc_ctrl_commands.c
+++ b/src/osmo-bsc/bsc_ctrl_commands.c
@@ -106,7 +106,7 @@ static int set_net_apply_config(struct ctrl_cmd *cmd, void *data)
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 @@ static int set_bts_apply_config(struct ctrl_cmd *cmd, void *data)
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 791abf6cb..0aa8e494a 100644
--- a/src/osmo-bsc/bsc_rf_ctrl.c
+++ b/src/osmo-bsc/bsc_rf_ctrl.c
@@ -227,7 +227,7 @@ static void rf_check_cb(void *_data)
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 032305e4b..876273e6d 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -4433,11 +4433,11 @@ DEFUN(drop_bts,
/* 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 cf81a22c6..56103b6f2 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts.c
@@ -389,12 +389,12 @@ find_bts_by_unitid(struct gsm_network *net, uint16_t site_id, uint16_t bts_id)
}
/* 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 @@ void ipaccess_drop_rsl(struct gsm_bts_trx *trx)
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 @@ void ipaccess_drop_oml(struct gsm_bts *bts)
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 @@ void ipaccess_drop_oml(struct gsm_bts *bts)
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 @@ void ipaccess_drop_oml(struct gsm_bts *bts)
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 @@ ipaccess_sign_link_up(void *unit_data, struct e1inp_line *line,
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 @@ ipaccess_sign_link_up(void *unit_data, struct e1inp_line *line,
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 @@ static void ipaccess_sign_link_down(struct e1inp_line *line)
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. */