Commit Graph

2155 Commits

Author SHA1 Message Date
Pau Espin 4fe090146f ms: clarify delayed MS release process related code and logging
Change-Id: Ieaea6ab07b4b2822bcf394f2d0e9298b9f3c5854
2021-03-03 20:28:51 +01:00
Alexander Couzens 423bf8c408 gprs_bssgp_pcu: rework BSSGP Reset messages to support SGSN originated BSSGP-RESET
Use primitives instead of parsing the message a second time.
Set bctx->is_sgsn to false to allow the BSSGP layer to send back a
RESET_ACK with cell information.

Related: OS#3879
Depends: Ibcbaffa94cbdc4296a8a7c372304ac11d50d9559 (libosmocore)
Change-Id: I3afaf826798e362270ffa622c24bfd124ef25cd1
2021-03-03 15:37:19 +00:00
Pau Espin Pedrol cf6c71263f tbf_dl: fix FBI not set upon X2031 = 0
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-02 18:25:33 +01:00
Pau Espin Pedrol 8afc6bad80 tbf_dl: Fix m_last_dl_drained_fn not set under some conditions
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: 7d0f9a0ec3
Change-Id: I7420aeffda3500bcdc990291e4a56511af433ff9
2021-03-02 18:24:46 +01:00
Pau Espin Pedrol 5b9d0bb8e5 tbf: log keep_open condition status
Change-Id: I069e84926aaa8f13b23c3ea4083b4c68dbc6cff2
2021-03-02 13:13:52 +01:00
Pau Espin Pedrol a89008b724 tbd_dl: Don't re-initialize class field twice
Change-Id: Ia92c24032dc1f8965008ff03a3a0a94bbb93893a
2021-03-02 13:09:32 +01:00
Pau Espin Pedrol a70bf72ce5 llc: use memset to fill llc dummy frame padding
Change-Id: Iaa55549f979ca23dad0bddd308c1144aa4b17255
2021-03-02 12:28:32 +01:00
Pau Espin 9688dc9aca bts: Add new stats to detect TBF allocation failure reasons
This is specially useful to detect for instance if a cell is handling
too many users, ending up in TFI or USF exhaustions. This information
can be later in the future used to tune TBF allocation algorithm behavior
(either manually/statially through config file, or
automatically/dynamically in code based on some thresholds).

Related: OS#5042
Change-Id: I5402e937ff8d800684655e500ef8e5c867141dc3
2021-03-01 13:18:36 +01:00
Pau Espin c85e093969 Remove uneeded ms param from alloc_algorithm_func_t func
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-26 11:50:21 +01:00
Pau Espin 36177c6b58 tbf: Improve logging when TBF being allocated or no TBF avail
Change-Id: I68491fe2c643262e35b4d4f1ecac34afcf61848f
2021-02-26 11:50:15 +01:00
Pau Espin 95e2266832 pdch: Standarize and improve logging
Change-Id: I1686a72eb9f9014ed3365376bc43d59d60bee8a5
2021-02-26 11:36:55 +01:00
Pau Espin 4e1c9adb67 bts: Count TBF TS allocation failure
Related: OS#2282
Change-Id: I0696bf77364bd31b96c00614a58ce66809683d1c
2021-02-25 17:49:59 +01:00
Pau Espin 7c9a4a41bc tbf: Log timeslot allocation failure
Change-Id: I48fc1eac37eeb74649bfc0888e06afc0079a58f8
2021-02-25 17:21:10 +01:00
Pau Espin Pedrol ed2afa3bed Support uplink multi-slot allocations
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-24 13:48:01 +00:00
Pau Espin 50aa492b85 Bump version: 0.8.0.396-fe8d-dirty → 0.9.0
Change-Id: I4b9405df5f40e8f2724ba8aa8f88e2602c1e8374
2021-02-23 14:41:01 +01:00
Pau Espin Pedrol fe8de457ac Use ALPHA value received in SI13 from PCUIF
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-22 12:29:12 +00:00
Pau Espin 4df2658884 find_multi_slots: Avoid multiple calls to mslot_class_get_type()
Change-Id: I9cda52befe32a7727ab479bc151d10106fb94688
2021-02-19 17:35:11 +01:00
Pau Espin 10475f5832 find_multi_slots: Mark mslot_class properties const
This way it's clear for reader that those variables are never touched
during the function.

Change-Id: Ief038c75bc02d0e987135f29599014eab88447dd
2021-02-19 17:33:23 +01:00
Pau Espin dfbf3d2c09 find_multi_slots: Avoid multiple calls to mslot_class_get_rx()
Change-Id: I06c97d81636e251f81c26f3aa042c70717be083a
2021-02-19 17:32:14 +01:00
Pau Espin 47a3b780db find_multi_slots: Avoid calling mslot_class_get_tx() on each iteration
Change-Id: I397495c158bce1c2715991371368b0d84cf69261
2021-02-19 16:56:36 +01:00
Pau Espin 1f8e229221 Use NULL as default value for pointer type
Using zero there is confusing since it's a pointer to an integer.

Change-Id: Ief2368954c71005c529e3eea3fee5df2630e44c1
2021-02-19 16:49:24 +01:00
Pau Espin 00f52cc3d6 tests: Replace deprecated API log_set_print_filename
Change-Id: Idcc4875592c81f17ac98c4f6098492b3d9dd33d2
2021-02-19 16:24:11 +01:00
Pau Espin b18d2a5fd9 tests: Explicitly drop category from log
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-19 16:24:11 +01:00
Alexander Couzens 151bc5b0d3 gprs_bssgp: use gprs_ns2_sns_add_bind() to allow the NSE to use the binds for IP-SNS configuration
The gprs_ns2 now requires to specify every bind which should be used by the NSE for IP-SNS

Related: SYS#5354
Depends: I9ab8092bf286e7d90e92f5702a5404425e959c84 (libosmocore)
Change-Id: I35c987224ce098f7ee9f189ce0fce9e68ad3feac
2021-02-19 12:00:47 +00:00
Pau Espin 9345eb34d3 sched: Avoid selecting TBF to tx NACC Dl msg if no TFI is assigned
The DL NACC related message (PKT Cell Neighbor Data/Change Continue)
are filled with the TFI of the target TBF. Hence, only select the tbf
for NACC transmission if the related TBF already has a TFI assigned.

Otherwise, "OSMO_ASSERT(tbf_is_tfi_assigned(tbf));" in nacc_fsm.c when
generating messages may be hit.

Related: SYS#4909
Change-Id: I72b2dff28aacdb04909c098c94834ff79f55b31d
2021-02-18 15:50:47 +01:00
Pau Espin cf6b3bc08f cosmetic: fix line indentation
Change-Id: Ia8335ce5c005885e4db1864faf775c4bff509c53
2021-02-18 14:02:50 +01:00
Pau Espin 66e8a49734 vty: Write 'neighbor resolution' config to file
Fixes: c0a250d17d
Related: SYS#4909
Change-Id: I44eef3826939e05ba88e0c5a67e1fef535582ba7
2021-02-17 20:25:03 +01:00
Alexander Couzens 94a367f224 gprs_bssgp: rename gprs_ns_config -> gprs_ns_update_config
Improve the naming of the function to match it's purpose.

Related: SYS#5354
Change-Id: Ib8e4ae734503fd6f6695d9d6767d809e1bf79d22
2021-02-16 21:32:47 +00:00
Alexander Couzens 13a12e2e3b gprs_bssgp: rework and rename ns_create_nsvc -> ns_configure_nse
Add support for multiple SNS endpoints.
Move the NSE allocation to the top in preparation of IP-SNS binds.
The future gprs_ns2 library will require to manual add every bind to the NSE for IP-SNS.
Rename the function to match more it's purpose.

Related: SYS#5354
Change-Id: I69cf48ab168a6dca4f649157bf6556d7cd27d4fb
2021-02-16 21:32:47 +00:00
Pau Espin 9313da517d nacc_fsm: Improve log when sending RIM RAN-INFO to gather SI from remote cell
Change-Id: I6972f46f0f3223ce00672178e5610bd3a012fb19
2021-02-15 12:12:51 +01:00
Pau Espin Pedrol a78f0d5bfe nacc_fsm: Support receiving Pkt Cell Chg Notif while in some advanced states
Related: SYS#4909
Change-Id: Iee9cb67bf2c0c6f36b788498f4ef2672e33204b7
2021-02-11 18:49:03 +01:00
Pau Espin Pedrol 8e69fc0c3a nacc_fsm: nacc_fsm: Support receiving Pkt Cell Change Notify in state WAIT_REQUEST_SI
Similar to what's done in the previous commit, but this time when we are
further forward in the resolution process.
This can be triggered for instance because we are taking too much time
to resolve and MS has timer to retransmit the Pkt cell Change Notify in
case no response was received in time.

This commit fixes osmo-pcu exiting due to ASSERT(0) since the event was
already accepted but not being handled in the state function.

Related: SYS#4909
Change-Id: I0c29e5979fec6eebe9dfb151907a4cd2f5e4a737
2021-02-11 13:23:52 +01:00
Pau Espin Pedrol 069a637be8 nacc_fsm: Support receiving Pkt Cell Change Notify in state WAIT_RESOLVE_RAC_CI
If the message is a duplicate (same tgt cell), simply ignore it.
If the message contains a different tgt cell, restart the resolution:
* Avoid re-creating the socket in that case
* Avoid potentially picking a CTRL response for an older request

Related: SYS#4909
Change-Id: Ia2ed2580bbbdd6d3464833257b0dcb8ec6f8d699
2021-02-11 13:17:16 +01:00
Pau Espin Pedrol 41ff273226 nacc_fsm: Remove NACC_EV_RX_SI from in_event_mask of some states
We don't care about those messages anymore if we already transitioned
further than NACC_ST_WAIT_REQUEST_SI. Furthermore, RIM code dispatching
the event to the FSM is only doing it in the mentioned state above.

Related: SYS#4909
Change-Id: If420b49e437ff02073669522408763e5e84fe477
2021-02-11 13:17:16 +01:00
Pau Espin Pedrol 0c10b3cdc1 nacc_fsm: Move code filling struct to helper function
Same filler will be needed in different places since that message can
arrive at different points of time (different states).
It also helps supporting newer key types in the future.

Change-Id: Idfd4db8408f767b1847b04c88047a1c4996e543e
2021-02-11 12:26:24 +01:00
Pau Espin Pedrol abba102d7b cosmetic: fix typo in comment
Change-Id: I5a384985ef54234e915bf6334125f8d087988d1d
2021-02-08 18:35:13 +01:00
Vadim Yanitskiy 830ca26034 vty: register libosmocore's FSM introspection commands
Change-Id: Id268e44de6eb873138f38720a61cabe589a5d2c8
2021-02-05 23:22:37 +01:00
Pau Espin 55aca83098 rlc.h: Fix struct bit fields on big endian systems
Related: OS#5003
Change-Id: I534539cdf197ce5c038752a177aff7efeefc9883
2021-02-04 12:59:40 +01:00
Pau Espin Pedrol 44768f2127 nacc: Avoid RIM procedures targeting cells under same PCU
Now that we have the required System Information in osmo-pcu to craft
the Packet Neigbour Cell Change packet for cells it controls, let's
avoid starting a RIM procedure to gather the SI info, since the SGSN
would end up routing the RIM request back at us and we'd answer back to
ourselves.

This same optimization cannot be done on the first step (CTRL Neighbor
Resolution against BSC), because the PCU cannot know if the target
ARFCN+BSIC requested by the MS is actually managed by a cell under the
PCU or it's another cell managed by another external PCU, because
ARFCN+BSIC keys can be resued among non-neighbor cells. Hence, it shall
always ask the BSC since only it holds the information about neighboring
cells.

Related: OS#4909
Change-Id: I928875b6b66dff55fc12f51b6b1ad919fef7d03b
2021-02-03 08:34:12 +00:00
Pau Espin Pedrol 952cb3d5d7 nacc: Implement Pkt Cell Change Continue retransmission
Use the fact that the MS must answer the RRBP of the Pkt Cell Change
Continue with a CTRL ACK to find out whether the message was received
successfuly or a retransmission is potentially required.

3GPP TS 44.060:
"""
When the mobile station receives the PACKET CELL CHANGE ORDER or
the PACKET CELL CHANGE CONTINUE message the mobile station shall
transmit a PACKET CONTROL ACKNOWLEDGMENT message in the specified
uplink radio block if a valid RRBP field is received as part of the
message; the mobile station may then switch to a new cell.
"""

Related: SYS#4909
Change-Id: I7cc28922e71699598da0ef6eb90136a47d3c002f
2021-02-03 08:34:04 +00:00
Philipp Maier a58ec61514 gprs_bssgp_rim: add serving BSS NACC application
Answer an incoming RAN INFORMATION REQUEST RIM PDU with RAN INFORMATION
PDU that contains system information type 1, 3 and 13

Depends: osmo-bts I5138ab183793e7eee4dc494318d984e9f1f56932
Change-Id: Id72118120c14984d2fb1b918b41fac4868150d41
Related: SYS#5103
2021-02-02 21:57:09 +01:00
Pau Espin Pedrol 1aef113bb7 nacc: Fix typo in function name
Change-Id: I74857eacf4664508dce70eb0c6dd2acd7bfb72e4
2021-02-01 19:34:53 +01:00
Pau Espin Pedrol 57dcde4242 tbf: Constify some methods
Change-Id: I2681a98583f4fb26a274c75d0279084239f76a68
2021-02-01 18:14:37 +01:00
Pau Espin Pedrol b71aab5646 tbf: Reuse stored result in variable in check_polling()
Change-Id: Ie6fbe3699bcb4f63f7b617243c769e60881d8aac
2021-02-01 16:37:46 +01:00
Pau Espin Pedrol 4668dc6f07 encoding: Fix comment description of S/P field
Those fields were ment to be 0 (non-valid), just the comments were
copied over from somewhere else, and they are misleading.

Change-Id: Ic95853e115f60c65f7f11187d49d6e870d08c7bb
2021-02-01 16:37:46 +01:00
Pau Espin Pedrol 79784d0249 Move src/tbf.txt to doc/
At least there it will pass less unnoticed, I just discovered this file
by chance.

Change-Id: I65a443ae498ae4c5e837e5a069fd87863f259152
2021-02-01 14:28:35 +01:00
Pau Espin Pedrol fdbcea3532 Drop comment about an already implemented TODO
The comment target is already implemented just above it.

Change-Id: I05534bbbad24ad8ba602244b834cdbadcabcc7ec
2021-02-01 14:02:15 +01:00
Pau Espin Pedrol 05be90367a Update TS 04.60 references to new TS 44.060
Change-Id: Ib7c3a74b502b2251da2f7b9d6d711f3e32133bc3
2021-02-01 13:06:45 +01:00
Vadim Yanitskiy 3877848e22 contrib/osmo-pcu.spec.in: add missing libosmoctrl dependency
Change-Id: I37c478f3f430f72620af17f1c3329f6ee8515402
Fixes: Id35f40d05f3e081f32fddbf1fa34cb338db452ca
2021-01-30 19:14:55 +00:00
Vadim Yanitskiy e0fb465678 contrib/osmo-pcu.spec.in: require libosmo* version 1.4.0
Keep this file in sync with the requirements in configure.ac.

Change-Id: I8fec52d0d77778775df0022da6cd53a213c057bc
2021-01-30 19:14:55 +00:00