[PATCH] osmo-bsc[master]: OML: consider RSL link state

Max gerrit-no-reply at lists.osmocom.org
Mon Oct 9 15:52:05 UTC 2017


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/4169

to look at the new patch set (#2).

OML: consider RSL link state

OML link state is available via vty ("sh bts 0" command) and
ctrl ("oml-connection-state" RO variable).

When showing OML link state, take into consideration RSL link state as
well: if OML is up but RSL is missing show it as degraded.

Change-Id: I5952fc59e4d82e0aa627ad91d20f964d9559a4c4
Related: OS#2486
---
M include/osmocom/bsc/gsm_data.h
M src/libbsc/bsc_ctrl_commands.c
M src/libbsc/bsc_init.c
M src/libbsc/bsc_vty.c
4 files changed, 21 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/69/4169/2

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 6814662..22ef911 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -654,6 +654,8 @@
 extern const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE+1];
 extern const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1];
 
+bool all_trx_rsl_connected(const struct gsm_bts *bts);
+
 /* control interface handling */
 int bsc_base_ctrl_cmds_install(void);
 
diff --git a/src/libbsc/bsc_ctrl_commands.c b/src/libbsc/bsc_ctrl_commands.c
index 7c2bfb5..cedc327 100644
--- a/src/libbsc/bsc_ctrl_commands.c
+++ b/src/libbsc/bsc_ctrl_commands.c
@@ -233,7 +233,11 @@
 {
 	struct gsm_bts *bts = cmd->node;
 
-	cmd->reply = bts->oml_link ? "connected" : "disconnected";
+	if (bts->oml_link)
+		cmd->reply = all_trx_rsl_connected(bts) ? "connected" : "degraded";
+	else
+		cmd->reply = "disconnected";
+
 	return CTRL_CMD_REPLY;
 }
 
diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c
index f3e13e2..c08b513 100644
--- a/src/libbsc/bsc_init.c
+++ b/src/libbsc/bsc_init.c
@@ -38,6 +38,7 @@
 #include <osmocom/bsc/common_bsc.h>
 #include <osmocom/bsc/pcu_if.h>
 #include <limits.h>
+#include <stdbool.h>
 
 /* global pointer to the gsm network data structure */
 extern struct gsm_network *bsc_gsmnet;
@@ -97,6 +98,18 @@
 	return 0;
 }
 
+bool all_trx_rsl_connected(const struct gsm_bts *bts)
+{
+	const struct gsm_bts_trx *trx;
+
+	llist_for_each_entry(trx, &bts->trx_list, list) {
+		if (!trx->rsl_link)
+			return false;
+	}
+
+	return true;
+}
+
 static int rsl_si(struct gsm_bts_trx *trx, enum osmo_sysinfo_type i, int si_len)
 {
 	struct gsm_bts *bts = trx->bts;
diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index f1c78c8..8c3c8d0 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -310,7 +310,7 @@
 	if (is_ipaccess_bts(bts)) {
 		vty_out(vty, "  OML Link state: ");
 		if (bts->oml_link) {
-			vty_out(vty, "connected");
+			vty_out(vty, all_trx_rsl_connected(bts) ? "connected" : "degraded");
 			if (bts->uptime) {
 				rc = clock_gettime(CLOCK_MONOTONIC, &tp);
 				if (rc == 0) { /* monotonic clock helps to ensure that conversion below is valid */

-- 
To view, visit https://gerrit.osmocom.org/4169
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I5952fc59e4d82e0aa627ad91d20f964d9559a4c4
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder


More information about the gerrit-log mailing list