From 04e72d34f5cf885a4d6e2e6b2f2575ad09d0c007 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Thu, 13 Aug 2015 18:36:56 +0200 Subject: tbf: Always start T3193 when changing state to GPRS_RLCMAC_WAIT_RELEASE Currently when receiving a PACKET DL ACK/NACK message with the Final Ack Indicator bit set, the TBF's state is set to GPRS_RLCMAC_WAIT_RELEASE but T3193 is only started when the LLC queue is empty. Otherwise the reuse_tbf() method is called to establish a new DL TBF. In that case, the timer is not started. This will leave the current TBF without a timer so it is potentially not released later on. This is recognisable by sticky entries in the output of the 'show tbf all' command and possibly allocation failures if there are too many of them. This commit changes the code to always start T3193 to make sure, that a timer is always active when the the state is set to GPRS_RLCMAC_WAIT_RELEASE. Note that TS 44.060, 9.3.2.6 requests to release the 'old' TBF immediately in some cases, which is not implemented by this change. This will lead to a longer reservation period of the TFI only, which is safer than reassigning it too early. Sponsored-by: On-Waves ehf --- src/tbf_dl.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 4739a500..01e6add0 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -821,20 +821,16 @@ int gprs_rlcmac_dl_tbf::maybe_start_new_window() set_state(GPRS_RLCMAC_WAIT_RELEASE); + /* start T3193 */ + tbf_timer_start(this, 3193, + bts_data()->t3193_msec / 1000, + (bts_data()->t3193_msec % 1000) * 1000); + /* check for LLC PDU in the LLC Queue */ - if (!have_data()) { - /* no message, start T3193, change state to RELEASE */ - LOGP(DRLCMACDL, LOGL_DEBUG, "- No new message, so we release.\n"); - /* start T3193 */ - tbf_timer_start(this, 3193, - bts_data()->t3193_msec / 1000, - (bts_data()->t3193_msec % 1000) * 1000); - - return 0; - } + if (have_data()) + /* we have more data so we will re-use this tbf */ + reuse_tbf(); - /* we have more data so we will re-use this tbf */ - reuse_tbf(); return 0; } -- cgit v1.2.3