Attention is currently required from: pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/30107 )
Change subject: log CC timeouts
......................................................................
Patch Set 1:
(1 comment)
File src/libmsc/gsm_04_08_cc.c:
https://gerrit.osmocom.org/c/osmo-msc/+/30107/comment/f097e6b6_7050c7fe
PS1, Line 401: LOG_TRANS(trans, LOGL_INFO, "Timeout of T%x\n", trans->cc.Tcurrent);
> what? are timers in hexadecimal notation? I don't recall ever seeing that.
it's super weird, but that's how the osmo-nitb legacy code was written.
These greps will explain:
▶ sgrep Tcurrent
include/osmocom/msc/transaction.h:97: int Tcurrent; /* current CC timer */
src/libmsc/gsm_04_08_cc.c:225: LOG_TRANS(trans, LOGL_DEBUG, "stopping pending timer T%x\n", trans->cc.Tcurrent);
src/libmsc/gsm_04_08_cc.c:227: trans->cc.Tcurrent = 0;
src/libmsc/gsm_04_08_cc.c:401: LOG_TRANS(trans, LOGL_INFO, "Timeout of T%x\n", trans->cc.Tcurrent);
src/libmsc/gsm_04_08_cc.c:408: switch(trans->cc.Tcurrent) {
src/libmsc/gsm_04_08_cc.c:462: mo_rel.cause.diag[0] = ((trans->cc.Tcurrent & 0xf00) >> 8) + '0';
src/libmsc/gsm_04_08_cc.c:463: mo_rel.cause.diag[1] = ((trans->cc.Tcurrent & 0x0f0) >> 4) + '0';
src/libmsc/gsm_04_08_cc.c:464: mo_rel.cause.diag[2] = (trans->cc.Tcurrent & 0x00f) + '0';
src/libmsc/gsm_04_08_cc.c:507: trans->cc.Tcurrent = current;
src/libmsc/msc_vty.c:847: trans->cc.Tcurrent,
▶ sgrep gsm48_start_cc_timer
src/libmsc/gsm_04_08_cc.c:501:static void gsm48_start_cc_timer(struct gsm_trans *trans, int current,
src/libmsc/gsm_04_08_cc.c:665: gsm48_start_cc_timer(trans, 0x303, GSM48_T303);
src/libmsc/gsm_04_08_cc.c:712: gsm48_start_cc_timer(trans, 0x310, GSM48_T310);
src/libmsc/gsm_04_08_cc.c:807: gsm48_start_cc_timer(trans, 0x301, GSM48_T301);
src/libmsc/gsm_04_08_cc.c:887: gsm48_start_cc_timer(trans, 0x313, GSM48_T313);
src/libmsc/gsm_04_08_cc.c:1039: gsm48_start_cc_timer(trans, 0x306, GSM48_T306);
src/libmsc/gsm_04_08_cc.c:1138: gsm48_start_cc_timer(trans, 0x308, GSM48_T308);
src/libmsc/gsm_04_08_cc.c:1470: gsm48_start_cc_timer(trans, 0x323, GSM48_T323);
For inter-MSC handover i had to write a separate CC FSM (mncc_call.c).
It would be nice to also replace this old CC code with using that FSM,
we would drop a lot of code that looks weird from today's perspective.
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/30107
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I857b4b15ebf75cf253697e96d358128620923221
Gerrit-Change-Number: 30107
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(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: Tue, 15 Nov 2022 12:50:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/30155 )
Change subject: contrib/jenkins.sh: use enable-werror with IU too
......................................................................
contrib/jenkins.sh: use enable-werror with IU too
Now that the warnings in osmo-iuh have been fixed, we should be able to
build the IU version of OsmoMSC with --enable-werror too.
Related: OS#4462
Change-Id: Id54be9dd1aa66cc27eb5ee4010be9e495865b331
---
M contrib/jenkins.sh
1 file changed, 2 insertions(+), 5 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index e1bbad4..558b6dc 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -39,13 +39,10 @@
osmo-build-dep.sh osmo-mgw
osmo-build-dep.sh osmo-hlr
-enable_werror=""
if [ "x$IU" = "x--enable-iu" ]; then
osmo-build-dep.sh libasn1c
#osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh
osmo-build-dep.sh osmo-iuh
-else
- enable_werror="--enable-werror"
fi
# Additional configure options and depends
@@ -64,12 +61,12 @@
cd "$base"
autoreconf --install --force
-./configure --enable-sanitize $enable_werror --enable-smpp $IU --enable-external-tests $CONFIG
+./configure --enable-sanitize --enable-werror --enable-smpp $IU --enable-external-tests $CONFIG
$MAKE $PARALLEL_MAKE
LD_LIBRARY_PATH="$inst/lib" $MAKE check \
|| cat-testlogs.sh
LD_LIBRARY_PATH="$inst/lib" \
- DISTCHECK_CONFIGURE_FLAGS="$enable_werror --enable-smpp $IU --enable-external-tests $CONFIG" \
+ DISTCHECK_CONFIGURE_FLAGS="--enable-werror --enable-smpp $IU --enable-external-tests $CONFIG" \
$MAKE $PARALLEL_MAKE distcheck \
|| cat-testlogs.sh
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/30155
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Id54be9dd1aa66cc27eb5ee4010be9e495865b331
Gerrit-Change-Number: 30155
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: merged
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30156 )
Change subject: contrib/jenkins.sh: use enable-werror with IU too
......................................................................
contrib/jenkins.sh: use enable-werror with IU too
Now that the warnings in osmo-iuh have been fixed, we should be able to
build the IU version of OsmoSGSN with --enable-werror too.
Related: OS#4462
Change-Id: I8cc4e209e21acfe513bef72927499f1ccdead783
---
M contrib/jenkins.sh
1 file changed, 2 insertions(+), 5 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 2325897..321beef 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -37,14 +37,11 @@
osmo-build-dep.sh osmo-ggsn
osmo-build-dep.sh osmo-hlr
-enable_werror=""
if [ "x$IU" = "x--enable-iu" ]; then
osmo-build-dep.sh libosmo-sccp
osmo-build-dep.sh libasn1c
#osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh
osmo-build-dep.sh osmo-iuh
-else
- enable_werror="--enable-werror"
fi
# Additional configure options and depends
@@ -63,12 +60,12 @@
cd "$base"
autoreconf --install --force
-./configure --enable-sanitize $enable_werror $IU --enable-external-tests $CONFIG
+./configure --enable-sanitize --enable-werror $IU --enable-external-tests $CONFIG
$MAKE $PARALLEL_MAKE
LD_LIBRARY_PATH="$inst/lib" $MAKE check \
|| cat-testlogs.sh
LD_LIBRARY_PATH="$inst/lib" \
- DISTCHECK_CONFIGURE_FLAGS="$enable_werror $IU --enable-external-tests $CONFIG" \
+ DISTCHECK_CONFIGURE_FLAGS="--enable-werror $IU --enable-external-tests $CONFIG" \
$MAKE $PARALLEL_MAKE distcheck \
|| cat-testlogs.sh
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30156
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I8cc4e209e21acfe513bef72927499f1ccdead783
Gerrit-Change-Number: 30156
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: jtavares.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-remsim/+/30154 )
Change subject: bankd, client, server: add -L option to disable log coloring
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
> Please clarify short option preference
I think it's better to be consistent within osmo-remsim-* binaires. So keep -L short opt but use the --disable-color as longopt. thanks.
--
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/30154
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: I6955b0af1ceb11a4029383e32bb298ee8da7503f
Gerrit-Change-Number: 30154
Gerrit-PatchSet: 1
Gerrit-Owner: jtavares <jtavares(a)kvh.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: jtavares <jtavares(a)kvh.com>
Gerrit-Comment-Date: Tue, 15 Nov 2022 12:48:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: jtavares <jtavares(a)kvh.com>
Gerrit-MessageType: comment
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/30158 )
Change subject: osmux: Rotate over available Osmux CID when allocating a new one
......................................................................
osmux: Rotate over available Osmux CID when allocating a new one
Before this patch, the free CID with the smallest number was always
selected to be used. This caused more or less the same subset of CIDs to
be used all the time, while the CIDs with bigger numbers were mostly
unused.
Let's distribute the use so that all CIDs are used roughly the same.
This has the advantage, among others, that the same CID will not be
re-used immediatelly after being freed if a new call is established.
It is useful to leave the CIDs unused for some time since the other end
peer may know of the call being tear down with some delay.
Hence if a new call is established immediately after the CID was
released, the same CID would be allocated and passed at the peer, which
would then detect that the old call (in its view still active) would
already make use of that remote CID.
Related: SYS#6161
Change-Id: I72803fb172accbabfc81923572890f8ecb06cefd
---
M src/common/osmux.c
1 file changed, 27 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/58/30158/1
diff --git a/src/common/osmux.c b/src/common/osmux.c
index 83730ce..ca56234 100644
--- a/src/common/osmux.c
+++ b/src/common/osmux.c
@@ -43,26 +43,45 @@
/* Bitmask containing Allocated Osmux circuit ID. +7 to round up to 8 bit boundary. */
static uint8_t osmux_cid_bitmap[OSMO_BYTES_FOR_BITS(OSMUX_CID_MAX + 1)];
-/*! Find and reserve a free OSMUX cid.
+/*! Find and reserve a free OSMUX cid. Keep state of last allocated CID to
+ * rotate allocated CIDs over time. This helps in letting CIDs unused for some
+ * time after last use.
* \returns OSMUX cid */
static int osmux_get_local_cid(void)
{
- int i, j;
+ static uint8_t next_free_osmux_cid_lookup = 0;
+ uint8_t start_i, start_j;
+ uint8_t i, j, cid;
- for (i = 0; i < sizeof(osmux_cid_bitmap); i++) {
- for (j = 0; j < 8; j++) {
+ start_i = next_free_osmux_cid_lookup >> 3;
+ start_j = next_free_osmux_cid_lookup & 0x07;
+
+ for (i = start_i; i < sizeof(osmux_cid_bitmap); i++) {
+ for (j = start_j; j < 8; j++) {
if (osmux_cid_bitmap[i] & (1 << j))
continue;
+ goto found;
+ }
+ }
- osmux_cid_bitmap[i] |= (1 << j);
- LOGP(DOSMUX, LOGL_DEBUG,
- "Allocating Osmux CID %u from pool\n", (i * 8) + j);
- return (i * 8) + j;
+ for (i = 0; i <= start_i; i++) {
+ for (j = 0; j < start_j; j++) {
+ if (osmux_cid_bitmap[i] & (1 << j))
+ continue;
+ goto found;
}
}
LOGP(DOSMUX, LOGL_ERROR, "All Osmux circuits are in use!\n");
return -1;
+
+found:
+ osmux_cid_bitmap[i] |= (1 << j);
+ cid = (i * 8) + j;
+ next_free_osmux_cid_lookup = (cid + 1) & 0xff;
+ LOGP(DOSMUX, LOGL_DEBUG,
+ "Allocating Osmux CID %u from pool\n", cid);
+ return cid;
}
/*! put back a no longer used OSMUX cid.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/30158
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I72803fb172accbabfc81923572890f8ecb06cefd
Gerrit-Change-Number: 30158
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/30157 )
Change subject: osmux: Rotate over available Osmux CID when allocating a new one
......................................................................
osmux: Rotate over available Osmux CID when allocating a new one
Before this patch, the free CID with the smallest number was always
selected to be used. This caused more or less the same subset of CIDs to
be used all the time, while the CIDs with bigger numbers were mostly
unused.
Let's distribute the use so that all CIDs are used roughly the same.
This has the advantage, among others, that the same CID will not be
re-used immediatelly after being freed if a new call is established.
It is useful to leave the CIDs unused for some time since the other end
peer may know of the call being tear down with some delay.
Hence if a new call is established immediately after the CID was
released, the same CID would be allocated and passed at the peer, which
would then detect that the old call (in its view still active) would
already make use of that remote CID.
Change-Id: I9dfbcc5e4b4c61ce217020e533d68fbcfa6b9f56
Related: SYS#6161
---
M src/libosmo-mgcp/mgcp_osmux.c
M tests/mgcp/mgcp_test.c
2 files changed, 29 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/57/30157/1
diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c
index 5df5446..2b42ebe 100644
--- a/src/libosmo-mgcp/mgcp_osmux.c
+++ b/src/libosmo-mgcp/mgcp_osmux.c
@@ -734,26 +734,45 @@
return used;
}
-/*! take a free OSMUX cid.
+/*! Find and reserve a free OSMUX cid. Keep state of last allocated CID to
+ * rotate allocated CIDs over time. This helps in letting CIDs unused for some
+ * time after last use.
* \returns OSMUX cid */
int osmux_cid_pool_get_next(void)
{
- int i, j;
+ static uint8_t next_free_osmux_cid_lookup = 0;
+ uint8_t start_i, start_j;
+ uint8_t i, j, cid;
- for (i = 0; i < sizeof(osmux_cid_bitmap); i++) {
- for (j = 0; j < 8; j++) {
+ start_i = next_free_osmux_cid_lookup >> 3;
+ start_j = next_free_osmux_cid_lookup & 0x07;
+
+ for (i = start_i; i < sizeof(osmux_cid_bitmap); i++) {
+ for (j = start_j; j < 8; j++) {
if (osmux_cid_bitmap[i] & (1 << j))
continue;
+ goto found;
+ }
+ }
- osmux_cid_bitmap[i] |= (1 << j);
- LOGP(DOSMUX, LOGL_DEBUG,
- "Allocating Osmux CID %u from pool\n", (i * 8) + j);
- return (i * 8) + j;
+ for (i = 0; i <= start_i; i++) {
+ for (j = 0; j < start_j; j++) {
+ if (osmux_cid_bitmap[i] & (1 << j))
+ continue;
+ goto found;
}
}
LOGP(DOSMUX, LOGL_ERROR, "All Osmux circuits are in use!\n");
return -1;
+
+found:
+ osmux_cid_bitmap[i] |= (1 << j);
+ cid = (i * 8) + j;
+ next_free_osmux_cid_lookup = (cid + 1) & 0xff;
+ LOGP(DOSMUX, LOGL_DEBUG,
+ "Allocating Osmux CID %u from pool\n", cid);
+ return cid;
}
/*! take a specific OSMUX cid.
diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index 2d8dfec..4aa655d 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -1632,7 +1632,8 @@
for (i = 0; i < 256; ++i) {
id = osmux_cid_pool_get_next();
- OSMO_ASSERT(id == i);
+ /* We called osmux_cid_pool_get_next() above, so next CID is i+1. */
+ OSMO_ASSERT(id == ((i + 1) & 0xff));
OSMO_ASSERT(osmux_cid_pool_count_used() == i + 1);
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/30157
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I9dfbcc5e4b4c61ce217020e533d68fbcfa6b9f56
Gerrit-Change-Number: 30157
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange