aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf_ul.cpp
AgeCommit message (Collapse)AuthorFilesLines
2019-03-27TBF: update MCS countersMax1-62/+57
* use enum CodingScheme directly instead of converting it to class and back * drop useless mode check * log errorneous update attempt Change-Id: I763136c2f356d63aa3d28d09c57fd5faf5336258
2019-03-26MCS: add mcs_is_*() helpersMax1-1/+1
In preparation for Channel Coding Command encoder in follow-up patches let's add necessary helpers. Those are similar to previously used helpers from GprsCodingScheme class but without CamelCase and with less typo chances between Gprs and Egprs cases. Change-Id: I6699cbc8d7ae766fa4d2b3d37e5f9ff1cf158b7e
2019-03-19MCS: use value_string for conversionMax1-4/+5
Change-Id: I212ebb892ab162821633974d5a6c7e315d308370
2019-03-12MCS: move Coding Scheme enum outside of class definitionMax1-21/+21
Move generic MCS enum to C header file to simplify further modifications to GprsCodingScheme class in follow-up patches. This also allows us to use standard libosmocore value_sting functions in upcoming patches for IA Rest Octet encoding/decoding. Related: OS#3014 Change-Id: I993b49d9a82b8c7ad677d52d11003794aeabe117
2019-02-19Add define for dummy burst stringMax1-2/+1
Change-Id: I464920b3d6d47bb1c797a4ce06230f005a2e06a0
2018-02-20TBF: make network counters internalMax1-1/+1
* 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-19Update header includesMax1-1/+10
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-03TBF: decrease logging verbosity for trafficMax1-1/+1
Change-Id: If43aa9895abf58602556c986a633ff93a6f00b06
2018-01-24TBF: make poll state internalMax1-2/+1
* add functions/macros for setting TBF's poll state * add function for checking TBF's poll state Change-Id: I6db1c4e7bd0a49aeb5e391afe371c36b96c6a702 Related: OS#1539
2018-01-24TBF: make UL ack state internalMax1-6/+6
* 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-01-19TBF: add dedicated log categoriesMax1-92/+69
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-01-17TBF: log source of state transitionsMax1-1/+1
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-01-12TBF: unify EGPRS window calculationMax1-15/+4
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: cleanup state flag handlingMax1-3/+1
* 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-02TBF: log timer invocation sourceMax1-1/+1
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
2017-12-20TBF: implement independent T31xx timersMax1-1/+1
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 loggingMax1-5/+3
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-05TBF: expand timer loggingMax1-1/+1
* log timer values * log start/stop cause * update test output as necessary This simplifies debugging issues with TBF timers. Related: OS#2407 Change-Id: Ib8e537416af9bec5d447356286f44e9e8bbf1b7a
2017-08-14Simplify polling troubleshootingMax1-2/+1
* introduce enum describing poll kind and use it in set_polling() * move state change into set_polling() * move logging into set_polling() and unify output * move duplicated code into static function * adjust tests to match unified logging output Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d Related: OS#1524
2017-08-14Encapsulate handling of UL ACK timeoutMax1-0/+21
Use helper methods instead checking and manipulating flag directly. Change-Id: Ia3f009c52118db95b38a077e08eecda844e7f8d1 Related: OS#1539
2017-05-15remove pcu own bitvector implementationAlexander Couzens1-1/+1
The osmocore bitvec is exact the same, but use a pointer instead of a reference. Change-Id: Id8f797631d89aa12b6e48efb2dc153a3e2f059f7
2017-01-23Add compression support in EGPRS PUANsivasankari1-0/+21
This adds compression of bitmap in PUAN. The compressed bitmap is used only if the number of bits in the bitmap does not fit in the message and there is a gain after compression. The algorithm is part of libosmocore and so there is dependency on the libosmocore for compilation. The algorithm is tested on integration setup by forcing compression. Change-Id: Id2eec4b5eb6da0ebd24054b541b09b700b9b40ba
2016-12-22Add counter at BTS level And statistics at TBF/MS level.sivasankari1-0/+17
Adds spb counters at BTS level(show bts statistics). Adds RLC/MAC downlink control msg at ms level(show ms imsi <imsi_val>). Adds the number of coding schemes counter for UL at TBF level. Change-Id: Icbe4ba95e34bea89ee36f532d099db68204b7c38
2016-11-14Add BTS level countersMrinal Mishra1-1/+54
Adds counters for MCS blocks, 11 bit Rach counters and others. Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a
2016-09-15EGPRS: Fix issue with row 4 of Table 10.4.14a.1 of 44.060 version 7.27.0 ↵Aravind Sirsikar1-6/+10
Release 7 row 4 of Table 10.4.14a.1 of Spec 44.060 version 7.27.0 Release 7. Says "The previous RLC data block contains a Upper Layer PDU, or a part of it, that fills precisely the previous data block and for which there is no length indicator in that RLC data block. The current RLC data block contains a Upper Layer PDU that either fills the current RLC data block precisely or continues in the next RLC data block." So when we receive block with 1st LI: value=0 and Value of E bit in the same octet as 1, we expect 2 chunks with 1st chunk as length as 0 and complete and 2nd chunk as length non zero. But with this bug we see only 1 chunk causing incorrect assembling This issue has been fixed in this patch. Related: OS#1811 Change-Id: I2cd0fca3ed28a553ede3f4b8a7d3267284dd2c9b
2016-08-02Add support for SPB handling for EGPRS UL TBFAravind Sirsikar1-22/+142
This patch will modify the EGPRS UL TBF flow to support Split block handling. This patch also contains test suite modification for SPB UL. Scenarios like MCS6->MCS3, MCS4->MCS1, MCS5->MCS2, MCS9->MCS3 MCS7->MCS2, MCS8->MCS3 have been simulated and Integration tested in NuRAN 1.0 hardware thoroughly. The scope of Unit testing is limited. Change-Id: I39ca53218b6e0982abc2ab9c703c24c8bf0a09c0
2016-07-12Add data structure for ARQ-II in EGPRS DLAravind Sirsikar1-2/+2
Modify the existing data structure to support ARQ-II for Retx in EGPRS DL. This will also hadle compilation issue related to renaming the variable. Change-Id: I734b1024bb32f2daa43af4adf59f4a17f2294afe
2016-06-16Add Header Type2 support in EGPRS ULAravind Sirsikar1-1/+1
This patch will add support for MCS5,6 in EGPRS UL along with incorrect assert correction to let MCS 6 work. Change-Id: Iac2422c8acbdcefe20aafbba6a4eb87c9893e3ba Reviewed-on: https://gerrit.osmocom.org/269 Tested-by: Jenkins Builder Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-07add KPI counter to count bytes for RLC and LLC framesAlexander Couzens1-0/+3
rlc.dl_bytes bytes before sending rlc rlc.dl_payload_bytes count data w/o LI rlc.ul_bytes bytes when received rlc (only valid) rlc.ul_payload_bytes count data fragments w/o LI llc.dl_bytes complete encapsulated LLC PDUs llc.ul_bytes complete received LLC PDUs Change-Id: I9a98a5a375d39b3f4990360056c4d6145e755f4d Reviewed-on: https://gerrit.osmocom.org/145 Reviewed-by: Harald Welte <laforge@gnumonks.org> Reviewed-by: Holger Freyther <holger@freyther.de> Tested-by: Jenkins Builder
2016-05-25add comments to describe functionsAlexander Couzens1-0/+1
Change-Id: Ie351632001abbeb82008a5eecae0d0323a8ef7d7 Reviewed-on: https://gerrit.osmocom.org/106 Reviewed-by: Harald Welte <laforge@gnumonks.org> Tested-by: Jenkins Builder
2016-05-25tbf_ul: use correct size for chunk_sizeAlexander Couzens1-1/+1
The size of the hole array in bytes was used instead of the size of elements. Change-Id: If6bf3e5f1ad773ddaa9fb2ce7c069e6b26659cbf Reviewed-on: https://gerrit.osmocom.org/105 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-02-08tbf: Add check_polling/set_pollingJacob Erlbeck1-11/+12
Currently the checks for and the actual polling is done in several places by copy & paste of several lines of code. This hinders changes of they polling is handled internally and also is likely source of programming mistakes. Separate this into a check_polling function, that checks whether polling is possible and returns the FN and the RRBP to be used in that case. Otherwise the cause is logged (LOGL_DEBUG) and a negative error value is returned. There are no other side effect beside the logging. If the call is successful, the set_polling method can be used to actually register the polling. Extend the encoder functions' parameters lists by an rrbp parameter. Sponsored-by: On-Waves ehf
2016-02-08tbf: Add and use tbf->poll_tsJacob Erlbeck1-0/+1
Currently tbf->control_ts is used to look up an incoming poll response. Since that may eventually change, poll timeouts could theoretically happen in that case. Store the real poll TS in tbf->poll_ts at all places where tbf->poll_fn is set. Do not use tbf->control_ts to look up outstanding polls. Sponsored-by: On-Waves ehf
2016-02-08sched: Pass the current TS to the control create functionsJacob Erlbeck1-2/+2
Currently the checks in that function are based on the different internal TS values of a TBF. It is assumed that they match the TS that the current RTS refers to. This commit adds a TS parameter to create_ul_ass, create_dl_ass, and create_ul_ack to make this more explicit. Sponsored-by: On-Waves ehf
2016-02-05edge: Fix RLC message sizeJacob Erlbeck1-1/+1
Currently the RLC message length that is obtained from the DSP is reduced by 1 if the last byte of the buffer includes spare bits. While this worked well with GPRS, these bits are being used to encode RLC blocks in EGPRS mode. Thus this last byte must not be chopped off. The functionality of the code is not affected by this, since the modified length value is not used. This commit adds GprsCodingScheme::usedSizeDL/UL to return the number of bytes needed to encode the message block. If there are single bits at the end that are to be used (EGPRS), the functions return the number of full bytes plus 1 (which is the buffer size reported by the DSP and returned by sizeUL/sizeDL). The commit also removes the len parameter from rcv_data_block_acknowledged. Sponsored-by: On-Waves ehf
2016-02-05edge: Rename gprs_rlc_ul_header_egprs and gprs_rlc_ul_data_block_infoJacob Erlbeck1-5/+5
These struct names are more specific than necessary. They are used for GPRS (uplink) already. In downlink direction, only a few fields will be added to the header struct. Add addition, gprs_rlc_ul_header_egprs does not map directly to an encoded header, like many other 'header' structs do. Change the names to fit both modes and both directions: gprs_rlc_ul_header_egprs -> gprs_rlc_data_info gprs_rlc_ul_data_block_info -> gprs_rlc_data_block_info Sponsored-by: On-Waves ehf
2016-02-01encoding: Remove RlcMacDownlink_t based write_packet_uplink_ackJacob Erlbeck1-8/+0
This is the CSN1-encoder based variant, which has been replaced and is no longer being used. Sponsored-by: On-Waves ehf
2016-02-01tbf: Use bitvec based write_packet_uplink_ackJacob Erlbeck1-0/+5
Use the new bitvec based encoder for PACKET UPLINK ACK/NACK messages and disable the old CSN.1 encoder based one. Sponsored-by: On-Waves ehf
2016-02-01rlc: Add and use mod_sns(bsn) methodJacob Erlbeck1-5/+4
Currently there is only a mod_sns() method which is being used in expression like bsn_expr & win.mod_sns(). This only works, because it is known that mod_sns() is (sns() - 1) where sns() in turn is always 2^n. This is error prone, hard to read, and relies on window specifics that should be kept inside the respective module. This commit adds a mod_sns(uint bsn) method to gprs_rlc_ul_window and gprs_rlc_dl_window, that encapsulates and hides this optimized computation. Sponsored-by: On-Waves ehf
2016-02-01rlc: Dump RLC data for debuggingJacob Erlbeck1-0/+3
Log incoming RLC data messages and RLC data units to LOGL_DEBUG. Sponsored-by: On-Waves ehf
2015-12-16edge: Remove unused GPRS functionsJacob Erlbeck1-302/+0
This commit removes the code that is no longer used due to the commit "Use a single PDCH rcv_data_block method for GPRS and EGPRS". Sponsored-by: On-Waves ehf
2015-12-16edge: Add methods for unified GPRS/EGPRS UL data block handlingJacob Erlbeck1-2/+268
The current rcv_data_block_acknowledged_gprs method is tightly coupled to GPRS. This commit adds variants of the involved methods that support EGPRS and GPRS RLC encodings likewise. Sponsored-by: On-Waves ehf
2015-12-16rlc: Do not raise_v_q in receive_bsnJacob Erlbeck1-1/+2
Currently gprs_rlc_ul_window::receive_bsn calls raise_v_q and returns the number of RLC data blocks that can be taken from the queue. This does not fit the EGPRS feature to put 2 independant data blocks in a single RLC block. This commit removes raise_v_q from receive_bsn, hence it must be called explicitely to get the number of processable data blocks. Sponsored-by: On-Waves ehf
2015-12-15edge: Rename rcv_data_block_acknowledgedJacob Erlbeck1-1/+1
This commit renames rcv_data_block_acknowledged to rcv_data_block_acknowledged_gprs to separate it from EGPRS data block decoding. Sponsored-by: On-Waves ehf
2015-06-22ms: Store the L1 measurement values in the MS objectsJacob Erlbeck1-0/+4
This commits adds the GprsMs::update_l1_meas() and GprsMs::l1_meas() methods to store and access the measurement values. The internal state is updated depending on which values are actually set. In addition, these values are shown in the output of the 'show ms imsi|tlli' command. Sponsored-by: On-Waves ehf
2015-06-22l1: Pass all L1 measurements upwardsJacob Erlbeck1-1/+4
Currently only the RSSI value is passed to the upper layers. Other values like TA and BER which are needed for TA update respectively CS selection are not propagated. This commit introduces and passes a struct that contains a set of measurement values. Sponsored-by: On-Waves ehf
2014-08-12tbf: Split out UL/DL TBF methods into separate filesDaniel Willmann1-0/+418
tbf_ul.cpp for UL TBF methods tbf_dl.cpp for DL TBF methods This commit contains no code changes. Ticket: SYS#389 Sponsored by: On-Waves ehf