Change in osmo-pcu[master]: Improve DATA.ind logging

laforge gerrit-no-reply at lists.osmocom.org
Fri Mar 12 07:40:15 UTC 2021


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

Change subject: Improve DATA.ind logging
......................................................................

Improve DATA.ind logging

pdch object is obtained prior in the stack so it is available for
logging.

Change-Id: If51f7bdbd626a44c7b8e182a3460dad49fda6ec3
---
M src/osmo-bts-litecell15/lc15_l1_if.c
M src/osmo-bts-oc2g/oc2g_l1_if.c
M src/osmo-bts-sysmo/sysmo_l1_if.c
M src/pcu_l1_if.cpp
M src/pcu_l1_if.h
5 files changed, 46 insertions(+), 31 deletions(-)

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



diff --git a/src/osmo-bts-litecell15/lc15_l1_if.c b/src/osmo-bts-litecell15/lc15_l1_if.c
index c87edaf..99c82a1 100644
--- a/src/osmo-bts-litecell15/lc15_l1_if.c
+++ b/src/osmo-bts-litecell15/lc15_l1_if.c
@@ -194,11 +194,13 @@
 {
 	int rc = 0;
 	struct gprs_rlcmac_bts *bts;
+	struct gprs_rlcmac_pdch *pdch;
 	struct pcu_l1_meas meas = {0};
 	uint8_t *data;
 	uint8_t data_len;
 
-	DEBUGP(DL1IF, "Rx PH-DATA.ind %s (hL2 %08x): %s\n",
+	DEBUGP(DL1IF, "(trx=%" PRIu8 ",ts=%u) FN=%u Rx PH-DATA.ind %s (hL2 %08x): %s\n",
+		fl1h->trx_no, data_ind->u8Tn, data_ind->u32Fn,
 		get_value_string(lc15bts_l1sapi_names, data_ind->sapi),
 		data_ind->hLayer2,
 		osmo_hexdump(data_ind->msgUnitParam.u8Buffer,
@@ -224,12 +226,14 @@
 			data = NULL;
 			data_len = 0;
 		}
-		pcu_rx_data_ind_pdtch(bts, fl1h->trx_no, data_ind->u8Tn, data,
-				      data_len, data_ind->u32Fn, &meas);
+		pdch = &bts->trx[fl1h->trx_no].pdch[data_ind->u8Tn];
+		pcu_rx_data_ind_pdtch(bts, pdch, data, data_len, data_ind->u32Fn, &meas);
 		break;
 	default:
-		LOGP(DL1IF, LOGL_NOTICE, "Rx PH-DATA.ind for unknown L1 SAPI %s\n",
-			get_value_string(lc15bts_l1sapi_names, data_ind->sapi));
+		LOGP(DL1IF, LOGL_NOTICE,
+		     "(trx=%" PRIu8 ",ts=%u) FN=%u Rx PH-DATA.ind for unknown L1 SAPI %s\n",
+		     fl1h->trx_no, data_ind->u8Tn, data_ind->u32Fn,
+		     get_value_string(lc15bts_l1sapi_names, data_ind->sapi));
 		break;
 	}
 
diff --git a/src/osmo-bts-oc2g/oc2g_l1_if.c b/src/osmo-bts-oc2g/oc2g_l1_if.c
index 5d2ce69..101bd56 100644
--- a/src/osmo-bts-oc2g/oc2g_l1_if.c
+++ b/src/osmo-bts-oc2g/oc2g_l1_if.c
@@ -194,11 +194,13 @@
 {
 	int rc = 0;
 	struct gprs_rlcmac_bts *bts;
+	struct gprs_rlcmac_pdch *pdch;
 	struct pcu_l1_meas meas = {0};
 	uint8_t *data;
 	uint8_t data_len;
 
-	DEBUGP(DL1IF, "Rx PH-DATA.ind %s (hL2 %08x): %s\n",
+	DEBUGP(DL1IF, "(trx=%" PRIu8 ",ts=%u) FN=%u Rx PH-DATA.ind %s (hL2 %08x): %s\n",
+		fl1h->trx_no, data_ind->u8Tn, data_ind->u32Fn,
 		get_value_string(oc2gbts_l1sapi_names, data_ind->sapi),
 		data_ind->hLayer2,
 		osmo_hexdump(data_ind->msgUnitParam.u8Buffer,
@@ -229,12 +231,14 @@
 			data = NULL;
 			data_len = 0;
 		}
-		pcu_rx_data_ind_pdtch(bts, fl1h->trx_no, data_ind->u8Tn, data,
-				      data_len, data_ind->u32Fn, &meas);
+		pdch = &bts->trx[fl1h->trx_no].pdch[data_ind->u8Tn];
+		pcu_rx_data_ind_pdtch(bts, pdch, data, data_len, data_ind->u32Fn, &meas);
 		break;
 	default:
-		LOGP(DL1IF, LOGL_NOTICE, "Rx PH-DATA.ind for unknown L1 SAPI %s\n",
-			get_value_string(oc2gbts_l1sapi_names, data_ind->sapi));
+		LOGP(DL1IF, LOGL_NOTICE,
+		     "(trx=%" PRIu8 ",ts=%u) FN=%u Rx PH-DATA.ind for unknown L1 SAPI %s\n",
+		     fl1h->trx_no, data_ind->u8Tn, data_ind->u32Fn,
+		     get_value_string(oc2gbts_l1sapi_names, data_ind->sapi));
 		break;
 	}
 
diff --git a/src/osmo-bts-sysmo/sysmo_l1_if.c b/src/osmo-bts-sysmo/sysmo_l1_if.c
index 4faccaa..eb869e1 100644
--- a/src/osmo-bts-sysmo/sysmo_l1_if.c
+++ b/src/osmo-bts-sysmo/sysmo_l1_if.c
@@ -176,12 +176,14 @@
 {
 	int rc = 0;
 	struct gprs_rlcmac_bts *bts;
+	struct gprs_rlcmac_pdch *pdch;
 	struct pcu_l1_meas meas = {0};
 	uint8_t *data;
 	uint8_t data_len;
 
 
-	DEBUGP(DL1IF, "Rx PH-DATA.ind %s (hL2 %08x): %s\n",
+	DEBUGP(DL1IF, "(trx=%" PRIu8 ",ts=%u) FN=%u Rx PH-DATA.ind %s (hL2 %08x): %s\n",
+		fl1h->trx_no, data_ind->u8Tn, data_ind->u32Fn,
 		get_value_string(femtobts_l1sapi_names, data_ind->sapi),
 		data_ind->hLayer2,
 		osmo_hexdump(data_ind->msgUnitParam.u8Buffer,
@@ -208,12 +210,14 @@
 			data = NULL;
 			data_len = 0;
 		}
-		pcu_rx_data_ind_pdtch(bts, fl1h->trx_no, data_ind->u8Tn, data,
-				      data_len, data_ind->u32Fn, &meas);
+		pdch = &bts->trx[fl1h->trx_no].pdch[data_ind->u8Tn];
+		pcu_rx_data_ind_pdtch(bts, pdch, data, data_len, data_ind->u32Fn, &meas);
 		break;
 	default:
-		LOGP(DL1IF, LOGL_NOTICE, "Rx PH-DATA.ind for unknown L1 SAPI %s\n",
-			get_value_string(femtobts_l1sapi_names, data_ind->sapi));
+		LOGP(DL1IF, LOGL_NOTICE,
+		     "(trx=%" PRIu8 ",ts=%u) FN=%u Rx PH-DATA.ind for unknown L1 SAPI %s\n",
+		     fl1h->trx_no, data_ind->u8Tn, data_ind->u32Fn,
+		     get_value_string(femtobts_l1sapi_names, data_ind->sapi));
 		rc = -1;
 		break;
 	}
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index a14a4ee..5a5031c 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -281,12 +281,9 @@
 	bts_set_current_block_frame_number(bts, fn, 5);
 }
 
-int pcu_rx_data_ind_pdtch(struct gprs_rlcmac_bts *bts, uint8_t trx_no, uint8_t ts_no, uint8_t *data,
+int pcu_rx_data_ind_pdtch(struct gprs_rlcmac_bts *bts, struct gprs_rlcmac_pdch *pdch, uint8_t *data,
 	uint8_t len, uint32_t fn, struct pcu_l1_meas *meas)
 {
-	struct gprs_rlcmac_pdch *pdch;
-
-	pdch = &bts->trx[trx_no].pdch[ts_no];
 	return pdch->rcv_block(data, len, fn, meas);
 }
 
@@ -366,27 +363,30 @@
 	int rc;
 	int current_fn = bts_current_frame_number(bts);
 	struct pcu_l1_meas meas = {0};
+	struct gprs_rlcmac_pdch *pdch;
 	uint8_t gsmtap_chantype;
 
-	LOGP(DL1IF, LOGL_DEBUG, "Data indication received: sapi=%d arfcn=%d "
-		"fn=%d cur_fn=%d block=%d data=%s\n", data_ind->sapi,
-		data_ind->arfcn, data_ind->fn, current_fn, data_ind->block_nr,
-		osmo_hexdump(data_ind->data, data_ind->len));
+	LOGP(DL1IF, LOGL_DEBUG, "(bts=%" PRIu8 ",trx=%" PRIu8 ",ts=%" PRIu8 ") FN=%u "
+		"Rx DATA.ind: sapi=%d arfcn=%d cur_fn=%d "
+		"block=%d data=%s\n", bts->nr, data_ind->trx_nr, data_ind->ts_nr,
+		data_ind->fn, data_ind->sapi, data_ind->arfcn, current_fn,
+		data_ind->block_nr, osmo_hexdump(data_ind->data, data_ind->len));
 
 	switch (data_ind->sapi) {
 	case PCU_IF_SAPI_PDTCH:
+		pdch = &bts->trx[data_ind->trx_nr].pdch[data_ind->ts_nr];
 		pcu_l1_meas_set_rssi(&meas, data_ind->rssi);
 		/* convert BER to % value */
 		pcu_l1_meas_set_ber(&meas, data_ind->ber10k / 100);
 		pcu_l1_meas_set_bto(&meas, data_ind->ta_offs_qbits);
 		pcu_l1_meas_set_link_qual(&meas, data_ind->lqual_cb / 10);
 
-		LOGP(DL1IF, LOGL_DEBUG, "Data indication with raw measurements received: BER10k = %d, BTO = %d, Q = %d\n",
-		     data_ind->ber10k, data_ind->ta_offs_qbits, data_ind->lqual_cb);
+		LOGPDCH(pdch, DL1IF, LOGL_DEBUG, "FN=%u Rx DATA.ind PDTCH: "
+			"BER10k = %d, BTO = %d, Q = %d\n", data_ind->fn,
+			data_ind->ber10k, data_ind->ta_offs_qbits, data_ind->lqual_cb);
 
-		rc = pcu_rx_data_ind_pdtch(bts, data_ind->trx_nr, data_ind->ts_nr,
-			data_ind->data, data_ind->len, data_ind->fn,
-			&meas);
+		rc = pcu_rx_data_ind_pdtch(bts, pdch, data_ind->data, data_ind->len,
+					   data_ind->fn, &meas);
 		gsmtap_chantype = GSMTAP_CHANNEL_PDTCH;
 		break;
 	case PCU_IF_SAPI_BCCH:
@@ -394,8 +394,9 @@
 		gsmtap_chantype = GSMTAP_CHANNEL_BCCH;
 		break;
 	default:
-		LOGP(DL1IF, LOGL_ERROR, "Received PCU data indication with "
-			"unsupported sapi %d\n", data_ind->sapi);
+		LOGP(DL1IF, LOGL_ERROR, "(bts=%" PRIu8 ",trx=%" PRIu8 ",ts=%" PRIu8 ") "
+		     "FN=%u Rx DATA.ind with unsupported sapi %d\n",
+		     bts->nr, data_ind->trx_nr, data_ind->ts_nr, data_ind->fn, data_ind->sapi);
 		rc = -EINVAL;
 		gsmtap_chantype = GSMTAP_CHANNEL_UNKNOWN;
 	}
diff --git a/src/pcu_l1_if.h b/src/pcu_l1_if.h
index e4a46a9..aff23f5 100644
--- a/src/pcu_l1_if.h
+++ b/src/pcu_l1_if.h
@@ -34,6 +34,8 @@
 }
 #endif
 
+#include "pdch.h"
+
 static inline uint8_t qta2ta(int16_t qta)
 {
 	if (qta < 0)
@@ -171,7 +173,7 @@
 	uint32_t fn, uint8_t block_nr);
 
 int pcu_rx_rach_ind_ptcch(struct gprs_rlcmac_bts *bts, uint8_t trx_nr, uint8_t ts_nr, uint32_t fn, int16_t qta);
-int pcu_rx_data_ind_pdtch(struct gprs_rlcmac_bts *bts, uint8_t trx, uint8_t ts, uint8_t *data,
+int pcu_rx_data_ind_pdtch(struct gprs_rlcmac_bts *bts, struct gprs_rlcmac_pdch *pdch, uint8_t *data,
 	uint8_t len, uint32_t fn, struct pcu_l1_meas *meas);
 
 void pcu_rx_block_time(struct gprs_rlcmac_bts *bts, uint16_t arfcn, uint32_t fn, uint8_t ts_no);

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: If51f7bdbd626a44c7b8e182a3460dad49fda6ec3
Gerrit-Change-Number: 23289
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210312/bd7cb7be/attachment.htm>


More information about the gerrit-log mailing list