Age | Commit message (Collapse) | Author | Files | Lines |
|
Rename it so that it becomes clear what the timer is used for.
Change-Id: Id4738ea196b232858e1ec9cdc439f9b81839058f
|
|
Simply apply the content of the configured timer when the MS goes idle.
Having that field is convenient to do tricky stuff in unit tests, but
makes the main osmo-pcu app more complex for no good enough reason.
Change-Id: I8d44318b37b6605afd84db8ccec0d75e6db293b9
|
|
Change-Id: Ie470b5b0c7b01d91f4ad693e52afd51860d6da2d
|
|
This is useful to track the lifecycle of MS objects. The RLCMAC cateogry
used so far in those log messages is too broad.
Change-Id: Ib4ce88d0f7309ac77c064a94bb0d667e8dbc33dd
|
|
Make the caller hold a reference to the MS object just allocated, so
that it hs to explicitly unref it and, in turn, if no new references
were added during its use, trigger release of the MS object.
This is useful to avoid leaking MS object if it was allocated and then
no TBF is attached to it because allocation of TBF failed.
Related: OS#6002
Change-Id: I2088a7ddd76fe9157b6626ef96ae4315e88779ea
|
|
Whether the TBF is GPRS or EGPRS is known at allocation time since it
comes from the information known in the MS object used to create it.
Hence, no need to delay calling it to later steps such as setup().
So far it was probably left in setup() due to the constrains about
requiring the subclass to be constructed (use of window() virtual API).
Change-Id: I2e9d2a98c666a930333d52fb6c0463d7593c2615
|
|
This commit changes lots of stuff in the MS release lifecycle, but
there's no really good way to split this into patches which make sense,
since all the chaos is intensively entangled.
Get rid of the ms_callback complex mess, it is not needed at all.
Previous MS release was strange due to the existance of previous
ms_callback.idle concept and MS storage: the MS signalled when it went
idle (no TBFs attached) and waited for somebody outside to free it,
while then arming itself the release timer to release itself if it was
not released by whoever.
The new lifecycle follows an easier (expected) approach: Whenever all
TBFs become detached from the MS and it becomes idle (use_count becomes
0), then it frees its reserved resources (TFI, etc.) and either:
* frees itself immediatelly under certain conditions (release timeout
configured = 0 or MS garbage with TLLI=GSM_RESERVED_TMSI)
* Arms release_timer and frees itself when it triggers.
If during release_timer the MS is required again (for instance because a
new TBF with TLLI/IMSI of the MS is observed), then a TBF is attached to
the MS and it is considered to become active again, hence the release_timer
is stopped.
OS#6002
Change-Id: Ibe5115bc15bb4d76026918adc1be79469c2f4839
|
|
It is interesting to log that a tbf is being detached *before* it
actually happens, so that the reader can see which TBF is being
detached.
Change-Id: I2008beb9ab8f97f7ea5ed7b45cfb3f23dfe7b27f
|
|
* Make sure that the tbf being attached has already the MS assigned.
* Check no re-attaching of alredy attached TBF ever happens.
* Document and early skip case where a non-attached TBF detach is
attempted.
* Avoid recursive call mess to tbf_set_ms(tbf, NULL); during detach.
* MsTest needs to be modified since it uses fake TBF objects which use
different set of calls than the regular TBFs in osmo-pcu. Since the
ul_tbf object is reused, it needs to be assigned ul_tbf->ms again before
re-assigning it, as per what happens usually in tbf_set_ms() in
osmo-pcu.
Change-Id: Ia18fe2de1fb3bf72f530157e5f30de64f2b11e12
|
|
Change-Id: Ib65629224e6bd5683bb9192ba4354e965e8d39ec
|
|
gprs_default_cb_ms_idle() is changed to have the same implementation as
previous bts_ms_idle_cb(), since that's the only one being used in
osmo-pcu code. It makes no sense to use different callback logic in unit
tests.
This is another step towards simplifying the code and getting rid of the
idle/active_cb().
Change-Id: I2a06d17588572a21dc5a14ddbde83766076b446d
|
|
With this change the MS no longer is removed from the llist without
potentially skipping free() if not idle in bts_ms_idle_cb().
As a result, some unit tests now can free it during bts tear down
instead of having them leaked.
The tests int MsTest need changes because the tbfs created are fake and
cannot be freed using tbf_free(), and hence cannot be detached from MS
using regular code paths. Instead first call explicit talloc_free(ms)
like other unit tests in the file already do.
Change-Id: Id53f8dfb9963366dd4b19a324615bbc83c4f23e7
|
|
That class is mostly a C++ class holding a llist plus some callbacks.
Having that in a separate class makes code more complex for no good
reason. This patch moves the llist into bts and allocates stuff directly
from within bts.
This will allow further cleanup of MS lieficyle in future patches.
Change-Id: I627f5db5073189c23ddf2b7f09c90abb24846f62
|
|
While at it, put them together and mark bts param as const.
This is a preparation for next patch.
Change-Id: Iad8aec4424f1f23cd4d02a14c4f9ec1b9fdb1f75
|
|
That information is not required during allocation of the object, and
most times it is not known.
Defer setting it only to meaningul values in paths obtaining the
information from peers.
Change-Id: I36f07dc389f7abe205fc4bcddbde93735f5d5cfc
|
|
Inside osmo-pcu code, the code path is to always call ms_alloc with
tlli=GSM_RESERVED_TMSI; a different value is only passed during unit
tests.
It makes no sense to have unit tests using differnet code paths than
ther app itself, since in the app it always desired to go through the
ms_set_tlli() and ms_confirm_tlli() which does more stuff.
Hence, drop the tlli param in ms_alloc and change the unit tests to use
the available APIs used by the application.
Change-Id: I730ec911a43b0f4e78faee4eeffb3ca8601564f8
|
|
This check (tlli != 0) was added in 2015 in
6d86628e5b6d81afae4ca1f24201ee90bfab1c2a, with the rationale below:
"""
To avoid dangling entries without a TLLI there (which cannnot be
retrieved anyway), the timer in the MS objects is not started after
all TBF have been detached, so that they get deleted immediately in
that case.
"""
The rationale makes sense, but through time the MS class was fixed to
return GSM_RESERVED_TMSI (0xFFFFFFFF) when no TMSI was available.
Hence, the check was wrong, and as a result, free() of MS containing
GSM_RESERVED_TMSI would be delayed over time by release timer.
Related: OS#6002
Change-Id: I7a694a30f8709c00af774846d7c4925cef253a71
|
|
Change-Id: I6620a524b393a0db6201930a1e2795a439785824
|
|
When debugging frame number offset problems betwen l1 and below and the
upper layers of the PCU, it may be helpful do know which blocks/frame
numbers got reserverd for uplink transmissions.
Change-Id: I4277c572a4cc6cbbf3ac4e67442c9036be687627
Related: OS#5198
|
|
The previous gprs/protocol/gsm_04_60.h header from libosmogsm was
misleading because it was placed in the subdirectory used by libosmogb,
and hence was recently deprecated in favour of gsm/protocol/gsm_04_60.h.
Let's follow the pragma message advising to move to the new header file.
Depends: libosmocore 0158b05337a825352d9fd7f074170b686e9fd1e5
Change-Id: I027abbf3ed4c71331000565af1ef4f08f10cfafc
|
|
We still want -no-install to be used for these tests.
Change-Id: I926df1918fd24ea7be4b390d168a8c76ef9931c0
|
|
Change-Id: Ibd7eb55e2cfe7daed2f8a8d74c6a3ede6f29308f
|
|
There is a function l1if_connect_pdch, but no complementary function
like we have it with l1if_open_pdch and l1if_close_pdch. The reason for
this is that the PHY implementations that rely on a femtocell DSP do not
need to disconnect the pdch explcitly. However, the planned support for
the E1 based Ercisson RBS CCU will require an explicit disconnect. So
lets add a function call for this.
Change-Id: Ied88f3289bda87c48f5f9255c4591470633cc805
Related: OS#5198
|
|
In case of an FN jump the expected value is logged. Lets also log the
delta between the expected and the current FN as it may give a better
clue what goes wrong
Change-Id: Ie361df30852570fe8a47347a42e962db869ccf82
|
|
A valid GSM frame ranges from 0 to 2715647. When using
set_current_frame_number() to set the current frame number (source
usually is the layer 1 and below) we should not allow invalid frame
numbers.
Note: this also fixes FnTest which uses invalid frame numbers for
testsing.
Change-Id: Iaae31b370fababba975d419b0d20ac15618c296e
Related: OS#5198
|
|
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: 677bebbe5c49d4607322e96053fe14ddd78d9549
Change-Id: Ie8cb49d5492cfc4cbf8340f3f376b0e6105e8c82
|
|
Add a test which showcases a scenario where the PCU ends up with 1
GprsMs object holding a DL-TBF in a weird condition half in one TRX and
half in other due to ms_merge().
This test (slightly adapted) used to cause a crash in osmo-pcu.git
586ddda9bc09d60f2d491158de843825cb7c876a (a few versions behind current
master).
Related: SYS#6231
Change-Id: Ic16b5e96debf91e72684833cd64253687857f3aa
|
|
This allows having full TS information, not only ts_no, which will be
needed later on followup patches.
Change-Id: I1efccb32c5afa4fe62233bf114ea95b6fbbe1a06
|
|
The DL-TBF in the test gets its TS allocated on TS4 (only that one is
enabled through setup_bts(bts, ts_no=4)), and hence it makes no sense to
ask it to send data on TS7.
Change-Id: Ibe6fc073b7438b8024c4d3ddb0e60c6112752351
|
|
This allows having full information on the control TS easily reachable
(like TRX ofthe PDCH), and makes it easy to compare TS by simply
matching the pointer address.
Change-Id: I6a97b6528b2f9d78dfbca8fb97ab7c621f777fc7
|
|
First commit towards trying to have alloc algorithm as isolated as
possible from others parts of the code trying to avoid state changes on
data structures.
Change name also because the alloc_algo not only allocated TS, but TFIs
and USFs.
Change-Id: I33a6c178c64a769f05d3880a69c38acb154afa62
|
|
This way it contains full information about the TS, not only the TN.
Change-Id: I19373939ec104d371e3e91422f018a8175cb0f89
|
|
* Make it similar to the already existing TBF allocation procedures
* Pass pdch pointer instead of trx and ts numbers
Change-Id: I04b3b65942732cc652adeaa507529b849292ff61
|
|
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
|
|
* 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
|
|
The field contains a common value between the 2 active TBFs of the MS,
so it makes no sense to have them duplicated on each TBF. It can be
sanely stored in the MS object.
Change-Id: I8df01a99ccbfaf7a442ade5000ee282bd638fbba
|
|
The pdch pointer contains more info than just timeslot number. For
instance, it contains information about the TRX owning the TS.
Change-Id: Ic31a7360a29e61f70bb1338ddab6f5f31aa8b26e
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|