Attention is currently required from: jolly, laforge.
Hello Jenkins Builder, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/40584?usp=email
to look at the new patch set (#7).
The following approvals got outdated and were removed:
Code-Review+1 by laforge, Verified+1 by Jenkins Builder
Change subject: Avoid reusing pending buffer; append incoming data instead
......................................................................
Avoid reusing pending buffer; append incoming data instead
When reading from a stream, a single read may return only part of a
message segment. In such cases, the partial data was stored in
'iofd->pending' and reused for subsequent reads to complete the message.
With upcoming changes that submit multiple read SQEs to io_uring,
each read uses its own pre-submitted buffer. Reusing 'iofd->pending' for
submitting next read is not possible, as the next read buffer is already
submitted.
Instead, create a new msgb which is used for the read operation and,
once completed, memcopy to the existing pending buffer, allowing message
segments to accumulate until complete.
Change-Id: I08df9736ccc5e9a7df61ca6dcf94629ee010752f
---
M src/core/osmo_io.c
M src/core/osmo_io_internal.h
M src/core/osmo_io_poll.c
M src/core/osmo_io_uring.c
4 files changed, 29 insertions(+), 28 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/84/40584/7
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/40584?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I08df9736ccc5e9a7df61ca6dcf94629ee010752f
Gerrit-Change-Number: 40584
Gerrit-PatchSet: 7
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Attention is currently required from: jolly.
Hello Jenkins Builder, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/40492?usp=email
to look at the new patch set (#9).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: Add multiple messages buffers to io_uring read operations
......................................................................
Add multiple messages buffers to io_uring read operations
Multiple message buffers can be read by receiving a single CQE when
using io_uring. If there is less data available than available buffers,
not all buffers will be filled.
Having more than one buffer is optional and the number can be controlled
via environment variable.
Related: OS#6705
Change-Id: Ic4544b8fcbad5a266db748d6864d3ae93ee06bce
---
M src/core/osmo_io.c
M src/core/osmo_io_uring.c
2 files changed, 59 insertions(+), 24 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/40492/9
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/40492?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ic4544b8fcbad5a266db748d6864d3ae93ee06bce
Gerrit-Change-Number: 40492
Gerrit-PatchSet: 9
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Attention is currently required from: jolly, pespin.
Hello Jenkins Builder, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/40494?usp=email
to look at the new patch set (#10).
The following approvals got outdated and were removed:
Code-Review+1 by pespin, Verified-1 by Jenkins Builder
Change subject: Send multiple read/recvfrom/recvmsg SQEs in advance
......................................................................
Send multiple read/recvfrom/recvmsg SQEs in advance
Multiple read or recvfrom operations can be submitted via SQEs when
using io_uring. This allows reading multiple packet / more data between
calls of osmo_select_main() the main loop.
Having more than one SQE submitted is optional and the number can be
controlled via environment variable.
Related: OS#6705
Change-Id: Id50a8900fa2fe6de553e5025feae7e1e8d501e30
---
M src/core/osmo_io.c
M src/core/osmo_io_internal.h
M src/core/osmo_io_uring.c
3 files changed, 84 insertions(+), 14 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/94/40494/10
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/40494?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id50a8900fa2fe6de553e5025feae7e1e8d501e30
Gerrit-Change-Number: 40494
Gerrit-PatchSet: 10
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Attention is currently required from: jolly, laforge.
Hello Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/40725?usp=email
to look at the new patch set (#6).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: Automatically increase io_uring, if too small.
......................................................................
Automatically increase io_uring, if too small.
The ring may be too small to store all SQEs before the kernel can
handle them. If this happens, a new ring is allocated with twice of the
size of the old ring. The old ring will not be destroyed, as it still
contains uncompleted elements. Some of them may never be completed.
A pointer to the current ring will be stored within the msghdr
structure. It is used when cancelling an SQE. The cancellation must be
performed in the same ring where it was created.
It is quite unlikely that the old ring cannot store the cancellation
SQE. If this happens, the kernel is given some time to handle the SQEs.
The initial size of the ring can be changed via environment variable.
Related: OS#6705
Change-Id: Id9230146acc8d54bfd44834e783c31b37bd64bca
---
M src/core/osmo_io_internal.h
M src/core/osmo_io_uring.c
2 files changed, 70 insertions(+), 23 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/25/40725/6
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/40725?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id9230146acc8d54bfd44834e783c31b37bd64bca
Gerrit-Change-Number: 40725
Gerrit-PatchSet: 6
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-dev/+/40770?usp=email )
Change subject: gen_makefile: support new Osmocom erlang makefiles
......................................................................
gen_makefile: support new Osmocom erlang makefiles
osmo-s1gw has a new install target that creates a complete release
package instead of running escriptize, which means different files will
need to be installed. From now on let's call the "install" target in the
Makefile if it exists.
Other erlang projects that osmo-dev supports:
* osmo-dia2gsup: "make install" works after adjusting it to support
REBAR_BASE_DIR (see patch mentioned below).
* osmo-epdg: doesn't have an "install" target in the Makefile yet, so it
will use the existing logic.
Depends: osmo-s1gw I5681ca103daf1c497218b4513b0ca97b1aae03d3
Depends: osmo-dia2gsup I9511341bced7d658eacb34250569dfbfe37c084c
Change-Id: I92d6fc6eb5a11068d4b3baca55dfb3abdedbbbf1
---
M gen_makefile.py
1 file changed, 18 insertions(+), 5 deletions(-)
Approvals:
fixeria: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/gen_makefile.py b/gen_makefile.py
index a118392..e06dbd2 100755
--- a/gen_makefile.py
+++ b/gen_makefile.py
@@ -340,7 +340,7 @@
else:
assert False, f"unknown buildsystem: {buildsystem}"
-def gen_makefile_install(proj, build_proj):
+def gen_makefile_install(proj, build_proj, src_proj):
no_ldconfig = '#' if args.no_ldconfig else ''
sudo_ldconfig = '' if args.ldconfig_without_sudo else 'sudo '
sudo_make_install = "sudo " if args.sudo_make_install else ""
@@ -364,12 +364,24 @@
touch $@
'''
elif buildsystem == "erlang":
+ # Use the "install" target if it exists, otherwise fall back to installing
+ # files generated by escriptize in default/bin. The fallback method can be
+ # removed once osmo-epdg has an install target.
return f'''
.make.{proj}.install: .make.{proj}.build
@echo "\\n\\n\\n===== $@\\n"
- for i in {build_proj}/default/bin/*; do \\
- install -v -Dm755 "$$i" -t {shlex.quote(args.install_prefix)}/bin/; \\
- done
+ set -ex; \\
+ if grep -q "^install:" {shlex.quote(src_proj)}/Makefile; then \\
+ {sudo_make_install}$(MAKE) \\
+ -C {shlex.quote(src_proj)} \\
+ install \\
+ DESTDIR={shlex.quote(args.install_prefix)} \\
+ REBAR_BASE_DIR="$$PWD"/{shlex.quote(build_proj)}; \\
+ else \\
+ for i in {build_proj}/default/bin/*; do \\
+ install -v -Dm755 "$$i" -t {shlex.quote(args.install_prefix)}/bin/; \\
+ done; \\
+ fi
sync
touch $@
'''
@@ -486,7 +498,8 @@
update_src_copy_cmd)}
{gen_makefile_install(proj,
- build_proj)}
+ build_proj,
+ src_proj)}
{gen_makefile_reinstall(proj,
deps_reinstall,
--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/40770?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: I92d6fc6eb5a11068d4b3baca55dfb3abdedbbbf1
Gerrit-Change-Number: 40770
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40756?usp=email )
Change subject: Makefile: generate and install complete release package
......................................................................
Makefile: generate and install complete release package
Previously, our Debian packages installed osmo-s1gw as an escript
executable - essentially a self-unpacking zip archive containing
*.app and *.beam files, similar to a Java JAR. This was generated
using `rebar3 escriptize` and worked well for some time.
However, at some point we started hitting bugs and limitations with
this approach, prompting a change to packaging osmo-s1gw as a
standard OTP-style BEAM application. This patch resolves those
issues and aligns better with typical Erlang deployment practices.
The default rebar3-generated start script daemonizes (double‑forks)
and wraps erlexec in complex shell logic that does not play well
with systemd (e.g. erl_child_setup failures). Thus we provide a
custom script that calls erlexec directly, avoids double‑forking,
and adds some user-friendly command line options.
The resulting package no longer depends on `erlang-nox` since it
includes the ERTS (Erlang Runtime System). This ensures consistent
behavior across different environments and simplifies deployment.
Change-Id: I5681ca103daf1c497218b4513b0ca97b1aae03d3
Related: SYS#7332
---
M Makefile
A contrib/osmo-s1gw.sh
M contrib/systemd/osmo-s1gw.service
M debian/control
4 files changed, 98 insertions(+), 6 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, approved
diff --git a/Makefile b/Makefile
index 1f37da5..ec8a7d6 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@
EUNIT_ARGS ?=
# directory paths for 'install'
BINDIR ?= /usr/bin
+LIBDIR ?= /usr/lib
CONFDIR ?= /etc/osmocom
SYSTEMDUNITDIR ?= /lib/systemd/system
@@ -32,8 +33,16 @@
analyze: $(GEN_FILES)
rebar3 dialyzer
-install: build
- install -Dm0755 _build/default/bin/osmo-s1gw \
+release: $(GEN_FILES)
+ rebar3 release
+
+run-release: release
+ contrib/osmo-s1gw.sh -r $(REBAR_BASE_DIR)/default/rel/osmo-s1gw -c $(CONFIG)
+
+install: release
+ install -d $(DESTDIR)$(LIBDIR)
+ cp -r $(REBAR_BASE_DIR)/default/rel/osmo-s1gw $(DESTDIR)$(LIBDIR)/
+ install -Dm0755 contrib/osmo-s1gw.sh \
$(DESTDIR)$(BINDIR)/osmo-s1gw
install -Dm0644 config/sys.config \
$(DESTDIR)$(CONFDIR)/osmo-s1gw.config
diff --git a/contrib/osmo-s1gw.sh b/contrib/osmo-s1gw.sh
new file mode 100755
index 0000000..385f981
--- /dev/null
+++ b/contrib/osmo-s1gw.sh
@@ -0,0 +1,83 @@
+#!/bin/sh -e
+
+# Simple boot script for Erlang/OTP releases that can be used in systemd unit files.
+#
+# Copyright 2025 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de>
+# Author: Vadim Yanitskiy <vyanitskiy(a)sysmocom.de>
+#
+# SPDX-License-Identifier: MPL-2.0
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+APP_NAME=osmo-s1gw
+
+ROOTDIR=${ROOTDIR:-"/usr/lib/${APP_NAME}"}
+CONFIG="/etc/osmocom/${APP_NAME}.config"
+COOKIE="${APP_NAME}"
+NODE_NAME="${APP_NAME}@$(uname -n)"
+ERL_SHELL="-noshell -noinput"
+
+# Parse command line options, if any
+while getopts "c:C:n:r:s" opt; do
+ case "$opt" in
+ c)
+ CONFIG="$OPTARG"
+ ;;
+ C)
+ COOKIE="$OPTARG"
+ ;;
+ n)
+ NODE_NAME="$OPTARG"
+ ;;
+ r)
+ ROOTDIR=$(realpath "$OPTARG")
+ ;;
+ s)
+ ERL_SHELL="-shell"
+ ;;
+ *)
+ echo "Usage: $0 [-s] [-r ROOTDIR] [-c CONFIG] [-C COOKIE] [-n NAME@HOST]"
+ exit 1
+ ;;
+ esac
+done
+
+# Make sure that the application's root directory exists
+if [ ! -d "${ROOTDIR}" ]; then
+ echo "Error: ROOTDIR=${ROOTDIR} does not exist"
+ echo "Please specify the root directory using '-r' or via the environment"
+ exit 1
+fi
+
+# Determine the ERTS directory path (if not set)
+if [ -z "${ERTS_DIR}" ]; then
+ # Parse the ERTS version from rebar3-generated bootstrap script
+ ERTS_VSN=$(grep "^ERTS_VSN=" ${ROOTDIR}/bin/${APP_NAME} | cut -d'"' -f2)
+ ERTS_DIR=${ERTS_DIR:-"${ROOTDIR}/erts-${ERTS_VSN}"}
+fi
+
+# Determine the release directory path (if not set)
+if [ -z "${REL_DIR}" ]; then
+ # Parse the release version from rebar3-generated bootstrap script
+ REL_VSN=$(grep "^REL_VSN=" ${ROOTDIR}/bin/${APP_NAME} | cut -d'"' -f2)
+ REL_DIR="${ROOTDIR}/releases/${REL_VSN}"
+fi
+
+# Determine the boot script name
+[ -f "${REL_DIR}/${APP_NAME}.boot" ] && BOOTFILE="${APP_NAME}" || BOOTFILE=start
+
+# erlexec requires BINDIR to be set
+export BINDIR="${ERTS_DIR}/bin"
+
+exec ${BINDIR}/erlexec \
+ +C multi_time_warp \
+ -boot "${REL_DIR}/${BOOTFILE}" \
+ -config "${CONFIG}" \
+ -setcookie "${COOKIE}" \
+ -sname "${NODE_NAME}" \
+ -mode embedded \
+ ${ERL_SHELL}
+
+# vim:set ts=2 sw=2 et:
diff --git a/contrib/systemd/osmo-s1gw.service b/contrib/systemd/osmo-s1gw.service
index a265964..bd52c4d 100644
--- a/contrib/systemd/osmo-s1gw.service
+++ b/contrib/systemd/osmo-s1gw.service
@@ -11,8 +11,7 @@
User=osmocom
Group=osmocom
Environment="HOME=/var/lib/osmo-s1gw"
-Environment="ERL_FLAGS=-config /etc/osmocom/osmo-s1gw.config"
-ExecStart=/usr/bin/osmo-s1gw foreground
+ExecStart=/usr/bin/osmo-s1gw -c /etc/osmocom/osmo-s1gw.config
CapabilityBoundingSet=CAP_NET_ADMIN
AmbientCapabilities=CAP_NET_ADMIN
RestartSec=2
diff --git a/debian/control b/debian/control
index eea7e1c..f5dda19 100644
--- a/debian/control
+++ b/debian/control
@@ -13,8 +13,9 @@
Package: osmo-s1gw
Architecture: any
-Depends: erlang-nox
-Multi-Arch: allowed
+Depends: ${shlibs:Depends},
+ ${misc:Depends}
+Multi-Arch: foreign
Description: Osmocom S1 gateway
This can be used on the S1 interface between eNB and MME/CN, and
acts as separation between the eNB-facing IP network and the
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40756?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I5681ca103daf1c497218b4513b0ca97b1aae03d3
Gerrit-Change-Number: 40756
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria <vyanitskiy(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>
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40757?usp=email )
Change subject: Makefile: 'run' becomes an alias of 'shell'
......................................................................
Makefile: 'run' becomes an alias of 'shell'
Running osmo-s1gw in form of an escript executable is prone to errors.
* Move away from escript and make 'run' an alias of 'shell'.
* Move `rebar3 escriptize` to a dedicated 'escript' recipe.
* Add 'run-escript' recipe in case its ever needed.
Change-Id: I8b34c11cc9361d8b65316401f67a5038544b27ac
Related: SYS#7332
---
M Makefile
1 file changed, 5 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/Makefile b/Makefile
index ec8a7d6..6b9267d 100644
--- a/Makefile
+++ b/Makefile
@@ -19,11 +19,15 @@
build: $(GEN_FILES)
rebar3 compile
+
+escript: $(GEN_FILES)
rebar3 escriptize
-run: build
+run-escript: escript
ERL_FLAGS='-config $(CONFIG)' $(REBAR_BASE_DIR)/default/bin/osmo-s1gw
+run: shell
+
shell: build
rebar3 shell --config $(CONFIG)
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40757?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I8b34c11cc9361d8b65316401f67a5038544b27ac
Gerrit-Change-Number: 40757
Gerrit-PatchSet: 5
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-Reviewer: pespin <pespin(a)sysmocom.de>