Commit Graph

8010 Commits

Author SHA1 Message Date
Neels Hofmeyr aa09938d2c implement all_allocated:{static_sdcch,static_tch} rate counters
Same as all_allocated:{sdcch,tch}, but already trigger when all
non-dynamic timeslots are allocated.

Related: SYS#4878
Related: Ib3997a827c9cc43d1361bb0cf3bfab9f6d91bf82 (osmo-ttcn3-hacks)
Change-Id: I2fa14531f16d3f07085620f1c50eb839c420da6a
2021-11-10 13:27:43 +00:00
Neels Hofmeyr 41f143827d implement all_allocated:{sdcch,tch} rate counters
Based on allAvailable{SDCCH,TCH}Allocated performance indicators, see
3GPP TS 52.402.

Related: SYS#4878
Related: Ib3997a827c9cc43d1361bb0cf3bfab9f6d91bf82 (osmo-ttcn3-hacks)
Change-Id: I8b06e435a224c8708cd6c67e97ee5413718fc1ed
2021-11-10 13:27:43 +00:00
Neels Hofmeyr e0458c2e00 add time_cc API: cumlative counter for time, reported as rate_ctr
This is a candidate for adding to libosmocore (as osmo_time_cc), but
let's first use this in osmo-bsc to make sure that it works as intended.

I started out expecting to be done with this in half an hour, but I
found out that accumulating elapsed time to an integer counter has a
staggering amount of complexity to it, and a million pitfalls.

The intended use is to report allAvailableSDCCHAllocated and
allAvailableTCHAllocated performance indicators in OsmoBSC. Hopefully
this will also be generally useful elsewhere, to be worth the effort.

Related: SYS#4878
Change-Id: Icdd36f27cb54b2e1b940c9e6404ba9dd3692a310
2021-11-10 13:27:43 +00:00
Neels Hofmeyr e455f0ab02 refactor lchan counting
Add chan_counts_for_trx() and chan_counts_for_bts(). Drop
bts_count_free_ts() and trx_count_free_ts().

Rationale:

The bts_count_free_ts() and trx_count_free_ts() always returned the
number of free lchans, not timeslots. Hence, passing the pchan type as
argument never really matched the semantics.

Especially, when looking for free SDCCH, there is no clear match on a
gsm_phys_chan_config enum value: SDCCH8_SACCH8C, CCCH_SDCCH4,
CCCH_SDCCH4_CBCH, SDCCH8_SACCH8C_CBCH? -- GSM_LCHAN_SDCCH is clear.

==> Rather count free lchans by enum gsm_chan_t.

Counting lchans of distinct types required separate iterations for each
lchan type.

==> Rather compose an array of counts for all types, in one go.

I need to count the amount of free SDCCH lchans in an upcoming patch to
implement the performance indicator allAvailableAllocatedSDCCH (cumulate
time for which no SDCCH are available).

To implement allAvailableAllocated{SDCCH,TCH}, I need a count of both
the used as well as the total lchans for a type: it does not make sense
to flag "all available allocated" if none are ever available.

To properly count dynamic ts, I need the maximum total that can be
possible at any time. And to count currently free lchans, I need the
current total. This may seem counter intuitive, but consider, e.g.:

- Obviously, if a cell has only static TCH/F timeslots, it does not make
  sense to flag that all available TCH/H are occupied, because no TCH/H
  are available ever. Just stating this as contrast to dyn TS.

- If a cell has OSMO_DYN timeslots, I *do* want to flag that all TCH/H
  are occupied when all dyn timeslots are fully occupied.

- If those OSMO_DYN however are all used as TCH/F, the current total of
  TCH/H becomes zero, and it seems like TCH/H should not be considered.

- To count the nr of currently free lchans, I need the currently
  possible total of lchans and the nr of occupied lchans.

So return both a maximum total and a current total of lchans. In above
example, the maximum total shows that there would be TCH/H possible.

BTW, it would be nice to keep a chan_counts array on trx, bts and bsc
level and update as channels are allocated and released, instead of
counting them all over periodically. But it's less error prone this way.

Related: SYS#4878
Change-Id: I2fb48c549186db812b1e9d6b735a92e80f27b8d3
2021-11-10 13:27:43 +00:00
Vadim Yanitskiy 5944ff07a8 gsm_data: use ascending order for interference boundaries
It's more logical to have the boundaries sorted in ascending order:

  * band 1 represents lowest interference levels,
  * band 5 represents highest interference levels.

Change-Id: Ie9bf4bf0c89418685b8ea5096332d22cfba7c521
Related: SYS#5313
2021-11-10 14:45:12 +03:00
Vadim Yanitskiy dd0dabbffc doc/manuals: add documentation for interference reporting
Change-Id: I3c15b11bbcba0811e3a15fe64365067bf8ad0dae
Related: SYS#5313
2021-11-10 14:42:17 +03:00
Vadim Yanitskiy 16b3b50830 ipaccess-config: warn about unknown flag name
Change-Id: Iab3bae3af9e1cac992b1f8947cda25fcff647992
2021-11-08 18:32:43 +00:00
Vadim Yanitskiy dd4af6ac0b ipaccess-config: fix wrong flag name in ipa_nvflag_strs[]
Change-Id: Idf8e3a9ee6d9a8801d53254c772548586d4a9c60
2021-11-08 18:32:43 +00:00
Vadim Yanitskiy 148e00a991 ipaccess-config: reduce verbosity of the OML logging
Change-Id: Ie52db9236da15da540e14cad56e01c2246b3e82e
2021-11-08 18:32:43 +00:00
Vadim Yanitskiy 3b0858f36b abis_rsl: permit simultaneous ACCH repetition and overpower
As stated in "GSM/EDGE Evolution and Performance", section 12.3,
both features *can* be enabled simultaneously.

Change-Id: I2189f01bd78625dab3d642597240338ee581fc98
Related: SYS#5319
2021-11-08 18:30:06 +00:00
Vadim Yanitskiy 447ca13616 abis_rsl: print_meas_rep_{buf,uni}() accept const *mr
Change-Id: I5c3e27a00cd84f102558499072965ec538f5a87f
2021-11-07 21:28:18 +03:00
Vadim Yanitskiy 70ab41e9cd abis_rsl: do not pass lchan to print_meas_rep_buf()
Change-Id: If965c7dc6b989ee758ddec0190ec1cce8363b240
2021-11-07 21:28:18 +03:00
Neels Hofmeyr d5a6dca2f9 implement incoming_intra_bsc_ho:* rate counters
We have lots of counters for intra-BSC handover *away from* a given BTS,
but still missing are counters indicating how many handovers *targeted*
a given BTS. Also count incoming HO.

Related: SYS#4878
Related: Iba229313d73fa20266f6d4eac5820579fb14c604 (osmo-ttcn3-hacks)
Change-Id: Id9f2c6e2865ebe680879018fff08d283ce24c983
2021-11-06 17:02:38 +01:00
Neels Hofmeyr a521a3fa39 tweak intra-bsc ho counter descriptions
Related: SYS#4878
Change-Id: I00eaf42fcd705cf3f4e06e8c7434fd05dbad4b84
2021-11-06 17:02:38 +01:00
Neels Hofmeyr 1d63b925f4 cosmetic tweaks on handover counting code
I was a bit confused that grep did not find HO counters being used, so
let's add some comments to better explain and provide a grep hook.

Related: SYS#4878
Change-Id: I242de13e657286e09428a8ca6e583d8b5155faa2
2021-11-06 17:02:37 +01:00
Neels Hofmeyr 8700803fa8 for linter: s/while(0)/while (0)
Change-Id: Ib422e7d1a7d543dcd8738581839ce55bb8fc29d2
2021-11-06 17:01:58 +01:00
Neels Hofmeyr 0887442c20 drop unused gsm48_tx_mm_serv_ack()
Related: SYS#4878
Change-Id: Ia9d841a8243adca347e7ea79d31e3cd65eab27ea
2021-11-05 12:01:27 +01:00
Neels Hofmeyr 96887554f9 add chreq:successful_<reason> rate counters
Related: SYS#4878
Change-Id: I32c2c197a6199617a82986480b686c515fa40d62
2021-11-05 12:01:27 +01:00
Pau Espin 5dbed8160f lchan_fsm: Fix possible NULL ptr dereference in _lchan_on_mode_modify_failure()
_lchan_on_activation_failure(), which calls lchan_on_mode_modify_failure(),
already checks for !for_conn in other paths. Hence, it can be that
for_conn being passed to _lchan_on_mode_modify_failure() may be null.

"""
 Stack trace of thread 7077:
 #0  0x000055d25a463842 _lchan_on_mode_modify_failure (osmo-bsc)
 #1  0x000055d25a46b57c _lchan_on_activation_failure (osmo-bsc)
 #2  0x00007fe8b2083be4 state_chg (libosmocore.so.17)
 #3  0x00007fe8b208409d _osmo_fsm_inst_state_chg (libosmocore.so.17)
 #4  0x000055d25a46825a lchan_fsm_wait_rll_rtp_establish (osmo-bsc)
 #5  0x00007fe8b2084239 _osmo_fsm_inst_dispatch (libosmocore.so.17)
 #6  0x00007fe8b2083be4 state_chg (libosmocore.so.17)
 #7  0x00007fe8b208409d _osmo_fsm_inst_state_chg (libosmocore.so.17)
 #8  0x000055d25a46dbdc lchan_rtp_fsm_wait_ipacc_mdcx_ack (osmo-bsc)
 #9  0x00007fe8b2084239 _osmo_fsm_inst_dispatch (libosmocore.so.17)
 #10 0x000055d25a411d69 abis_rsl_rx_ipacc_mdcx_ack (osmo-bsc)
"""

Related: SYS#5698
Change-Id: If8b2895feef6e30f9c1db97394dd16d892b277f2
2021-11-05 10:26:39 +00:00
Pau Espin 93d84380e9 assignment_fsm: Log modified lchan in assignment_fsm_allstate_action()
Change-Id: I579c265e9d18402ce806e4d0ea836042185dedaa
2021-11-05 10:26:39 +00:00
Vadim Yanitskiy 140aa51ea1 rsl_tx_chan_activ(): fix manual channel activation for nanoBTS
nanoBTS would NACK a CHANnel ACTIVation message for an 'intra cell
channel change' if it does not contain the Timing Advance IE.  And
this is right, because according to 3GPP TS 48.058, section 8.4.1,
point '4)', it *must* be included.

Indeed, the actual Timing Advance value is not known during the
manual channel activation triggered from the VTY interface.  So
let's merely indicate 0 if it's not known.

Change-Id: Iee7ddb4cf1a9a7bb9b34e6c9f6f9899da480fbd0
2021-11-05 01:58:45 +03:00
Vadim Yanitskiy e74269bbe2 lchan_fsm: cosmetic: move a 'case' below the 'default' branch
It's unusual to have 'case' statements below the 'default' statement.

Change-Id: I523a6d55d9a103ba69351d9dc6d0c000a422a765
2021-11-05 01:25:00 +03:00
Vadim Yanitskiy 06502214ab .gitignore: remove non-existing ipaccess-firmware binary
Change-Id: I4fb706ace67216f51a8e052b0ef72d944cefd88f
2021-11-05 00:11:33 +03:00
Vadim Yanitskiy 2360ff1840 .gitignore: also ignore *.la files
I started to see 'src/osmo-bsc/libbsc.la' in 'Untracked files'.

Change-Id: I6e4a88e3bf92a1c0e1ccb92f8ff91e24d4e99926
2021-11-05 00:10:30 +03:00
Oliver Smith 2e9237734e Revert "Turn some compiler warnings into errors"
Do not turn some compiler warnings into errors by default. This patch
was added before --enable-werror was available.

We build with --enable-werror during development and in CI. If the code
is built with a different compiler that throws additional warnings, it
should not stop the build.

This reverts commit 34f012639d.

Related: OS#5289
Change-Id: I6b143b803349b97e783c586615d7f2ed4e1ff058
2021-11-04 10:38:05 +01:00
Oliver Smith ed10dc446d bsc_ctrl_commands: fix uninitialized value (mode)
Fixes: CID#240848
Change-Id: I571055b350d343318ef1ae469ae92475925d1910
2021-11-04 09:51:26 +01:00
Philipp Maier 9cb639daad control.adoc: comment out fixme note
The fixme note:
"FIXME: add variables defined in src/ctrl/control_if.c?"

is not directed at the reader of the manual. It should stay in the
source, but it should not be visible in the pdf. Lets comment it out.

Change-Id: Id68f53d18f0873af3c07a0ae52cd12bc94bc0b96
2021-11-03 17:25:28 +00:00
Philipp Maier 3ca2ae1d0a bsc_ctrl_commands: change neighbor-list mode/arfcn via control interface
It is possible to change the neighbor-list mode via the VTY from
automatic mode to manual neighbor-list configuration. In the manual
mode, the user can add ARFCN values manually. This command can be found
under the bts node. Lets add pendant of this command on the control
interface as well.

Change-Id: Id97bc0d31a358db6221c385761773fb48670c921
Related: SYS#5641
2021-11-03 17:25:28 +00:00
Philipp Maier 085a92584f heighbor_ident: add/del neighbor cells via ctrl interface
The VTY allows flexible control over the neighbor cell information via
the neighbor command, which can be found in the configure terminal under
the bts node. Lets add pendant of this command on the control interface
as well.

Change-Id: I343a40e18fa9b91e6c381912c0426a002841e079
Related: SYS#5641
2021-11-03 17:25:28 +00:00
Philipp Maier 554e169784 control.adoc: improve description of command bts.N.send-new-system-informations
Change-Id: I48bdb7fd991dac2d5112440c879d0ded5b726715
Related: SYS#5641
2021-11-02 10:52:51 +00:00
Neels Hofmeyr 33d48cd42b constify lchan_state_is()
An upcoming patch would rather pass a const struct gsm_lchan*.
See I2fb48c549186db812b1e9d6b735a92e80f27b8d3.

Related: OS#4878
Change-Id: I523cbf04e77f43924c3f09094d56f815d3de640d
2021-11-01 11:22:48 +00:00
Philipp Maier fdcd49b081 neighbor_ident: add comment about Neighbor Address Resolution Service
The Neighbor Address Resolution Service is using the control interface
API as well. Lets add a comment to indicate that this service is not
related to the normal control interface.

Change-Id: Iec86f72548bfc54a2c86dadec69dd1c64813d852
2021-11-01 11:30:03 +01:00
Philipp Maier 298f6bff86 bsc_subscr_conn_fsm: fix mgw-pool ref counting
When the gsm_subscr_conn_fsm (GSCO) terminates abormally it might not go
through the forget-mgw-endpoint mechanism. It might be terminated
forcefully, which means only the pre_term callback runs. The pre_term
callback clears the endpoint, but it does not put the mgcp_client
reference back into the pool. This results into a wrong ref-count in the
mgw-pool.

Change-Id: I5a7ce6a1880a1060df74d03dd4eb38b51fd85c69
Related: SYS#5675
2021-10-29 05:48:43 +00:00
Philipp Maier 2537ddd23c osmo_bsc_main: remove unused option -t --testmode
The option -t --testmode is defined, but not evaluated. It seems that
the code of this option was removed long ago. Lets remove it now.

Change-Id: Ie11173f5a7aab568b9a25102ad7dcf37fd49f318
2021-10-28 12:10:38 +02:00
Pau Espin 7be36cfde6 Set subslots_per_pchan_vamos[GSM_PCHAN_OSMO_DYN] = 0
VAMOS secondary lchans are to be used specifically when the osmocom dyn
TS is set to pchan_is=TCH_{F,H}. Setting secondary subslots for
OSMO_DYN TS is not needed since it's only used to initialize the TS, and
OSMO DYN already initializes 8 subslots
(subslots_per_pchan[GSM_PCHAN_OSMO_DYN]=8). Otherwise, ts_setup_lchans()
will try to initialize 8+2 lchans on the TS, which is more than needed
and will access out of bounds in the array.

Related: OS#5278
Change-Id: I8727d5b446179c0ebcd8738507efe5a50afaf1e2
2021-10-25 19:17:51 +02:00
Pau Espin f147b5f617 timeslot_fsm: Add assert to make sure we never go out of bounds in ts->lchan array
Related: OS#5278
Change-Id: I23a5349838e0c540fbb54cad10f2af42268d7729
2021-10-25 19:17:40 +02:00
Pau Espin 410a1be79e Set subslots_per_pchan[GSM_PCHAN_OSMO_DYN] = 8
Since a while ago, osmocom types dynamic TS supports being configured as
SDCCH8, hence the maximum subslots is 8. This fixes issue where only up
to 2 subslots where being used on those TS.

Related: OS#5278
Related: SYS#5309
Fixes: 52b9912ef9
Change-Id: I50e6530284ef49cfd77d1944d4a183c5df345820
2021-10-25 13:43:48 +02:00
Vadim Yanitskiy 4e39590e52 [overpower] Add VTY transcript tests for all commands
Change-Id: Iefbdbeb36a4692102dbb76d86113a183e4f381a7
Related: SYS#5319
2021-10-24 13:55:51 +03:00
Vadim Yanitskiy b599a8baac [overpower] VTY: add more ACCH overpower related parameters
The new fields in 'struct abis_rsl_osmo_temp_ovp_acch_cap' allow:

  * selectively enabling SACCH and/or FACCH,
  * setting the RxQual (BER) threshold.

Change-Id: Ia2e01e11d718ea0ba2a7e49ae2b871d57991f31c
Depends: Ia28293a12de0af71f55e701fb65c46e905dae217
Related: SYS#5319
2021-10-24 13:55:51 +03:00
Vadim Yanitskiy 014f6232d5 [overpower] VTY: fix copy-pasted warning message
Change-Id: Ie0bc0b503c7c7e893b5c94597c84c47fa881874d
Related: SYS#5319
2021-10-21 18:12:04 +00:00
Vadim Yanitskiy 63cc810acc [overpower] VTY: cosmetic: fix lower case in command description
Change-Id: Iadce870b599b4af4269b9026bd8fbe746f1f4979
Related: SYS#5319
2021-10-21 18:12:04 +00:00
Pau Espin 3a3b1c1ff5 jenkins.sh: Fix typo
Change-Id: I80add059bd41cf385de1981bddd5c35b1d19bf57
2021-10-20 19:47:48 +02:00
Pau Espin be2f5400b6 gitignore: Fix typo
Change-Id: I4c9737b7749f0b8eb8fac3c882bcd7e6f66c58a8
2021-10-20 19:23:59 +02:00
Philipp Maier 72c735603e osmo_bsc_main: remove not longer needed fixme note
It is not possible to operate a cell that has secondary TRXs in
different bands. Especially considering that DCS1800 and PCS1900 have
overlapping ARFCN numbers it would be hard for the MS to tell to which
band it should switch. Also the ImmAss. message only contains the ARFCN
number. It is impractical to have TRXs in different bands and probably
this also violates the sepec.

Change-Id: Icc2af9e2a9bca3897dbbb34d7b2c0fe6f843bedd
2021-10-13 11:47:05 +02:00
Philipp Maier d24d34aff0 bts: set ncc_permitted from bts_alloc
The value ncc_permitted is preset in osmo_bsc_main.c from
bootstrap_bts(). It is a constant value that also cannot be changed via
the VTY. Therefore it should be set from bts_alloc(). This also fixes
the problem that when the BTS is added at runtime from the VTY. BTSs
added at runtime would have an all zero ncc_permitted until the next
restart of osmo_bsc.

Change-Id: I9f02277d7b4b4bcb383e749435416a0b22efd5e8
Related: SYS#5369
2021-10-13 11:47:01 +02:00
Philipp Maier b818d5755f drop chan_load_samples_idx initalization from bootstrap_bts()
The index counter bts->chan_load_samples_idx is initialized to 0 in
bootstrap_bts. Since the bts object is allocated using talloc it is
already guaranteed that everything is set to zero. So we do not need to
initalize chan_load_samples_idx.

Change-Id: Ia75e59c44c3ccd653a2614c2cda7519faf999f09
2021-10-13 11:37:06 +02:00
Philipp Maier 8935c8a0b5 bts: set acs value in bts_alloc
The acs value is currently set from bootstrap_bts() in osmo_bsc_main.c.
The value is set to 0. Since the BTS object is allocated using
talloc it is guaranteed to be 0 from the beginning. Lets set it from
bts_alloc anyway so that we have a place holder that is easy to find.

Change-Id: Idc4e08c471e15c36b4ea7eb3981254e179115765
2021-10-13 11:36:47 +02:00
Philipp Maier c3c62f6051 bts: set pwrc value in bts_alloc
The pwrc value is currently set from bootstrap_bts() in osmo_bsc_main.c.
The value is set to 0. Since the BTS object is allocated using
talloc it is guaranteed to be 0 from the beginning. Lets set it from
bts_alloc anyway so that we have a place holder that is easy to find.

Change-Id: Id76879a94cf8cf8c07e8fc7e8aa399cd50e04e9a
2021-10-13 11:27:02 +02:00
Philipp Maier 314167c799 bts: set R99 MSC flag in SI13 in bts_alloc
At the moment we set the R99 flag from bootstrap_bts() in
osmo_bsc_main.c. However this constant flag should be set together
with the many preinitalized chan_desc values in bts_alloc

Change-Id: I5b78c4e25616ab552c37ba8b7c9948cf7052bad4
2021-10-13 11:27:02 +02:00
Philipp Maier 409718e590 osmo_bsc_main: remove code dup in bootstrap_bts()
The function gsm_set_bts_type() already takes care of setting the
model->started flag to true. There is no need to do this in
bootstrap_bts() again.

Change-Id: Ia70943d96d466ab506fe368ef178a2ccc7483adc
2021-10-13 11:27:02 +02:00