Change in osmo-bts[master]: power_control: properly track the first initial state

2021-01-11 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/22051 )

Change subject: power_control: properly track the first initial state
..

power_control: properly track the first initial state

Change-Id: I16e7474b5affbd90855a2e407b305e9dec581dfa
Related: SYS#4918, SYS#4917
---
M include/osmo-bts/gsm_data.h
M src/common/power_control.c
2 files changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index 253b115..8071a28 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -215,6 +215,8 @@

 /* Measurement pre-processing state */
 struct gsm_power_ctrl_meas_proc_state {
+   /* Number of measurements processed */
+   unsigned int meas_num;
/* Algorithm specific data */
union {
struct {
diff --git a/src/common/power_control.c b/src/common/power_control.c
index 0629630..5e2e85e 100644
--- a/src/common/power_control.c
+++ b/src/common/power_control.c
@@ -78,7 +78,7 @@
int *Avg100 = >ewma.Avg100;

/* We don't have 'Avg[n - 1]' if this is the first run */
-   if (*Avg100 == 0) {
+   if (mps->meas_num++ == 0) {
*Avg100 = Val * EWMA_SCALE_FACTOR;
return Val;
}

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I16e7474b5affbd90855a2e407b305e9dec581dfa
Gerrit-Change-Number: 22051
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-bts[master]: power_control: properly track the first initial state

2021-01-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/22051 )

Change subject: power_control: properly track the first initial state
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I16e7474b5affbd90855a2e407b305e9dec581dfa
Gerrit-Change-Number: 22051
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 11 Jan 2021 13:55:56 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: power_control: properly track the first initial state

2021-01-08 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/22051 )

Change subject: power_control: properly track the first initial state
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bts/+/22051/1/src/common/power_control.c
File src/common/power_control.c:

https://gerrit.osmocom.org/c/osmo-bts/+/22051/1/src/common/power_control.c@81
PS1, Line 81:   if (mps->meas_num++ == 0) {
> a boolean would be better, otherwise you are applying wrong value when it 
> overflows (not critical th […]
For other pre-processing methods (like unweighted average) it makes more sense 
to have a counter, so you know how many measurements you have in the buffer.



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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I16e7474b5affbd90855a2e407b305e9dec581dfa
Gerrit-Change-Number: 22051
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Fri, 08 Jan 2021 15:57:57 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in osmo-bts[master]: power_control: properly track the first initial state

2021-01-08 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/22051 )

Change subject: power_control: properly track the first initial state
..


Patch Set 1: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/c/osmo-bts/+/22051/1/src/common/power_control.c
File src/common/power_control.c:

https://gerrit.osmocom.org/c/osmo-bts/+/22051/1/src/common/power_control.c@81
PS1, Line 81:   if (mps->meas_num++ == 0) {
a boolean would be better, otherwise you are applying wrong value when it 
overflows (not critical though since it would take a long time, but still it's 
easy to fix as mentioned).



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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I16e7474b5affbd90855a2e407b305e9dec581dfa
Gerrit-Change-Number: 22051
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Fri, 08 Jan 2021 13:31:53 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: power_control: properly track the first initial state

2021-01-07 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/22051 )


Change subject: power_control: properly track the first initial state
..

power_control: properly track the first initial state

Change-Id: I16e7474b5affbd90855a2e407b305e9dec581dfa
Related: SYS#4918, SYS#4917
---
M include/osmo-bts/gsm_data.h
M src/common/power_control.c
2 files changed, 3 insertions(+), 1 deletion(-)



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

diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index 253b115..8071a28 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -215,6 +215,8 @@

 /* Measurement pre-processing state */
 struct gsm_power_ctrl_meas_proc_state {
+   /* Number of measurements processed */
+   unsigned int meas_num;
/* Algorithm specific data */
union {
struct {
diff --git a/src/common/power_control.c b/src/common/power_control.c
index 0629630..5e2e85e 100644
--- a/src/common/power_control.c
+++ b/src/common/power_control.c
@@ -78,7 +78,7 @@
int *Avg100 = >ewma.Avg100;

/* We don't have 'Avg[n - 1]' if this is the first run */
-   if (*Avg100 == 0) {
+   if (mps->meas_num++ == 0) {
*Avg100 = Val * EWMA_SCALE_FACTOR;
return Val;
}

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I16e7474b5affbd90855a2e407b305e9dec581dfa
Gerrit-Change-Number: 22051
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange