aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2021-03-24sched: Simplify usf selection codePau Espin Pedrol1-13/+6
Simply use the UL TBF pointer all along until the end, instead of setting both the UL TBF pointer plus the usf var. This commit is also a preparation for next commit which also selects UL TBF when a poll is available, to set its USF in the DL message instead of "USF_UNUSED". Change-Id: I3aa3886932ef87db18ed7ff6991ea315f481990b
2021-03-24sched: Fix scheduling UL TBF not matching conditionsPau Espin Pedrol1-3/+3
With previous code, a skipped TBF could be returned despite not matching the conditions, since at the end of the loop the tbf pointer was returned. Related: OS#5020 Change-Id: If6dccec86c7a655bf1c62f333cfbc8d2c507c94f
2021-03-24Fix: left shift cannot be repesented in type intPau Espin Pedrol1-1/+1
Caught by ASan: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' Change-Id: I30aed795d027dc063f06e08c8455bad2dd92cf24
2021-03-23gprs_bssgp_pcu: add comments to the pcu statesAlexander Couzens1-0/+4
Related: OS#3879 Change-Id: Iccf6508ce46162e6dfd6b00abd44e24cb425b346
2021-03-23gprs_bssgp_pcu: ensure only known BVCI can be resetted by the SGSNAlexander Couzens1-0/+12
Related: OS#3879 Change-Id: I04e36ce4a29e51d85e67a0d3a81aa0e1eb9e9c08
2021-03-20pdch_ul_controller: Fix compiler warning on gcc-10.2Harald Welte1-0/+2
pdch_ul_controller.c: In function ‘pdch_ulc_release_tbf’: pdch_ul_controller.c:217:7: error: ‘item_tbf’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 217 | if (item_tbf != tbf) | ^ Change-Id: I42120fdf23753945ebc16bb5469d9fd253c3da37
2021-03-18direct_phy: Fix condition dropping rx DATA.ind payload in inPau Espin Pedrol3-3/+3
Related: OS#5020 Fixes: 81c549d5be1f5e161d6231d3f2e5fb4aa3b0557c Change-Id: Iad8e50b856009439d78c596c5b54dc3e9836e1d4
2021-03-17sysmo: fix wrong FN jumps in rx RA.indPau Espin Pedrol5-12/+3
There's no need for setting the FN in RA.ind since we anyway already receive a DATA.ind beforehand. Furthermore, the applied delay of 5 in the call is not really used at all. Change-Id: I437f4f95d054aea96bec3b9343e495451020ff3c
2021-03-15ulc: Fix FN store order upon wrap aroundPau Espin Pedrol1-6/+26
Related: OS#5020 Change-Id: I0a742f7fa1541b1837739207b9383772f981fb25
2021-03-15bts: Detect FN jumpsPau Espin Pedrol3-9/+26
Change-Id: I29fb27981597edc69abb976049ba41aa840488cb
2021-03-15sched: Use new PDCH UL ControllerPau Espin Pedrol3-24/+23
Take the time to also do small refactorings to clarify and simplify the function, by using rts_next_fn() already available in pcu_utils.h and getting rid of poll_tbf from tbf_candidates, which clearly follows another objective. Using PDCH UL Controller has the advantage that we don't need to check poll_scheduled() on each TBF, but only do the query once. Related: OS#5020 Change-Id: Ia60bb5249a9837dec1f42180e44d9848334d86d6
2021-03-15Replace PollController with newly added PDCH UL ControllerPau Espin Pedrol10-197/+125
TbfTest is updated to submit empty blocks to have somehow meaningful output (at least as meaningful test results as before, not much). That's because we must update bts->curr_fn to have polls expire. Related: OS#5020 Change-Id: I683ca738ce5a133c49c36a1d94439a942d64a831
2021-03-15Add new PDCH UL Controller, drop SBAllocator classPau Espin Pedrol15-223/+441
Right now we handle different types of UL allocations in different classes like PollAllocator and SBAllocator, and they usually don't take into account the other one in most cases. Furthermore, those objects are usually per-BTS object, instead of per PDCH object. This is a first step towards having a unified per-PDCH controller which takes care of controlling what is scheduled and hence expected on the uplink. Each PDCH has a UL Controller which keeps track of all reserved uplink frame, be it SB, RRBP poll or USF assigned, all under the same API. As a first step, only the SBA part is fully implemented and used (being it the easiest part to replace); TBF poll+usf will come in follow-up patches later on. As a result, the SBAllocator per-BTS class dissappears but some of its code is refactored/reused to provide more features to the gprs_rlcmac_sba object, which is also further integrated into the new UL Controller. Related: OS#5020 Change-Id: I84b24beea4a1aa2c1528f41435f77bd16df2b947
2021-03-12pdch: Log FN when decoding UL Ctrl blockPau Espin Pedrol1-6/+6
Change-Id: I5a44ebf49f7489211a77607052db6d9731f38704
2021-03-12tbf: Fix wrong variable printed in logPau Espin Pedrol1-1/+1
Change-Id: Iad99e48fcb7488daed40a5095c5dcdc02def00c5
2021-03-12Improve logging in DATA.req and ACT.reqPau Espin Pedrol1-15/+19
Change-Id: Id57d50d8bf528adfef3713c594102d31ab49c149
2021-03-12Improve DATA.ind loggingPau Espin Pedrol5-31/+46
pdch object is obtained prior in the stack so it is available for logging. Change-Id: If51f7bdbd626a44c7b8e182a3460dad49fda6ec3
2021-03-12pdch.h: Drop uneeded include bts.hPau Espin Pedrol1-2/+0
This header is not needed and creates include loop issues in follow-up patches. Change-Id: Ic12ab293f27b5e13d1401c6f17d4d549bf5115f9
2021-03-12Introduce init() APIs for PDCH and TRX objectsPau Espin Pedrol4-21/+23
This will make it easier to keep object specific initializations in expected place. Change-Id: Idf1dbdf8bc0b1e16d86eeeffb1193fdf3a57d6ef
2021-03-12Track TDMA clock with DATA.ind instead of TIME.indPau Espin Pedrol2-1/+5
Since recently (see Depends below), BTS side submits DATA.ind with len=0 to announce nothing was received on that UL block FN. This will allow osmo-pcu track time more accurately, and use this information to quickly find out if a UL block was expected as requested by RRBP or USF poll and increment counters such as N3101 (finally being able to properly implement timers such as T3619). Depends: osmo-bts.git Change-Id I343c7a721dab72411edbca816c8864926bc329fb Related: OS#5020 Change-Id: Ibc495173119465e74f726ddc36e312334e6dc0fd
2021-03-11pcu_utils.h: Fix trailing whitespacePau Espin Pedrol1-1/+1
Change-Id: I113766e342a00f61f9894dee1bb89b8ae8354007
2021-03-08direct_phy: Support submitting DATA.ind with len=0 to upper layersPau Espin Pedrol3-51/+43
Since recently (see Depends below), BTS side submits DATA.ind with len=0 to announce nothing was received on that UL block FN. This will allow osmo-pcu track time more accurately, and use this information to quickly find out if a UL block was expected as requested by RRBP or USF poll and increment counters such as N3101 (finally being able to properly implement timers such as T3619). This patch does the same for direct phy feature, where the osmo-pcu process receives the DATA.ind directly from the DSP. Depends: osmo-bts.git Change-Id I343c7a721dab72411edbca816c8864926bc329fb Related: OS#5033 Change-Id: I9a835e16ef0e5a68c003a93d1a33233aa43464ae
2021-03-08pdch: Silently ignore DATA.ind with len=0Pau Espin Pedrol1-0/+9
Since recently (see Depends below), BTS side submits DATA.ind with len=0 to announce nothing was received on that UL block FN. This will allow osmo-pcu track time more accurately, and use this information to quickly find out if a UL block was expected as requested by RRBP or USF poll and increment counters such as N3101 (finally being able to properly implement timers such as T3619). Depends: osmo-bts.git Change-Id I343c7a721dab72411edbca816c8864926bc329fb Related: OS#5020 Change-Id: I17c28abf63b153448b533971ac5cf2e48daadea8
2021-03-04tbf: Log N310* counter incrementsPau Espin Pedrol1-2/+4
Change-Id: Iacd2fb894b4f2a9aade7e66aa40969fea031c3b2
2021-03-03sched: sched_select_downlink(): Clean up param list and improve loggingPau Espin Pedrol1-9/+10
Passing TRX and TS is redundant since the info is contained in pdch object. Change-Id: I1b154d82c4a3e09f7fe7ef771de2abca0160cc7b
2021-03-03sched: sched_select_ctrl_msg(): Clean up param list and improve loggingPau Espin Pedrol1-12/+11
Passing TRX and TS is redundant since the info is contained in pdch object. Change-Id: Ic3ec7547cae2ddd0f9c33b82e15ec83cd941e6c8
2021-03-03gprs_ms: Use standarized logging on more messagesPau Espin Pedrol1-10/+6
Change-Id: If7f471f4932c2347cd857cd59f761a36d9e735d1
2021-03-03ms: clarify delayed MS release process related code and loggingPau Espin Pedrol1-10/+13
Change-Id: Ieaea6ab07b4b2822bcf394f2d0e9298b9f3c5854
2021-03-03gprs_bssgp_pcu: rework BSSGP Reset messages to support SGSN originated ↵Alexander Couzens1-16/+34
BSSGP-RESET Use primitives instead of parsing the message a second time. Set bctx->is_sgsn to false to allow the BSSGP layer to send back a RESET_ACK with cell information. Related: OS#3879 Depends: Ibcbaffa94cbdc4296a8a7c372304ac11d50d9559 (libosmocore) Change-Id: I3afaf826798e362270ffa622c24bfd124ef25cd1
2021-03-02tbf_dl: fix FBI not set upon X2031 = 0Pau Espin Pedrol1-0/+10
If Idle TBF timer (X2031) is set to 0, it means the TBF release is immediately started once all queued data has been scheduled. In that case, we must set FBI=1 (by setting cv=0) and move to FINISH state. This used to work over the usual path where X2031 != 0, because release start will alays happen at a later sched poll time where a dummy LLC frame is sent and FBI set accordingly. Change-Id: Ib20602936ae084c413f6bfe14eea33b602020be0
2021-03-02tbf_dl: Fix m_last_dl_drained_fn not set under some conditionsPau Espin Pedrol1-4/+4
Old commit getting rid of LLC UI dummy and updating create_new_bsn() function introduced a bug by not moving update of value m_last_dl_drained_fn prior to a new break introduced. As a result, the value is not updated in the case LLC queue becomes drained but last few bytes are drained at exactly that moment. Furthermore, then the IDLE tbf timer (X2031, keep_open())) returns always true since according to it the drain never happened. The impact of the bug is basically delaying a bit more than expected the time the TBF stays in IDLE state with the TBF release process yet to be started. Related: OS#4849 Fixes: 7d0f9a0ec383fcfca934731bd6979b6be6629c90 Change-Id: I7420aeffda3500bcdc990291e4a56511af433ff9
2021-03-02tbf: log keep_open condition statusPau Espin Pedrol1-1/+9
Change-Id: I069e84926aaa8f13b23c3ea4083b4c68dbc6cff2
2021-03-02tbd_dl: Don't re-initialize class field twicePau Espin Pedrol1-5/+2
Change-Id: Ia92c24032dc1f8965008ff03a3a0a94bbb93893a
2021-03-02llc: use memset to fill llc dummy frame paddingPau Espin Pedrol1-2/+4
Change-Id: Iaa55549f979ca23dad0bddd308c1144aa4b17255
2021-03-01bts: Add new stats to detect TBF allocation failure reasonsPau Espin Pedrol3-3/+15
This is specially useful to detect for instance if a cell is handling too many users, ending up in TFI or USF exhaustions. This information can be later in the future used to tune TBF allocation algorithm behavior (either manually/statially through config file, or automatically/dynamically in code based on some thresholds). Related: OS#5042 Change-Id: I5402e937ff8d800684655e500ef8e5c867141dc3
2021-02-26Remove uneeded ms param from alloc_algorithm_func_t funcPau Espin Pedrol4-22/+15
Since a while ago, the data architecture was changed so that TBF is guaranteed to always have a MS object associated. Hence, it makes no sense to pass the MS object as a separate param as we can take it from tbf object and makes code less confusing. Change-Id: Idc0c76cf6f007afa4236480cdad0d8e99dabec5f
2021-02-26tbf: Improve logging when TBF being allocated or no TBF availPau Espin Pedrol2-8/+6
Change-Id: I68491fe2c643262e35b4d4f1ecac34afcf61848f
2021-02-26pdch: Standarize and improve loggingPau Espin Pedrol2-58/+65
Change-Id: I1686a72eb9f9014ed3365376bc43d59d60bee8a5
2021-02-25bts: Count TBF TS allocation failurePau Espin Pedrol3-0/+4
Related: OS#2282 Change-Id: I0696bf77364bd31b96c00614a58ce66809683d1c
2021-02-25tbf: Log timeslot allocation failurePau Espin Pedrol1-0/+3
Change-Id: I48fc1eac37eeb74649bfc0888e06afc0079a58f8
2021-02-24Support uplink multi-slot allocationsPau Espin Pedrol1-22/+23
Before this patch, allocate_usf() was implemented to only allocate 1 USF per TBF, regardless of the available ul_slot mask. As a result, only 1 slot at max was allocated to any TBF. That's a pity because usual multislot classes like 12 support up to 2 UL slots per TBF (in common TS with DL). This patch reworks allocate_usf() to allocate as many UL multislots as possible (given mslot class, current USF availability, TFI availability, related DL TBF slots for the same MS, etc.). As a result, it can be seen that AllocTest results change substantially and maximum concurrent TBF allocation drops under some conditions. That happens due to more USFs being reserved (because each TBF has now more UL slots reserved). Hence now USF exhaustion becomes the usual limitation factor as per the number of concurrent TBFs than can be handled per TRX (as opposed to TFIs previously). Some of the biggest limitations in test appear though because really high end multislot classes are used, which can consume high volumes of UL slots (USFs), and which are probably not the most extended devices in the field. Moreover, in general the curren timeslot allocator for a given multislot class will in general try to optimize the DL side gathering most of the possible timeslots there. That means, for instance on ms class 12 (4 Tx, 4Rx, 5 Sum), 4 DL slots and 1 UL slot will still be selected. But in the case where only 3 PDCHs are available, then with this new multi-slot UL support a TBF will reserve 3 DL slots and 2 UL slots, while before this patch it would only taken 1 UL slot instead of 2. This USF exhaustion situation can be improved in the future by parametrizing (VTY command?) the maximum amount of UL slots that a TBF can reserve, making for instance a default value of 2, meaning usual classes can gather up 2 UL timelosts at a time while forbidding high-end hungry classes to gather up to 8 UL timeslots. Another approach would be to dynamically limit the amount of allowed reservable UL timeslots based on current USF reservation load. Related: OS#2282 Change-Id: Id97cc6e3b769511b591b1694549e0dac55227c43
2021-02-22Use ALPHA value received in SI13 from PCUIFPau Espin Pedrol7-11/+37
The old VTY command is marked as deprecated and still overrides the use in case it's used. Related: SYS#5358 Depends: libosmocore.git Change-Id I74fb0a3afc1ac4aadbfc609b882d929401f790eb Depends: osmo-bsc.git Change-Id I8b97ea11bad5fe05f2f634945b5703ee9abde81d Change-Id: I46f2a955b157a409055fca7fb917dc4f75482426
2021-02-19find_multi_slots: Avoid multiple calls to mslot_class_get_type()Pau Espin Pedrol1-3/+4
Change-Id: I9cda52befe32a7727ab479bc151d10106fb94688
2021-02-19find_multi_slots: Mark mslot_class properties constPau Espin Pedrol1-4/+4
This way it's clear for reader that those variables are never touched during the function. Change-Id: Ief038c75bc02d0e987135f29599014eab88447dd
2021-02-19find_multi_slots: Avoid multiple calls to mslot_class_get_rx()Pau Espin Pedrol1-3/+4
Change-Id: I06c97d81636e251f81c26f3aa042c70717be083a
2021-02-19find_multi_slots: Avoid calling mslot_class_get_tx() on each iterationPau Espin Pedrol1-1/+1
Change-Id: I397495c158bce1c2715991371368b0d84cf69261
2021-02-19Use NULL as default value for pointer typePau Espin Pedrol1-1/+1
Using zero there is confusing since it's a pointer to an integer. Change-Id: Ief2368954c71005c529e3eea3fee5df2630e44c1
2021-02-19gprs_bssgp: use gprs_ns2_sns_add_bind() to allow the NSE to use the binds ↵Alexander Couzens1-0/+8
for IP-SNS configuration The gprs_ns2 now requires to specify every bind which should be used by the NSE for IP-SNS Related: SYS#5354 Depends: I9ab8092bf286e7d90e92f5702a5404425e959c84 (libosmocore) Change-Id: I35c987224ce098f7ee9f189ce0fce9e68ad3feac
2021-02-18sched: Avoid selecting TBF to tx NACC Dl msg if no TFI is assignedPau Espin Pedrol1-4/+4
The DL NACC related message (PKT Cell Neighbor Data/Change Continue) are filled with the TFI of the target TBF. Hence, only select the tbf for NACC transmission if the related TBF already has a TFI assigned. Otherwise, "OSMO_ASSERT(tbf_is_tfi_assigned(tbf));" in nacc_fsm.c when generating messages may be hit. Related: SYS#4909 Change-Id: I72b2dff28aacdb04909c098c94834ff79f55b31d
2021-02-18cosmetic: fix line indentationPau Espin Pedrol1-1/+1
Change-Id: Ia8335ce5c005885e4db1864faf775c4bff509c53