Change in osmo-pcu[master]: tbf: Drop unneeded method set_tlli_from_ul

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Fri Jun 26 12:35:47 UTC 2020


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/19023 )


Change subject: tbf: Drop unneeded method set_tlli_from_ul
......................................................................

tbf: Drop unneeded method set_tlli_from_ul

Since commit 322456ed474a733094c9f3e240295b469023ad14 (and previous
one), it is expected that a tbf object ALWAYS has a MS object referend
to it, even if it's a temporary copy which will later be merged when
TLLI/IMSI is retrieved and it is found that several MS objects relate to
the same MS.

The purpose of set_tlli_from_ul was mainly to update TBF's ms() to
old_ms before going through usual tbf->update_ms() path. That's not
really needed since ms() is already always set and TBFs for old_ms are
already freed in update_ms() and children function.

Change-Id: Ie8795e7a02032336e53febb65c11f9150c36d2a0
---
M src/tbf.cpp
M src/tbf.h
M src/tbf_dl.cpp
M src/tbf_ul.cpp
M tests/tbf/TbfTest.err
5 files changed, 2 insertions(+), 52 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/23/19023/1

diff --git a/src/tbf.cpp b/src/tbf.cpp
index 0cc0129..f77b1e2 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -392,9 +392,6 @@
 
 void gprs_rlcmac_tbf::update_ms(uint32_t tlli, enum gprs_rlcmac_tbf_direction dir)
 {
-	if (!ms())
-		return;
-
 	if (!tlli)
 		return;
 
@@ -1439,49 +1436,6 @@
 	return 0;
 }
 
-int gprs_rlcmac_tbf::set_tlli_from_ul(uint32_t new_tlli)
-{
-	struct gprs_rlcmac_tbf *dl_tbf = NULL;
-	struct gprs_rlcmac_tbf *ul_tbf = NULL;
-	GprsMs *old_ms;
-
-	OSMO_ASSERT(direction == GPRS_RLCMAC_UL_TBF);
-
-	old_ms = bts->ms_by_tlli(new_tlli);
-	/* Keep the old MS object for the update_ms() */
-	GprsMs::Guard guard(old_ms);
-	if (old_ms) {
-		/* Get them before calling set_ms() */
-		dl_tbf = old_ms->dl_tbf();
-		ul_tbf = old_ms->ul_tbf();
-
-		if (!ms())
-			set_ms(old_ms);
-	}
-
-	if (dl_tbf && dl_tbf->ms() != ms()) {
-		LOGPTBFUL(dl_tbf, LOGL_NOTICE,
-			  "Got RACH from TLLI=0x%08x while TBF still exists: killing pending DL TBF\n", new_tlli);
-		tbf_free(dl_tbf);
-		dl_tbf = NULL;
-	}
-	if (ul_tbf && ul_tbf->ms() != ms()) {
-		LOGPTBFUL(ul_tbf, LOGL_NOTICE,
-			  "Got RACH from TLLI=0x%08x while TBF still exists: killing pending UL TBF\n", new_tlli);
-		tbf_free(ul_tbf);
-		ul_tbf = NULL;
-	}
-
-	/* The TLLI has been taken from an UL message */
-	update_ms(new_tlli, GPRS_RLCMAC_UL_TBF);
-
-#if 0 /* REMOVEME ??? */
-	if (ms()->need_dl_tbf())
-		establish_dl_tbf_on_pacch();
-#endif
-	return 1;
-}
-
 const char *tbf_name(gprs_rlcmac_tbf *tbf)
 {
 	return tbf ? tbf->name() : "(no TBF)";
diff --git a/src/tbf.h b/src/tbf.h
index be3336a..528bee3 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -319,7 +319,6 @@
 protected:
 	gprs_rlcmac_bts *bts_data() const;
 	void enable_egprs();
-	int set_tlli_from_ul(uint32_t new_tlli);
 	void merge_and_clear_ms(GprsMs *old_ms);
 
 	gprs_llc_queue *llc_queue();
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 03149ba..02aaa3a 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -151,8 +151,6 @@
 	ul_tbf = ms->ul_tbf();
 	ta = ms->ta();
 
-	/* TODO: if (!ms) create MS before tbf_alloc is called? */
-
 	if (ul_tbf && ul_tbf->m_contention_resolution_done
 	 && !ul_tbf->m_final_ack_sent) {
 		use_trx = ul_tbf->trx->trx_no;
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp
index 3115080..489fc87 100644
--- a/src/tbf_ul.cpp
+++ b/src/tbf_ul.cpp
@@ -305,7 +305,7 @@
 				LOGPTBFUL(this, LOGL_INFO,
 					  "Decoded premier TLLI=0x%08x of UL DATA TFI=%d.\n",
 					  new_tlli, rlc->tfi);
-				set_tlli_from_ul(new_tlli);
+				update_ms(new_tlli, GPRS_RLCMAC_UL_TBF);
 			} else if (new_tlli && new_tlli != tlli()) {
 				LOGPTBFUL(this, LOGL_NOTICE,
 					  "TLLI mismatch on UL DATA TFI=%d. (Ignoring due to contention resolution)\n",
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index 827f5ce..0d097ee 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -2079,7 +2079,6 @@
 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) BSN 0 storing in window (0..63)
 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) data_length=20, data=f1 22 33 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) Decoded premier TLLI=0xf1223344 of UL DATA TFI=0.
-TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) Got RACH from TLLI=0xf1223344 while TBF still exists: killing pending DL TBF
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) changes state from ASSIGN to RELEASING
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=RELEASING) free
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=RELEASING) stopping timer T0 [freeing TBF]
@@ -2089,8 +2088,8 @@
 Modifying MS object, TLLI = 0x00000000, IMSI '' -> '0011223344'
 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
 Clearing MS object, TLLI: 0xf1223344, IMSI: '0011223344'
-Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed
 Destroying MS object, TLLI = 0x00000000
+Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed
 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Assembling frames: (len=20)
 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Frame 1 starts at offset 4, length=16, is_complete=1
 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) complete UL frame len=16

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/19023
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Ie8795e7a02032336e53febb65c11f9150c36d2a0
Gerrit-Change-Number: 19023
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200626/d8704f7d/attachment.htm>


More information about the gerrit-log mailing list