Attention is currently required from: pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27720 )
Change subject: scheduler: remove redundant OSMO_ASSERT() statements
......................................................................
Patch Set 1: Code-Review+2
(1 comment)
Patchset:
PS1:
> That's precisely the point of the asserts, to describe and check that "guaranteed" situation, so tha […]
Yes, I agree with the concept in general. But on the other hand we should not put assert()s everywhere to address every possible failure vector. In this context it's hard to imagine why would somebody change bts_model_l1sap_down() to call this function on receipt of a different prim type, given that it's clear from the function name what kind of the input it expects...
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27720
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a01bba7b5eb337ae1552c442d74447565c52e25
Gerrit-Change-Number: 27720
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: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 11 Apr 2022 13:37:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: fixeria.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27722 )
Change subject: osmo-bts-trx: rx_tchh_fn(): use a lookup table for FACCH/H
......................................................................
Patch Set 1:
(1 comment)
File src/osmo-bts-trx/sched_lchan_tchh.c:
https://gerrit.osmocom.org/c/osmo-bts/+/27722/comment/e4415baf_66b40148
PS1, Line 85: int fn_is_odd = (((bi->fn + 26 - 10) % 26) >> 2) & 1;
> I am not a big fan of this kind of functions, sorry. This statement: […]
It may be self explaining to you after having read the specs, I can tell you it's not safe explaining to me, at least without further investigation. Having fn_is_facch() is self explanatory. Just sharing my view here.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27722
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I7c4e3befdd33bef4d89a04a4c7cb1a2d4078c156
Gerrit-Change-Number: 27722
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: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 11 Apr 2022 13:34:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27711 )
Change subject: Make subscr_conn_get_next_id RAN specific
......................................................................
Make subscr_conn_get_next_id RAN specific
Instead of having RAN/CN as parameter, make the function a bit simpler
and only allow RAN. The motivation for this change is, that for MGW a
similar function is required, and it was recommended in code review to
rather duplicate the short function instead of making it more complex.
I'm dropping the CN part here since it wasn't used anyway, and if used
in the future, the function could be duplicated for CN as well.
Related: SYS#5560
Change-Id: I77b0ef33f94c401d24f38eb8d79e1007234e0ab4
---
M include/osmocom/bsc_nat/subscr_conn.h
M src/osmo-bsc-nat/bsc_nat_fsm.c
M src/osmo-bsc-nat/subscr_conn.c
3 files changed, 5 insertions(+), 12 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
diff --git a/include/osmocom/bsc_nat/subscr_conn.h b/include/osmocom/bsc_nat/subscr_conn.h
index 7de3f0f..02a0019 100644
--- a/include/osmocom/bsc_nat/subscr_conn.h
+++ b/include/osmocom/bsc_nat/subscr_conn.h
@@ -36,7 +36,7 @@
} ran;
};
-int subscr_conn_get_next_id(enum bsc_nat_net net);
+int subscr_conn_get_next_id_ran();
struct subscr_conn *subscr_conn_alloc(struct msc *msc, struct bsc *bsc, uint32_t id_cn, uint32_t id_ran);
diff --git a/src/osmo-bsc-nat/bsc_nat_fsm.c b/src/osmo-bsc-nat/bsc_nat_fsm.c
index 22413ef..2a32c9d 100644
--- a/src/osmo-bsc-nat/bsc_nat_fsm.c
+++ b/src/osmo-bsc-nat/bsc_nat_fsm.c
@@ -200,7 +200,7 @@
goto error;
}
- subscr_conn = subscr_conn_alloc(msc, bsc, subscr_conn_get_next_id(BSC_NAT_NET_CN), prim->u.connect.conn_id);
+ subscr_conn = subscr_conn_alloc(msc, bsc, subscr_conn_get_next_id_ran(), prim->u.connect.conn_id);
LOGP(DMAIN, LOGL_DEBUG, "Fwd via %s\n", talloc_get_name(subscr_conn));
diff --git a/src/osmo-bsc-nat/subscr_conn.c b/src/osmo-bsc-nat/subscr_conn.c
index 02afb7d..a94287c 100644
--- a/src/osmo-bsc-nat/subscr_conn.c
+++ b/src/osmo-bsc-nat/subscr_conn.c
@@ -26,15 +26,9 @@
#include <osmocom/bsc_nat/subscr_conn.h>
#include <osmocom/bsc_nat/logging.h>
-/* Get the next available id in either CN or RAN. */
-int subscr_conn_get_next_id(enum bsc_nat_net net)
+int subscr_conn_get_next_id_ran()
{
- uint32_t *id;
-
- if (net == BSC_NAT_NET_RAN)
- id = &g_bsc_nat->ran.subscr_conn_id_next;
- else
- id = &g_bsc_nat->cn.subscr_conn_id_next;
+ uint32_t *id = &g_bsc_nat->ran.subscr_conn_id_next;
for (int i = 0; i < 0xFFFFFF; i++) {
struct subscr_conn *subscr_conn;
@@ -43,8 +37,7 @@
*id = (*id + 1) & 0xffffff;
llist_for_each_entry(subscr_conn, &g_bsc_nat->subscr_conns, list) {
- if ((net == BSC_NAT_NET_RAN && subscr_conn->ran.id == *id)
- || (net == BSC_NAT_NET_CN && subscr_conn->cn.id == *id)) {
+ if (*id == subscr_conn->ran.id) {
already_used = true;
break;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27711
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc-nat
Gerrit-Branch: master
Gerrit-Change-Id: I77b0ef33f94c401d24f38eb8d79e1007234e0ab4
Gerrit-Change-Number: 27711
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27722 )
Change subject: osmo-bts-trx: rx_tchh_fn(): use a lookup table for FACCH/H
......................................................................
Patch Set 1:
(1 comment)
File src/osmo-bts-trx/sched_lchan_tchh.c:
https://gerrit.osmocom.org/c/osmo-bts/+/27722/comment/d3b98858_1e14fdb5
PS1, Line 85: int fn_is_odd = (((bi->fn + 26 - 10) % 26) >> 2) & 1;
> Then having a static inline function fn_is_facch which does "!sched_tchh_ul_facch_map[bi->fn % 26]" […]
I am not a big fan of this kind of functions, sorry. This statement:
sched_tchh_ul_facch_map[bi->fn % 26]
is self-explaining, IMO. The negation is required because gsm0503_tch_hr_decode() involves double-negation: it would try to decode the buffer as FACCH/H if its argument 'odd' is false.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27722
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I7c4e3befdd33bef4d89a04a4c7cb1a2d4078c156
Gerrit-Change-Number: 27722
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: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 11 Apr 2022 13:18:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: fixeria.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27722 )
Change subject: osmo-bts-trx: rx_tchh_fn(): use a lookup table for FACCH/H
......................................................................
Patch Set 1:
(1 comment)
File src/osmo-bts-trx/sched_lchan_tchh.c:
https://gerrit.osmocom.org/c/osmo-bts/+/27722/comment/51ac4a16_9f609060
PS1, Line 85: int fn_is_odd = (((bi->fn + 26 - 10) % 26) >> 2) & 1;
> Yes, this naming looks weird to me too. 'fn_is_facch' would have been a lot cleaner. […]
Then having a static inline function fn_is_facch which does "!sched_tchh_ul_facch_map[bi->fn % 26]" would be helpful to understand better the code imho. I'd welcome it at least.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27722
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I7c4e3befdd33bef4d89a04a4c7cb1a2d4078c156
Gerrit-Change-Number: 27722
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: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 11 Apr 2022 12:55:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment