laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/41208?usp=email )
Change subject: osmo_trau_frame_encode(): fix encoding of 16k O&M frames
......................................................................
osmo_trau_frame_encode(): fix encoding of 16k O&M frames
The behavior of osmo_trau_frame_encode() for OSMO_TRAU16_FT_OAM
has the same unfortunate (but now officially documented) design
quirk as all other 16k frame types: bits C1..C5 are set internally
by the encoding function and not from caller-supplied fr->c_bits[].
However, there was also a bug: bits C6..C15, which are taken from
fr->c_bits[] for all frame types, were copied from the wrong part
of this fr->c_bits[] array. Fix the latter bug.
Change-Id: Ia366d5b0385b764c492bbed9a030ca27db71fcff
---
M src/trau/trau_frame.c
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
diff --git a/src/trau/trau_frame.c b/src/trau/trau_frame.c
index 652c703..ad7a102 100644
--- a/src/trau/trau_frame.c
+++ b/src/trau/trau_frame.c
@@ -397,7 +397,7 @@
/* C1 .. C5 */
memcpy(trau_bits + 17, cbits5, 5);
/* C6 .. C15 */
- memcpy(trau_bits + 17 + 5, fr->c_bits, 15 - 5);
+ memcpy(trau_bits + 17 + 5, fr->c_bits + 5, 15 - 5);
/* D1 .. D255 */
for (i = 32, d_idx = 0; i < 304; i += 16, d_idx += 15) {
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/41208?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Ia366d5b0385b764c492bbed9a030ca27db71fcff
Gerrit-Change-Number: 41208
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
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>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/41209?usp=email )
Change subject: osmo_trau_frame_encode(): reduce space requirement in common case
......................................................................
osmo_trau_frame_encode(): reduce space requirement in common case
Since its introduction in 2020, osmo_trau_frame_encode() API has had
the ability to emit TRAU-DL frames that are either lengthened or
shortened for timing adjustment, like real TRAUs do. However, this
capability was never exercised in OsmoMGW-E1, nor is it used in the
new tw-e1abis-mgw: given the constraint of having to submit 160-byte
blocks to the E1 stack every 20 ms, it is not really feasible for
our current sw-only implementation to achieve the same 125 us timing
optimizations that are possible and desirable in a hardware or FPGA
implementation.
Since all current users of osmo_trau_frame_encode() API call it with
fr->dl_ta_usec set to 0, the doubled output space requirement imposed
by the function becomes an unnecessary burden and an API design bug
in need of fixing. Solution: check fr->dir and fr->dl_ta_usec to see
if frame output lengthening is actually possible for each given
invocation of this function, and require doubled output space only
in those cases.
Change-Id: I9f3541b0618ebef26e53b69041e5b74abefd3b85
---
M src/trau/trau_frame.c
1 file changed, 14 insertions(+), 11 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
diff --git a/src/trau/trau_frame.c b/src/trau/trau_frame.c
index ad7a102..d0cf3d1 100644
--- a/src/trau/trau_frame.c
+++ b/src/trau/trau_frame.c
@@ -1268,6 +1268,8 @@
*/
int osmo_trau_frame_encode(ubit_t *bits, size_t n_bits, const struct osmo_trau_frame *fr)
{
+ size_t space_req;
+
/* check for sufficient space provided by caller in output buffer */
switch (fr->type) {
case OSMO_TRAU16_FT_FR:
@@ -1276,35 +1278,37 @@
case OSMO_TRAU16_FT_AMR:
case OSMO_TRAU16_FT_IDLE:
/* timing alignment may happen: increased space requirement */
- if (n_bits < 2 * 40 * 8 - 1)
- return -ENOSPC;
+ if (fr->dir == OSMO_TRAU_DIR_DL && fr->dl_ta_usec > 0)
+ space_req = 2 * 40 * 8 - 1;
+ else
+ space_req = 1 * 40 * 8;
break;
case OSMO_TRAU16_FT_OAM:
case OSMO_TRAU16_FT_DATA_HR:
case OSMO_TRAU16_FT_DATA:
case OSMO_TRAU16_FT_D145_SYNC:
case OSMO_TRAU16_FT_EDATA:
- if (n_bits < 1 * 40 * 8)
- return -ENOSPC;
+ space_req = 1 * 40 * 8;
break;
case OSMO_TRAU8_SPEECH:
case OSMO_TRAU8_AMR_LOW:
case OSMO_TRAU8_AMR_6k7:
case OSMO_TRAU8_AMR_7k4:
/* timing alignment may happen: increased space requirement */
- if (n_bits < 2 * 20 * 8 - 1)
- return -ENOSPC;
+ if (fr->dir == OSMO_TRAU_DIR_DL && fr->dl_ta_usec > 0)
+ space_req = 2 * 20 * 8 - 1;
+ else
+ space_req = 1 * 20 * 8;
break;
case OSMO_TRAU8_DATA:
case OSMO_TRAU8_OAM:
- if (n_bits < 1 * 20 * 8)
- return -ENOSPC;
- break;
- case OSMO_TRAU_FT_NONE:
+ space_req = 1 * 20 * 8;
break;
default:
return -EINVAL;
}
+ if (n_bits < space_req)
+ return -ENOSPC;
switch (fr->type) {
case OSMO_TRAU16_FT_FR:
@@ -1338,7 +1342,6 @@
return encode8_amr_67(bits, fr);
case OSMO_TRAU8_AMR_7k4:
return encode8_amr_74(bits, fr);
- case OSMO_TRAU_FT_NONE:
default:
return -EINVAL;
}
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/41209?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I9f3541b0618ebef26e53b69041e5b74abefd3b85
Gerrit-Change-Number: 41209
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
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>
Attention is currently required from: keith, pespin.
fixeria has posted comments on this change by keith. ( https://gerrit.osmocom.org/c/osmo-msc/+/28340?usp=email )
Change subject: sqlite optimisation: Avoid unneeded database operation
......................................................................
Patch Set 5:
(2 comments)
File src/libmsc/db.c:
https://gerrit.osmocom.org/c/osmo-msc/+/28340/comment/80b7de71_ed68cf76?usp… :
PS4, Line 302: id = $id LIMIT 1
> I consider it standard practice to add a LIMIT 1 to a query that is only intended to ever delete max […]
Not sure if this really a standard practice, given that not all database bacnends support the `LIMIT` statement in `DELETE FROM` queries. I am not strictly against this as it does not hurt, but it looks redundant to me. The uniqueness of `id` (primary key) must be guaranteed by the database engine, so either you have exactly one record matching your query or none.
https://gerrit.osmocom.org/c/osmo-msc/+/28340/comment/d55a8767_86c83c79?usp… :
PS4, Line 303: DB_STMT_SMS_DEL_EXPIRED
I believe this was already brought up here by other reviewers: we now have two identical queries in the array. One of them should be removed to avoid duplication (can be done in a separate patch).
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28340?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I777155c0f818b979c636bb59953719e472771603
Gerrit-Change-Number: 28340
Gerrit-PatchSet: 5
Gerrit-Owner: keith <keith(a)rhizomatica.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: keith <keith(a)rhizomatica.org>
Gerrit-Comment-Date: Mon, 13 Oct 2025 07:44:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: keith <keith(a)rhizomatica.org>
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41215?usp=email )
Change subject: testenv: add --install-package
......................................................................
testenv: add --install-package
Add an option to quickly install packages in the container. This is
useful when making a new SUT run with osmo-ttcn3-hacks and figuring out
which packages need to be installed to make the build pass (without
rebuilding the whole container for each missing dependency). It can also
be used to quickly install additional debugging tools (strace, valgrind,
etc.). A cache for the deb files is already getting mounted inside the
container.
Change-Id: Ie54817e6c0334a224a612521beb378537c10d39d
---
M _testenv/testenv/__init__.py
M _testenv/testenv/podman.py
2 files changed, 14 insertions(+), 0 deletions(-)
Approvals:
fixeria: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/_testenv/testenv/__init__.py b/_testenv/testenv/__init__.py
index 44259c2..8a3b728 100644
--- a/_testenv/testenv/__init__.py
+++ b/_testenv/testenv/__init__.py
@@ -210,6 +210,14 @@
action="store_true",
help="run an interactive shell before stopping daemons/container",
)
+ group.add_argument(
+ "-I",
+ "--install-package",
+ dest="install_packages",
+ action="append",
+ metavar="PACKAGE",
+ help="temporarily install a debian package in the container",
+ )
group = sub_run.add_argument_group("output options")
group.add_argument(
@@ -272,6 +280,9 @@
if args.kernel == "debian" and not args.podman:
raise NoTraceException("--kernel-debian requires --podman")
+ if args.install_packages and not args.podman:
+ raise NoTraceException("--install-packages requires --podman")
+
if args.kernel == "custom" and not os.path.exists(custom_kernel_path):
logging.critical(
"See _testenv/README.md for more information on downloading a pre-built kernel or building your own kernel."
diff --git a/_testenv/testenv/podman.py b/_testenv/testenv/podman.py
index 678a0c1..2013699 100644
--- a/_testenv/testenv/podman.py
+++ b/_testenv/testenv/podman.py
@@ -285,6 +285,9 @@
if not os.path.exists(pkgcache):
exec_cmd(["apt-get", "-q", "update"])
+ if testenv.args.install_packages:
+ exec_cmd(["apt-get", "install", "-y", "--no-install-recommends"] + testenv.args.install_packages)
+
def check_titan_version():
version, _ = testenv.testenv_cfg.get_titan_version_first_cfg()
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41215?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ie54817e6c0334a224a612521beb378537c10d39d
Gerrit-Change-Number: 41215
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>