Commit Graph

11 Commits

Author SHA1 Message Date
Vadim Yanitskiy ac8acc98a3 call osmo_timer_del() unconditionally, without osmo_timer_pending()
osmo_timer_del() does check if a timer is active internally.

Change-Id: I3e42a74d59b8e8d0d46cc4027676149689cc18a3
2022-07-22 03:39:23 +07:00
Pau Espin e6b8b8201a acc: Simplify start/stop by using new signal S_NM_RUNNING_CHG
ACC used to be stared/stopped based on operational/administrative state
changes. The new S_NM_RUNNING_CHG triggers a single boolean based on the
same logic, so we can now simplify the mechanism.

Change-Id: I2e09bcb18a6c3bb2e88bba98579fb4854a6b0699
2022-05-13 14:06:37 +02:00
Pau Espin b978d1582f nm_statechg_signal_data: Convert state ptr to data
There's no need to use pointers there, it is only asking for errors from
code handling the data structe from the signal by attempting to change
them. Even for mem size point of view it doesn't make sense, since it's
3 byte vs a 4 byte pointer.

Furthermore, this is a preparation for new commit, where the NM object
current state will be updated before emitting the signal. This patch
eases a lot the follow up mentioned patch.

Change-Id: I9b648dfd8392b7b40bfe2b38f3345017481f5129
2022-05-06 14:50:24 +02:00
Pau Espin 7b36d0b0a0 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
2022-05-06 12:34:59 +00:00
Pau Espin 633523167d abis_nm: Merge signals S_NM_STATECHG_ADM and S_NM_STATECHG_OPER
Having 2 signals makes all code handling them more complex, specially
because S_NM_STATE_CHG_OPER could actually provide any change in
admin/oper/availability.
Both signals already provided the same kind of data (the whole
admin/oper/avail state change), so let's simply merge the signals
themselves. Current code really doesn't act differently for those 2
signals anyway.

Change-Id: Ia86d20a42b859063d0327b940ba528ec1438b04a
2022-05-05 14:51:10 +02:00
Neels Hofmeyr 1b277ec2a2 RSL link: explicitly select rsl_link based on lchan
Prepare for VAMOS, where there will be secondary "shadow" lchans serving
secondary MS on the same timeslots. For those, RSL messages will need to
reflect a different stream ID aka TEI, via an rsl_link_vamos.

Make sure that every code path that sends an RSL message for a specific
lchan selects the RSL link via the new function rsl_chan_link(). When
VAMOS is implemented, this function can select the proper RSL stream.

Rename gsm_bts_trx.rsl_link to rsl_link_primary. This makes sure I'm not
missing any uses of the RSL link, and clarifies the code.

Related: SYS#5315 OS#4940
Change-Id: Ifbf16bb296e91f151d19e15e39f5c953ad77ff17
2021-05-28 17:22:59 +00:00
Pau Espin 88cef63e85 acc: Fix ACC rotate barring highest ACCs too quickly during wraparound
Expected steps (size=4):
6 7 8 9 -> 0 7 8 9 -> 0 1 8 9 -> 0 1 2 9 -> 0 1 2 3 -> 1 2 3 4 -> ...

Befre this patch, for size>2 we got:
6 7 8 9 -> 0 6 7 8 -> 0 1 6 7 -> 0 1 2 6 -> 0 1 2 3 -> 1 2 3 4 -> ...

Which means highest ACCs were barred during more time than others.

Change-Id: I03c298ecb29c4fc5f4c361773f2666588e423ffe
2020-08-27 14:05:14 +02:00
Pau Espin 1e5e7004dc Introduce support for ACC ramping during whole BTS life cycle
Prior to this patch, ACC ramping was only used to go 0->N in the
number of allowed ACCs during BTS startup. It could optionally
dynamically stretch or extend the ramping time based on channel load.

With this patch, ACC ramping is kept alive during the entire time the
BTS is active, and subset of allowed ACCs can now be incresed or
decreased based on channel load. A new VTY command
"access-control-class-ramping-chan-load" is added to configure a lower
and an upper threshold. Channel load under the low threshold will
potentially trigger an increment of the subset size of allowed ACCs,
while a channel load over the upper threshold will potentially trigger
the opposite (a decrease in size).
The time between checks is kept fixed per VTY command (reusing old
"access-control-class-ramping-step-size"), but the "dynamic" option
is deprecated and ignored from now on since it provides nothing valuable
in the new implementation, because the size always dynamically changes
based on channel load (configured thresholds).

Related: SYS#4912
Change-Id: Id17f947c92cdfc0eb9541a9bf066338169caaeb5
2020-07-31 09:56:46 +00:00
Harald Welte c4b25704f5 acc.c: Don't use C99 constructs, this breaks builds on Debian 8
[  160s] acc.c: In function 'get_highest_allowed_acc':
[  160s] acc.c:117:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
[  160s]   for (int i = 9; i >= 0; i--) {
[  160s]   ^
[  160s] acc.c:117:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
[  160s] acc.c: In function 'get_lowest_allowed_acc':
[  160s] acc.c:127:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
[  160s]   for (int i = 0; i < 10; i++) {
[  160s]   ^
[  160s] Makefile:617: recipe for target 'acc.o' failed

Change-Id: I03722854634b2d6d6f1abac7c7553762b5fc6890
2020-07-30 10:40:24 +02:00
Pau Espin deaa6fd624 Introduce support for ACC subset rotation
See updated documentation section in manuals/chapters/bts.adoc regarding
an explanation on how the system works.

Related: SYS#4911
Change-Id: I952c9eeae02809c7184078c655574ec817902e06
2020-07-29 20:09:47 +00:00
Pau Espin 02f2056ccf rename files acc_ramp.* -> acc.c*
With upcoming next commit, the file will contain far more code that
simply ramping, so rename it to be more generic.

Change-Id: I8c368ab87e264439dea4ccf556821a44664cdbb0
2020-07-20 16:21:59 +02:00