pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-bsc/+/28045 )
Change subject: acc: Fix erratic ramping behavior when several BTS configured
......................................................................
acc: Fix erratic ramping behavior when several BTS configured
One callback function was being registered for each BTS.
That means, when a C0 RCARRIER of one specific BTS changed NM state,
the outcome on whether to trigger/abort ramping would end up being
applied to all BTS.
Change-Id: I56c4dd1809fdcf8441a69bf77ad173e1ccc8eea7
---
M include/osmocom/bsc/acc.h
M src/osmo-bsc/acc.c
M src/osmo-bsc/osmo_bsc_main.c
3 files changed, 10 insertions(+), 4 deletions(-)
Approvals:
fixeria: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/include/osmocom/bsc/acc.h b/include/osmocom/bsc/acc.h
index c7be38c..531a69a 100644
--- a/include/osmocom/bsc/acc.h
+++ b/include/osmocom/bsc/acc.h
@@ -161,6 +161,8 @@
return acc_ramp->step_interval_sec;
}
+void acc_ramp_global_init(void);
+
void acc_ramp_init(struct acc_ramp *acc_ramp, struct gsm_bts *bts);
int acc_ramp_set_step_size(struct acc_ramp *acc_ramp, unsigned int step_size);
int acc_ramp_set_step_interval(struct acc_ramp *acc_ramp, unsigned int step_interval);
diff --git a/src/osmo-bsc/acc.c b/src/osmo-bsc/acc.c
index 755ffd1..1172fd8 100644
--- a/src/osmo-bsc/acc.c
+++ b/src/osmo-bsc/acc.c
@@ -414,7 +414,6 @@
static int acc_ramp_nm_sig_cb(unsigned int subsys, unsigned int signal, void
*handler_data, void *signal_data)
{
struct nm_statechg_signal_data *nsd = signal_data;
- struct acc_ramp *acc_ramp = handler_data;
struct gsm_bts_trx *trx = NULL;
bool trigger_ramping = false, abort_ramping = false;
@@ -523,9 +522,9 @@
}
if (trigger_ramping)
- acc_ramp_trigger(acc_ramp);
+ acc_ramp_trigger(&trx->bts->acc_ramp);
else if (abort_ramping)
- acc_ramp_abort(acc_ramp);
+ acc_ramp_abort(&trx->bts->acc_ramp);
return 0;
}
@@ -548,7 +547,6 @@
acc_ramp->chan_load_lower_threshold = ACC_RAMP_CHAN_LOAD_THRESHOLD_LOW;
acc_ramp->chan_load_upper_threshold = ACC_RAMP_CHAN_LOAD_THRESHOLD_UP;
osmo_timer_setup(&acc_ramp->step_timer, do_acc_ramping_step, acc_ramp);
- osmo_signal_register_handler(SS_NM, acc_ramp_nm_sig_cb, acc_ramp);
}
/*!
@@ -646,3 +644,8 @@
acc_mgr_set_len_allowed_ramp(&acc_ramp->bts->acc_mgr, 10);
}
+
+void acc_ramp_global_init(void)
+{
+ osmo_signal_register_handler(SS_NM, acc_ramp_nm_sig_cb, NULL);
+}
diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index 12ddbd2..8d63183 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -929,6 +929,7 @@
assignment_fsm_init();
handover_fsm_init();
lb_init();
+ acc_ramp_global_init();
/* Read the config */
rc = bsc_network_configure(config_file);
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bsc/+/28045
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I56c4dd1809fdcf8441a69bf77ad173e1ccc8eea7
Gerrit-Change-Number: 28045
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged