diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2014-08-25 16:20:23 +0200 |
---|---|---|
committer | Daniel Willmann <daniel@totalueberwachung.de> | 2014-09-10 19:19:58 +0200 |
commit | efd5dbb16866ffe08c675172e6456aba5d588166 (patch) | |
tree | def422bd8653ce3f623457b91a0691f39f68c6c9 /src/tbf_dl.cpp | |
parent | 510d7d36ed1a040679f371976fa2c326c4b478bf (diff) |
tbf: Handle DL ACK/NACK poll timeout correctly
If the PCU didn't receive the downlink ack/nack when it was polled there
is no reason to assume it will arrive at a later time. In that case
N3105 is already increased, but the next block sent should have a valid
RRBP set as well to poll again.
This can happen if either the BSN with the valid RRBP gets lost on the
downlink or the DL ACK/NACK gets lost on the uplink path.
Ticket: SYS#382
Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/tbf_dl.cpp')
-rw-r--r-- | src/tbf_dl.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index a715af78..feed6c78 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -478,21 +478,28 @@ struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block( struct rlc_dl_header *rh; struct msgb *dl_msg; uint8_t len; + bool need_poll; /* get data and header from current block */ data = m_rlc.block(index)->block; len = m_rlc.block(index)->len; rh = (struct rlc_dl_header *)data; + need_poll = state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); /* Clear Polling, if still set in history buffer */ rh->s_p = 0; /* poll after POLL_ACK_AFTER_FRAMES frames, or when final block is tx. */ - if (m_tx_counter >= POLL_ACK_AFTER_FRAMES || first_fin_ack) { + if (m_tx_counter >= POLL_ACK_AFTER_FRAMES || first_fin_ack || + need_poll) { if (first_fin_ack) { LOGP(DRLCMACDL, LOGL_DEBUG, "- Scheduling Ack/Nack " "polling, because first final block sent.\n"); + } else if (need_poll) { + LOGP(DRLCMACDL, LOGL_DEBUG, "- Scheduling Ack/Nack " + "polling, because polling timed out.\n", + POLL_ACK_AFTER_FRAMES); } else { LOGP(DRLCMACDL, LOGL_DEBUG, "- Scheduling Ack/Nack " "polling, because %d blocks sent.\n", @@ -524,6 +531,9 @@ struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block( poll_state = GPRS_RLCMAC_POLL_SCHED; poll_fn = (fn + 13) % 2715648; + /* Clear poll timeout flag */ + state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); + /* set polling in header */ rh->rrbp = 0; /* N+13 */ rh->s_p = 1; /* Polling */ |