Attention is currently required from: laforge, dexter.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27552 )
Change subject: osmo-bts-trx: rx_tchh_fn(): get rid of chan_state->meas_avg_facch
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
> this is probably the kind of change we want @pmaier to review, but unfortunately he's unavailable th […]
Yes, definitely. We can wait until he's back, not urgent.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27552
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I7902b4709bc3f418174e8373f52e87bb31cdc826
Gerrit-Change-Number: 27552
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 22 Mar 2022 21:34:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: comment
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27558 )
Change subject: trx_sched_ul_burst(): get rid of the 'switch' statement
......................................................................
trx_sched_ul_burst(): get rid of the 'switch' statement
Both TRXC_RACH and TRXC_PTCCH are handled in the rx_rach_fn(),
so we can eliminate the need of having a 'switch' statement in
the general (perfrmance critical) code path.
Change-Id: I66d8785a63215af37a77e258039549e4e6292e49
---
M src/common/scheduler.c
M src/osmo-bts-trx/sched_lchan_rach.c
2 files changed, 7 insertions(+), 10 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
laforge: Looks good to me, but someone else must approve
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index b27d7ea..e6a664f 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -1546,16 +1546,9 @@
/* handle NOPE indications */
if (bi->flags & TRX_BI_F_NOPE_IND) {
- switch (bi->chan) {
- case TRXC_PTCCH:
- case TRXC_RACH:
- /* For some logical channel types NOPE.ind is valueless. */
- return 0;
- default:
- /* NOTE: Uplink burst handler must check bi->burst_len before
- * accessing bi->burst to avoid uninitialized memory access. */
- return func(l1ts, bi);
- }
+ /* NOTE: Uplink burst handler must check bi->burst_len before
+ * accessing bi->burst to avoid uninitialized memory access. */
+ return func(l1ts, bi);
}
/* decrypt */
diff --git a/src/osmo-bts-trx/sched_lchan_rach.c b/src/osmo-bts-trx/sched_lchan_rach.c
index c3abf32..5d9d0b1 100644
--- a/src/osmo-bts-trx/sched_lchan_rach.c
+++ b/src/osmo-bts-trx/sched_lchan_rach.c
@@ -112,6 +112,10 @@
uint8_t ra;
int rc;
+ /* Ignore NOPE indications, they're of no use here */
+ if (bi->flags & TRX_BI_F_NOPE_IND)
+ return 0;
+
/* TSC (Training Sequence Code) is an optional parameter of the UL burst
* indication. We need this information in order to decide whether an
* Access Burst is 11-bit encoded or not (see OS#1854). If this information
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27558
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I66d8785a63215af37a77e258039549e4e6292e49
Gerrit-Change-Number: 27558
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: merged
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27550 )
Change subject: osmo-bts-trx: rx_tchh_fn(): use proper meas averaging mode
......................................................................
osmo-bts-trx: rx_tchh_fn(): use proper meas averaging mode
Compared to TCH/F, TCH/H is a bit special in a way that:
* speech frames are interleaved over 4 consecutive bursts,
* while FACCH frames are interleaved over 6 consecutive bursts.
This is why in rx_tchh_fn() we allocate a buffer large enough to
store up to 6 bursts. Let's say we have that buffer filled up
completely with all 6 bursts (from 'a' to 'f'). Now attempting
to decode them may yield either a speech frame or a FACCH frame:
+---+---+---+---+---+---+
| a | b | c | d | e | f | Burst 'a' received first, 'f' last
+---+---+---+---+---+---+
^^^^^^^^^^^^^^^ Speech frame (bursts 'a' .. 'd')
^^^^^^^^^^^^^^^^^^^^^^^ FACCH frame (bursts 'a' .. 'f')
For FACCH we use measurement averaging mode SCHED_MEAS_AVG_M_S6N6,
so that 6 last samples are averaged - so far so good. For speech
we use SCHED_MEAS_AVG_M_S4N4, so that 4 last samples corresponding
to bursts 'c', 'd', 'e', 'f' are averaged - this is wrong.
We actually need to average the *first* 4 samples corresponding to
bursts 'a', 'b', 'c', 'd' in the case of speech. Let's add and use
a new averaging mode SCHED_MEAS_AVG_M_S6N4 for that.
Change-Id: Iea6f4e5471550f4c2b57aaebeac83c80e879489d
---
M include/osmo-bts/scheduler.h
M src/osmo-bts-trx/sched_lchan_tchh.c
M src/osmo-bts-trx/scheduler_trx.c
3 files changed, 5 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index 8643edd..1e1a2d7 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -306,10 +306,12 @@
/* Averaging mode for trx_sched_meas_avg() */
enum sched_meas_avg_mode {
- /* last 4 bursts (default for xCCH, TCH/H, PTCCH and PDTCH) */
+ /* last 4 bursts (default for xCCH, PTCCH and PDTCH) */
SCHED_MEAS_AVG_M_S4N4,
/* last 8 bursts (default for TCH/F and FACCH/F) */
SCHED_MEAS_AVG_M_S8N8,
+ /* first 4 of last 6 bursts (default for TCH/H) */
+ SCHED_MEAS_AVG_M_S6N4,
/* last 6 bursts (default for FACCH/H) */
SCHED_MEAS_AVG_M_S6N6,
/* first 4 of last 8 bursts */
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index 8264163..edbb566 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -64,7 +64,7 @@
* Even FN ending at: 10,11,19,20,2,3
*/
int fn_is_odd = (((bi->fn + 26 - 10) % 26) >> 2) & 1;
- enum sched_meas_avg_mode meas_avg_mode = SCHED_MEAS_AVG_M_S4N4;
+ enum sched_meas_avg_mode meas_avg_mode = SCHED_MEAS_AVG_M_S6N4;
struct l1sched_meas_set meas_avg;
unsigned int fn_begin;
unsigned int fn_tch_end;
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 78c7b4a..6ce5a9a 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -635,6 +635,7 @@
static const uint8_t trx_sched_meas_modeset[][2] = {
[SCHED_MEAS_AVG_M_S4N4] = { 4, 4 },
[SCHED_MEAS_AVG_M_S8N8] = { 8, 8 },
+ [SCHED_MEAS_AVG_M_S6N4] = { 6, 4 },
[SCHED_MEAS_AVG_M_S6N6] = { 6, 6 },
[SCHED_MEAS_AVG_M_S8N4] = { 8, 4 },
[SCHED_MEAS_AVG_M_S6N2] = { 6, 2 },
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27550
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iea6f4e5471550f4c2b57aaebeac83c80e879489d
Gerrit-Change-Number: 27550
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: merged
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27548 )
Change subject: osmo-bts-trx: use consistent naming for 'enum sched_meas_avg_mode'
......................................................................
osmo-bts-trx: use consistent naming for 'enum sched_meas_avg_mode'
This is a purely cosmetic change. The new naming clearly indicates
how deep to go back in the measurement history (S) and how many
samples to average (N). For example:
* SCHED_MEAS_AVG_M_S4N4 - go S=4 steps back and average N=4 samples;
* SCHED_MEAS_AVG_M_S6N2 - go S=6 steps back and average N=2 samples.
Change-Id: I96a8dd08084c7c179f879fc00e75c5edcfb11caa
---
M include/osmo-bts/scheduler.h
M src/osmo-bts-trx/sched_lchan_pdtch.c
M src/osmo-bts-trx/sched_lchan_tchf.c
M src/osmo-bts-trx/sched_lchan_tchh.c
M src/osmo-bts-trx/sched_lchan_xcch.c
M src/osmo-bts-trx/scheduler_trx.c
6 files changed, 21 insertions(+), 21 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index d640647..8643edd 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -307,17 +307,17 @@
/* Averaging mode for trx_sched_meas_avg() */
enum sched_meas_avg_mode {
/* last 4 bursts (default for xCCH, TCH/H, PTCCH and PDTCH) */
- SCHED_MEAS_AVG_M_QUAD,
+ SCHED_MEAS_AVG_M_S4N4,
/* last 8 bursts (default for TCH/F and FACCH/F) */
- SCHED_MEAS_AVG_M_OCTO,
+ SCHED_MEAS_AVG_M_S8N8,
/* last 6 bursts (default for FACCH/H) */
- SCHED_MEAS_AVG_M_SIX,
+ SCHED_MEAS_AVG_M_S6N6,
/* first 4 of last 8 bursts */
- SCHED_MEAS_AVG_M8_FIRST_QUAD,
+ SCHED_MEAS_AVG_M_S8N4,
/* first 2 of last 6 bursts */
- SCHED_MEAS_AVG_M6_FIRST_TWO,
+ SCHED_MEAS_AVG_M_S6N2,
/* middle 2 of last 6 bursts */
- SCHED_MEAS_AVG_M6_MIDDLE_TWO,
+ SCHED_MEAS_AVG_M_S4N2,
};
void trx_sched_meas_push(struct l1sched_chan_state *chan_state,
diff --git a/src/osmo-bts-trx/sched_lchan_pdtch.c b/src/osmo-bts-trx/sched_lchan_pdtch.c
index 6a2ad0d..92bb5a8 100644
--- a/src/osmo-bts-trx/sched_lchan_pdtch.c
+++ b/src/osmo-bts-trx/sched_lchan_pdtch.c
@@ -101,7 +101,7 @@
return 0;
/* average measurements of the last 4 bursts */
- trx_sched_meas_avg(chan_state, &meas_avg, SCHED_MEAS_AVG_M_QUAD);
+ trx_sched_meas_avg(chan_state, &meas_avg, SCHED_MEAS_AVG_M_S4N4);
/* check for complete set of bursts */
if ((*mask & 0xf) != 0xf) {
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index 1bf67a0..0388ec0 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -55,7 +55,7 @@
uint8_t rsl_cmode = chan_state->rsl_cmode;
uint8_t tch_mode = chan_state->tch_mode;
uint8_t tch_data[128]; /* just to be safe */
- enum sched_meas_avg_mode meas_avg_mode = SCHED_MEAS_AVG_M_OCTO;
+ enum sched_meas_avg_mode meas_avg_mode = SCHED_MEAS_AVG_M_S8N8;
struct l1sched_meas_set meas_avg;
int rc, amr = 0;
int n_errors = 0;
@@ -175,11 +175,11 @@
switch (chan_state->amr_last_dtx) {
case AFS_SID_FIRST:
case AFS_SID_UPDATE_CN:
- meas_avg_mode = SCHED_MEAS_AVG_M8_FIRST_QUAD;
+ meas_avg_mode = SCHED_MEAS_AVG_M_S8N4;
break;
case AFS_SID_UPDATE:
case AFS_ONSET:
- meas_avg_mode = SCHED_MEAS_AVG_M_QUAD;
+ meas_avg_mode = SCHED_MEAS_AVG_M_S4N4;
break;
}
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index 5d2c12c..8264163 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -64,7 +64,7 @@
* Even FN ending at: 10,11,19,20,2,3
*/
int fn_is_odd = (((bi->fn + 26 - 10) % 26) >> 2) & 1;
- enum sched_meas_avg_mode meas_avg_mode = SCHED_MEAS_AVG_M_QUAD;
+ enum sched_meas_avg_mode meas_avg_mode = SCHED_MEAS_AVG_M_S4N4;
struct l1sched_meas_set meas_avg;
unsigned int fn_begin;
unsigned int fn_tch_end;
@@ -214,10 +214,10 @@
case AHS_SID_UPDATE_CN:
case AHS_SID_FIRST_INH:
case AHS_SID_UPDATE_INH:
- meas_avg_mode = SCHED_MEAS_AVG_M6_FIRST_TWO;
+ meas_avg_mode = SCHED_MEAS_AVG_M_S6N2;
break;
case AHS_ONSET:
- meas_avg_mode = SCHED_MEAS_AVG_M6_MIDDLE_TWO;
+ meas_avg_mode = SCHED_MEAS_AVG_M_S4N2;
break;
}
@@ -250,7 +250,7 @@
/* average measurements of the last N (depends on mode) bursts */
if (rc == GSM_MACBLOCK_LEN)
- meas_avg_mode = SCHED_MEAS_AVG_M_SIX;
+ meas_avg_mode = SCHED_MEAS_AVG_M_S6N6;
trx_sched_meas_avg(chan_state, &meas_avg, meas_avg_mode);
/* Check if the frame is bad */
diff --git a/src/osmo-bts-trx/sched_lchan_xcch.c b/src/osmo-bts-trx/sched_lchan_xcch.c
index 6a65574..1d529f2 100644
--- a/src/osmo-bts-trx/sched_lchan_xcch.c
+++ b/src/osmo-bts-trx/sched_lchan_xcch.c
@@ -111,7 +111,7 @@
return 0;
/* average measurements of the last 4 bursts */
- trx_sched_meas_avg(chan_state, &meas_avg, SCHED_MEAS_AVG_M_QUAD);
+ trx_sched_meas_avg(chan_state, &meas_avg, SCHED_MEAS_AVG_M_S4N4);
/* check for complete set of bursts */
if ((*mask & 0xf) != 0xf) {
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 3a6418b..74de902 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -647,27 +647,27 @@
switch (mode) {
/* last 4 bursts (default for xCCH, TCH/H, PTCCH and PDTCH) */
- case SCHED_MEAS_AVG_M_QUAD:
+ case SCHED_MEAS_AVG_M_S4N4:
n = 4; shift = n;
break;
/* last 8 bursts (default for TCH/F and FACCH/F) */
- case SCHED_MEAS_AVG_M_OCTO:
+ case SCHED_MEAS_AVG_M_S8N8:
n = 8; shift = n;
break;
/* last 6 bursts (default for FACCH/H) */
- case SCHED_MEAS_AVG_M_SIX:
+ case SCHED_MEAS_AVG_M_S6N6:
n = 6; shift = n;
break;
/* first 4 of last 8 bursts */
- case SCHED_MEAS_AVG_M8_FIRST_QUAD:
+ case SCHED_MEAS_AVG_M_S8N4:
n = 4; shift = 8;
break;
/* first 2 of last 6 bursts */
- case SCHED_MEAS_AVG_M6_FIRST_TWO:
+ case SCHED_MEAS_AVG_M_S6N2:
n = 2; shift = 6;
break;
/* middle 2 of last 6 bursts */
- case SCHED_MEAS_AVG_M6_MIDDLE_TWO:
+ case SCHED_MEAS_AVG_M_S4N2:
n = 2; shift = 4;
break;
default:
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27548
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I96a8dd08084c7c179f879fc00e75c5edcfb11caa
Gerrit-Change-Number: 27548
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: merged