Change in osmo-bsc[master]: separate 'interference-meas level-bounds' cfg and used

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/.

neels gerrit-no-reply at lists.osmocom.org
Thu Jul 8 04:49:22 UTC 2021


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/24887 )


Change subject: separate 'interference-meas level-bounds' cfg and used
......................................................................

separate 'interference-meas level-bounds' cfg and used

The VTY defun already indicates BSC_VTY_ATTR_RESTART_ABIS_OML_LINK
correctly, but so far we would start using the new values internally,
even before the OML link is restarted. Fix that.

Have bts->interf_meas_params twice: interf_meas_params_cfg for the VTY
configured values, and interf_meas_params_used for the values that the
BTS actually knows about, after they were sent via OML.

In a running BSC, when changing the interference level boundaries on the
telnet VTY, the BTS is not immediately told about the change. That would
require a BTS restart. Hence store the cfg values separately in
interf_meas_params_cfg. For comparing/printing interference levels in a
running BTS, only employ the values that were actually sent via OML and
placed in interf_meas_params_used.

Change-Id: Iad8cf4151ff7f86dc0549158ed5d91d788d40b1f
---
M include/osmocom/bsc/bts.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts.c
M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
M src/osmo-bsc/nm_bts_fsm.c
M tests/handover/handover_test.c
7 files changed, 27 insertions(+), 24 deletions(-)



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

diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index 2e88129..f618e2c 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -548,8 +548,10 @@
 	/* Maximum BCCH carrier power reduction */
 	uint8_t c0_max_power_red_db;
 
-	/* Interference Measurement Parameters */
-	struct gsm_interf_meas_params interf_meas_params;
+	/* Interference Measurement Parameters, as read from VTY */
+	struct gsm_interf_meas_params interf_meas_params_cfg;
+	/* Interference Measurement Parameters, as last sent via OML */
+	struct gsm_interf_meas_params interf_meas_params_used;
 
 	/* We will ignore CHAN RQD with access delay greater than rach_max_delay */
 	uint8_t rach_max_delay;
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 08e9411..b240cbc 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1525,14 +1525,14 @@
 		/* Store the actual received index */
 		lchan->interf_band = interf_band;
 		/* Clamp the index to 5 before accessing array of interference band bounds */
-		interf_band = OSMO_MIN(interf_band, ARRAY_SIZE(bts->interf_meas_params.bounds_dbm)-1);
+		interf_band = OSMO_MIN(interf_band, ARRAY_SIZE(bts->interf_meas_params_used.bounds_dbm)-1);
 		/* FIXME: when testing with ip.access nanoBTS, we observe a value range of 1..6. According to spec, it
 		 * seems like values 0..5 are intended: 3GPP TS 48.058 9.3.21 Resource Information says:
 		 * "The Interf Band field (bits 6-8) indicates in binary the interference level expressed as one of five
 		 * possible interference level bands as defined by O&M."
 		 * and 3GPP TS 52.021 9.4.25 "Interference level Boundaries" (OML) defines values 0, X1, X2, X3, X4, X5.
 		 * If nanoBTS sends 6, the above code clamps it to 5, so that we lose one band in accuracy. */
-		lchan->interf_dbm = -((int16_t)bts->interf_meas_params.bounds_dbm[interf_band]);
+		lchan->interf_dbm = -((int16_t)bts->interf_meas_params_used.bounds_dbm[interf_band]);
 	}
 
 	return 0;
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 2b52b16..e0aa97f 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -1272,22 +1272,22 @@
 	    || bts->repeated_acch_policy.dl_facch_cmd)
 		vty_out(vty, "  repeat rxqual %u%s", bts->repeated_acch_policy.rxqual, VTY_NEWLINE);
 
-	if (bts->interf_meas_params.avg_period != interf_meas_params_def.avg_period) {
+	if (bts->interf_meas_params_cfg.avg_period != interf_meas_params_def.avg_period) {
 		vty_out(vty, "  interference-meas avg-period %u%s",
-			bts->interf_meas_params.avg_period,
+			bts->interf_meas_params_cfg.avg_period,
 			VTY_NEWLINE);
 	}
-	if (memcmp(bts->interf_meas_params.bounds_dbm,
+	if (memcmp(bts->interf_meas_params_cfg.bounds_dbm,
 		   interf_meas_params_def.bounds_dbm,
 		   sizeof(interf_meas_params_def.bounds_dbm))) {
 		vty_out(vty, "  interference-meas level-bounds "
 			"%d %d %d %d %d %d%s",
-			-1 * bts->interf_meas_params.bounds_dbm[0],
-			-1 * bts->interf_meas_params.bounds_dbm[1],
-			-1 * bts->interf_meas_params.bounds_dbm[2],
-			-1 * bts->interf_meas_params.bounds_dbm[3],
-			-1 * bts->interf_meas_params.bounds_dbm[4],
-			-1 * bts->interf_meas_params.bounds_dbm[5],
+			-1 * bts->interf_meas_params_cfg.bounds_dbm[0],
+			-1 * bts->interf_meas_params_cfg.bounds_dbm[1],
+			-1 * bts->interf_meas_params_cfg.bounds_dbm[2],
+			-1 * bts->interf_meas_params_cfg.bounds_dbm[3],
+			-1 * bts->interf_meas_params_cfg.bounds_dbm[4],
+			-1 * bts->interf_meas_params_cfg.bounds_dbm[5],
 			VTY_NEWLINE);
 	}
 
@@ -4997,7 +4997,7 @@
 {
 	struct gsm_bts *bts = vty->index;
 
-	bts->interf_meas_params.avg_period = atoi(argv[0]);
+	bts->interf_meas_params_cfg.avg_period = atoi(argv[0]);
 
 	return CMD_SUCCESS;
 }
@@ -5019,13 +5019,10 @@
 	struct gsm_bts *bts = vty->index;
 	unsigned int i;
 
-	for (i = 0; i < ARRAY_SIZE(bts->interf_meas_params.bounds_dbm); i++) {
-		bts->interf_meas_params.bounds_dbm[i] = abs(atoi(argv[i]));
+	for (i = 0; i < ARRAY_SIZE(bts->interf_meas_params_cfg.bounds_dbm); i++) {
+		bts->interf_meas_params_cfg.bounds_dbm[i] = abs(atoi(argv[i]));
 		/* TODO: ensure ascending (or descending?) order */
 	}
-	/* FIXME: when changed in a running BSC, this changes the dBm meanings of the reported interference levels
-	 * without telling the BTS about it. So the interpretation of the interference level band numbers will then be
-	 * wrong. */
 	return CMD_SUCCESS;
 }
 
diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c
index cf3a6b8..d03f092 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -358,7 +358,7 @@
 	bts->bs_power_ctrl.dir = GSM_PWR_CTRL_DIR_DL;
 
 	/* Interference Measurement Parameters (defaults) */
-	bts->interf_meas_params = interf_meas_params_def;
+	bts->interf_meas_params_cfg = interf_meas_params_def;
 
 	bts->rach_max_delay = 63;
 
diff --git a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
index ed3a802..aac0ddf 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
@@ -37,10 +37,10 @@
 
 	/* Interference level Boundaries: 0 .. X5 (3GPP TS 52.021, section 9.4.25) */
 	msgb_tv_fixed_put(msgb, NM_ATT_INTERF_BOUND,
-			  sizeof(bts->interf_meas_params.bounds_dbm),
-			  &bts->interf_meas_params.bounds_dbm[0]);
+			  sizeof(bts->interf_meas_params_cfg.bounds_dbm),
+			  &bts->interf_meas_params_cfg.bounds_dbm[0]);
 	/* Intave: Interference Averaging period (3GPP TS 52.021, section 9.4.24) */
-	msgb_tv_put(msgb, NM_ATT_INTAVE_PARAM, bts->interf_meas_params.avg_period);
+	msgb_tv_put(msgb, NM_ATT_INTAVE_PARAM, bts->interf_meas_params_cfg.avg_period);
 
 	rlt = gsm_bts_get_radio_link_timeout(bts);
 	if (rlt == -1) {
diff --git a/src/osmo-bsc/nm_bts_fsm.c b/src/osmo-bsc/nm_bts_fsm.c
index 329d911..e64d74c 100644
--- a/src/osmo-bsc/nm_bts_fsm.c
+++ b/src/osmo-bsc/nm_bts_fsm.c
@@ -106,7 +106,8 @@
 	    !bts->mo.set_attr_sent && !bts->mo.set_attr_ack_received) {
 		bts->mo.set_attr_sent = true;
 		msgb = nanobts_attr_bts_get(bts);
-		abis_nm_set_bts_attr(bts, msgb->data, msgb->len);
+		if (abis_nm_set_bts_attr(bts, msgb->data, msgb->len) == 0)
+			bts->interf_meas_params_used = bts->interf_meas_params_cfg;
 		msgb_free(msgb);
 	}
 
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 8d316ca..ce9880b 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -1065,6 +1065,9 @@
 	uint8_t *res_info_len;
 	VTY_ECHO();
 
+	/* In this test suite, always act as if the interf_meas_params_cfg were already sent to the BTS via OML */
+	bts->interf_meas_params_used = bts->interf_meas_params_cfg;
+
 	argv += 2;
 	argc -= 2;
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24887
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Iad8cf4151ff7f86dc0549158ed5d91d788d40b1f
Gerrit-Change-Number: 24887
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210708/70b5dbc4/attachment.htm>


More information about the gerrit-log mailing list