[MERGED] osmo-bts[master]: measurement.c: Don't silently copy "FULL" measurements to "SUB"

2018-02-26 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: measurement.c: Don't silently copy "FULL" measurements to "SUB"
..


measurement.c: Don't silently copy "FULL" measurements to "SUB"

The existing code contained an ugly hack that if we didn't have any
"SUB" measurements we would simply use the "FULL" values.  That's wrong
as TS 45.008 contains quite detailed rules on how the "SUB" values are
to be computed.  In some cases, they are identical to "FULL", but in
most they are not.

Let's remove the hack and replace it with an ERROR message, as clearly
something is wrong if we ever encounter a measurement period end in
which no single "SUB" measurement was received.  The only situation in
which this can occur is if the related uplink burst/block was missing,
so let's set BER to 100% and level to lowest possible.

Change-Id: I358f7b97fd4ea19264a77eff7abef13da7d5fbcd
---
M src/common/measurement.c
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/common/measurement.c b/src/common/measurement.c
index 87bd4db..98d9403 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -380,8 +380,11 @@
ber_sub_sum = ber_sub_sum / num_meas_sub;
irssi_sub_sum = irssi_sub_sum / num_meas_sub;
} else {
-   ber_sub_sum = ber_full_sum;
-   irssi_sub_sum = irssi_full_sum;
+   LOGP(DMEAS, LOGL_ERROR, "%s No measurements for SUB!!!\n", 
gsm_lchan_name(lchan));
+   /* The only situation in which this can occur is if the related 
uplink burst/block was
+* missing, so let's set BER to 100% and level to lowest 
possible. */
+   ber_sub_sum = 1; /* 100% */
+   irssi_sub_sum = 120; /* -120 dBm */
}
 
LOGP(DMEAS, LOGL_INFO, "%s Computed TA(% 4dqb) BER-FULL(%2u.%02u%%), 
RSSI-FULL(-%3udBm), "

-- 
To view, visit https://gerrit.osmocom.org/6857
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I358f7b97fd4ea19264a77eff7abef13da7d5fbcd
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-bts[master]: measurement.c: Don't silently copy "FULL" measurements to "SUB"

2018-02-23 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6857
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I358f7b97fd4ea19264a77eff7abef13da7d5fbcd
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


[PATCH] osmo-bts[master]: measurement.c: Don't silently copy "FULL" measurements to "SUB"

2018-02-23 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6857

measurement.c: Don't silently copy "FULL" measurements to "SUB"

The existing code contained an ugly hack that if we didn't have any
"SUB" measurements we would simply use the "FULL" values.  That's wrong
as TS 45.008 contains quite detailed rules on how the "SUB" values are
to be computed.  In some cases, they are identical to "FULL", but in
most they are not.

Let's remove the hack and replace it with an ERROR message, as clearly
something is wrong if we ever encounter a measurement period end in
which no single "SUB" measurement was received.  The only situation in
which this can occur is if the related uplink burst/block was missing,
so let's set BER to 100% and level to lowest possible.

Change-Id: I358f7b97fd4ea19264a77eff7abef13da7d5fbcd
---
M src/common/measurement.c
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/57/6857/1

diff --git a/src/common/measurement.c b/src/common/measurement.c
index 1406fef..85c5515 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -425,8 +425,11 @@
ber_sub_sum = ber_sub_sum / num_meas_sub;
irssi_sub_sum = irssi_sub_sum / num_meas_sub;
} else {
-   ber_sub_sum = ber_full_sum;
-   irssi_sub_sum = irssi_full_sum;
+   LOGP(DMEAS, LOGL_ERROR, "%s No measurements for SUB!!!\n", 
gsm_lchan_name(lchan));
+   /* The only situation in which this can occur is if the related 
uplink burst/block was
+* missing, so let's set BER to 100% and level to lowest 
possible. */
+   ber_sub_sum = 1; /* 100% */
+   irssi_sub_sum = 120; /* -120 dBm */
}
 
LOGP(DMEAS, LOGL_INFO, "%s Computed TA(% 4dqb) BER-FULL(%2u.%02u%%), 
RSSI-FULL(-%3udBm), "

-- 
To view, visit https://gerrit.osmocom.org/6857
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I358f7b97fd4ea19264a77eff7abef13da7d5fbcd
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte