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
This commit is contained in:
Neels Hofmeyr 2021-07-08 06:20:46 +02:00 committed by laforge
parent 71b4f94601
commit ae0b737c62
7 changed files with 28 additions and 21 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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) {

View File

@ -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 &&

View File

@ -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;