From 58916318eff7ca6f480201f24b8e6668740248af Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 11 May 2021 14:40:41 +0200 Subject: [PATCH] ul_tbf: Simplify function rcv_data_block_acknowledged Let's avoid different code paths in the loop based on is_tlli_invalid. Instead, always do the proper storing of the block, and if later on the corner case is found (no TLLI received while in Content Resolution process) when checking tlli related stuff, then simply invalidate the block. Related: OS#1940 Change-Id: I77afaa617d7ce045c0f6d994fc0d8e03fe69de53 --- src/tbf_ul.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 272d8b3c..e92a920f 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -420,7 +420,6 @@ int gprs_rlcmac_ul_tbf::rcv_data_block_acknowledged( int num_chunks; uint8_t *rlc_data; rdbi = &rlc->block_info[block_idx]; - bool need_rlc_data = false; LOGPTBFUL(this, LOGL_DEBUG, "Got %s RLC data block: CV=%d, BSN=%d, SPB=%d, PI=%d, E=%d, TI=%d, bitoffs=%d\n", @@ -435,23 +434,12 @@ int gprs_rlcmac_ul_tbf::rcv_data_block_acknowledged( LOGPTBFUL(this, LOGL_DEBUG, "BSN %d out of window %d..%d (it's normal)\n", rdbi->bsn, m_window.v_q(), m_window.mod_sns(m_window.v_q() + ws - 1)); + continue; } else if (m_window.is_received(rdbi->bsn)) { LOGPTBFUL(this, LOGL_DEBUG, "BSN %d already received\n", rdbi->bsn); - } else { - need_rlc_data = true; - } - - if (!is_tlli_valid()) { - if (!rdbi->ti) { - LOGPTBFUL(this, LOGL_NOTICE, "Missing TLLI within UL DATA.\n"); - continue; - } - need_rlc_data = true; - } - - if (!need_rlc_data) continue; + } /* Store block and meta info to BSN buffer */ @@ -513,6 +501,10 @@ int gprs_rlcmac_ul_tbf::rcv_data_block_acknowledged( m_window.invalidate_bsn(rdbi->bsn); continue; } + } else if (!is_tlli_valid()) { + LOGPTBFUL(this, LOGL_NOTICE, "Missing TLLI within UL DATA.\n"); + m_window.invalidate_bsn(rdbi->bsn); + continue; } m_window.receive_bsn(rdbi->bsn);