AgeCommit message (Collapse)AuthorFilesLines
2018-02-27Simplify TS alloc: move slot check into functionsneels/masterMax5-123/+626
Move timeslot applicability check outside of nested for loop into separate functions and document them. Add corresponding tests. This allows us to clarify types used in TS-related computations. Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Related: OS#2282
2018-02-27Simplify TS alloc: move slot assignmentMax4-42/+84
Move into separate functions: * move timeslot reservation * move UL timeslot assignment * move DL timeslot assignment Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Related: OS#2282
2018-02-27TBF: make network counters internalMax5-35/+88
* store N310* counters in shared array similar to corresponding timers * add functions to increment/reset counters This avoids direct access to TBF counters from PDCH. Change-Id: I8ffff9c7186f74bde7e6ac5f6e98f0b3e4c35274 Related: OS#1539
2018-02-27Simplify TS alloc: constify max dl slot funcMax2-2/+2
Constify parameters of gprs_alloc_max_dl_slots_per_ms(). Change-Id: Ic90930d98560459eab0054cb9e1625cb99db61c8 Related: OS#2282
2018-02-27Simplify TS alloc: don't use PDCH for free TFIMax4-19/+21
Don't use PDCH from free TFI lookup routine. This allows for simpler function which can be moved to mslot_class.c alongside with other similar helpers. Change-Id: Ie154866900453d232a890f7b9a30911b451525a1 Related: OS#2282
2018-02-27Move PDCH-related functions into separate filesMax16-1020/+1125
The PDCH class and corresponding functions are rather self-contained and independent from BTS implementation. Let's move them into separate file to make bts.cpp more manageable. As additional benefit it allow us to somewhat untangle all the different cross-dependent includes. Change-Id: Ie05e25361e6741a81b024679f9675c98d4923683 Related: OS#1539
2018-02-27Simplify TS alloc: split USF/UL allocationMax1-19/+42
* move USF allocation into separate function * document USF allocation This allows to clearly see where selected UL TS is forced into single TS in algorithm B allocator. Change-Id: I563dc10827ce68295553f88f3bf2e1fc0ba595c1 Related: OS#2282
2018-02-27Simplify TS alloc: split allocationMax3-57/+105
* generalize TS allocation and move it into separate function * move single-slot allocation into separate function * use common functions for TS allocation on both UL and DL Change-Id: Ied45ae380c345bc76fe9d6fd9a6184d1109f83f2 Related: OS#2282
2018-02-27Simplify TS alloc: separate capacity computationMax3-40/+50
Move TRX capacity computation into separate function and document it. Change-Id: Ifd88fc7ff818ea2a041eae61c5d457926a0df0f2 Related: OS#2282
2018-02-27Simplify TS alloc: split off RX mask computationMax4-49/+57
Move computation of RX mask into separate function and document it. This allows to significantly shrink find_multi_slot() function and overall improve code readability. Since the test output requires cosmetic adjustment anyway due to change in the sequence of log messages, use this opportunity to better group and format log message. Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Related: OS#2282
2018-02-27Update header includesMax26-30/+118
Many files include unnecessary headers and don't include headers which are actually used. Because of that combined with the fact that OsmoPCU is a mixture of C and C++, it makes it hard to modularize code. Fix this (using iwyu [1] tool): * add missing headers * remove unused headers [1] https://include-what-you-use.org/ Related: OS#1539 Change-Id: I8c9f488a43b099c72b2d30d3245e7ba50872fc00
2018-02-27Move include guard to the topMax2-5/+6
Having explicit include above the douible-include guard defines is potential source for hard to track bugs. Let's move it inside the guard statement. Change-Id: I5114a63ce00b03c8eed23565d52969250bd505cc Related: OS#1539
2018-02-27Move paging generation into PDCHMax2-12/+14
Previously paging was prepared inside BTS function and than handed over to PDCH function. Move the actual preparation into PDCH to better decouple PDCH from BTS. Related: OS#1539 Change-Id: I389fb16b6e54040770c21f88edbcb8e045636928
2018-02-27Use explicit type for pcu_lsb()Max1-2/+1
It's only used for byte-long input so we can specify input and output types explicitly. Change-Id: Id0bef691e17e4331c7c4b491661e36173d85388a
2018-02-27Make osmo-pcu wait for BTS to become available at start-up time.Stefan Sperling3-7/+27
After the PCU socket becomes available, the BTS might send an INFO_IND message with the 'ACTIVE' flag cleared. If this happens, do not exit immediately, but keep retrying until an INFO_IND message with the 'ACTIVE' flag arrives. Note that this change only affects behaviour at process start-up time. If the BTS switches from active to inactive state then osmo-pcu will still exit. If this behaviour should be changed as well it could be done in a follow-up patch. Tested against osom-bsc + osmo-bts-virtual. Change-Id: Ic42a5601a43b81d260721fef5d9fa52447f9d309 Related: OS#2689
2018-02-27emu: use libosmocore definitionsMax1-29/+1
Change-Id: I4eade528faeb3841549ad7a6c78e8c1357909614
2018-02-27TBF: move common test code into functionsMax1-109/+67
* move common code into functions * print error instead of failing test right away This allows the tests to continue till completion even in case of intermediate error which simplifies troubleshooting by allowing to gather more errors in a single test run. Change-Id: I1c4ad1dc94542835f15bd666f0821e0ccfcc78c1 Related: OS#1759
2018-02-27RACH: improve single block detectionMax1-44/+28
Replace unreadable if-else ladder in is_single_block() with regular switch-case. This enables implementation of 11-bit RACH support in follow-up patches. Related: OS#1548 Change-Id: I9180478152f9341f11bb3dffe61671da683f24d8
2018-02-27vty: drop unused functionMax3-7/+1
Change-Id: I01f3773ca6a9b6d4e28ca2f59c944c6d48918dd1
2018-02-27TBF: show assignment kind in vtyMax1-3/+5
Change-Id: Ic4e40d9c141ab7ee3f7c4dceec007dbe16359f93 Related: OS#1759
2018-02-27TBF: add helpers for assignment type handlingMax4-10/+86
* add function to set/unset given assignment type * log assignment type flag changes * update tests output with additional logs This enables us to carefully track the TBF assignment type transitions. Change-Id: I3fe9d52472be8b7f257e8326b2f84e8e7d7bd1f4 Related: OS#1759
2018-02-27TBF: decrease logging verbosity for trafficMax2-3/+3
Change-Id: If43aa9895abf58602556c986a633ff93a6f00b06
2018-02-27Simplify TS alloc: internalize TRX checkMax1-11/+10
Move TRX check inside local tfi_find_free() wrapper to make main algorithm easier to follow. Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Related: OS#2282
2018-02-27TS alloc: print suggested TRX on allocation errorsMax2-825/+825
If TS allocation fails due to unavailable TFI, print TRX which was suggested to allocator. This simplifies allocator debugging but requires cosmetic modifications to test output. Change-Id: Icaf97d71d71985d52dc0bda448c26b19fe5645e7 Related: OS#2282
2018-02-27Simplify TS alloc: adjust function signaturesMax3-51/+61
* document used parameters and return values * use consistent formatting * constify function parameters where appropriate (adjusting parameter types if necessary) Change-Id: I211b10b4da59c73d509b719346774515c761886a Related: OS#2282
2018-02-27Simplify TS alloc: use defines for constantsMax4-8/+9
* define and use constant for occupied TFI instead copying the same magic number all over the place * use libosmocore's define for bit pretty-printer Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Related: OS#2282
2018-02-27Simplify TS alloc: avoid TS reassignmentMax1-5/+5
Assign reserved_*_slots only when multislot masks are found to avoid reassignment and make code easier to follow. Change-Id: I9b0482f4ea75ead9855cd78e33c8e70d0ccf4484 Related: OS#2282
2018-02-27Simplify TS alloc: fix allocation callsMax4-19/+26
Using the semantic patch below, adjust allocation-related calls to match updated allocator signatures. // spatch --c++ --dir src -I src --sp-file callfix.spatch --in-place --recursive-includes // spatch --c++ --dir tests -I src --sp-file callfix.spatch --in-place --recursive-includes @@ expression A, B, C, D, E; @@ tbf_alloc_ul_tbf(A, B, C, D, E, ( - 1 + true | - 0 + false ) ) @@ expression A, B, C, D, E; @@ tbf_alloc_dl_tbf(A, B, C, D, E, ( - 1 + true | - 0 + false ) ) Change-Id: I43c76cb49093b40eb854d324e898e821270053dc Related: OS#2282
2018-02-27Simplify TS alloc: adjust allocator signaturesMax7-62/+61
* drop unused parameters (from both functions and structs) * document used parameters and return values * tighten types used for parameters * use consistent formatting Tests are adjusted accordingly but test results are left untouched to avoid regressions. Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Related: OS#2282
2018-02-27TBF: override send function via linker optionMax2-1/+4
Use --wrap linker facility to override pcu_sock_send() similar to other Osmo* projects. Change-Id: Ia3d436bd3d1fb0ce8e98526bd7457f4c57667ceb
2018-02-27TBF: decrease L1 logging verbosity in testMax2-290/+1
Don't clutter output with low-level details. Change-Id: I451f2472070dea2387bfaea45ca5bdd9e3b2276d
2018-02-27cosmetic: fix whitespace issue with include filesMax1-3/+3
Change-Id: I401fe88f5bd1665becd6fe6d4204b3877d548ccc
2018-02-27Add multislot classes from latest specMax7-3172/+72613
The table B.1 is copy-pasted from 3GPP TS 45.002 and reformatted via Emacs macros into C struct to avoid typos. The test output expanded accordingly. The allocation test expectations and output are adjusted accordingly. Note: classes 35-45 which need TA offset are not properly supported yet. This can be extended once we have such devices available for tests. Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Related: OS#2282
2018-02-27AllocTest: remove assumption on max MS classMax3-2732/+4072
So far the allocation was only tested up to hardcoded MS class 29. Drop that assumption and test for all supported MS classes. Adjust expected test output as necessary. Note: using mslot_class_max() forces allocation for MS classes 30 and 31 for which no actual data is available (will be added in follow-up patches) which current implementation treats differently depending on TX/RX direction - see gprs_alloc_max_dl_slots_per_ms(). Because of that we have to adjust the expected number of allocations in test_successive_allocation() as well. Change-Id: I7737f303d97197ef159b14a19c3312a11f07b433 Related: OS#2282
2018-02-27AllocTest: expand test outputMax2-101/+85
* print MS classes * unify and print test mode description * print additional info on test completion This only changes meta info about test run but not the actual test output. Change-Id: I30a4b8f561a9677f4e9ded33a051a249bd15a6a2 Related: OS#2282
2018-02-27AllocTest: adjust test_alloc_b()Max1-199/+156
This function contains 3 independent test cases. Let's split them into separate functions to simplify further modifications: * split test cases into separate functions * use them for mass test as well * change function names to avoid confusion * make individual test cases return error instead of failing via assert on allocation failure The top-level test_alloc_b() is used as part of exhaustion tests in test_all_alloc_b() for example, so it's expected that allocation might fail (due to TFI or USF exhaustion for example) eventually. In this case it's better to indicate it to caller instead of failing entire program. The test output does not require any adjustements because we do not exhaust to the point of allocation failure yet. Change-Id: Id7e03a85ce96e7d617cecee963759bae589a3a1a Related: OS#2282
2018-02-27Add tests for find_multi_slots()Max6-3/+1353
* make function public * add tests Change-Id: I4174703808335c19341cd5b5f4422496d958967f
2018-02-27TBF: adjust test log levelsMax2-1186/+4796
* enable debugging for DTBF* * disable excessive DRLCMAC* Change-Id: I122620941e7939d513742c8589a75e0ab76f79ab
2018-02-27TBF: make poll state internalMax7-14/+43
* add functions/macros for setting TBF's poll state * add function for checking TBF's poll state Change-Id: I6db1c4e7bd0a49aeb5e391afe371c36b96c6a702 Related: OS#1539
2018-02-27TBF: make UL ack state internalMax5-13/+38
* add functions/macros for setting TBF's UL ack state * add functions for checking TBF's UL ack state N. B: this should not be confused with TBF-UL state. Change-Id: I144483447d4b0b93e775da0e926ee45eb8ab39f3 Related: OS#1539
2018-02-27TBF: make UL/DL state internalMax6-44/+77
* add functions/macros for setting TBF's UL/DL state * add functions for checking TBF's UL/DL state * move pre-free check into separate function N. B: this should not be confused with TBF-UL or TBF-DL state. Change-Id: Idcbf5775d17b1247f2ed01788f9b0788ce66e871 Related: OS#1539
2018-02-27TBF: add dedicated log categoriesMax8-5694/+137339
Previously all TBF-related events were logged as part of DRLCMAC which is too broad to make it practically useful due to excessive amount of log messages generated. Introduce dedicated log categories for TBF-related events. Adjust test output as necessary. Change-Id: I64d660e5971263d5c63d2ba95d50625c16a594aa
2018-02-27Set V_N and V_B to known initial stateMax1-0/+2
Reset V_N and V_B in UL/DL window class constructors to make sure we always start from known initial state. Related: OS#1759 Change-Id: I8e14ffa913b49c5394229220de9165cdfaabdf19 Fixes: CID70468, CID70469.
2018-02-27jenkins.sh: Disable building doxygen for depsMax1-1/+1
Don't clutter build logs with irrelevant output. Change-Id: If1784baa519c10ab0ab3e600f373c27a6c8ae4c6
2018-02-27TBF: log source of state transitionsMax6-25/+28
We use the same approach for osmo_fsm: when state transition happens, it's not very useful to always log the transition function itself, it's much more useful to see where the actual transition comes from. Change-Id: I348ba89bdda2b44c7019e9c893c764ee08c80bec Related: OS#1759
2018-02-27Allow specifying sysmocom headers explicitlyMax3-6/+15
The headers for LC1.5 are specified explicitly. Add corresponding option to specify sysmoBTS headers location and use it in jenkins build. While at it, unify header fixup code with the one used in OsmoBTS. Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462
2018-01-15Fix sanitizer buildMax1-0/+1
Add sanitizer flags to linker as well to resolve linker error. Change-Id: I695baaf8ce78ed938f6f71c40d17120fa690338b
2018-01-15Allocate global context for TypesTestMax1-0/+5
Missing allocation leads to LSAN error: ==24997==ERROR: LeakSanitizer: detected memory leaks Indirect leak of 230 byte(s) in 2 object(s) allocated from: #0 0x7feaa1b2fb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50) #1 0x7feaa13dbc80 in _talloc_zero (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0x5c80) Change-Id: I62c03dad353f459abcdb7a18a69b7782da38dfb7 SUMMARY: AddressSanitizer: 230 byte(s) leaked in 2 allocation(s).
2018-01-12Fix jenkins.sh to match jenkins job axis filterMax1-2/+2
The 'yes/no' values are automatically converted to True/False upon jenkins job instantiation. Let's use those directly. Change-Id: Ib2100c8345d1f07f488de8170348fec9f877dd9b
2018-01-12Don't access TBF internals in vty functionsMax1-2/+2
Obtain corresponding window object of UL/DL TBF by using proper accessor function instead of direct access to private member. Change-Id: I89bcd2c2b0b6f120d40d20fd43c1e516de3e3950