Change in osmo-pcu[master]: pdch: rcv pkt meas rep: Allocate MS object early in path and use it

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/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Aug 24 07:50:49 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/19707 )

Change subject: pdch: rcv pkt meas rep: Allocate MS object early in path and use it
......................................................................

pdch: rcv pkt meas rep: Allocate MS object early in path and use it

Let's create the MS object early if doesn't exist and fill in the
information, so that we can operate on it in an early way (for instance,
logging macros), this way it's easier to trace the lifecycle of
subscribers.

Change-Id: I3ec7eb970310698dd228ae6ad65ec5ca833bab3f
---
M src/gprs_rlcmac.h
M src/gprs_rlcmac_meas.cpp
M src/pdch.cpp
3 files changed, 15 insertions(+), 13 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h
index 6587c40..3d5ea99 100644
--- a/src/gprs_rlcmac.h
+++ b/src/gprs_rlcmac.h
@@ -75,7 +75,7 @@
 
 int gprs_rlcmac_lost_rep(struct gprs_rlcmac_dl_tbf *tbf);
 
-int gprs_rlcmac_meas_rep(Packet_Measurement_Report_t *pmr);
+int gprs_rlcmac_meas_rep(GprsMs *ms, Packet_Measurement_Report_t *pmr);
 
 int gprs_rlcmac_rssi(struct gprs_rlcmac_tbf *tbf, int8_t rssi);
 
diff --git a/src/gprs_rlcmac_meas.cpp b/src/gprs_rlcmac_meas.cpp
index e4df559..b9a324f 100644
--- a/src/gprs_rlcmac_meas.cpp
+++ b/src/gprs_rlcmac_meas.cpp
@@ -37,14 +37,13 @@
 /* TODO: trigger the measurement report from the pollcontroller and use it for flow control */
 
 /* received Measurement Report */
-int gprs_rlcmac_meas_rep(Packet_Measurement_Report_t *pmr)
+int gprs_rlcmac_meas_rep(GprsMs *ms, Packet_Measurement_Report_t *pmr)
 {
 	NC_Measurement_Report_t *ncr;
 	NC_Measurements_t *nc;
 	int i;
 
-	LOGP(DRLCMACMEAS, LOGL_INFO, "Measurement Report of TLLI=0x%08x:",
-	     pmr->TLLI);
+	LOGPMS(ms, DRLCMACMEAS, LOGL_INFO, "Rx Measurement Report:");
 
 	switch (pmr->UnionType) {
 	case 0:
diff --git a/src/pdch.cpp b/src/pdch.cpp
index fbbeddc..7986373 100644
--- a/src/pdch.cpp
+++ b/src/pdch.cpp
@@ -663,18 +663,21 @@
 
 void gprs_rlcmac_pdch::rcv_measurement_report(Packet_Measurement_Report_t *report, uint32_t fn)
 {
-	struct gprs_rlcmac_sba *sba = bts()->sba()->find(this, fn);
-	if (sba) {
-		GprsMs *ms = bts()->ms_store().get_ms(report->TLLI);
-		if (!ms)
-			LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement "
-				"but TLLI 0x%08x is unknown\n", report->TLLI);
-		else
-			ms->set_ta(sba->ta);
+	struct gprs_rlcmac_sba *sba;
+	GprsMs *ms;
 
+	ms = bts()->ms_by_tlli(report->TLLI);
+	if (!ms) {
+		LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement "
+		     "but TLLI 0x%08x is unknown\n", report->TLLI);
+		ms = bts()->ms_alloc(0, 0);
+		ms->set_tlli(report->TLLI);
+	}
+	if ((sba = bts()->sba()->find(this, fn))) {
+		ms->set_ta(sba->ta);
 		bts()->sba()->free_sba(sba);
 	}
-	gprs_rlcmac_meas_rep(report);
+	gprs_rlcmac_meas_rep(ms, report);
 }
 
 /* Received Uplink RLC control block. */

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I3ec7eb970310698dd228ae6ad65ec5ca833bab3f
Gerrit-Change-Number: 19707
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200824/e3131783/attachment.htm>


More information about the gerrit-log mailing list