Attention is currently required from: pespin.
Hello osmith, Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-gprs/+/33900
to look at the new patch set (#2).
Change subject: rlcmac: recalculate CV as needed when already in Countdown procedure
......................................................................
rlcmac: recalculate CV as needed when already in Countdown procedure
Getting out of contention resolution means we may have to update our
calculated CV state because we are no longer sending TLLI.
Same happens if a new tx CS is provided by the network, since different
block size means different CV.
In this commit only code paths for the state where already in Countdown
Procedure are added. If TBF has to enter Countdown Procedure due the
above mentioned changes, it will do so using regular path where a new
RLC block is created.
Related specs: TS 44.060 9.3.1
Related: OS#6018
Change-Id: I6ca88c005060ba1302d46717e45b0d9731d86d8d
---
M include/osmocom/gprs/rlcmac/tbf_ul.h
M src/rlcmac/tbf_ul.c
M src/rlcmac/tbf_ul_fsm.c
3 files changed, 83 insertions(+), 16 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/00/33900/2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/33900
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: I6ca88c005060ba1302d46717e45b0d9731d86d8d
Gerrit-Change-Number: 33900
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/33885 )
Change subject: rlcmac: rlc_window_dl: Fix RBB generation
......................................................................
rlcmac: rlc_window_dl: Fix RBB generation
We want to do mod sns on the BSN, not on the boolean returned by
gprs_rlcmac_rlc_v_n_is_received().
This is a typo which occurred while porting the code from osmo-pcu.git
void gprs_rlc_ul_window::update_rbb(char *rbb), where the following line
is used:
"""
if (m_v_n.is_received((ssn()-1-i) & mod_sns()))
"""
Change-Id: I37c8fd5c2528f035f077c3e05105f913922ffd84
---
M src/rlcmac/rlc_window_dl.c
1 file changed, 19 insertions(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
diff --git a/src/rlcmac/rlc_window_dl.c b/src/rlcmac/rlc_window_dl.c
index a2bef5f..77153b6 100644
--- a/src/rlcmac/rlc_window_dl.c
+++ b/src/rlcmac/rlc_window_dl.c
@@ -163,7 +163,7 @@
unsigned int i;
for (i = 0; i < ws; i++) {
- if (gprs_rlcmac_rlc_v_n_is_received(&dlw->v_n, ssn - 1 - i) & mod_sns)
+ if (gprs_rlcmac_rlc_v_n_is_received(&dlw->v_n, (ssn - 1 - i) & mod_sns))
rbb[ws - 1 - i] = 'R';
else
rbb[ws - 1 - i] = 'I';
--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/33885
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: I37c8fd5c2528f035f077c3e05105f913922ffd84
Gerrit-Change-Number: 33885
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/33886 )
Change subject: rlcmac: Mark received BSNs falling out of the V(N)/RBB when V(R) is raised
......................................................................
rlcmac: Mark received BSNs falling out of the V(N)/RBB when V(R) is raised
Problem this patch is fixing:
The current RLCMAC window code ported from osmo-pcu is never
invalidating the BSNs which have been received after they are not
needed.
As a result, when the DL TBF keeps sending data for a long time, and
finally BSN wraps around 127->0, when this implementation receives the
BSN=0, it will find it is already received and hence will discard it,
and then keep asking for BSN=0 nevertheless in PKT DL ACK, causing an
endless loop where PCU stays submitting the same block forever.
Explanation of the solution:
The V(N) array contains the status of the previous WS (64 in GPRS) data
blocks. This array is used to construct the RRB signaled to the peer
during PKT DL ACK/NACK messages together with the SSN (start sequence
number), which in our case is mainly V(R), aka one block higher than the
highest received block in the rx window.
Hence, whenever PKT DL ACK/NACK is transmitted, it contains an RRB
ranging [V(R)-1,...V(R)-WS)] mod SNS (SNS=128 in GPRS).
The receive window is basically [V(Q) <= BSN < V(R)] mod SNS, as is of
size 64.
The V(R) is increased whenever a highest new block arrives which is in the
receive window (guaranteeing it will be increased to at most V(Q)+64.
Since we are only announcing state of blocks from V(R)..V(R)-WS, and
blocks received which are before that BSN are dropped since don't fall
inside the rx window, we can securely mark as invalid those blocks
falling behind V(R)-WS whenever we increase V(R).
Related: OS#6102
Change-Id: I962111995e741a7e9c230b2dd4904c2fa9a828e9
---
M include/osmocom/gprs/rlcmac/rlc_window_dl.h
M src/rlcmac/rlc_window_dl.c
M tests/rlcmac/rlcmac_prim_test.err
3 files changed, 55 insertions(+), 11 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
diff --git a/include/osmocom/gprs/rlcmac/rlc_window_dl.h b/include/osmocom/gprs/rlcmac/rlc_window_dl.h
index 58faaa4..93ccbe4 100644
--- a/include/osmocom/gprs/rlcmac/rlc_window_dl.h
+++ b/include/osmocom/gprs/rlcmac/rlc_window_dl.h
@@ -62,7 +62,6 @@
uint16_t gprs_rlcmac_rlc_dl_window_raise_v_q(struct gprs_rlcmac_rlc_dl_window *dlw);
void gprs_rlcmac_rlc_dl_window_receive_bsn(struct gprs_rlcmac_rlc_dl_window *dlw, uint16_t bsn);
-bool gprs_rlcmac_rlc_dl_window_invalidate_bsn(struct gprs_rlcmac_rlc_dl_window *dlw, uint16_t bsn);
static inline uint16_t gprs_rlcmac_rlc_dl_window_ssn(const struct gprs_rlcmac_rlc_dl_window *dlw)
{
diff --git a/src/rlcmac/rlc_window_dl.c b/src/rlcmac/rlc_window_dl.c
index 77153b6..eab01cd 100644
--- a/src/rlcmac/rlc_window_dl.c
+++ b/src/rlcmac/rlc_window_dl.c
@@ -69,6 +69,11 @@
return gprs_rlcmac_rlc_v_n_mark(v_n, bsn, GPRS_RLCMAC_RLC_DL_BSN_MISSING);
}
+void gprs_rlcmac_rlc_v_n_mark_invalid(struct gprs_rlcmac_rlc_v_n *v_n, int bsn)
+{
+ return gprs_rlcmac_rlc_v_n_mark(v_n, bsn, GPRS_RLCMAC_RLC_DL_BSN_INVALID);
+}
+
/*************
* UL WINDOW
*************/
@@ -220,8 +225,14 @@
/* Positive offset, so raise. */
if (offset_v_r < (gprs_rlcmac_rlc_window_sns(w) >> 1)) {
while (offset_v_r--) {
- if (offset_v_r) /* all except the received block */
- gprs_rlcmac_rlc_v_n_mark_missing(&dlw->v_n, gprs_rlcmac_rlc_dl_window_v_r(dlw));
+ const uint16_t v_r = gprs_rlcmac_rlc_dl_window_v_r(dlw);
+ const uint16_t bsn_no_longer_in_ws = gprs_rlcmac_rlc_window_mod_sns_bsn(w, v_r - gprs_rlcmac_rlc_window_ws(w));
+ LOGRLCMAC(LOGL_DEBUG, "- Mark BSN %u as INVALID\n", bsn_no_longer_in_ws);
+ gprs_rlcmac_rlc_v_n_mark_invalid(&dlw->v_n, bsn_no_longer_in_ws);
+ if (offset_v_r) {/* all except the received block */
+ LOGRLCMAC(LOGL_DEBUG, "- Mark BSN %u as MISSING\n", v_r);
+ gprs_rlcmac_rlc_v_n_mark_missing(&dlw->v_n, v_r);
+ }
gprs_rlcmac_rlc_dl_window_raise_v_r_to(dlw, 1);
}
LOGRLCMAC(LOGL_DEBUG, "- Raising V(R) to %d\n", gprs_rlcmac_rlc_dl_window_v_r(dlw));
@@ -255,11 +266,3 @@
gprs_rlcmac_rlc_v_n_mark_received(&dlw->v_n, bsn);
gprs_rlcmac_rlc_dl_window_raise_v_r(dlw, bsn);
}
-
-bool gprs_rlcmac_rlc_dl_window_invalidate_bsn(struct gprs_rlcmac_rlc_dl_window *dlw, uint16_t bsn)
-{
- bool was_valid = gprs_rlcmac_rlc_v_n_is_received(&dlw->v_n, bsn);
- gprs_rlcmac_rlc_v_n_mark_missing(&dlw->v_n, bsn);
-
- return was_valid;
-}
diff --git a/tests/rlcmac/rlcmac_prim_test.err b/tests/rlcmac/rlcmac_prim_test.err
index ec707d2..006efc3 100644
--- a/tests/rlcmac/rlcmac_prim_test.err
+++ b/tests/rlcmac/rlcmac_prim_test.err
@@ -885,6 +885,7 @@
DLGLOBAL DEBUG TBF(DL:NR-0:TLLI-00000001) Got CS-1 RLC data block: FBI=1, BSN=0, SPB=0, S/P=1 RRBP=1, E=0, bitoffs=24
DLGLOBAL DEBUG TBF(DL:NR-0:TLLI-00000001) BSN 0 storing in window (0..63)
DLGLOBAL DEBUG TBF(DL:NR-0:TLLI-00000001) data_length=20, data=19 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
+DLGLOBAL DEBUG - Mark BSN 64 as INVALID
DLGLOBAL DEBUG - Raising V(R) to 1
DLGLOBAL DEBUG - Taking block 0 out, raising V(Q) to 1
DLGLOBAL DEBUG TBF(DL:NR-0:TLLI-00000001) Assembling frames: (len=20)
@@ -923,6 +924,7 @@
DLGLOBAL DEBUG TBF(DL:NR-0:TLLI-00000001) Got CS-1 RLC data block: FBI=1, BSN=0, SPB=0, S/P=1 RRBP=1, E=0, bitoffs=24
DLGLOBAL DEBUG TBF(DL:NR-0:TLLI-00000001) BSN 0 storing in window (0..63)
DLGLOBAL DEBUG TBF(DL:NR-0:TLLI-00000001) data_length=20, data=19 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
+DLGLOBAL DEBUG - Mark BSN 64 as INVALID
DLGLOBAL DEBUG - Raising V(R) to 1
DLGLOBAL DEBUG - Taking block 0 out, raising V(Q) to 1
DLGLOBAL DEBUG TBF(DL:NR-0:TLLI-00000001) Assembling frames: (len=20)
--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/33886
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: I962111995e741a7e9c230b2dd4904c2fa9a828e9
Gerrit-Change-Number: 33886
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged