Commit
c70a84daebb8141062fef352866cc9ee0364b58e
by Pau Espin Pedrol
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}.
Commit
74643c5fdd3302f42eca6b2995e084d3f0d342f9
by Pau Espin Pedrol
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.
Commit
e02b95a6d98e7e1f7051bf4a6447f590e76eb8fb
by Pau Espin Pedrol
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.