[MERGED] osmo-bts[master]: Alarm on various errors

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Sun Jan 8 11:15:28 UTC 2017


Max has submitted this change and it was merged.

Change subject: Alarm on various errors
......................................................................


Alarm on various errors

Send OML Failure Report for unsupported BTS attributes and other errors.

Change-Id: Ic163bcfb6361a8ebd39e0bc0f238ef51e2cb214e
Related: OS#1615
---
M src/common/bts.c
M src/common/l1sap.c
M src/common/oml.c
M src/common/rsl.c
4 files changed, 85 insertions(+), 8 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/common/bts.c b/src/common/bts.c
index d249137..efefb86 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -256,6 +256,7 @@
 {
 	struct e1inp_sign_link *link = trx->rsl_link;
 	uint8_t radio_state = link ?  NM_OPSTATE_ENABLED : NM_OPSTATE_DISABLED;
+	int rc;
 
 	LOGP(DSUM, LOGL_INFO, "RSL link (TRX %02x) state changed to %s, sending Status'.\n",
 		trx->nr, link ? "up" : "down");
@@ -263,10 +264,13 @@
 	oml_mo_state_chg(&trx->mo, radio_state, NM_AVSTATE_OK);
 
 	if (link)
-		rsl_tx_rf_res(trx);
+		rc = rsl_tx_rf_res(trx);
 	else
-		bts_model_trx_deact_rf(trx);
-
+		rc = bts_model_trx_deact_rf(trx);
+	if (rc < 0)
+		oml_tx_failure_event_rep(&trx->mo, OSMO_EVT_MAJ_RSL_FAIL, link ?
+					 "Failed to establish RSL link (%d)\n" :
+					 "Failed to deactivate RF (%d)\n", rc);
 	return 0;
 }
 
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index e6e53db..968237f 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -44,6 +44,7 @@
 #include <osmo-bts/measurement.h>
 #include <osmo-bts/bts.h>
 #include <osmo-bts/rsl.h>
+#include <osmo-bts/oml.h>
 #include <osmo-bts/bts_model.h>
 #include <osmo-bts/handover.h>
 #include <osmo-bts/power_control.h>
@@ -1024,6 +1025,10 @@
 	default:
 		LOGP(DL1P, LOGL_NOTICE, "unknown prim %d op %d\n",
 			l1sap->oph.primitive, l1sap->oph.operation);
+		oml_tx_failure_event_rep(&trx->mo, OSMO_EVT_MAJ_UKWN_MSG,
+					 "unknown prim %d op %d\n",
+					 l1sap->oph.primitive,
+					 l1sap->oph.operation);
 		break;
 	}
 
diff --git a/src/common/oml.c b/src/common/oml.c
index 870ef3c..8ccfcc6 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -345,19 +345,28 @@
 	DEBUGPC(DOML, "Rx SET BTS ATTR\n");
 
 	rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh));
-	if (rc < 0)
+	if (rc < 0) {
+		oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UNSUP_ATTR,
+					 "New value for Attribute not supported\n");
 		return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT);
+	}
 
 	/* Test for globally unsupported stuff here */
 	if (TLVP_PRESENT(&tp, NM_ATT_BCCH_ARFCN)) {
 		uint16_t arfcn = ntohs(tlvp_val16_unal(&tp, NM_ATT_BCCH_ARFCN));
 		if (arfcn > 1024) {
+			oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_WARN_SW_WARN,
+						 "Given ARFCN %d is not supported.\n",
+						 arfcn);
 			LOGP(DOML, LOGL_NOTICE, "Given ARFCN %d is not supported.\n", arfcn);
 			return oml_fom_ack_nack(msg, NM_NACK_FREQ_NOTAVAIL);
 		}
 	}
 	/* 9.4.52 Starting Time */
 	if (TLVP_PRESENT(&tp, NM_ATT_START_TIME)) {
+		oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UNSUP_ATTR,
+					 "NM_ATT_START_TIME Attribute not "
+					 "supported\n");
 		return oml_fom_ack_nack(msg, NM_NACK_SPEC_IMPL_NOTSUPP);
 	}
 
@@ -494,8 +503,12 @@
 	DEBUGPC(DOML, "Rx SET RADIO CARRIER ATTR\n");
 
 	rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh));
-	if (rc < 0)
+	if (rc < 0) {
+		oml_tx_failure_event_rep(&trx->mo, OSMO_EVT_MAJ_UNSUP_ATTR,
+					 "New value for Set Radio Attribute not"
+					 " supported\n");
 		return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT);
+	}
 
 	/* merge existing BTS attributes with new attributes */
 	tp_merged = osmo_tlvp_copy(trx->mo.nm_attr, trx->bts);
@@ -656,8 +669,12 @@
 	DEBUGPC(DOML, "Rx SET CHAN ATTR\n");
 
 	rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh));
-	if (rc < 0)
+	if (rc < 0) {
+		oml_tx_failure_event_rep(&ts->mo, OSMO_EVT_MAJ_UNSUP_ATTR,
+					 "New value for Set Channel Attribute "
+					 "not supported\n");
 		return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT);
+	}
 
 	/* 9.4.21 HSN... */
 	/* 9.4.27 MAIO */
@@ -791,11 +808,29 @@
 
 	if (msgb_l2len(msg) < sizeof(*foh)) {
 		LOGP(DOML, LOGL_NOTICE, "Formatted O&M message too short\n");
+		trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr);
+		if (trx) {
+			trx->mo.obj_inst.bts_nr = 0;
+			trx->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr;
+			trx->mo.obj_inst.ts_nr = 0xff;
+			oml_tx_failure_event_rep(&trx->mo, OSMO_EVT_MAJ_UKWN_MSG,
+						 "Formatted O&M message too short\n");
+		}
 		return -EIO;
 	}
 
 	if (foh->obj_inst.bts_nr != 0 && foh->obj_inst.bts_nr != 0xff) {
 		LOGP(DOML, LOGL_INFO, "Formatted O&M with BTS %d out of range.\n", foh->obj_inst.bts_nr);
+		trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr);
+		if (trx) {
+			trx->mo.obj_inst.bts_nr = 0;
+			trx->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr;
+			trx->mo.obj_inst.ts_nr = 0xff;
+			oml_tx_failure_event_rep(&trx->mo, OSMO_EVT_MAJ_UKWN_MSG,
+						 "Formatted O&M with BTS %d out"
+						 " of range (0:0xFF).\n",
+						 foh->obj_inst.bts_nr);
+		}
 		return oml_fom_ack_nack(msg, NM_NACK_BTSNR_UNKN);
 	}
 
@@ -829,6 +864,20 @@
 	default:
 		LOGP(DOML, LOGL_INFO, "unknown Formatted O&M msg_type 0x%02x\n",
 			foh->msg_type);
+		trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr);
+		if (trx) {
+			trx->mo.obj_inst.bts_nr = 0;
+			trx->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr;
+			trx->mo.obj_inst.ts_nr = 0xff;
+			oml_tx_failure_event_rep(&trx->mo, OSMO_EVT_MAJ_UKWN_MSG,
+						 "unknown Formatted O&M "
+						 "msg_type 0x%02x\n",
+						 foh->msg_type);
+		} else
+			oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UKWN_MSG,
+						 "unknown Formatted O&M "
+						 "msg_type 0x%02x\n",
+						 foh->msg_type);
 		ret = oml_fom_ack_nack(msg, NM_NACK_MSGTYPE_INVAL);
 	}
 
@@ -997,8 +1046,13 @@
 	DEBUGPC(DOML, "Rx IPA SET ATTR\n");
 
 	rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh));
-	if (rc < 0)
+	if (rc < 0) {
+		mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst);
+		oml_tx_failure_event_rep(mo, OSMO_EVT_MAJ_UNSUP_ATTR,
+					 "New value for IPAC Set Attribute not "
+					 "supported\n");
 		return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT);
+	}
 
 	/* Resolve MO by obj_class/obj_inst */
 	mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst);
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 9e9cbb6..be1861c 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -401,7 +401,11 @@
 	rc = paging_add_identity(btsb->paging_state, paging_group,
 				 identity_lv, chan_needed);
 	if (rc < 0) {
-		/* FIXME: notfiy the BSC somehow ?*/
+		/* FIXME: notfiy the BSC on other errors? */
+		if (rc == -ENOSPC && trx)
+			oml_tx_failure_event_rep(&trx->mo,
+						 OSMO_EVT_MIN_PAG_TAB_FULL,
+						 "BTS paging table is full\n");
 	}
 
 	pcu_tx_pag_req(identity_lv, chan_needed);
@@ -1649,6 +1653,11 @@
 			LOGP(DRSL, LOGL_ERROR,
 			     "%s IPAC Failed to create RTP/RTCP sockets\n",
 			     gsm_lchan_name(lchan));
+			oml_tx_failure_event_rep(&lchan->ts->trx->mo,
+						 OSMO_EVT_CRIT_RTP_TOUT,
+						 "%s IPAC Failed to create "
+						 "RTP/RTCP sockets\n",
+						 gsm_lchan_name(lchan));
 			return tx_ipac_XXcx_nack(lchan, RSL_ERR_RES_UNAVAIL,
 						 inc_ip_port, dch->c.msg_type);
 		}
@@ -1688,6 +1697,11 @@
 			LOGP(DRSL, LOGL_ERROR,
 			     "%s IPAC Failed to bind RTP/RTCP sockets\n",
 			     gsm_lchan_name(lchan));
+			oml_tx_failure_event_rep(&lchan->ts->trx->mo,
+						 OSMO_EVT_CRIT_RTP_TOUT,
+						 "%s IPAC Failed to bind "
+						 "RTP/RTCP sockets\n",
+						 gsm_lchan_name(lchan));
 			osmo_rtp_socket_free(lchan->abis_ip.rtp_socket);
 			lchan->abis_ip.rtp_socket = NULL;
 			msgb_queue_flush(&lchan->dl_tch_queue);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic163bcfb6361a8ebd39e0bc0f238ef51e2cb214e
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Minh-Quang Nguyen <minh-quang.nguyen at nutaq.com>



More information about the gerrit-log mailing list