Commit Graph

2157 Commits

Author SHA1 Message Date
Vadim Yanitskiy e33c236db0 {ms,gprs_pcu}_talloc_destructor(): call osmo_timer_del() unconditionally
osmo_timer_del() does check if a timer is active internally.

Change-Id: I062c7636b59714860fa6b49a2d59c6528ebd57e3
2022-08-08 20:22:41 +00:00
Vadim Yanitskiy 8942a2c72f Makefile.am: add 'git-version-gen' to EXTRA_DIST
Change-Id: Idbf4bf70d83fbf697d4a094dbb47592deaea6114
2022-08-07 19:39:03 +07:00
Vadim Yanitskiy 559c9c219c Makefile.am: generate missing .version file
Change-Id: Id0cd2debf9b2d120c6dec1e534eefc4fe0a4210f
2022-08-07 19:31:47 +07:00
Vadim Yanitskiy a1f1128be5 tests: target 'check-local' does not depend on BUILT_SOURCES
Change-Id: I6cef8024cc10998b29e2bf7fc64c4c98fed7d8dd
2022-08-06 18:36:12 +00:00
Vadim Yanitskiy 19319ce487 tests: make target 'check-local' depend on 'atconfig'
I believe this may be related to sporadic failures we hit on Jenkins:

  test -z "atconfig" || rm -f atconfig
  ../../../tests/testsuite: line 987: ./atconfig: No such file or directory
  make[2]: *** [Makefile:1464: clean-local] Error 1

This dependency is present in all other Osmocom projects.

Change-Id: Id9bf06392ad31e1ecc66a5bd13069a915183a76b
2022-08-06 18:36:12 +00:00
Vadim Yanitskiy 5e0fbdcb9e tests/rlcmac: use ARRAY_SIZE macro
Change-Id: I6e9d95ef007e984d25403eb64f8aeab02e3fa8e7
2022-08-06 02:51:46 +07:00
Vadim Yanitskiy cc2da7ba2c tests/rlcmac: cosmetic: fix coding style in arrays
Change-Id: I65a5313704f692c411714006def143cfdb7cc04a
2022-08-06 02:51:46 +07:00
Vadim Yanitskiy 3094bb218a tests/rlcmac: make all test functions static
Change-Id: Ia7f1615edf1cac630631c14ccaeebab758aa4f72
2022-08-06 02:51:39 +07:00
Vadim Yanitskiy 97eb2f9446 tests/rlcmac: remove unused printSizeofRLCMAC()
Change-Id: I4858d1cb0c4ffb0a152b1d975e30d50efa6296a7
2022-08-06 02:18:58 +07:00
Vadim Yanitskiy 2f2935eadd tests/rlcmac: remove unused #includes
Change-Id: Ib3315f61eb90704b1216094a80e9f379f4150d33
2022-08-06 02:17:37 +07:00
Vadim Yanitskiy 0eaa3d3798 neigh_cache: fix: properly convert from nanoseconds to microseconds
Change-Id: I38dc7c04b1fd0e3a17af4c8caef991916f25f2b9
2022-07-20 00:12:46 +07:00
Pau Espin 263c75c912 nacc_fsm: Fix uninitialized plmn.mnc_3_digits parsing CTRL neigh resolution cmd
Fixes: Coverity CID#272987
Change-Id: I819bdb0cc126113542547e9c397673a2dee0f168
2022-06-30 08:58:29 +02:00
Vadim Yanitskiy 1a1e8307db encoding: fix an uninitialized field in gen_freq_params()
This is not critical, given that we set 'ElementsOf_RFL_NUMBER' to 0.
But still, let's ensure that all fields are initialized.

Change-Id: I4dd5202d1c4bd75baf0ab4f88ffefcc47272bd9c
Fixes: CID#272999
2022-06-29 11:55:28 +00:00
Pau Espin 7ebdfc29da Bump version: 1.0.0.21-b896-dirty → 1.1.0
Change-Id: Ie4c2e2c9462746a7a5577a3cc2601ab7dd74bc4a
2022-06-29 09:48:53 +02:00
Harald Welte b896b8e258 update git URLs (git -> https; gitea)
Change-Id: I52c1a8c3b1233433b786d0e4680d3016b181b242
2022-06-18 12:31:20 +02:00
Pau Espin cd18a5003d gprs_ms_stoage: Release all MS in ms_storage cleanup()
This makes sure all MS and TBF objects under a bts are freed when its
underlaying storage is freed (cleanup() is called).

Related: OS#5555
Change-Id: Idf3ad8b70c97313dec38a49d48cf36d6c9b404c7
2022-05-09 17:47:34 +02:00
Pau Espin 52e2c08f66 TbfTest: Reset MS timeout to 0 in test_tbf_dl_llc_loss()
The timeout is set to a high value to avoid freeing the MS during main
loop iteration. Let's set it back to 0 to have a common free path in
test infrastructure.

Change-Id: I6dc4765163fde1a46574b49f3185aea65391e0d0
2022-05-09 17:47:28 +02:00
Pau Espin bf5e3cb3a4 bts: Call gprs_bssgp_destroy() in destructor
Change-Id: I7ed7f489f36f88277e2d5e393edcb339bf0cbba0
2022-05-09 16:40:43 +02:00
Pau Espin adcf27955d gprs_pcu: Explicitly free all bts objects in list before freeing pcu
This is mostly important to unit tests, where the gprs_pcu object is
recreated several times (it is not recreated in normal operation).

The BTS objects are already being freed through talloc dependency tree.
However, since they may trigger counter updates, access to the pcu list,
etc, let's better do it explicitly before erasing gprs_pcu object
fields.

Related: OS#5555
Change-Id: If2a8360e214d993a8a89993532ff1099b30bdbb1
2022-05-09 16:32:03 +02:00
Pau Espin 9184e855a1 tests/tbf: Set up pcu timers in prepare_pcu()
Change-Id: I30a491f82cced558ad72108c3c5ed7015d1d4d3b
2022-05-09 16:32:03 +02:00
Pau Espin f3561b59e4 gprs_ms_storage: Use bts_stat_item_inc/dec APIs
Change-Id: I2957513c35a1a075440d82b0f7f2c767c69ea9cc
2022-05-09 16:32:03 +02:00
Pau Espin c7802d9fc1 gprs_ms: Use osmo_timer_setup() API
Change-Id: I261f4dcee15942bdce82c6b8a8a558a38bedd6fe
2022-05-09 16:08:42 +02:00
Pau Espin 0bdad9f388 tests/llc: Add test_llc_codel
Related: OS#5508
Change-Id: I9c87b65496a6fe0187a1bc9f3419e2d7269e66f0
2022-04-05 11:16:17 +00:00
Pau Espin 2f94b77d8e tests/llc: Add test_llc_meta_pdu_life_expire
Related: OS#5508
Change-Id: I7ba6be32778e2c2b22723db10fa66655812c8452
2022-04-05 11:16:17 +00:00
Pau Espin 6b1e9515c9 llc_queue: Refactor to handle codel_state per prio queue internally
A CoDel state per prio queue is needed, otherwise the sojourn time state
is not properly reset when a high prio packet is dequeued.

If we have a global codel state shared for all prio queues of an MS, then
basically high prio (GMM) packets will "never" be dropped because they are
handled/dequeued way quicker, so it's sojourn time will be below the
threshold most probably, stopping the "dropping" state for the rest of
lower prio packets.

The handling of different codel states is moved from MS object to the
llc_queue, also offloading already loaded dl_tbf.cpp in the process.
This will also allow in the future setting different CoDel parameters
for different priority queues if needed.

Tests need to be adapted since now the CoDel and PDU lifetime are
incorporated into the llc_queue_dequeue(). Also because dequeue now also
accesses related MS fields.

Related: OS#5508
Change-Id: I2bce2e82ab6389d8a70130a5c26a966a316b0fa4
2022-04-05 11:16:17 +00:00
Pau Espin 9c2512a638 pdch is_enabled: Use API getter instead of accessing field directly
Change-Id: I389f42ef2e95d28643ec51771e46d083d4e20057
2022-04-05 10:43:39 +00:00
Pau Espin 5c598c76cd llc: schedule frames to MS based on SAPI priority
The CoDel state is still applied globally, which could cause higher prio
messages (GMM) to clear dropping state (since those are left for a
smaller period of time inside the queue).

CoDel state will be moved per prio-queue in a follow-up patch.

Related: OS#5508
Related: SYS#5908
Change-Id: Ie8bd91eeac4fa7487d4f11b808dea95737041c7e
2022-04-04 17:26:14 +02:00
Pau Espin 1cf38fcbe8 gprs_ms_storage: MS always has non NULL ms->bts
An MS object is always attached to a BTS through its lifespan.

Change-Id: Ie9ed9341a82b5edaee09da9156e95a616088f950
2022-04-01 17:24:47 +02:00
Pau Espin b498746a49 ms: Remove unneeded bts!=NULL check
The ms_alloc function is expected to always have a proper bts object
passed, since an ms is always attached at a BTS.

Change-Id: I10b3c94dcb2fed4bff40b1ab7ea455175cf77ce4
2022-04-01 17:24:47 +02:00
Pau Espin de4dc29c12 ms: validate codel enabled against proper define
This is a cosmetic change, since LLC_CODEL_DISABLE is defined as 0.
It clarifies though the meaning of the if condition.

Change-Id: I7c4bda5977a94c2aaf01ca368570f80fd6ebae00
2022-04-01 17:24:47 +02:00
Pau Espin ee1cb75127 llc: Move static functions below related object
Move all static functions related to gprs_llc object below it, so that
it's easy finding all related APIs being together.

Change-Id: If781e66c6e8a119cc22948c82167ceb90270ea6d
2022-03-31 19:47:39 +02:00
Pau Espin 4f8384bfbb llc: Convert to C
There's no real reason (other than historical) why code in llc should be
kept as c++ code. Let's rewrite it as C so that it can be included by
existing C code without having to add C->C++ shim, ifdefs all around,
etc.
This simplifies code and easies modification/improvement of the related
objects.

Change-Id: I250680ba581167d7398b2f734769c756cbb61c48
2022-03-31 19:42:15 +02:00
Pau Espin 1463383505 llc: Convert to C: s/m_//g
Change-Id: Ia5272841392110b87725e87a7e6824c17a70d6d1
2022-03-31 19:09:08 +02:00
Pau Espin 2d92e3937f Fix assert hit if connecting to SGSN fails
"""
DLBSSGP ERROR gprs_bssgp_pcu.c:1278 Failed to connect!
DL1IF ERROR pcu_l1_if.cpp:827 No NSVC available to connect to the SGSN!
DRLCMAC INFO pdch.cpp:185 PDCH(bts=0,trx=0,ts=0) PDCH state: disabled => disabled
Assert failed m_is_enabled == 1 pdch.cpp:186
"""

Change-Id: I36dc64fa807091bf2b565417c1185c4cb399932b
2022-03-30 22:09:12 +02:00
Oliver Smith 8d03c50024 treewide: remove FSF address
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.

Change-Id: I4a49dbeeec89b22624c968152118aecf8886dac6
2021-12-14 12:19:13 +01:00
Pau Espin 11f72dfbcb Bump version: 0.9.0.280-56b7c-dirty → 1.0.0
Change-Id: I38b083755e71eac5158e68ef958e210eeced9038
2021-11-16 16:47:29 +01:00
Pau Espin 56b7c64298 Move T3172 T_defs_bts->T_defs_pcu to have it configurable in VTY
The timers in T_defs_bts are actually set by BTS over PCUIF. That's not
the case for T3172, hence let's move it to T_defs_pcu so it can be
configured over VTY.

Change-Id: If24191b2305007aa5be5b551c913738a97597c77
2021-11-16 11:35:23 +01:00
Pau Espin 683ce64039 T_defs_pcu: Set default val for X2000 to 0 ms
That timer is really only useful to free the tbf asynchronously after
generating the Pkt Access Reject message, since we have nothing to do
with it after the message is sent, and the dummt TBF doesn't really hold
any reserved resource such as USF or TFI.
The timer is useful to still do the freeing asyncrhonously, since the
scheduler is interacting with the TBF during the code path, but there's
no real need to keep the object alive for 2 ms afterwards. Having a
default value of 0 ms is enough, since it fullfills the requirement
of freeing asnchronously.

The value of 2 ms was set initially when the reject support was added
here (e9a138e111), with no specific
explanation on the 2 ms value. It was just probably picked as a
convinience one, but 0 is actually more convinient.

Change-Id: I60e34e643f5c9d9afaf85530c54ab3232dc8f0be
2021-11-15 17:10:55 +00:00
Pau Espin e30153ea10 tbf_dl_ass_fsm: Drop unsued X2000 timer callback
That timer is only relevant for transmission of Packet Access Reject,
which happens only for Uplink assignment, and hence is only set in the
timer of tbf_ul_ass_fsm, never in tbf_dl_ass_fsm. This is probably a
copy-paste artifact when implementing both FSMs.

Change-Id: I95900e211eddb280c72fb712ba1da4d2230cb77b
2021-11-15 17:10:55 +00:00
Pau Espin 0dcbc07682 bts: Add counter availablePDCHAllocatedTime
We basically want to probe whether it's possible to allocate TBFs, or
whether we know it will fail due to all main resources being already in
use (TFI, USF).

Having bts_all_pdch_allocated() return false doesn't mean though that an
MS will be able to allocate a TBF for sure. That's because further
restrictions are applied based on MS: whether it was already attached to
a specific TRX, whether the ms_class allows for a certain multislot
combination, etc. However, it should provide a general idea on whether
for sure the PCU is unable to provide more allocations. More fine
grained state about failures can still be followed by looking at
tbf:alloc:failed:* rate counters.

Related: SYS#4878
Depends: Iabb17a08e6e1a86f168cdb008fba05ecd4776bdd (libosmocore)
Change-Id: Ie0f0c451558817bddc3fe1a0f0df531f14c9f1d3
2021-11-15 11:40:07 +01:00
Pau Espin 5deac1404d Fix MS ending up with assigned imsi 000
The whole paging path and data structre is cleaned up.
New MS helpers ms_imsi_is_valid() and ms_paging_group() are introduced
to help in the process and keep implementation details inside GprsMs
class.

Related: OS#5303
Change-Id: I4c0838b26ede58e4b711410eee2a8e4f71e9414b
2021-11-12 18:38:43 +01:00
Pau Espin 13866f02a2 vty: Introduce command 'gsmtap-remote-host' and 'gsmtap-category enable-all'
Related: OS#5306
Change-Id: Ibc6f78c46831b3c90ee3e97300fc13dc441df4c8
2021-11-12 17:01:28 +01:00
Pau Espin afd9393a2d pcu_main: Mark -r cmdline param as deprecated
We have VTY support for it enabled in osmo-pcu since a while ago. Let's
mark it as depcreated now so that we can drop this cmdline arg in the
future.

Change-Id: Ic39c94984cb311aac0464d69f564af6d5447bd0f
2021-11-12 17:00:34 +01:00
Pau Espin 17bfbedbc7 tbf_{dl,ul}_ass_fsm.c: use proper macro to log tbf
TBF can be either UL or DL in that FSM.

Change-Id: Ief0cd5298e062f11b0f39716162a67b87c9ff35f
2021-11-12 13:14:19 +01:00
Pau Espin bd1b90f141 tbf_dl_ass_fsm: Fix missing transition to NONE if DL TBF is nonexistent
If by the time the PktDlAss is to be scheduled by the scheduler the DL
TBF is gone, the FSM will abort the assignment and go back to state
NONE.
However, the transition was missing, ending up in the scheduler trying
to schedule the message unsuccessfuly lots of times per second, clogging
the logs and disrupting normal operation.

Related: OS#5293
Change-Id: I6f421e5ddc9894fee72de1102df35a76cf2f2647
2021-11-12 12:03:00 +00:00
Pau Espin 84f2b51a37 tbf_dl_ass_fsm: Log both TBFs if old TBF is handling assignment for new one
Change-Id: I4ec4eb2ca3f4fa576a4f9ada8c2462f59ca078b9
2021-11-12 12:03:00 +00:00
Pau Espin dbdf84eaff cosmetic: gprs_pcu.h: Fix typo in comment
Change-Id: I7140decb50e822bf412fa380dc8b6ef6486a5681
2021-11-11 14:11:40 +01:00
Pau Espin 7eb9e69506 tbf_ul_ass_fsm: Log both TBFs if old TBF is handling assignment for new one
Change-Id: If475560aab16b0a89743139189ff7720389132a5
2021-11-10 17:54:38 +01:00
Pau Espin 715aeb4ebc pdch: Increase log level of line informing about TS control change
This way it's the same log level as the one used in all other paths
using tbf_assign_control_ts() to assign tbf->control_ts =
tbf->first_common_ts, and this specific event is not lost from logs.

Change-Id: Ia32d835ee4c14d7d48391452b5e3d05ed88e0483
2021-11-10 17:21:43 +01:00
Pau Espin ace3b1bdc1 pdch: Drop previous UL TBF from MS who sent PktResReq through SBA
If the MS has a pending UL TBF but we just received a PktResReq on an
allocated SBA from it (same TLLI, hence same MS), then it means it
allocated the SBA through RACH req and hence it was on CCCH. That means
it was not active on any PDCH, hence for sure the previous UL TBF can be
dropped.

Related: OS#5293

Change-Id: I1f20dba56f46ea15cbb9b03bdc5b79d923491a3c
2021-11-10 16:11:19 +01:00