Age | Commit message (Collapse) | Author | Files | Lines |
|
Change-Id: I142b870abda36950db5ff296c7c22228b0b11f55
|
|
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
|
|
The state_fsm field will be moved to subclass (DL_TBF/UL_TBF) in a
follow up commit when splitting the tbf_fsm.c implementation per
subclass.
Rearrange a bit the code to access the using the subclass pointer in the
only sublcass where it needs to be used (DL_TBF).
Change-Id: I360485c73be8636565f89ba29796d84ac94fd94e
|
|
This way we can easily get the subclass from the parent if the pointer
is const. Similar to what we already have for the opposite direction
{ul,dl}_tbf_as_tbf_const().
Change-Id: I35e650d13ecf3a5020d136e7d8d99837786503e2
|
|
Change-Id: I5d4b411585321d94fefdd01f22c62932d4a8f83a
|
|
This is a preparatory step towards splitting tbf_fsm.c into tbf_ul_fsm.c
and tbf_dl_fsm.c.
In order to accomplish it, the struct tbf_fsm_ctx will also be
duplicated (and each one will contain a explicit ul_tbf/dl_tbf pointer).
Hence, a DL_TBF will have a struct tbf_dl_fsm_ctx and a UL_TBF will have
a struct tbf_ul_fsm_ctx, since those hold implementation specific
state. However, the FSM interface will be partly shared (events,
states), and hence we want to keep the "fi" pointer into the "tbf"
parent class so that it can be used regardless of the tbf direction
type.
Change-Id: I03e691ccf6a94431caa55653349158f5b85db017
|
|
It is nowadays only used internally, hence it can be moved to the .c file
to better describe its scope.
Change-Id: I23cfa5b7efbeb6a58855099780749741c9c947e9
|
|
Change-Id: I91738f951f57bd171d8cbd66fe5e5c46e6fa953b
|
|
Change-Id: Id349fbfe683b7b63ac9076d2e9998f7c3ecea112
|
|
Change-Id: Icf6204d99f91531f5ecad05e3f9f89406e5d12b5
|
|
Related: OS#5687
Change-Id: I1694af74eee2624709ad6cebbc4fb37320e2ef9d
|
|
Change-Id: I26cda7826e9d648ea086bb408293e431a9cac206
|
|
Change-Id: I833864aa51059be9c97c16329bc16913c53e171d
|
|
FSM IDs are properly updated now, so there's no need for the pointer
address to properly follow them.
Change-Id: Ia48c6d5afcdd95e32c7c9b327774f78f07342a0f
|
|
Use same formatting similar to what's now used in TBF, which is far more
easy to grep and follow. This way one can easily follow what happens to
a given IMSI, a give TFI, a given TLLI, etc.
Change-Id: If9b325764c8fd540d60b6419f32223fd7f5a5898
|
|
use a format in tbf::name() which is sanitized (osmo_sanitize) and hence
can be used both in regular log as well as for its internal FSM ids.
Until now, the FSMs contained a small amount of information with
different formatting than the regular LOGPTFB(), which made it difficult
to grep or follow a TBF through its lifetime looking at logs. The new
unified format makes that a lot easier.
Extra information is now printed if available, such as IMSI.
Furthermore, the TFI is updated to include BTS and TRX, since the TFI is
unique within the scope of a TRX.
Change-Id: I3ce1f53942a2f881d0adadd6e5643f5cdf6e31da
|
|
If data received from SGSN is waiting to be sent to the MS, we may have
created a DL-TBF assignment over PCH if the MS was not in packet-active
mode. If the MS instead reaches back to the PCU asking for an UL-TBF, the
PCU has to wait until Content Resolution of the UL-TBF has succeeded in order
to attempt now to assign the DL-TBF over PACCH.
The delay was already there, but the trigger to attempt the DL-TBF
assignment upon UL-TBF contention reslution success was missing.
Related: OS#5700
Change-Id: Ib8f7ad2390485ce9fd76a9de6cd349a5f4037568
|
|
This is a preparation towards fixing MS not recreating a DL-TBF (being
assigned on CCCH) when MS starts an UL-TBF and finishes contention
resolution.
A counter is removed which was counting contention resolution (MS) on
the wrong place.
Change-Id: I8b9555864d3615ce0a024b641c67921f82273a8d
|
|
It is desired to free pending DL-TBF under some scenarios, which somehow
are related to those where we call the ms_merge() procedure since it's at
time an MS can be identified when coming from packet-idle state.
Until now, the freeing of those DL-TBFs happen because the ms_merge()
procedure doesn't migrate DL-TBF from "old_ms" to "ms". This was done
manually under the cases where it was deemed necessary before calling
the ms_merge() procedure 8because old_ms and its tbfs are gone after
returning from it).
This logic, though convinient for the specific cases at hand, is quite
confusing for readers and program execution since one would expect the
ms merge to, well, merge everything.
Therefore, this patch changes the ms_merge() logic to always merge the
DL-TBF, and only under the specific cases where it makes sense to free
it, do so explicitly after MS merge, where all the info has been updated
and united.
2 code paths are now explicitly freeing the existing DL-TBF when needed:
- TBF_EV_FIRST_UL_DATA_RECVD: 1st data (containing TLLI) is
received from MS, hence identifyng the MS and potentially having been
merged with some old MS which used to have a DL-TBF, most probably in
process of being assigned through CCCH (PCH). This event is triggered
during MS using 1phase-access, and we should drop the exsitng DL-TBF
because MS just came from packet-idle mode (CCCH).
- rcv_resource_request(): PktResourceRequest is received at an scheduled
SBA, meaning the MS is doing 2phase-access, meaning MS also came from
packet-idle mode (CCCH), so previous DL-TBF can be dropped.
Related: OS#5700
Change-Id: I29f4ffa904d79d58275c6596cc5ef6790b6e68c6
|
|
This allows easier tracking of this event. It will also extended later
on with more logic which is better placed in tbf_fsm.
Change-Id: I5c935914e13db3928c32621ec04eb2760367615d
|
|
That function was pretty confusing since it used a "enum
gprs_rlcmac_tbf_direction dir" param (whose type is expected to describe
the data direction of a TBF) to describe the direction of the the packet
which triggered its call.
The parameter was actually always called with "GPRS_RLCMAC_UL_TBF" which
in this case meant "uplink direction" which meant "TLLI was updated from
the MS, not the SGSN".
The DL direction was only used in unit tests, which can hence be simply
replaced by ms_confirm_tlli(), which this commit does.
So this update_ms() function was actually used in practice in osmo-pcu
to trigger update of TLLI and find duplicates only when an RLCMAC block
(control or data) was received from the MS. Therefore, this function is
renamed in this patch and moved to the gprs_ms class, since it really
does nothing with the TBF.
Related: OS#5700
Change-Id: I1b7c0fde15b9bb8a973068994dbe972285ad0aff
|
|
Use proper prefix according to the type being allocated.
Change-Id: Ic98c3c852c96c3f52f1c8f531b8d0fd28ce5aef5
|
|
Change-Id: Ifa3d6b38fca89500ef02c9b972f514ceaf8fe83b
|
|
While at it, improve logging of the merge action
Change-Id: I39d9eac159448fc3c3a4db9e1b9c5364e906a78f
|
|
This way it becomes clearer in logs that we are merging MS which
contains the same TLLI.
Change-Id: Ifd232daa4219e1726c30449d647312a3a226a61d
|
|
Similar structure as what we have with DL-TBF.
Change-Id: I256aeede2a2678c9738539fb6ec4db9766fa85e4
|
|
This will help in the future when splitting tbf_fsm into different FSMs
for UL-TBF and DL-TBF, since only some of the events and states are
shared.
That means we can keep a single state and event enum, but the FSMs can
be implemented separately in different files, easing a lot extending and
understanding the logic.
Change-Id: Id97f0d532d2d7ab2791a35c1f836d7c8da050124
|
|
Change-Id: Ief048cc1b5e8a18ceaeb5432415d14f5ef7ee0ea
|
|
ms_new_dl_tbf_assignment() is split into 2 functions, one to
allocate+assign on PACCH and another one for PCH.
This makes a lot clearer the aim of each caller of the function.
Once this is done, it becomes obvious tbf->establish_dl_tbf_on_pacch()
is basically doing the same as ms_new_dl_tbf_assigned_on_pacch() so drop
it.
Change-Id: I610210e3120c962d91ce8ff94c66161e086761ba
|
|
Use the dl_tbf prefix which is usually used to easily distinguish from
"ul_tbf" specific APIs and "tbf" generic (parent class) APIs.
Change-Id: Ibf6ae20da99866af5f2b6e12184f3145d1fc0bbf
|
|
Split the function into 2 functions, one for assignment on PACCH and one
for assignment on PCH. This makes code calling this API far more clearer
on what is the exact aim when assigning the TBF.
Change-Id: Ic92867e55337b0bd6b5bfc97f13b7982eedb1cb7
|
|
UL_ACK_NACK (FinACK=1)
In that state (ul_tbf=TBF_ST_FINISHED), we are unable to reach the MS to
assign a new DL TBF.
* MS Is not available in CCCH because it's attached the PDCH.
* MS won't be able to PKT_CTRL_ACK a PktDlAss on PACCH, because next
thing it will do is to PKT_CTRL_ACK the UL_ACK_NACK(FINACK=1) we
already polled it for, and immediatelly after that it will release the
UL TBF on its side and go back to packet idle mode.
Hence, we must wait for MS to send the PKT_CTRL_ACK to us in order to be
able to assign the DL TBF in PCH (CCCH).
Related: OS#5700
Change-Id: I7a30db9cc7dae70e04054f1a4dba004bd1780d4a
|
|
Those power params are applied in the Pkt Ul Ass sent to the
MS.
In practice it doesn't matter much because the Pkt Ul Ass message is
created later asynchronously by the scheduler (event CREATE_RLCMAC_MSG).
Still it's much cleaner applying the information before allocating the
UL-TBF, since that's an extra independent step.
Change-Id: I63133aa42dcf27a86437b1bc8dc83c30d6718028
|
|
Change-Id: I05b39d3183fdf741d648a15ff803d20e324443af
|
|
There's no sense if doing the lookup and allocation if the message is
not expected, it will be unrefed (freed) afterwards anyway.
Moreover, this way we avoid doing stuff for the WIP code paths which act
on different request ID than TLLI.
Change-Id: I4be8858230a2eebdb33260093d082a005cb9fcd4
|
|
Change-Id: Ie2a0af7928578823e944b85781ce284722547661
|
|
Change-Id: I223d9d5823c90ff31089420d35a7bf0fe1ebf870
|
|
Otherwise it may give the wrong impression that the FSM can be used by
both DL TBFs and UL TBFs, which is not the case (only used by UL TBFs).
Change-Id: I788eae58248fa21732efe802344aa3c0c5031b5a
|
|
Prefix the function accordingly to specify the input object.
Change-Id: I225568fe2cb5236817cdd9609354c24c66723606
|
|
It is quite common in all osmo-pcu code to have to convert between
parent class "tbf" and children "dl_tbf"/"ul_tbf", or other way around.
This commit adds new helper static inline functions to cast between
those while doing type checks.
This is used by new LOGPTBFDL and LOGPTBFUL macros to now expect the
proper subclass and cast securely inside the macro itself, hence sparing
all code calling those macros to have to cast explicitly the pointer to
the parent "tbf" class.
Change-Id: I7e4489ad4b93c9c8442213947e53c10b61fdc5e9
|
|
It will called by GprsMs (C code) in a follow-up patch.
Change-Id: Ib586894bc5834c33d38d23b7194f6dfadf9bc375
|
|
The struct gsm_pcu_if_info_ts is named "gsm_pcu_if_info_trx_ts" in
osmo-bts. Lets rename it since the definition in osmo-bts is newer.
Change-Id: If8b50181d3b609612aa8433b635052aadddd3484
|
|
struct gsm_pcu_if_info_ts has a struct member "h", which controls
frequency hopping. This struct member is named "hopping" in osmo-bts, so
lets rename it here as well to be consistent.
Change-Id: I3156b39cc91da07ee3f97e8c8be60fc989cf112b
|
|
Rename it so that it follows the usual prefix for the type it allocates.
Change-Id: I7d30a85fefaa61d100fbd51af4601a3cf7de2159
|
|
The UL_ACK_NACK FSM is only used in Uplink TBFs.
Change-Id: Ic9893d274f4b6fafc75a615f7d6dcb9433b94ace
|
|
The LLC queue is already in the MS object. The LLC timer and most
of the logic to enqueue its data is independent from the TBF.
Change-Id: I56b89fcac838d8eb732b629734d5e458e9c806d1
|
|
Change-Id: If363e3320372c798b9b16274327fa8041358e350
|
|
Change-Id: I8127e17607426443bb95b42873b580fc9f400af9
|
|
This way it can be used outside of LOGPMS().
Change-Id: I8ab713154c8f308878f3e85b6f7e8afc5c4be249
|
|
That's the special value checked in the implementation of get_ms() to
skip lookups based on TLLI.
This should save some cicles trying to match TLLI 0.
Change-Id: I364d238ff8a82abb14281140fe18b273c0e8f541
|