aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
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
2018-01-12TBF: unify EGPRS window calculationMax5-70/+57
Move actual calculation into shared function and use it to set window size for TBF. TBT test output requires cosmetic adjuestements due to extended debug output. Change-Id: Ib9f4a277082da3c71007f5f3b4f2acac8b994540 Related: OS#1759
2018-01-12TBF-DL: move priority computation into functionMax2-26/+37
Improve readability by moving priority computation into separate function. Change-Id: Icdca0106a544036eaa94a25f0d4f84e4282f4568
2018-01-12TBF: move window parameters to UL/DL levelMax6-32/+42
The UL and DL TBF use different classes implementing window management. Hence it's better to use it explicitly instead of using the common window management superclass inside common TBF superclass. While at it, also remove the direct access to window class - use accessor functions instead. Related: OS#1759 Change-Id: I0b55aa8947db65f7206adcf53ea32b74a831d9e6
2018-01-12Avoid code duplication in TBF testMax1-122/+75
Move repetitive checks into corresponding macros to avoid copy-pasted code. This also enables strickter checks some of which were apparently omitted while copy-pasting. This is part of preparation work to move to separate UL/DL windows. Related: OS#1759 Change-Id: If7aa72f5aa66c5e9c255542c066b5494c098aab2
2018-01-12TBF-UL: add simpler test helperMax2-4/+9
Add function to set both V_R and V_Q values to 0 which is useful for TBF test. Related: OS#1759 Change-Id: I719abfbd5b88c694cbbd69d5c4dcb42baaca91b2
2018-01-12Clarify RACH-related interfacesMax2-82/+87
* make is_11bit parameter into bool * remove is_single_block() from public interface and mark it as static * move logging outside of if ladder * move side-effects from is_single_block() into separate static functions * simplify UL-TBF allocation in case of 11-bit RACH This immediately makes it obvious that priority is never actually used despite being computed - seems like a leftover from merge of incomplete patch series. Change-Id: If189b7166a29a87ffb17a7a9bc560f674851fd53 Related: OS#1548
2018-01-12TBF: cleanup state flag handlingMax5-33/+36
* introduce generic function to check whether particular flag was set for'a TBF and clear it if necessary. Use this instead of clear_poll_timeout_flag() * add function to explicitly set assignment and appropriate state flags Overall this makes the code easier to read and debug. Related: OS#1759 Change-Id: Ic4560280c72f91700f2e19c6c7f6658dc29625c2
2018-01-12Make TBF state privateMax2-5/+2
Let's make sure no external function can mess with the TBF state. Change-Id: I217f4c4bac21dd584c8682928a080a1a6e9507e1
2018-01-04cosmetic: clarify coding scheme and puncturingMax5-45/+45
* use appropriate types for coding scheme parameters * add comment regarding possible number of RLCMAC blocks The code in create_dl_acked_block() has underlying assumption that rlc.num_data_blocks can never be more than 2, which is true and is enforced by appropriate asserts but is not obvious when looking at the function code alone. It's equally hard for Coverity which leads to false positives in scan. Lets' make this assumption explicit by putting it into for(;;) condition alongside with corresponding comment. Fixes: CID143070 Change-Id: If599a6c8a6ef56d847604fcf41bb71decccd8a78
2018-01-04window: move encoding into functionsMax5-31/+46
* move window size encoding and writing into separate functions * introduce necessary TBF wrappers to avoid direct m_window access This is part of preparation work to move to separate UL/DL windows. Related: OS#1759 Change-Id: I60184d5049bc7d7b119df5a9eb82d1c4b788c840
2018-01-04TBF-DL: mark rcvd_dl_ack() parameters as booleanMax3-10/+10
The final(_ack) parameter of rcvd_dl_ack() only used as boolean - mark it as such. Change-Id: Icc4d68f049a45d4b42c5594f50594ff0d44c1bac
2018-01-03Fix llc_queue_size() typeMax2-2/+2
It either returns 0 or LLC queue size() which has size_t return type. This means it can never be negative - hence it's better to use size_t as return type. Change-Id: I2a6e849d349ab12854976bd0d68537a370a9c83d Fixes: CID181478
2018-01-02TBF: bail out for unknown timersMax1-0/+2
Return right after logging error if attempting to start or stop unknown timer. Change-Id: Ie6ae564d41a5e03270685c6bafb3504278eb3551 Fixes: CID181512, CID181514
2018-01-02TBF: log timer invocation sourceMax5-23/+29
When troubleshooting TBF timers we're not only interested in timer duration but also in the code which triggered it. Let's use LOGPSRC to log it: wrap t_start() in a macro for convenience. Change-Id: If5f883ae52c469e5158bad24da9904fdc455582f Related: OS#2407
2018-01-02TBF: unify timer handlingMax4-68/+32
Use generic timer handling infrastracture to handle assignment/reject internal timer. Rename timer array accordingly. Use defines with explicit second/microsecond values to make it more readable. Change-Id: I63fb7e6f0695383a83472c836a381a055f64690b
2017-12-28Add optional profiling supportMax1-0/+9
This facilitates the use of programs like uftrace. It's disabled by default due to associated overhead. Change-Id: I5c16988cefa46e0b958030c0f3bff9efc5b4979d
2017-12-22Add tests for pcu_lsb()Max3-0/+279
This utility functions is used by TBF allocation routines and only tested indirectly through allocation test. Let's add proper exhaustive test which checks all uint8_t values. This also requires adding missing include to pcu_utils.h Change-Id: If08a7f0d31f0e5ad8a5efa5885880aed19c329ab
2017-12-21Enable sanitize for CI testMax1-1/+2
Change-Id: Ia33ffb9b25df587706367bc24925cf9cead3b9a0
2017-12-21Add --enable-sanitize configure optionMax1-0/+9
Change-Id: Idb2c1d6057012ed2f032e7504387a0767d02d75b
2017-12-21Add function to get max supported MS classMax2-1/+7
It's useful for allocation tests. Change-Id: I31d503af700ec3364042ff7e661710953cacf9f8 Related: OS#2282
2017-12-21Fix warningsMax1-2/+2
Fix warnings detected by compiler and coverity scan. Change-Id: If463c7f8769e18d3df74837f0cb0f545cca9b23e Fixes: CID181479
2017-12-20TBF: add N3101 counterMax3-0/+30
Properly reset the counter when receiving valid RLCMAC block and update it when no data is received as per 3GPP TS 44.060 §8.1.1.1 Change-Id: I2f79c6153dc4073c9d293b2824979e6381576682 Fixes: OS#2407
2017-12-20TBF: implement independent T31xx timersMax6-79/+179
Previously TBF got single timer so the pending timer was automatically cancelled when new one was scheduled. Let's make it more robust by implementing independent T31 xx timers from 3GPP TS 44.060 §13.2 with corresponding start/stop functions and counters. The semantics of the timers is preserved as before: pending timers are restarted unconditionally. It might be neecessary to change this later on after spec review. N. B. T0: used for assign/reject timeouts, have to be properly attributed and documented first. Change-Id: I0305873ca47534f53441247217881da59625e1f7 Related: OS#2407
2017-12-20Introduce LOGTBF* for consistent loggingMax6-1015/+980
When troubleshooting complex issues with TBF lifecycle, it's much easier to follow the logs which are consistently formatted. Add LOGTBF*() macro similar to struct-specific log routines we use in other Osmocom project and use it to log TBF-related messages in a unified way. Tweak test output accordingly. Related: OS#2407 Change-Id: I388249afefc32d2f6e5cb5e5abc6daf4dbd284ea
2017-12-18Fix tests after rate_ctr changeMax1-1/+9
Recent change lin libosmocore disallow registering rate_ctr with the same name and indexing multiple times. To accommodate to this check if rate counters arealready allocated (by static allocator of BTS singleton for example) and register rate counter with different index. This fixes the tests for now but eventually we'll remove the BTS singleton which will allow us to remove this hack. Change-Id: I7c552ce653b44ec3a31049641728926adc07361d Related: OS#2757
2017-12-18Remove unused includes and forward declarationsMax12-24/+0
Change-Id: I59da04edd1b8ff965bbfbe00ccae1f7c9b6e5301