From be660c371b231c253a97464ddd8f32ec8721da21 Mon Sep 17 00:00:00 2001 From: Alin Rauta Date: Thu, 27 Nov 2014 18:50:48 +0100 Subject: networkd: fix kernel rtnl receive buffer overrun error We got the following error when running systemd on a device with many ports: "rtnl: kernel receive buffer overrun Event source 'rtnl-receive-message' returned error, disabling: No buffer space available" I think the kernel socket receive buffer queue should be increased. The default value is taken from: "/proc/sys/net/core/rmem_default", but we can overwrite it using SO_RCVBUF socket option. This is already done in networkd for other sockets. For example, the bus socket (sd-bus/bus-socket.c) has a receive queue of 8MB. In our case, the default is 208KB. Increasing the buffer receive queue for manager socket to 512KB should be enough to get rid of the above error. [tomegun: bump the limit even higher to 8M] --- src/libsystemd/sd-rtnl/sd-rtnl.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/libsystemd/sd-rtnl') diff --git a/src/libsystemd/sd-rtnl/sd-rtnl.c b/src/libsystemd/sd-rtnl/sd-rtnl.c index 1af38f3667..abb011ea24 100644 --- a/src/libsystemd/sd-rtnl/sd-rtnl.c +++ b/src/libsystemd/sd-rtnl/sd-rtnl.c @@ -140,6 +140,10 @@ int sd_rtnl_open(sd_rtnl **ret, unsigned n_groups, ...) { return 0; } +int sd_rtnl_inc_rcvbuf(const sd_rtnl *const rtnl, const int size) { + return fd_inc_rcvbuf(rtnl->fd, size); +} + sd_rtnl *sd_rtnl_ref(sd_rtnl *rtnl) { assert_return(rtnl, NULL); assert_return(!rtnl_pid_changed(rtnl), NULL); -- cgit v1.2.3-54-g00ecf