Attention is currently required from: pespin.
fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmocore/+/41701?usp=email )
Change subject: gsmtap_util: Fix fds not closed in ofd_wq_mode=0
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41701?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I55fd51066d22261cf89fbf9501bec3af743a641d
Gerrit-Change-Number: 41701
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 17 Dec 2025 17:21:57 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmocore/+/41703?usp=email )
Change subject: logging_vty: Set 'gsmtap log nonblocking-io' as default
......................................................................
Patch Set 2: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41703?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ifca8a821e13ec1327ab2476b0db91078fcff948b
Gerrit-Change-Number: 41703
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 17 Dec 2025 17:14:23 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmocore/+/41702?usp=email )
Change subject: logging_vty: Allow setting gsmtap log tgt as (blocking-io|nonblocking-io|wq)
......................................................................
Patch Set 2:
(2 comments)
Patchset:
PS2:
what I don't yet see is any attempt to increase the UDP socket send buffer using SO_SNDBUF. On my debian unstable system the default size (wmem_default) is 212992 while the maximum permitted (if an application bothers to use SO_SNDBUF) is 10485676 almost a five-fold increase.
I guess we should have some libosmocore function that reads wmem_max at program initialization time and caches it in a global variable, and then a user-callable function for "set socket buffer to maximum permitted by the OS". The latter should then be used for any UDP sockets that see a lot of transmit traffic, like TRXD and gsmtap-log.
File src/vty/logging_vty.c:
https://gerrit.osmocom.org/c/libosmocore/+/41702/comment/4dc50a0b_dc325929?… :
PS2, Line 818: "Use non-blocking, synchronous I/O (may lose msgs if UDP sndbuf becomes full)\n"
s/sndbuf/socket transmit buffer/ or s/sndbuf/socket send buffer/ ?
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41702?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id5d31bedd7d265d18f6e475ccbc94ced80598d04
Gerrit-Change-Number: 41702
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 17 Dec 2025 17:13:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmocore/+/41701?usp=email )
Change subject: gsmtap_util: Fix fds not closed in ofd_wq_mode=0
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41701?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I55fd51066d22261cf89fbf9501bec3af743a641d
Gerrit-Change-Number: 41701
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 17 Dec 2025 17:06:54 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/41700?usp=email )
Change subject: gsmtap_util: Get rid of unused wq
......................................................................
gsmtap_util: Get rid of unused wq
struct gsmtap_inst went private in
1584b2ac39292aedddb8abd165957912fe9399c0 and
f38077ee6ab429ef3f0881a8ca7de4877032358a, which were merged prior to
libosmocore release 1.10.0. That release bumped the LIBVERSION major
counter, and hence that struct is officially not available and protected
by LIBVERSION ABI since then.
That means we can safely remove it from the implementation since nobody
compiled against this libversion should be using those fields directly anymore.
Related: OS#6213
Change-Id: I4f1cf168c230471a6d7be4bb065d7105a993349f
---
M src/core/gsmtap_util.c
1 file changed, 8 insertions(+), 23 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
fixeria: Looks good to me, but someone else must approve
daniel: Looks good to me, but someone else must approve
diff --git a/src/core/gsmtap_util.c b/src/core/gsmtap_util.c
index 62d3ffa..d6a9752 100644
--- a/src/core/gsmtap_util.c
+++ b/src/core/gsmtap_util.c
@@ -47,28 +47,14 @@
*
* \file gsmtap_util.c */
-/*! one gsmtap instance
- * Until gsmtap_inst_fd() is removed from the API at some point in the future, we have to keep the first member as
- * 'int' and the second as 'struct osmo_wqueue' (this effectively makes sure that the struct member wq.bfd.fd maintains
- * the same memory offset from the start of the struct) to ensure that inlined static 'instances' of gsmtap_inst_fd() in
- * old binaries keep working the way they used to even with gsmtap_inst objects obtained from newer versions of libosmocore */
+/*! one gsmtap instance */
struct gsmtap_inst {
- int osmo_io_mode; /*!< Indicates whether or not to use Osmo IO mode for message output (thus enabling use of tx queues).
- * This field member may not be changed or moved (backwards compatibility) */
- struct osmo_wqueue wq; /*!< the wait queue. This field member may not be changed or moved (backwards compatibility) */
-
- struct osmo_io_fd *out; /*!< Used when osmo_io_mode is nonzero */
+ int osmo_io_mode; /*!< Indicates whether or not to use Osmo IO mode for message output (thus enabling use of tx queues) */
+ int source_fd; /*!< the gsmtap source FD */
+ struct osmo_io_fd *out; /*!< Used when osmo_io_mode is nonzero */
int sink_fd;
};
-struct _gsmtap_inst_legacy {
- int ofd_wq_mode;
- struct osmo_wqueue wq;
- struct osmo_fd sink_ofd;
-};
-osmo_static_assert(offsetof(struct gsmtap_inst, wq) == offsetof(struct _gsmtap_inst_legacy, wq),
- gsmtap_inst_new_wq_offset_equals_legacy_wq_offset);
-
/*! Deprecated, use gsmtap_inst_fd2() instead
* \param[in] gti GSMTAP instance
* \returns file descriptor of GSMTAP instance */
@@ -82,7 +68,7 @@
* \returns file descriptor of GSMTAP instance */
int gsmtap_inst_fd2(const struct gsmtap_inst *gti)
{
- return gti->wq.bfd.fd;
+ return gti->source_fd;
}
/*! convert RSL channel number to GSMTAP channel type
@@ -485,15 +471,14 @@
gti = talloc_zero(NULL, struct gsmtap_inst);
gti->osmo_io_mode = ofd_wq_mode;
- /* Still using the wq member for its 'fd' field only, since we are keeping it for now, anyways */
- gti->wq.bfd.fd = fd;
+ gti->source_fd = fd;
gti->sink_fd = -1;
if (ofd_wq_mode) {
- gti->out = osmo_iofd_setup(gti, gti->wq.bfd.fd, "gsmtap_inst.io_fd", OSMO_IO_FD_MODE_READ_WRITE, &gsmtap_ops, NULL);
+ gti->out = osmo_iofd_setup(gti, gti->source_fd, "gsmtap_inst.io_fd", OSMO_IO_FD_MODE_READ_WRITE, &gsmtap_ops, NULL);
if (gti->out == NULL)
goto err_cleanup;
- if (osmo_iofd_register(gti->out, gti->wq.bfd.fd) < 0)
+ if (osmo_iofd_register(gti->out, gti->source_fd) < 0)
goto err_cleanup;
/* Use a big enough tx queue to avoid gsmtap messages being dropped: */
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41700?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I4f1cf168c230471a6d7be4bb065d7105a993349f
Gerrit-Change-Number: 41700
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
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>
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/41702?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: logging_vty: Allow setting gsmtap log tgt as (blocking-io|nonblocking-io|wq)
......................................................................
logging_vty: Allow setting gsmtap log tgt as (blocking-io|nonblocking-io|wq)
The current patch adds the possibility to configure it, and leaves the
previous behavior as default: blocking-io.
Related: OS#6213
Change-Id: Id5d31bedd7d265d18f6e475ccbc94ced80598d04
---
M TODO-RELEASE
M include/osmocom/core/gsmtap_util.h
M include/osmocom/core/socket.h
M src/core/gsmtap_util.c
M src/core/libosmocore.map
M src/core/socket.c
M src/vty/logging_vty.c
7 files changed, 87 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/02/41702/2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41702?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: Id5d31bedd7d265d18f6e475ccbc94ced80598d04
Gerrit-Change-Number: 41702
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/41703?usp=email )
Change subject: logging_vty: Set 'gsmtap log nonblocking-io' as default
......................................................................
logging_vty: Set 'gsmtap log nonblocking-io' as default
Apps using a VTY are expected to be using an event loop, and hence
should not be using blocking operations which would stall the event
loop.
If user fears losing messages (eg, when enabling a lot of DEBUG),
then the taget can still be switched to "wq" at the expense of
losing performance, or increasing the kernel UDP socket sndbuf by means
of sysctl net.core.wmem_{default,max}.
Related: OS#6213
Related: OS#6794
Change-Id: Ifca8a821e13ec1327ab2476b0db91078fcff948b
---
M src/vty/logging_vty.c
1 file changed, 7 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/03/41703/1
diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index 1c030b5..77b09d8 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -815,13 +815,13 @@
"log gsmtap [HOSTNAME] [(nonblocking-io|blocking-io|wq)]",
LOG_STR "Logging via GSMTAP\n"
"Host name to send the GSMTAP logging to (UDP port 4729)\n"
- "Use non-blocking, synchronous I/O (may lose msgs if UDP sndbuf becomes full)\n"
- "Use blocking, synchronous I/O (only for debug purposes or when blocking is acceptable) (default)\n"
+ "Use non-blocking, synchronous I/O (may lose msgs if UDP sndbuf becomes full) (default)\n"
+ "Use blocking, synchronous I/O (only for debug purposes or when blocking is acceptable)\n"
"Use Tx workqueue, asynchronous I/O (may lose msgs if queue becomes full)\n")
{
const char *hostname = argc > 0 ? argv[0] : "127.0.0.1";
bool ofd_wq_mode = argc > 1 && (strcmp(argv[1], "wq") == 0);
- bool nonblocking_io = argc > 1 && (strcmp(argv[1], "nonblocking-io") == 0);
+ bool blocking_io = argc > 1 && (strcmp(argv[1], "blocking-io") == 0);
struct log_target *tgt;
log_tgt_mutex_lock();
@@ -835,7 +835,7 @@
hostname, VTY_NEWLINE);
RET_WITH_UNLOCK(CMD_WARNING);
}
- if (!ofd_wq_mode && nonblocking_io) {
+ if (!ofd_wq_mode && !blocking_io) {
int rc = gsmtap_source_set_nonblock(tgt->tgt_gsmtap.gsmtap_inst, 1);
if (rc != 0)
vty_out(vty, "%% Unable to configre GSMTAP log for %s as nonblocking-io%s",
@@ -850,7 +850,7 @@
}
if (!ofd_wq_mode) {
int fd = gsmtap_inst_fd2(tgt->tgt_gsmtap.gsmtap_inst);
- if (fd > 0 && osmo_sock_get_nonblock(fd) != nonblocking_io) {
+ if (fd > 0 && !osmo_sock_get_nonblock(fd) != blocking_io) {
vty_out(vty, "%% Remove and re-add the log gsmtap target in order to "
"change between blocking and non-blocking IO%s", VTY_NEWLINE);
RET_WITH_UNLOCK(CMD_WARNING);
@@ -1071,8 +1071,8 @@
pars = " wq";
} else {
int fd = gsmtap_inst_fd2(tgt->tgt_gsmtap.gsmtap_inst);
- if (fd > 0 && osmo_sock_get_nonblock(fd))
- pars = " nonblocking-io";
+ if (fd > 0 && !osmo_sock_get_nonblock(fd))
+ pars = " blocking-io";
else
pars = "";
}
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41703?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ifca8a821e13ec1327ab2476b0db91078fcff948b
Gerrit-Change-Number: 41703
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>