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>
Attention is currently required from: laforge.
dexter has posted comments on this change by laforge. ( https://gerrit.osmocom.org/c/pysim/+/41712?usp=email )
Change subject: pyshark_gsmtap: Adjust display filter for some wireshark versions
......................................................................
Patch Set 1:
(1 comment)
File pySim/apdu_source/pyshark_gsmtap.py:
https://gerrit.osmocom.org/c/pysim/+/41712/comment/d04deefb_8a7a5900?usp=em… :
PS1, Line 87: pyshark_inst = pyshark.FileCapture(pcap_filename, display_filter='gsmtap.type == 4', use_json=True, keep_packets=False)
I have tried to check back why this patch fails the unit-tests. The GSMTAP header in the test trace looks correct. The type is 4. For me the test also fails. Wireshark seems to have problems as well. With gsmtap.type == 4 no packets are shown.
The wireshark on my system is: Version 4.0.17 (Git v4.0.17 packaged as 4.0.17-0+deb12u1),
The pyshark version is 0.6p, li { white-space: pre-wrap; }
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41712?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I53c1c8ed58a82c37cd4be4af3890af21da839e86
Gerrit-Change-Number: 41712
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: dexter <pmaier(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Thu, 18 Dec 2025 15:35:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41713?usp=email )
Change subject: pysim/log: also accept ANSI strings to specify the log message colors
......................................................................
pysim/log: also accept ANSI strings to specify the log message colors
the PySimLogger class currently only accepts cmd2 color enum values.
This is what we need for pySim-shell.py. However, in case we want to
use the PySimLogger in stand-alone programs that do not use cmd2, this
is a bit bulky. Let's add some flexibility to PySimLogger, so that we
can specify the colors as raw ANSI strings as well.
Change-Id: I93543e19649064043ae8323f82ecd8c423d1d921
Related: SYS#7725
---
M pySim/log.py
1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/13/41713/1
diff --git a/pySim/log.py b/pySim/log.py
index 997627f..82ab304 100644
--- a/pySim/log.py
+++ b/pySim/log.py
@@ -108,7 +108,10 @@
formatted_message = logging.Formatter.format(PySimLogger.__formatter, record)
color = PySimLogger.colors.get(record.levelno)
if color:
- PySimLogger.print_callback(style(formatted_message, fg = color))
+ if type(color) is str:
+ PySimLogger.print_callback(color + formatted_message + "\033[0m")
+ else:
+ PySimLogger.print_callback(style(formatted_message, fg = color))
else:
PySimLogger.print_callback(formatted_message)
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41713?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I93543e19649064043ae8323f82ecd8c423d1d921
Gerrit-Change-Number: 41713
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: daniel, fixeria, laforge.
Hello Jenkins Builder, daniel, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/41508?usp=email
to look at the new patch set (#5).
The following approvals got outdated and were removed:
Code-Review-1 by daniel, Code-Review-1 by laforge, Verified+1 by Jenkins Builder
Change subject: card_key_provider: add PostgreSQL support
......................................................................
card_key_provider: add PostgreSQL support
The Card Key Provider currently only has support for CSV files
as input. Unfortunately using CSV files does not scale very well
when the card inventory is very large and continously updated.
In this case a centralized storage in the form of a database
is the more suitable approach.
This patch adds PostgreSQL support next to the existing CSV
file support. It also adds an importer tool to import existing
CSV files into the database.
Change-Id: Icba625c02a60d7e1f519b506a46bda5ded0537d3
Related: SYS#7725
---
M README.md
A contrib/csv-to-pgsql.py
M docs/card-key-provider.rst
M pySim-shell.py
M pySim/card_key_provider.py
M requirements.txt
M setup.py
7 files changed, 576 insertions(+), 10 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/08/41508/5
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41508?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Icba625c02a60d7e1f519b506a46bda5ded0537d3
Gerrit-Change-Number: 41508
Gerrit-PatchSet: 5
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Attention is currently required from: fixeria, laforge.
pespin 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 3:
(1 comment)
Patchset:
PS2:
> and it seems one can set whatever large integer value, the kernel will
always accept it and just truncate it to (twice) the amount set in the
sysctl.
ACK, this seems to be done on purpose in liux sk_setsockopt():
/* Don't error on this BSD doesn't and if you think
* about it this is right. Otherwise apps have to
* play 'guess the biggest size' games. RCVBUF/SNDBUF
* are treated in BSD as hints
*/
--
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: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 18 Dec 2025 15:00:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>