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 3: 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: 3
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: Thu, 18 Dec 2025 15:50:19 +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/+/41715?usp=email )
Change subject: gsmtap_util: Set source_fd RCVBUF to minimum
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41715?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: If82b3edf11dea1a124035d4eb0e6aa44f4223555
Gerrit-Change-Number: 41715
Gerrit-PatchSet: 1
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: Thu, 18 Dec 2025 15:48:16 +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/+/41714?usp=email )
Change subject: gsmtap_util: Set sink_fd RCVBUF and SNDBUF to minimum
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41714?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: Icfbc24ff679898496666d224d49e1ff06ddffda8
Gerrit-Change-Number: 41714
Gerrit-PatchSet: 1
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: Thu, 18 Dec 2025 15:47:59 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/41715?usp=email )
Change subject: gsmtap_util: Set source_fd RCVBUF to minimum
......................................................................
gsmtap_util: Set source_fd RCVBUF to minimum
We never expect to receive anything on this socket, so set its RCVBUF to
the minimum possible to save some memory.
Change-Id: If82b3edf11dea1a124035d4eb0e6aa44f4223555
---
M src/core/gsmtap_util.c
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/15/41715/1
diff --git a/src/core/gsmtap_util.c b/src/core/gsmtap_util.c
index 3fab7ac..0a920e3 100644
--- a/src/core/gsmtap_util.c
+++ b/src/core/gsmtap_util.c
@@ -501,6 +501,7 @@
{
struct gsmtap_inst *gti;
int fd;
+ int buflen;
fd = gsmtap_source_init_fd2(local_host, local_port, rem_host, rem_port);
if (fd < 0)
@@ -522,6 +523,11 @@
osmo_iofd_set_txqueue_max_length(gti->out, 1024);
}
+ /* We never read from this socket, so tell the kernel
+ * to set the RCVBUF to the minimum possible value */
+ buflen = 0;
+ setsockopt(gti->source_fd, SOL_SOCKET, SO_RCVBUF, &buflen, sizeof(buflen));
+
return gti;
err_cleanup:
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41715?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: If82b3edf11dea1a124035d4eb0e6aa44f4223555
Gerrit-Change-Number: 41715
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/41716?usp=email )
Change subject: gsmtap_util: Increase source_fd's SO_SNDBUF to 4MB
......................................................................
gsmtap_util: Increase source_fd's SO_SNDBUF to 4MB
Using bpftrace we spotted osmo-bts sporadically blocking on send()
of gsmtap_log for 2-4s, most probably due to the UDP send buffer being
full. The wmem_default of ~292KB is indeed a bit tight, and for instance
upstream Linux got its wmem_max to 4MB in april 2025 since it's becoming
more usual that sockets need to increase this value.
Hence, increase the SO_SNDBUF to 4MB to get some extra room and avoid
blocks (or drops if socket is later on set non-blocking) and be able to
accomodate to logging spikes better.
The kernel will take care of lowering the size set to the configured
net.core.wmem_max if needed.
Related: OS#6794
Change-Id: I5033a018dfc748b309600102b8a9ade0df014615
---
M src/core/gsmtap_util.c
1 file changed, 10 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/16/41716/1
diff --git a/src/core/gsmtap_util.c b/src/core/gsmtap_util.c
index 0a920e3..b46f273 100644
--- a/src/core/gsmtap_util.c
+++ b/src/core/gsmtap_util.c
@@ -528,6 +528,16 @@
buflen = 0;
setsockopt(gti->source_fd, SOL_SOCKET, SO_RCVBUF, &buflen, sizeof(buflen));
+ /* The wmem_default of 212992B is too low for heavy bursty gsmtap transmission (eg. tons of DEBUG logging).
+ * A full UDP socket send buffer can cause blocks (or drops if sk is later configured non-blocking),
+ * so let's try to increase it to a safer value of 4MB (newer default net.core.wmem_max in linux kernel since
+ * 2025 a6d4f25888b83b8300aef28d9ee22765c1cc9b34).
+ * The kernel will trim the size set to the configured net.core.wmem_max if lower.
+ * In case you wonder, YES! blocking of 2-4s was seen in osmo-bts gsmtap_log's send() during ttcn3-bts-test execution.
+ */
+ buflen = 4194304; /* 4 << 20 */
+ setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &buflen, sizeof(buflen));
+
return gti;
err_cleanup:
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41716?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: I5033a018dfc748b309600102b8a9ade0df014615
Gerrit-Change-Number: 41716
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/41714?usp=email )
Change subject: gsmtap_util: Set sink_fd RCVBUF and SNDBUF to minimum
......................................................................
gsmtap_util: Set sink_fd RCVBUF and SNDBUF to minimum
We never transmit anything over the socket, nor are interested in
reading from it. We are only interested in having the socket open to
avoid ICMP errors.
Hence, set the buffers to the minimum to save some memory which we won't
ever need/use.
Change-Id: Icfbc24ff679898496666d224d49e1ff06ddffda8
---
M src/core/gsmtap_util.c
1 file changed, 9 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/14/41714/1
diff --git a/src/core/gsmtap_util.c b/src/core/gsmtap_util.c
index b21de74..3fab7ac 100644
--- a/src/core/gsmtap_util.c
+++ b/src/core/gsmtap_util.c
@@ -325,12 +325,18 @@
return rc;
if (osmo_sockaddr_is_local((struct sockaddr *)&ss, ss_len) == 1) {
- rc = osmo_sock_init_sa((struct sockaddr *)&ss, SOCK_DGRAM,
+ int zero = 0;
+ int fd = osmo_sock_init_sa((struct sockaddr *)&ss, SOCK_DGRAM,
IPPROTO_UDP,
OSMO_SOCK_F_BIND |
OSMO_SOCK_F_UDP_REUSEADDR);
- if (rc >= 0)
- return rc;
+ if (fd < 0)
+ return fd;
+ /* We never read nor write from this socket, so tell the kernel
+ * to set the RCVBUF/SNDBUF to the minimum possible value */
+ setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &zero, sizeof(zero));
+ setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &zero, sizeof(zero));
+ return fd;
}
return -ENODEV;
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41714?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: Icfbc24ff679898496666d224d49e1ff06ddffda8
Gerrit-Change-Number: 41714
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>