Commit Graph

6 Commits

Author SHA1 Message Date
Pau Espin 76ef66698c Mark several fsm related internal symbols as static
After some earlier refactoring, those fields are only used internally in
the module, and hence can be marked as static.

Change-Id: Ibf2a6ee5636ae7102ffd13b7497769652bcc3202
2023-01-30 10:42:44 +01:00
Pau Espin d1058b9445 Avoid moving DL-TBF from old_msg to new_ms during ms_merge
The DL-TBF assigned to another MS object may have a totally different
set of reserved resources (TS set, TRX, etc.), so one cannot simply move
those to the new MS. To start with, if the 2 MS are on different TRX it
is clear that one of them will not be really in operation. That's most
probably the DL-TBF being in ASSIGN state on CCCH waiting for PCUIF_CNF
and later X2002 to trigger to start sending DL blocks, but without
confirmation whether the MS is really there. Since the other new MS
object probably has a UL-TBF, that's the one probably operative, and
hence a new DL-TBF can be created at that same time and assigned through
UL-TBF's PACCH.

Unit test test_ms_merge_dl_tbf_different_trx showcases the above
scenario.

Related: SYS#6231
Related: OS#5700
Related: 677bebbe5c
Change-Id: Ie8cb49d5492cfc4cbf8340f3f376b0e6105e8c82
2022-12-19 12:32:44 +01:00
Pau Espin 4a09054dc0 Trigger PACCH assignment inside dl_tbf_upgrade_to_multislot()
The triggering of the assignment for the new TBF allocation is part of
the "upgrade to multislot" process, hence move that inside the function.

Change-Id: Ic2b959f2476b900cb263ccd8f6698ed843bafd29
2022-12-16 11:05:46 +00:00
Pau Espin b7a2b59c68 Refactor code related to DL-TBF upgrade to multislot
* Make clear the code relates to DL-TBF and not UL-TBF.
* Change wording to "upgrade" to match the existing field and API
  "tbf_can_upgrade_to_multislot()".
* Free the TBF if we cannot allocate new resources.

Change-Id: I0e4f8d7e46235a471b2124b280c81ff07b6967a4
2022-12-16 11:05:46 +00:00
Pau Espin 83a0892e61 tbf_dl_fsm_ctx: Properly define tbf backptr as dl_tbf
Since the tbf_fsm was split recently into tbf_dl_fsm and tbf_ul_fsm,
each has now its own ctx strucvture, which can hold the proper tbf
subclass.

Change-Id: Id2571e55e1fea2918207175f2030ec026e880bc1
2022-12-12 20:09:49 +01:00
Pau Espin 343c0ee8d9 Split tbf_fsm as tbf_{ul,dl}_fsm
The 2 types of TBF share some parts of the implementation, but actually
half of the code is specific to one direction or another.
Since FSM are becoming (and will become even) more complex, split the
FSM implementation into 2 separate FSMs, one for each direction.
The FSM interface is kept compatible (events and states), hence code can
still operate on the tbfs on events and states which are shared.

Test output changes are mainly due to:
* FSM instance now created in subclass constructor, so order of log
  lines during constructor of parent class and subclass slightly
  changes.
* osmo_fsm doesn't allow having 2 FSM types with same name registered,
  hence the "TBF" name has to be changed to "DL_TBF" and "UL_TBF" for
  each FSM class.
* FSM classes now use DTBFUL and DTBFDL instead of DTBF for logging. Some
  tests don't have those categories enabled, hence some log lines
  dissappear (it's actually fine we don't care about those in the test
  cases).

Change-Id: I879af3f4b3e330687d498cd59f5f4933d6ca56f0
2022-11-18 16:54:20 +01:00