aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2020-09-26initial support for static userspace probes via systemtaplaforge/usdtHarald Welte7-0/+71
This adds a --enable-systemtap configure option, which will then add static tracepoints to the generated osmo-bts-* binary. At this point, only two sets of tracepoints are supported, and only in osmo-bts-trx: ul_data_{start,done} and dl_rst_{start,done}. The probes are intended to be used for analyzing the amount of time needed for processing of uplink bursts / generation of downlink bursts. Change-Id: Ibb4962253f1a195dc1a54405bac058ccb2545799
2020-07-24bts-trx: prov_fsm: Fix mess with 1 event having 2 namesPau Espin Pedrol3-4/+2
They were both half implemented but named differently, due to myself adding them during the initial FSM implementation. This prevents osmo-bts-trx sending a POWEROFF when OML link is dropped. Related: SYS#4864 Change-Id: Ic2dab864b6d4075dfb9a1e4acfd9af013c9c46fe
2020-07-23bts-trx: Fix osmocom dyn ts assert hit during Adm State UnlockPau Espin Pedrol1-0/+7
How to reproduce: * Configure a TS to be TCH/F_TCH/H_PDCH in osmo-bsc.cfg * Run the network with osmo-bts-trx, then use osmo-bsc's "rf_locked 1" * Then, unlock it: "rf_locked 0" * The following assert will be hit: Assert failed ts->dyn.pchan_is == ts->dyn.pchan_want /osmo-bts/src/osmo-bts-trx/l1_if.c:349 """ (gdb) bt #0 0x00007ffff5bb9355 in raise () from /usr/lib/libc.so.6 #1 0x00007ffff5ba2853 in abort () from /usr/lib/libc.so.6 #2 0x00007ffff6832361 in osmo_panic_default ( fmt=0x555555814e60 "Assert failed %s %s:%d\n", args=0x7fffffffc6e0) at /libosmocore/src/panic.c:49 #3 0x00007ffff683249d in osmo_panic ( fmt=0x555555814e60 "Assert failed %s %s:%d\n") at /libosmocore/src/panic.c:84 #4 0x000055555570fdf7 in trx_set_ts (ts=0x7ffff1e6bce8) at /osmo-bts/src/osmo-bts-trx/l1_if.c:349 #5 0x00005555557133c1 in bts_model_chg_adm_state (bts=0x627000000160, mo=0x7ffff1e0f8a0, obj=0x7ffff1e0f860, adm_state=2 '\002') at /osmo-bts/src/osmo-bts-trx/l1_if.c:681 #6 0x0000555555769978 in oml_rx_chg_adm_state (bts=0x627000000160, msg=0x633000003e00) at /osmo-bts/src/common/oml.c:1044 #7 0x000055555576a8d3 in down_fom (bts=0x627000000160, msg=0x633000003e00) at /osmo-bts/src/common/oml.c:1129 #8 0x0000555555770aed in down_oml (bts=0x627000000160, msg=0x633000003e00) at /osmo-bts/src/common/oml.c:1476 #9 0x00005555557f8174 in sign_link_cb (msg=0x633000003e00) at /osmo-bts/src/common/abis.c:188 #10 0x00007ffff73b5935 in ipaccess_bts_read_cb (link=0x6120000030a0, --Type <RET> for more, q to quit, c to continue without paging-- msg=0x633000003e00) at /libosmo-abis/src/input/ipaccess.c:980 #11 0x00007ffff73a1060 in ipa_client_read (link=0x6120000030a0) at /libosmo-abis/src/input/ipa.c:72 #12 0x00007ffff73a2458 in ipa_client_fd_cb (ofd=0x62f000038a50, what=1) at /libosmo-abis/src/input/ipa.c:136 #13 0x00007ffff67ebfa7 in osmo_fd_disp_fds (_rset=0x7fffffffdda0, _wset=0x7fffffffde40, _eset=0x7fffffffdee0) at /libosmocore/src/select.c:227 #14 0x00007ffff67ec38c in _osmo_select_main (polling=0) at /libosmocore/src/select.c:265 #15 0x00007ffff67ec46b in osmo_select_main (polling=0) at /libosmocore/src/select.c:274 #16 0x00005555557ef089 in bts_main (argc=7, argv=0x7fffffffe208) at /osmo-bts/src/common/main.c:354 #17 0x00005555556fe621 in main (argc=7, argv=0x7fffffffe208) at /osmo-bts/src/osmo-bts-trx/main.c:176 """ Related: OS#4920 Change-Id: Ia3210e24b921fd0c67f77068b7ef4a65f270cd11
2020-07-23rsl: Fix wrong param passed to gsm_pchan_name() in log linePau Espin Pedrol1-1/+1
Change-Id: I42b7a79b85e8750a12166dbfc66ad06f7cb713a6
2020-07-22bts-trx: Delay TRXC POWERON cmd until all TRXs are provisionedPau Espin Pedrol2-8/+58
Waiting until all other TRX are provisioned before really sending POWERON helps avoiding race conditions where TRX!=0 are not yet fully configured at the TRX side before POWERON is called. This solves for instance the situation where after POWERON RSP the BTS started ramping up on all TRX while on some NOMTXPOWER RSP was yet not received... Related: SYS#4920 Change-Id: I906be4714807c7a2793971cb6062120e24337d7b
2020-07-22bts-trx: Integrate TRX provisioning logic more tightly into the FSMPau Espin Pedrol5-87/+228
The state of each config required is now tracked through the "acked" variables, this way the FSM can know when all configs are confirmed by the TRX and can proceed to submit POWERON command. With this version each TRX is still totally independent (there's an FSM per TRX), which means POWERON can be sent on TRX0 before TRX!=0 are fully configured. As a result, powe ramping may start before we know the NOMTXPOWER of a TRX. This kind of issue will be fixed in next commit. Related: SYS#4920 Change-Id: I1b736a4be5ce52a854f5767d8609153e1f4c08d9
2020-07-22bts-trx: Use bool type for on/off state variablesPau Espin Pedrol3-39/+39
Change-Id: Icb1b7bd8852417ab7b9a7dbc205aa6f6db97d64d
2020-07-20tx_power_test: Disable using color in log outputPau Espin Pedrol2-37/+37
It's really not used and only adds unneeded variabilities to output. Change-Id: I5aa95997c8df4ce5ba8271acae99c45f68b96e11
2020-07-14bts-trx: introduce TRX provisioning FSMPau Espin Pedrol6-224/+537
With prior code state managing the TRXC side of osmo-bts-trx, there are plenty o cases (race conditions) where things can go wrong/unexpected, because there's really no infrastructure to wait and synchronize between different TRXs (eg wait until all are configured to POWERON), or to simply keep well known per-trx state regarding lower layers. In order to fix in the future all of those issues and to sanitize current code, a new per-trx FSM is introduced, which takes care of submitting TRXC commands and waiting for response when needed to manage the state of the TRX. Related: OS#4364 Change-Id: I2a00c23df15840e33fbb232c9e1dd6db128f63f6
2020-07-14bts-trx: Remove unused function l1if_provision_transceiver()Pau Espin Pedrol2-25/+0
Change-Id: I509fdbc7883f227cef4b7e46cb68fa2418c63f97
2020-07-14common: Avoid changing OPSTATE to Enabled upon RSL upPau Espin Pedrol1-5/+2
the RSL link has nothing to do regarding the state of the Radio Carrier, as in it being up is not enough to have a working (enabled) Radio Carrier. Change-Id: Iefb5c4e1097233b5c31e4d621c544d51516af678
2020-07-14bts-trx: Don't set OPSTATE enabled during trx_initPau Espin Pedrol1-3/+0
At that time we schedule a POWERON command towards osmo-trx, so let the callback of RSP POWERON set the OPSTATE in l1if_poweronoff_cb rather than setting it without waiting for confirmation from osmo-trx. Change-Id: Ib36a073cae5e1522821a04d8806648562f4e0f5b
2020-07-14Move struct gsm_bts_trx: gsm_data.* & bts.* => bts_trx.*Pau Espin Pedrol13-237/+283
Move all struct gsm_bts_trx references from bulky gsm_data to its own file containing all related definitions and implementations. Also move a few functions clearly related to that object which were placed in bts.* Change-Id: Iebaf5b221c48b571f45408af867ce6f9c0cd9f4a
2020-07-14measurement: replace u_int64_t with uint64_tAlexander Couzens1-1/+1
Be consistent and use everywhere uint64_t. Change-Id: Id6b5df7f5045901109fe1007a5ad54e2f95b95f8
2020-07-09bts-virt: Don't rely on gsmtap_makemsg() returning NULL for ↵Pau Espin Pedrol1-1/+4
GSMTAP_CHANNEL_UNKNOWN commit d211c490cad38f2009943121d57bdb7df8eee9b0 avoided sending GSMTAP packets on the virtual Um interface with type GSMTAP_CHANNEL_UNKNOWN by relying on gsmtap_makemsg returning NULL. But that's not the corect approach since it's totally fine to be sending GSMTAP_CHANNEL_UNKNOWN on some GSMTAP cases (for instance when the program fails to infer the type when decoding a message), since then this way one can study pcap files and find the offending encoded messages which failed to be decoded. This patch goes togehter with revert patch introduced in libosmocore as explained in the commit referred above. Change-Id: I233afd930d3e43f7b120d40192c7c192102e38d9
2020-07-09l1sap: do not print redundant info in l1sap_chan_act()Vadim Yanitskiy1-2/+1
LOGPLCHAN() prepends the BTS/TRX/TS numbers itself. Change-Id: I8a1dd7da7098fe8c8a015459608d9134821fb322
2020-07-05Move gsm_bts code gsm-data.* => bts.*Pau Espin Pedrol12-487/+479
bts.h refers to struct gsm_bts object, but we still had a bunch of stuff in bulky gsm_data.* from old days. Let's move stuff where it belongs to start clean up of gsm_data. Change-Id: I0a4219e3f64f625ee8b364bf408b8d2bcc8085c5
2020-07-05Move nm_state and Mo related code gsm_data.* => oml.*Pau Espin Pedrol4-175/+168
Change-Id: I57ea9c4ddbe5443b9b6afe3f8e6b38170d0e5a0e
2020-07-05gsm_data.h: Use enum type for NM state fieldsPau Espin Pedrol2-4/+6
Change-Id: I21fa1688a0c8a3788a5ecedd5912f596a69a1beb
2020-07-05bts-trx: Implement ramp up/down during ADM state changePau Espin Pedrol1-16/+75
Ramp down when BTS is administratevly locked, and ramp up when it becomes unlocked again. Af ramping down, bts_model_trx_deact_rf is called to make sure all channels are released. power_ramp_start() is dropped from inside bts_model_trx_deact_rf since it's not the proper place. In there we simply want to instantaneously drop RF. Related: SYS#4920 Change-Id: Ib7a7b0a0c24779349f142215f0bb32b72c86ce70
2020-07-05pcu_sock: Avoid presenting TS from disabled TRX as available to PCUPau Espin Pedrol1-0/+8
Change-Id: I4b24faf3a8fe5846b9394fea8faf9d37cc0ac9ff
2020-07-05bts_shutdown: Speed up shutdown if no TRX is operationalPau Espin Pedrol1-11/+36
This change avoids waiting for full ramp down if TRXs are already non operational. Change-Id: Ie1c7c3a969e7968075b89edcd1ab2227b178a869
2020-07-05bts-trx: Introduce rate counter for scheduler timerfd missed FNsPau Espin Pedrol3-1/+25
This should provide a quick way to check if the system is frequently overloaded over time and hence downlink FNs are scheduled later than expected. Change-Id: I0051b9ab18ebc9f92db11374d856de94f155efa4
2020-06-30osmo-bts-trx/scheduler: get rid of unused 'meas' in l1sched_chan_stateVadim Yanitskiy1-4/+1
Change-Id: I4337cfdc393ec44df9bb9824ba4981eaf5b45f0b
2020-06-29osmo-bts-trx/scheduler: cosmetic: move trx_if_powered() checkVadim Yanitskiy1-4/+4
I believe the modern compilers are smart enough to optimize the outer (per-timeslot) loop of trx_sched_fn() in a way that TDMA frame number is advanced after making sure that a transceiver is powered on. However, it's still more perspicuous to check availability of a given transceiver first. Change-Id: I6a97000c1c84e36096e9ba378a489c82caa4cc5b
2020-06-29A-bis/OML: handle hopping params in Set Channel AttributesVadim Yanitskiy3-21/+42
Change-Id: Ieac26c7aca118c16889cdde2565a514681dc137b Related: OS#4546
2020-06-27tx_power: Support controlling BTS with nominal tx pwr < 0dBmPau Espin Pedrol5-9/+12
Related: OS#4583 Change-Id: I88d59d47837105d52e2b4dfb819511cd360c50a1
2020-06-26osmo-bts-trx/scheduler: get rid of _sched_fcch_burstVadim Yanitskiy3-11/+2
According to 3GPP 45.002, section 5.2.4, a frequency correction burst is basically a sequence of zeros. Since br->burst is already zero-initialized, there is no need to maintain and memcpy() another sequence of zeros into it. Just set the length. Change-Id: Ic4f6d550010da5caf4bc471ff1e184c9fab30c6d
2020-06-26vty: fix missing separator in help for power ramp commandsVadim Yanitskiy1-1/+1
Change-Id: Id83fa562ba8496be8915573d2222dd64c7ca5eb9
2020-06-25osmo-bts-trx/scheduler: make mark trx_sched_fn() return voidVadim Yanitskiy1-3/+1
This function never returns anything else than 0. Change-Id: I119535fc09d611ef9f903f5d44aa21cecdce19a2
2020-06-25osmo-bts-trx: fix trx_sched_fn(): properly advance frame numberVadim Yanitskiy1-4/+6
In trx_sched_fn() we schedule Downlink bursts in advance, in order to give the transceiver some time to process them. This function handles all timeslots of all transceivers in a loop. The problem is that the given frame number is overwritten on each iteration. Let's say we have 4 transceivers, each with default fn-advance 20. The given frame number N will be advanced 4 times, so the resulting frame number for 4-th transceiver would be (N + 4 * 20) instead of (N + 20) as expected. Therefore, all additional transceivers would be served more and more in the future (depending on their position). Change-Id: Ie3ab544eac81a675266df09cd2b7740e4183188e
2020-06-25Use libosmocore's TDMA frame number API (constatns & arithmetic)Vadim Yanitskiy6-52/+31
Depends: (libosmocore) Ic291fd3644f34964374227a191c7045d79d77e0d Change-Id: I61c97a62bd5dbbb4a984921ebdfc10ad6ed00f2a
2020-06-25bts-omldummy: Speed up shutdown (instantaneous ramp)Pau Espin Pedrol1-0/+3
Change-Id: I4d4e7a5bfb899787605b3b25dcdc9e9470c438d9
2020-06-25bts-omldummy: Implement bts_model_trx_closePau Espin Pedrol1-1/+2
Change-Id: I13221e5dffe3290fc791f8866f25141fcc0821ff
2020-06-25Fix shutdown in osmo-bts-{omldummy,virtual}Pau Espin Pedrol3-1/+3
Change-Id: Idadb62ec25181b140d9061dc7470da00d47d8336
2020-06-24osmo-bts.spec.in: Use %config(noreplace) to retain current config fileHarald Welte1-2/+2
Change-Id: I8d92cfddaa5bbfa33e36f37b48033b468c7d72cf
2020-06-23bts-trx: Mark 'osmotrx power' VTY cmd as deprecatedPau Espin Pedrol1-1/+5
There's a standarized way through OML's Administrate State to control the status of TRX, so let's use and maintain that one rather than this ad-hoc hack. Related: SYS#4920 Change-Id: Ia7f190063c35e0ed8e2e734047b3aff608cd3ce3
2020-06-23bts-virtual: Implement bts_model_trx_closePau Espin Pedrol1-1/+10
Change-Id: Id37562652b1ebc27d808d83342e4961b936dbcad
2020-06-23bts_shutdown: Wait until all TRX are closedPau Espin Pedrol2-11/+51
Setting the phy link of a trx to SHUTDOWN sets operative state to DISABLED, so we use operative state as a condition to know whether all TRX are already powered off properly and we can exit. Change-Id: I2bcd211d7edcc8486461a555d6c470a94b166ed7
2020-06-23bts_model: Convert bts_model_trx_close() to return asynchronouslyPau Espin Pedrol10-24/+62
Some backends like osmo-bts-trx require exchanging messages like POWEROFF to close the TRX, and hence need some time. Switch the function to expect result asynchronously by calling a callback. This will be used later to wait until all TRX are really powered off before exiting the process. Change-Id: I7d76b600fc06e1114b35bf0c2d08eff5bbd1b69a
2020-06-23bts_shutdown: First deact RF on all TRX, finally close themPau Espin Pedrol1-0/+2
It makes more sense to first deactive RF on all TRX and finally close them totally. This way we keep consistency between all TRXs and it's easier for lower layers which may need to close them all at once. Also in the event that we want to turn bts_model_trx_deact_rf to return asynchronously. Change-Id: Ib62358384e37a5cef692926439462042fab0138c
2020-06-23bts-trx: Split part of bts_model_trx_close() steps into bts_model_deact_rfPau Espin Pedrol1-7/+17
bts_model_trx_close is only called during bts_shutdown immediately after bts_model_deact_rf, so its logic keeps being essentially the same after this code movement. On the other hand, bts_model_deact_rf is also called during RSL link establishment if it failed for whatever reason in bts.c:trx_link_estab(). In that case, we want to make sure the TRX is not used so we need to implement bts_model_deact_rf. Change-Id: Id4eae743da81773a04b82e7b454071b0cc66677a
2020-06-23Implement tx power ramp down during BTS shutdownPau Espin Pedrol3-7/+43
Upon BTS shutdown (for instance because the Abis link against BSC was lost), stop the operation in an ordered manner (cell soft lock). This means slowly decrease tx power so that MS have time to handover to other neighbour cells. Related: SYS#4920 Change-Id: I70e34dda8974ebd94aea33bd9fb1d99f9063cc55
2020-06-23Introduce bts_shutdown FSMPau Espin Pedrol7-34/+204
Using an FSM here will allow for more complex ordered shutdown procedures, like power ramp down, waiting for TRX deact asyncrhonously, etc. Current commit leaves everything in place already prepared to implement ramp down, which will be implemented in next commit in the series. Related: SYS#4920 Change-Id: I8f48f17e61c3b9b86342eaf5b8a2b1ac9758bde5
2020-06-23abis.c: Use LOGPIL when logging signalling link downPau Espin Pedrol1-1/+1
Change-Id: Icedd533046853f67da5da84aae28b895a8cdb0bf
2020-06-22bts.c: Fix typo in log line and improve itPau Espin Pedrol1-1/+1
Change-Id: I44d079893d01946da703c4338a686795ced3cb00
2020-06-22phy_link.h: Drop unimplemented function definitionPau Espin Pedrol1-2/+0
Change-Id: Ib306a80bd8ea3434a49806ec73a1cfe9a82b9122
2020-06-19tx_power: Log bypass param in power_ramp_startPau Espin Pedrol1-2/+2
Change-Id: I72559a50570cf447b5930f8995b1f345baeb1ee5
2020-06-19bts-trx: Instruct user to set manually nominal-tx-power if NOMTXPOWER not ↵Pau Espin Pedrol1-1/+4
supported Using the VTY command will force that value and prevent osmo-bts-trx to use/send NOMTXPOWER cmd over TRXC. Change-Id: I496753bc74767a7e18b831768d9d422a738192b7
2020-06-18power_ramp: Add support to get callback when ramping process completesPau Espin Pedrol12-18/+26
It will be used in forthcoming commits to feed FSM events once the ramping process completes. Change-Id: I778dc215cf6055b93658670cc12e78ad2e51f85e