Commit Graph

500 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther ad53ffaf6a tbf: Remove copy and paste between several call sites 2014-06-08 13:57:19 +02:00
Holger Hans Peter Freyther bbe51c5ce2 clean-up: Kill the alpha and gammar parameter from the method 2014-06-08 11:43:58 +02:00
Holger Hans Peter Freyther 53e6a18581 clean-up: The ta_idx parameter was always -1, remove it
The amount of parameters is so difficult to understand and the
goal of Encoding is to support our application and not be able
to provide all possible combinations for these messages.
2014-06-08 11:27:05 +02:00
Holger Hans Peter Freyther f758b152ba clean-up: Pass the pdch to kill arfcn, ts and tsc parameter 2014-06-08 11:19:45 +02:00
Holger Hans Peter Freyther b1189e517f bts: Separate the receive handling for TBF and SBA
Make the code a bit more clear, avoid having to initialize some
variables as it is not clear if they are used or not. It would
be easier if we wouldn't have to pass ra/fn to these methods.
The early allocation of the bitvec should be okay as we expect
allocations to succeed.
2014-06-08 11:04:39 +02:00
Holger Hans Peter Freyther d7c6fdc653 wip: speculative change 2014-06-08 08:29:55 +02:00
Holger Hans Peter Freyther d7a41145a8 clean-up: Remove trx/ts/arfcn from two more places
Continue with the clean-up and remove trx/ts integers from the
API. Introduce the first template in pcu_l1_if.cpp to have a
generic "extract ts,trx,arfcn" function.
2014-06-08 08:29:28 +02:00
Holger Hans Peter Freyther ead6f08f42 clean-up: Continue to use types instead of passing ints around
Make parts of the recevie handling work on the PDCH and removing
the duplication of ARFCN, TS-Number and TRX-Number. Only the lower
level should deal with ints and everyone else just with the object
2014-06-08 08:29:24 +02:00
Daniel Willmann 77e58f602d bts: Remove outdated comment
There is no parameter in the function and the bts has a memeber trx
which has a member pdch.

Sponsored-by: On-Waves ehf
2014-06-04 19:01:56 +02:00
Daniel Willmann 5d77f14904 csn1: Add spaces between string literal and identifier
This is required by C++11

csn1.cpp:1147:44: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
LOGPC(DCSN1, LOGL_NOTICE, "%"PRIu64"|", bitvec_read_field(vector, readIndex, bits_to_handle));

Sponsored-by: On-Waves ehf
2014-06-04 17:17:48 +02:00
Daniel Willmann 17a1d5e162 gprs_rlcmac_pdch: Get rid of ul/dl_tbf
The current code keeps a reference to all tbfs in the bts and another
reference in the pdch. This allows for the possibility of both lists to
go out of sync.

This patch removes the pdch-specific list of ul and dl tbfs and uses the
lists in the bts to lookup tbfs everywhere.

Performance for going through the global list is not an issue yet. We
can optimize this later and in a better way.

Sponsored-by: On-Waves ehf
2014-06-04 17:17:45 +02:00
Daniel Willmann 1e0c61032f gprs_rlcmac_pdch: Don't access private members
This patch introduces methods to get ul and dl tbf by tfi and uses them
in gprs_rlcmac_sched.

Sponsored by: On-Waves ehf
2014-06-04 17:14:22 +02:00
Daniel Willmann cf1fae7f38 tbf: Re-send dl assignment if we can upgrade to multislot
The current code would only ever assign one PDCH for the initial
assignment (from CCCH). Only if reuse_tbf is called the algorithm would
actually use multiple DL PDCHs if possible.

This patch introduced a tbf attribute upgrade_to_multislot that is set
if we have multiple PDCH configured, and support multislot assignment,
but can only assign a single PDCH (alloc_algorithm_b, parameter single
is set). In this case after the assignment completes (and the MS is
listening on a PDCH) we resend a DL assignment though the PACCH and this
time we can assign multiple timeslots.
2014-05-30 18:23:17 +02:00
Daniel Willmann 73191a443f tbf/bts, encoding: Keep track of WAIT_RELEASE state for DL assignment
The current code does not properly distinguish between DL assignments to
reuse a tbf (after it was put in state WAIT_RELEASE) and DL assignments
for an active tbf to change the allocation of the PDCH timeslots.

This patch introduces a new variable was_releasing which remembers if
trigger_dl_ass() was called with a tbf in state WAIT_RELEASE. In that
case we have to set the CONTROL_ACK field in the download assignment.

This should allow us to send DL assignments to change PDCH TS allocation
of a tbf before we enter FLOW state.
2014-05-30 18:21:00 +02:00
Daniel Willmann fc03bbe078 tbf/bts: Rename tbf->snd_dl_ack to tbf->rcvd_dl_ack
This function is called to act upon a received DL ACK packet so this
name makes more sense.
2014-05-30 18:19:06 +02:00
Andreas Eversberg 9167055ed2 Fixed calculation of colliding UL/DL slots in TS allocation algorithm B
Counter j must be wrapped to prevent beeing negative, when it is
initialized. This wrapping happens, if TS 0 is used for PDCH in
combination with regular GPRS phones (MS class 12 or similar).
2014-05-30 18:18:09 +02:00
Holger Hans Peter Freyther 8f3520579a Merge remote-tracking branch 'origin/sysmocom/master' 2014-05-15 12:24:12 +02:00
Holger Hans Peter Freyther f81e2f7621 systemd: Do not re-start in case of exit(1) (e.g. a config issue) 2014-03-21 18:18:36 +01:00
Holger Hans Peter Freyther 59fe8f79cc systemd: Reduce the re-start interval to a couple of seconds
With the exit on failure/disconnect option we restart the PCU a
lot more and might not want to wait five seconds.
2014-02-04 13:20:54 +01:00
Holger Hans Peter Freyther d8f339592d sysmopcu: Re-start the PCU on disconnect
During the refactorings I highlighted that the PCU has two
equally broken clean-up paths.

Fixes: SYS#134
2014-01-21 16:59:33 +01:00
Holger Hans Peter Freyther a09e33cdeb TODO: Update the todolist with some musings... 2014-01-16 10:11:57 +01:00
Holger Hans Peter Freyther e5109ba1f0 tbf: Change the log area to RLCMACDL so we see it in a DL trace 2014-01-16 10:11:22 +01:00
Holger Hans Peter Freyther 3d0cc2f97d tbf: Make finding use-after-free more easy and set to NULL or return
Make finding use-after-free more easy by setting things to NULL
or simply return after tbf_free(this) has been called.
2014-01-16 10:09:42 +01:00
Holger Hans Peter Freyther a004799699 tbf: Use past-tense and call it created_ts 2014-01-16 10:07:20 +01:00
Holger Hans Peter Freyther b293043e2d Merge remote-tracking branch 'sysmocom/tbf-vty' into sysmocom/master 2014-01-16 10:06:22 +01:00
Daniel Willmann 80367aae17 tbf: Save a timestamp at tbf allocation and print it in the VTY 2014-01-15 17:41:45 +01:00
Daniel Willmann 772415fd8a pcu_vty: Add a command to print info about all TBFs 2014-01-15 17:41:45 +01:00
Daniel Willmann afa72f5210 tbf: Add a function to output tbf info to VTY 2014-01-15 17:41:44 +01:00
Holger Hans Peter Freyther 85c1ea5cb6 Merge remote-tracking branch 'sysmocom/window-rework' into sysmocom/master 2014-01-15 17:25:49 +01:00
Daniel Willmann 3ce011f44f rlc: Rename state() to show_state() to better reflect its function
show_state() is only used for debugging output to make the v(b) array
human readable.
2014-01-15 15:23:35 +01:00
Daniel Willmann d54d9f5c75 rlc: Use an enum for the state array instead of chars
gprs_rlc_bsn_state is now used to hold the ACK state of sent/received
rlc packets.
2014-01-15 15:23:35 +01:00
Daniel Willmann 146514e180 rlc/tbf: Move v_b into DL window
Move functions resend_needed(), mark_for_resend(), update(),
move_window(), state(), count_unacked() out of v_b directly into the UL
window and provide a function get_state in v_b to access the v_b
elements.
2014-01-15 15:23:21 +01:00
Daniel Willmann 55844795be rlc/tbf: Add function receive_bsn that updates v_r, v_q, v_n
We don't need to expose the mecanics of updating the variables to the
outside.
2014-01-15 15:23:21 +01:00
Daniel Willmann 7c3751b10b rlc/tbf: Move v_n into gprs_rlc_ul_window and adapt the tests
v_n is part of the UL window handling so move it inside the ul_window
2014-01-15 15:23:21 +01:00
Daniel Willmann f4a1ec6ce7 rlc: Rename the simple raise_v_r method to avoid naming conflicts 2014-01-15 15:23:21 +01:00
Holger Hans Peter Freyther c2fab7a6ff alloc: Update the test result now that everything is back to working again 2014-01-15 14:42:58 +01:00
Andreas Eversberg 0a940087b2 alloc_algorithm_b: Remove obsolete 'i' incrementation from for-loop 2014-01-15 14:33:49 +01:00
Holger Hans Peter Freyther 2bf3446f7a misc: Allow to cross-execute the tests using qemu
When cross-compiling osmo-bts/osmo-pcu one can not easily
execute the testsuite. By adding the OSMO_QEMU variable in
front of the normal execution we can execute the tests. This
should work for native and cross builds.

$ OSMO_QEMU="qemu-arm -L /opt/poky/1.1.2/sysroots/armv5te-poky-linux-gnueabi/" make check
2014-01-15 11:14:52 +01:00
Holger Hans Peter Freyther 746b390201 Merge branch 'sysmocom/allocation-corrections' into sysmocom/master
Merge the refactorings we did at sysmocom and the new test cases that
test the easy success cases of the allocation algorithm. Include the
multislot fixes from Andreas.
2014-01-15 10:39:26 +01:00
Andreas Eversberg 1cd9d886e6 alloc_algorithm_b: Add seperate function to shrink rx window when TS are removed
After reduce_rx_window() and update_rx_win_max() was called, one or more TS
might be removed. tx_win_min and tx_win_max must be adjusted to the new range
of allocated slots.
2014-01-15 10:39:08 +01:00
Andreas Eversberg fe2dcc8aec alloc_algorithm_b: Increment 'i', so allocated TS will not exceed tx_range 2014-01-15 10:39:08 +01:00
Holger Hans Peter Freyther f3eec04655 alloc/test: Add a crazy test that tests each possible combination
Make a crazy test that will test each possible PDCH configuration
and MS Class and verify that the UL/DL assignments work and that
they are on the same first_common_ts.
2014-01-15 10:39:08 +01:00
Andreas Eversberg 765736dc77 alloc_algorithm_b: Do not select uplink slots that cannot be used for downlink
In order to poll MS, the mobile must be able to receive polling request.

In order to allow the MS to transmit, the USF must be received by the mobile.
2014-01-15 10:39:08 +01:00
Andreas Eversberg 7a16d46fdc alloc_algorithm_b: Set tx_range to 8, if all 8 TS are supported by MS 2014-01-15 10:39:08 +01:00
Andreas Eversberg ccde4c462d alloc_algorithm_b: For type 1 MS, limit number of donwlink TS to 5
The algorithm does not support more than 5 TS on downlink for type 1 MS.
Supporting more than 5 TS would require adding more complexity to this
algorithm. MS that support more than 4 (or 5) TS on downlink are rare,
if they really exist.
2014-01-15 10:39:08 +01:00
Andreas Eversberg b03d427b08 alloc_algorithm_b: Correctly increment RX/TX window, even if TS is not useable 2014-01-15 10:39:08 +01:00
Holger Hans Peter Freyther 73193110f2 alloc: Move the uplink ts selection/pre-assignment out of the code
Create a select_ul_slots which is very (95%) similar to the
select_dl_slots handling. This needs to be refactored and the
todo for multiple uplink slots should be handled too.

Add a warning about a potential failure on a busy PCU.
2014-01-15 10:39:08 +01:00
Holger Hans Peter Freyther 1fe69323ad alloc: Move the selection of the first enabled pdch to a new method 2014-01-15 10:39:08 +01:00
Holger Hans Peter Freyther 3fd2ddf1a2 alloc: Move the tx window calculation to a new method 2014-01-15 10:39:08 +01:00
Holger Hans Peter Freyther dd4af8045f alloc: Move upating of the rx window max for Type==1 to a new method 2014-01-15 10:39:08 +01:00