aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-07-08 06:20:46 +0200
committerlaforge <laforge@osmocom.org>2021-07-16 16:04:18 +0000
commitae0b737c62e4f8953dc64b67515fff5f2b330fea (patch)
tree8b34928a8b443fddede661758a19d9359d07cc6a
parent71b4f94601cbd1aa97729be2d789d21d20aea706 (diff)
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 immediately start using the new values internally, and wrongly interpret interference levels. 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. Related: SYS#5313 Change-Id: Iad8cf4151ff7f86dc0549158ed5d91d788d40b1f
-rw-r--r--include/osmocom/bsc/bts.h6
-rw-r--r--src/osmo-bsc/abis_rsl.c4
-rw-r--r--src/osmo-bsc/bsc_vty.c25
-rw-r--r--src/osmo-bsc/bts.c2
-rw-r--r--src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c6
-rw-r--r--src/osmo-bsc/nm_bts_fsm.c3
-rw-r--r--tests/handover/handover_test.c3
7 files changed, 28 insertions, 21 deletions
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index 992c9bb22..9ec936438 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -552,8 +552,10 @@ struct gsm_bts {
/* 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 42d77b35d..9b6429d5d 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1523,14 +1523,14 @@ static int rsl_rx_resource_indication(struct msgb *msg)
/* 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 97dd61556..1eeda3b3f 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -1276,22 +1276,22 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
|| 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);
}
@@ -5040,7 +5040,7 @@ DEFUN_USRATTR(cfg_bts_interf_meas_avg_period,
{
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;
}
@@ -5062,11 +5062,10 @@ DEFUN_USRATTR(cfg_bts_interf_meas_level_bounds,
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 */
}
-
return CMD_SUCCESS;
}
diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c
index cf3a6b8cd..d03f092df 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -358,7 +358,7 @@ struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, struct gsm_bts_sm *bts_sm
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 ed3a80212..aac0ddfd1 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
@@ -37,10 +37,10 @@ struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts)
/* 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 329d91190..eda74fd5a 100644
--- a/src/osmo-bsc/nm_bts_fsm.c
+++ b/src/osmo-bsc/nm_bts_fsm.c
@@ -116,6 +116,9 @@ static void configure_loop(struct gsm_bts *bts, struct gsm_nm_state *state, bool
abis_nm_chg_adm_state(bts, NM_OC_BTS,
bts->bts_nr, 0xff, 0xff,
NM_STATE_UNLOCKED);
+ /* Message containing BTS attributes, including the interference band bounds, was ACKed by the BTS.
+ * Store the sent bounds as the ones being used for logging and comparing intereference levels. */
+ bts->interf_meas_params_used = bts->interf_meas_params_cfg;
}
if (allow_opstart && state->administrative == NM_STATE_UNLOCKED &&
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 331726af2..315fc1043 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -1118,6 +1118,9 @@ DEFUN(res_ind, res_ind_cmd,
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;