path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2021-03-31tbf: Get rid of attribute poll_tsHEADmasterPau Espin Pedrol1-10/+8
That field is not needed anymore, and it works only under the assumption that only 1 poll request can be active at a time per TBF, which is not true. Change-Id: I9b8bed7741d385bab4cd8c64b841a78a02a05fe1
2021-03-31tbf: Get rid of attribute poll_fnPau Espin Pedrol2-73/+84
That field is not needed anymore, and it works only under the assumption that only 1 poll request can be active at a time per TBF, which is not true. Change-Id: I63a34a702f028b871530fb7caeb13e8ea1cc78ac
2021-03-31Get rid of param 'poll' with constant valuePau Espin Pedrol1-36/+36
Value 'false' is always passed by all callers of the function, so there's no need to pass it. Furthermore, since it's false, there's no need to access poll_fn since RRBP will always be invalid. Change-Id: Ia48ce2a021865e76e813dedb22aca9c2522c5693
2021-03-31tbf: get rid of poll_state completelyPau Espin Pedrol1-16/+0
The poll_state logic was part of previous implementation (prior to pdch ul controller) where the ssumption was that TBF could only had 1 POLL request in transit, which is really not true. With current infrastructure we don't need this state tracking at all. Change-Id: Ie5b807ccd38aa736ae11b3310ca61ad0156ca4d4
2021-03-31tbf: Allow multiple concurrent pollsPau Espin Pedrol1-400/+315
There's no good reason to allow only for 1 concurrent POLL requested to a TBF, it was onyl done this was as an implementation limitation factor. It can well happen that several multiple POLLs may be in transit at the same time, eg to get DL ACK/NACK as well as to get a CTRL ACK for a Pkt Cell Change Continue (NACC). Change-Id: Ic4080db684a4626cae90dd574d123081981284ca
2021-03-31tbf: Get rid of unneeded poll_scheduled()Pau Espin Pedrol1-104/+104
This API is not really needed anymore, since anyway it works under the assumption there can only be 1 POLL in transit per TBF, which isn't necessarily true. Change-Id: I875f51cade95faeb2d79dcebfead4c83e23a731b
2021-03-31pdch_ulc: Store TBF poll reasonPau Espin Pedrol1-6/+6
This allows easily checking the initial reason to trigger the poll when either it is received or times out. Later on this reason can be transformed into an FSM event and sent to the related FSM. Related: OS#5020 Change-Id: Ie8fefd1f47ad674ce597a8065b15284088956bde
2021-03-31pdch_ulc: Support picking RRBP other than N+13Pau Espin Pedrol4-1/+129
Current algo always tries to sched RRBP the soonest possible. Related: OS#5020 Change-Id: Ic6ddeea70e1f914cf423d0daab8fc492d0c992e2
2021-03-31Pick unreserved UL FN when allocating an SBAPau Espin Pedrol2-0/+34
Make sure an unreserved FN is picked and reserved when allocating and scheduling an SBA. In practice this has no change in behavior right now, since anyway using an offset of 52 FNs ensure no USF or POLL has alredy been scheduled that far in the future. Since it's also impossible to allocate more than 1 SBA per PDCH and RTS FN, we are also safe about multiple SBAs being allocated, because we use a hardcoded offset of 52. However, that could change in the future, when we dynamically tweak the current offset of 52 FN based on information from BTS about its AGCH queue load: * If load is high, we may need to increase the offset since it will take more time for the BTS to transmit the TBF and hence we must reserve a TBF starting time further in the future (higher FN). * If load turns low, we may schedule next SBA a bit more nearby in time than the previously allocated SBA, hence here there could be a collision. Related: OS#5020 Change-Id: I2d4e21e2307de6c17748e8da5c7e149c947a7eb9
2021-03-24Properly implement N3101Pau Espin Pedrol1-69/+73
N3101 is incremented by unanswered USF requests, not from unanswered POLLs. Related: OS#5033 Change-Id: I1a55bdd39db8843976915b9f74fadb0942298413
2021-03-24Track scheduled UL blocks through USFPau Espin Pedrol1-0/+275
This way PCU can now detect whether scheduled UL blocks through USF were never received. This allows in a follow-up patch to start increasing N3101 properly. Related: OS#5033 Change-Id: Ia99c9edad6e5bd837e9baeb4fb2683b227887957
2021-03-17sysmo: fix wrong FN jumps in rx RA.indPau Espin Pedrol1-1/+1
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 Pedrol3-48/+72
Related: OS#5020 Change-Id: I0a742f7fa1541b1837739207b9383772f981fb25
2021-03-15tests: ulc: Show current bug with FN wrap aroundPau Espin Pedrol3-0/+330
Issue will be fixed in next commit. Leaving ASSERTs disabled so that test passes in jenkins. Related: OS#5020 Change-Id: I657db6b300363f8f3a9e4cfaf7a7f49e361a0512
2021-03-15tests: Introduce unit tests for PDCH UL ControllerPau Espin Pedrol5-0/+212
Related: OS#5020 Change-Id: Ie1ff0ca3d7fc8a9824d6fe4dceb746e301082bda
2021-03-15cosmetic: tests/Makefile.am: Split content into several linesPau Espin Pedrol1-3/+21
Change-Id: I67361862b992d761b314d9565165ece7e380606d
2021-03-15bts: Detect FN jumpsPau Espin Pedrol2-5/+61
Change-Id: I29fb27981597edc69abb976049ba41aa840488cb
2021-03-15Replace PollController with newly added PDCH UL ControllerPau Espin Pedrol2-49/+163
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 Pedrol2-2/+2
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-58/+58
Change-Id: I5a44ebf49f7489211a77607052db6d9731f38704
2021-03-12tests: rlcmac: Fix C vs C++ linkage of extern symbolPau Espin Pedrol1-1/+2
RLCMACTest.cpp:31:30: error: conflicting declaration of ‘const log_info gprs_log_info’ with ‘C’ linkage 31 | extern const struct log_info gprs_log_info; gprs_debug.h:54:30: note: previous declaration with ‘C++’ linkag Change-Id: I5922950dd0057bf7eb8578e2144f127082323fc6
2021-03-12Track TDMA clock with DATA.ind instead of TIME.indPau Espin Pedrol1-140/+140
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-04tbf: Log N310* counter incrementsPau Espin Pedrol1-0/+2
Change-Id: Iacd2fb894b4f2a9aade7e66aa40969fea031c3b2
2021-03-03sched: sched_select_downlink(): Clean up param list and improve loggingPau Espin Pedrol1-178/+178
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-30/+30
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 Pedrol3-223/+223
Change-Id: If7f471f4932c2347cd857cd59f761a36d9e735d1
2021-03-03ms: clarify delayed MS release process related code and loggingPau Espin Pedrol2-1/+3
Change-Id: Ieaea6ab07b4b2822bcf394f2d0e9298b9f3c5854
2021-03-02tbf_dl: fix FBI not set upon X2031 = 0Pau Espin Pedrol1-0/+23
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-0/+2
Change-Id: I069e84926aaa8f13b23c3ea4083b4c68dbc6cff2
2021-02-26Remove uneeded ms param from alloc_algorithm_func_t funcPau Espin Pedrol1-5/+2
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 Pedrol3-50853/+50853
Change-Id: I68491fe2c643262e35b4d4f1ecac34afcf61848f
2021-02-26pdch: Standarize and improve loggingPau Espin Pedrol2-462/+462
Change-Id: I1686a72eb9f9014ed3365376bc43d59d60bee8a5
2021-02-25tbf: Log timeslot allocation failurePau Espin Pedrol2-0/+40
Change-Id: I48fc1eac37eeb74649bfc0888e06afc0079a58f8
2021-02-24Support uplink multi-slot allocationsPau Espin Pedrol3-8622/+7457
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 Pedrol1-1/+0
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-19tests: Replace deprecated API log_set_print_filenamePau Espin Pedrol11-11/+11
Change-Id: Idcc4875592c81f17ac98c4f6098492b3d9dd33d2
2021-02-19tests: Explicitly drop category from logPau Espin Pedrol7-1/+14
Let's disable category here since we don't care about its formatting here. In any case, every test relying on logging output validation should always explicitly state the config to avoid issues in the future if default values change. Change-Id: I7f9c56313cfaa74ebe666f44763a83d8102f5484 Related: OS#5034
2021-02-16gprs_bssgp: rename gprs_ns_config -> gprs_ns_update_configAlexander Couzens1-1/+1
Improve the naming of the function to match it's purpose. Related: SYS#5354 Change-Id: Ib8e4ae734503fd6f6695d9d6767d809e1bf79d22
2021-01-30tests/rlcmac: add more test vectors for Packet Resource RequestVadim Yanitskiy3-0/+47
All vectors should be valid, since they were generated by an MS. As can be seen, osmo-pcu fails to decode one of the vectors. Change-Id: I37a2ddd394eeffa1cae0f3e419eeee0200a57fcf OS#4955 Change-Id: Ib5677048f5668185ffe752f97c97d5612eee4d72
2021-01-29Introduce NACC supportPau Espin Pedrol1-1/+13
A new nacc_fsm is introduced per MS object, with its partner priv structure struct nacc_fsm_ctx, which exists and is available in the MS object only during the duration of the NACC procedure. The NACC context is created on an MS whenever a Pkt Cell Change Notification is received on Uplink RLCMAC, which asks for neighbor information of a given ARFCN+BSIC. First, the target ARFCN+BSIC needs to be translated into a CGI-PS (RAC+CI) address. That's done by asking the BSC through the Neighbour Resolution Service available in osmo-bsc using the CTRL interface. Once the CGI-PS of the target cell is known, PCU starts a RIM RAN-INFO request against the SGSN (which will route the request as needed), and wait for a response containing the SI bits from the target cell. After the SI are received, the scheduler is instructed to eventually poll a TBF for the MS originating the CCN, so that we can send the SI encapsulated into multiple Packet Neighbor Cell Data messages on the downlink. One all the SI bits are sent, the scheduler is instructed to send a Packet Cell Change Continue message. Once the message above has been sent, the FSM autodestroys itself. Caches are also introduced in this patch which allows for re-using recently known translations ARFCN+BSIC -> CGI-PS and CGI-PS -> SI_INFO respectively. Change-Id: Id35f40d05f3e081f32fddbf1fa34cb338db452ca
2021-01-25Fix Dl EGPRS data blocks being generated occasionally on GPRS TBFsPau Espin Pedrol1-3/+3
Under some circumstances, it could happen that a DL TBF is created as a GPRS TBF due to not yet having enough information of the MS, and only after the TBF is created the PCU gains that information and upgrades the MS mode to "EGPRS". Hence, there's the possibility to run into a situation where a GPRS TBF is attached to a EGPRS MS. It may also happen sometimes that despite the TBF and the MS be EGPRS, there's need to further limit the DL MCS to use, eg. MCS1-4 (GMSK). As a result, when asking for the current DL (M)CS to use, we must tell the MS which kind of limitations we want to apply. The later reasoning was already implemented when GPRS+EGPRS multiplexing was added, but the former was not being checked. Hence, by further spreading through the call stack the "req_kind_mode" we match both cases. Related: OS#4973 Change-Id: Ic0276ce045660713129f0c72f1158a3321c5977f
2021-01-25ms: Properly handle EGPRS_GMSK mode in ms_max_cs_dl/ul()Pau Espin Pedrol1-2/+2
Change-Id: Ied3e02a12145112fafa12282ed7aefa5b0fa6eb6
2021-01-25ms: Set proper initial MCS values setting mode EGPRS_GMSKPau Espin Pedrol1-2/+2
Before this patch, shared logic with EGPRS case would allow keeping MCS>4. Change-Id: I94cbf0c120fd37deb2dfd077d35b3811c7da0675
2021-01-20Allow multiple bts objects in PCUPau Espin Pedrol9-95/+70
This patch doesn't really tests whether osmo-pcu can work on a multi-bts environment, but it prepares the data structures to be able to do so at any later point in time. Change-Id: I6b10913f46c19d438c4e250a436a7446694b725a
2021-01-19Convert osmo_bts_sock.cpp to CPau Espin Pedrol1-1/+1
There's no real point in using C++ there, and using C++ makes the compiler fail to use llist_head in multi-bts patches added later due to: """ 'offsetof' within non-standard-layout type is conditionally-supported """ Change-Id: I8965b5cc5a713e64788b5b6aa183d3035341ddbb
2021-01-19Convert gprs_bssgp_pcu.cpp to CPau Espin Pedrol2-10/+10
There's no real use of C++ in that file, and it causes problems when using llist_head entry macros in future patches adding initial support for multiple BTS in PCU object, so let's move it to plain C. Change-Id: Ic771a89fd78b5e66151a5384f0ff6a8895589466
2021-01-19Get rid of bts singletonsPau Espin Pedrol1-1/+1
There's no BTS single global object anymore, get rid of those APIs. Move users to use "pcu->bts", which will evolve to a linked list in the future. Change-Id: I9cf762b0d3cb9e2cc3582727e07fa82c8e183ec5
2021-01-19Unify BTS into a C usable structurePau Espin Pedrol9-488/+449
Previous work on BTS class started to get stuff out of the C++ struct into a C struct (BTS -> struct gprs_glcmac_bts) so that some parts of it were accessible from C code. Doing so, however, ended up being messy too, since all code needs to be switching from one object to another, which actually refer to the same logical component. Let's instead rejoin the structures and make sure the struct is accessible and usable from both C and C++ code by rewriting all methods to be C compatible and converting 3 allocated suboject as pointers. This way BTS can internally still use those C++ objects while providing a clean APi to both C and C++ code. Change-Id: I7d12c896c5ded659ca9d3bff4cf3a3fc857db9dd
2021-01-18Move ws_* fields from BTS to PCUPau Espin Pedrol1-10/+8
Change-Id: I997bc52f0d924c8f2a0b1d6cf23af98828ad4258