Change in osmo-pcu[master]: pdch.cpp: Fix wrong annoying log line about non-scheduled ResourceReq...

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
Wed Jul 8 16:47:58 UTC 2020


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


Change subject: pdch.cpp: Fix wrong annoying log line about non-scheduled ResourceReq received
......................................................................

pdch.cpp: Fix wrong annoying log line about non-scheduled ResourceReq received

It's perfectly fine receiving a Resource Request message under some
circumstances (as stated in the comment added in the commit).

To print issues only under non-expected circumstances, the function
rcv_resource_request need to be refactored:
* Destroying older UL_TBF is delayed because it is needed further
  down.
* When the old UL_TBF is FINISHED, it's an acceptable time to receive a
  Resource request, so we check if that's the case and don't print a
  warning in that case.

Change-Id: I4b4367126d6a16055cd2f45afc4a6b9c15a7c980
---
M src/pdch.cpp
M tests/tbf/TbfTest.err
2 files changed, 22 insertions(+), 21 deletions(-)



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

diff --git a/src/pdch.cpp b/src/pdch.cpp
index 3436e5b..cee92dc 100644
--- a/src/pdch.cpp
+++ b/src/pdch.cpp
@@ -550,42 +550,35 @@
 	if (request->ID.UnionType) {
 		struct gprs_rlcmac_ul_tbf *ul_tbf;
 		uint32_t tlli = request->ID.u.TLLI;
-		bool found = true;
+		bool ms_found = true;
 
 		GprsMs *ms = bts()->ms_by_tlli(tlli);
 		if (!ms) {
-			found = false;
+			ms_found = false;
 			ms = bts()->ms_alloc(0, 0); /* ms class updated later */
 		}
+		ul_tbf = ms->ul_tbf(); /* hence ul_tbf may be NULL */
 
 		/* Keep the ms, even if it gets idle temporarily */
 		GprsMs::Guard guard(ms);
 
-		if (found) {
-			ul_tbf = ms->ul_tbf();
-			/* We got a RACH so the MS was in packet idle mode and thus
-			 * didn't have any active TBFs */
-			if (ul_tbf) {
-				LOGPTBFUL(ul_tbf, LOGL_NOTICE,
-					  "Got RACH from TLLI=0x%08x while TBF still exists. Killing pending UL TBF\n",
-					  tlli);
-				tbf_free(ul_tbf);
-			}
-		}
-
 		LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF "
 			"in packet resource request of single "
 			"block, so we provide one:\n");
 		sba = bts()->sba()->find(this, fn);
-		if (!sba) {
-			LOGP(DRLCMAC, LOGL_NOTICE, "MS requests UL TBF "
-				"in packet resource request of single "
-				"block, but there is no resource request "
-				"scheduled!\n");
-		} else {
+		if (sba) {
 			ms->set_ta(sba->ta);
 			bts()->sba()->free_sba(sba);
+		} else if (!ul_tbf || !ul_tbf->state_is(GPRS_RLCMAC_FINISHED)) {
+			LOGPTBFUL(ul_tbf, LOGL_NOTICE,
+				  "MS requests UL TBF in PACKET RESOURCE REQ of "
+				  "single block, but there is no resource request "
+				  "scheduled!\n");
 		}
+		/* else: Resource Request can be received even if not scheduled
+		   by the network since it's used by MS to re-establish a new UL
+		   TBF when last one has finished. */
+
 		if (request->Exist_MS_Radio_Access_capability2) {
 			uint8_t ms_class, egprs_ms_class;
 			ms_class = Decoding::get_ms_class_by_capability(&request->MS_Radio_Access_capability2);
@@ -596,6 +589,14 @@
 				ms->set_egprs_ms_class(egprs_ms_class);
 		}
 
+		/* Get rid of previous finished UL TBF before providing a new one */
+		if (ms_found && ul_tbf) {
+			if (!ul_tbf->state_is(GPRS_RLCMAC_FINISHED))
+				LOGPTBFUL(ul_tbf, LOGL_NOTICE,
+					  "Got PACKET RESOURCE REQ while TBF not finished, killing pending UL TBF\n");
+			tbf_free(ul_tbf);
+		}
+
 		ul_tbf = tbf_alloc_ul(bts_data(), ms, trx_no(), tlli);
 		if (!ul_tbf) {
 			handle_tbf_reject(bts_data(), ms, tlli,
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index 800d4f8..29c8eb3 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -7902,7 +7902,7 @@
 ------------------------- RX : Uplink Control Block -------------------------
 Creating MS object, TLLI = 0x00000000
 MS requests UL TBF in packet resource request of single block, so we provide one:
-MS requests UL TBF in packet resource request of single block, but there is no resource request scheduled!
+(no TBF) MS requests UL TBF in PACKET RESOURCE REQ of single block, but there is no resource request scheduled!
 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11
 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11
 ********** UL-TBF starts here **********

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I4b4367126d6a16055cd2f45afc4a6b9c15a7c980
Gerrit-Change-Number: 19196
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/20200708/86be7e5d/attachment.htm>


More information about the gerrit-log mailing list