Holger Hans Peter Freyther
81e8f0a8a2
l1if: Include string.h to fix possible coverity issue
...
Coverity warns about the below lines of code. strerror is supposed
to return a char* and %s should work on char. Let's see if including
string.h will make coverity more happy. The pre-processes file looked
sane as well.
LOGP(DL1IF, LOGL_ERROR, "error writing to L1 msg_queue: %s\n",
strerror(errno));
Coverity: CID 1040951, CID 1040950, CID 1040952
2013-12-12 14:32:33 +01:00
Holger Hans Peter Freyther
752a3b2baa
Merge branch 'sysmocom/gprs-window-handling' into sysmocom/master
...
Daniel and me worked on the window handling. We now test that what
we encode is compatible to what we decode. The char array now includes
SSN-1 to the right of the array (reflecting a time axis that grows
towards the right..)
2013-12-12 11:11:02 +01:00
Daniel Willmann
5e94cd4fde
decoding: Cosmetic - change rbb decoding
2013-12-12 11:09:17 +01:00
Daniel Willmann
cc5a4cbe9b
rlc: Make the update loop more understandable
...
Add bitnum_to_bsn() as a convenience function to get the BSN, use it
in the update handling and ignore rbb for values outside of our tx
window.
2013-12-12 11:07:47 +01:00
Daniel Willmann
48df40d2a4
tests/TypesTest: Check rbb handling in DL
2013-12-12 11:06:40 +01:00
Daniel Willmann
f1786a375f
tests/TypesTest: Ensure that extract_rbb(encode_rbb(x)) == x
2013-12-12 11:05:43 +01:00
Daniel Willmann
6f7cb2cb4f
decoding: Use 'I' and 'R' in rbb array for DL
...
We want to match up rbb decoding and encoding so it helps to use the
same chars.
2013-12-12 11:03:50 +01:00
Daniel Willmann
0f2b5fc749
tests/TypesTest: Print the result of Encoding::encode_rbb()
2013-12-12 11:03:35 +01:00
Daniel Willmann
5241c1a018
encoding: Factor out encode_rbb to help testing
2013-12-12 11:03:13 +01:00
Daniel Willmann
52ea8a0d87
encoding: Use ul_window ssn()/update_rbb() methods when encoding ul ACK
...
Use the ssn() and update_rbb() methods of gprs_rlc_ul_window when
encoding the ACK/NACK packet in write_packet_uplink_ack()
2013-12-12 11:02:09 +01:00
Daniel Willmann
e6e605ba86
encoding: Change wording to match that of 3GPP TS 04.60
...
The spec (in ch. 9.1.8.1) speaks of RECEIVED or INVALID in the RLC
receiver, so change the wording in the log message to match.
2013-12-12 11:01:52 +01:00
Daniel Willmann
c3f4330fa3
tests/TypesTest: Add OSMO_ASSERT_STR_EQ which prints out the parameters
...
Use it to compare rbb
2013-12-12 11:01:32 +01:00
Daniel Willmann
f86fb7a953
tests/TypesTest: Test ssn() and update_rbb() uplink window methods in TypesTest
...
Test that ssn and rbb are updated correctly.
2013-12-12 11:01:13 +01:00
Daniel Willmann
8a31f9e016
rlc: Manage the received block bitmap in the ul_window
...
Added two methods to gprs_rlc_ul_window
* ssn() returns the starting sequence number
* update_rbb() returns an array of chars representing the state of the
received block bitmap. Each element is either 'I'nvalid or
'R'eceived. The rbb is generated from v_n
rbb[63] relates to BSN ssn-1
...
rbb[0] relates to BSN ssn-64
2013-12-12 10:59:56 +01:00
Holger Hans Peter Freyther
11f2d58dbd
rlc: Create a testcase for the uplink window
2013-12-04 21:05:18 +01:00
Holger Hans Peter Freyther
3cbf9e040c
rlc: Make the RLC types only operate on the BSN
...
The code has an internal optimization to only use window_size
space. This means that the caller needed to know that only half
of the size was used. Change the API to work on the BSN and do
the mapping internally. The compiler should have plenty of
opportunity to propagate the constant(s) but this has not been
verified.
2013-12-04 21:01:02 +01:00
Holger Hans Peter Freyther
3c95776805
tbf: Separate the handling for rh->si and call in case of re-transmission
...
In case of a retransmission ack the window again..
2013-12-04 13:51:43 +01:00
Holger Hans Peter Freyther
7a5f3c2153
tbf/sched: We pick the _last_ entry, rotate the lists
...
We always pick the _last_ entry from the lists. Let's rotate
so we make it a bit more fair.
2013-11-26 21:00:52 +01:00
Holger Hans Peter Freyther
7f3e662b34
tbf/rlc: Move raising of V(Q) into the ul window code
2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther
cbb00ebd04
rlc/tbf: Move the code to raise V(R) into the ul_window handling
2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther
423dd2286b
tbf/rlc: Move the putting of a block into the rlc code
2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther
4c06d9155c
tbf: Move the extraction of the TLLI into a separate method
2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther
c15d5cc230
tbf/rlc: Remove the side-effect from the loop.
2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther
9977e1545a
tbf: Reduce complexity and deal with only one way of assignment
...
The normal mode of the PCU doesn't really work right now. There
is no place to have certain kind of features that are not built
and not unit-tested.
2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther
6ab5b24be4
tbf/rlc: Move the check if something is in the window out.
2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther
7decedcbf8
rlc: The bsn has never been used. Remove it from the Xl_window
2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther
faf3ef45b3
rlc: Add a basic test for the DL Window and moving the window
2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther
e9b1ebba9d
rlc: Test the basic of the gprs_rlc_v_n code for remembering the state
2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther
270f7fce1d
tbf/rlc: Move the v_n handling into a dedicated object
2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther
f1593b7c49
tbf/rlc: Big change and move the window handling out to the rlc
...
The send and receive window is now managed by an external object.
There are some issues that can only be solved with C++11 but it
is progres and removes some of the spaghetti code. For GPRS the
sns and ws is hardcoded. Move that into the window code.
2013-11-26 21:00:51 +01:00
Holger Hans Peter Freyther
ab6cd921e3
tbf: Update the legend and mention invalid as well
...
We should not see it but the legend should be complete.
2013-11-26 20:57:42 +01:00
Holger Hans Peter Freyther
9a76968ec4
rlc: Use uint16_t for the BSN in all cases.
...
The sns is only 128 for GPRS (it can be bigger for EDGE) so the
uint8_t was enough but it is bad to have inconsistencies for both
of them.
2013-11-26 20:57:40 +01:00
Holger Hans Peter Freyther
9c5539d46d
tbf/rlc: Move the counting of unacked frames into the RLC V_B class
...
Whenwe receive a final ack we assume that all the unacked frames
have been acked now. Move the counting to V_B and now the caller
can remove the BSN and the "lost" variable which has always been
zero.
2013-11-26 20:57:24 +01:00
Holger Hans Peter Freyther
86dc355a33
tbf: Split the handling of DL ACK/NACK into two separate parts
...
Split the handling of the final ack and the handling of frames
that is moving frames.
2013-11-26 20:57:24 +01:00
Holger Hans Peter Freyther
bc15570651
tbf/rlc: Change the code and generate the entire state in the V_B
2013-11-26 20:57:24 +01:00
Holger Hans Peter Freyther
e358ff8fa4
tbf/rlc: Move the moving of V(A) into the V_B code
...
Move the code that moves the V_B to the first not acked frame. Return
how many indexes the V_B was moved and update the V_A in the caller.
2013-11-26 20:57:24 +01:00
Holger Hans Peter Freyther
df6b4f52e0
tbf/rlc: Move the parsing of RBB to Decoding, move window marking out
...
Move the parsing of the bitbmap out of the TBF code into Decoding.
Move the updating of the V_B into the V_B class. Add some comments
about handling the mod_sns, mod_sns_half parameters by using template
code.
2013-11-26 20:57:24 +01:00
Holger Hans Peter Freyther
9eb8ace260
tbf: Fix the indention of this routine
2013-11-26 20:57:24 +01:00
Holger Hans Peter Freyther
12c039cdb2
debug_diagram: Remove the special debug_diagram compilation mode
...
This approach is somehow flawed. We need/want to debug problems on
systems with real traffic and re-compiling it with debug_diagram
is not an option. All internal logging needs to be expressive enough
so we can understand what is going on (e.g. create a script to
post-process the output).
2013-11-26 20:57:24 +01:00
Holger Hans Peter Freyther
a6ba67cb3a
tbf: Simplify the create_dl_acked_block into two parts
...
Separate the resend from creating a new block. It shows that the
first_fin_ack is always set to FALSE for re-sending. This might
not be what we want.
2013-11-26 20:57:24 +01:00
Holger Hans Peter Freyther
8b16ae30fe
tbf/rlc: Move the marking of frames for resend into the v_b
2013-11-26 20:57:24 +01:00
Holger Hans Peter Freyther
c03e38291a
tbf: Move the check if the window is stalled to a separate method
2013-11-26 20:57:24 +01:00
Holger Hans Peter Freyther
1577779526
rlc/tbf: Move the loop into the gprs_rlc_v_b class
2013-11-26 20:57:19 +01:00
Holger Hans Peter Freyther
ef93bdb19b
tbf: Count how often we re-start a BSN in the send routine
...
There appears to be a scheduling issue. Even without any NACKs
we are re-transmitting a lot of frames. It might be because of
this.
2013-11-24 00:01:50 +01:00
Holger Hans Peter Freyther
64b49bc3ce
tbf: Always increase the tx_counter when we transmit a frame
...
In case the ACK could not be scheduled we were not increasing the
tx_counter. Change the code flow to always increase the tx_counter
after we have created a frame.
2013-11-23 23:16:07 +01:00
Holger Hans Peter Freyther
40fc8f9e46
sched: Make internal methods static
2013-11-23 23:03:14 +01:00
Holger Hans Peter Freyther
b18aedcc50
tbf: Make the ws and sns number "private" (they should also be const)
2013-11-23 16:27:50 +01:00
Holger Hans Peter Freyther
9525567d77
rlc: Create a basic test that mark/is is talking about the same
2013-11-23 16:19:17 +01:00
Holger Hans Peter Freyther
6b5660c19f
rlc: Move the rlc headers into a separate header file
2013-11-23 16:19:17 +01:00
Holger Hans Peter Freyther
321f3c3104
rlc: Move the ack state array into a separate class that can be tested
2013-11-23 16:19:17 +01:00