From f00c472ee8d121b1019263267651cbe5cf35dba8 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 25 Jan 2016 15:22:44 +0100 Subject: [PATCH] platform: increase netlink socket receive buffer size When the receive buffer is too small, we easily can hit ENOBUFS during recvmsg() and need to resync the platform cache. But even worse, we possibly also loose ACKs for pending netlink requests so that requests seem to fail (although they might have succeeded). Avoid that harder by increasing the buffer size to 8MB. This is also done by networkd: https://github.com/systemd/systemd/commit/be660c371b231c253a97464ddd8f32ec8721da21 --- src/platform/nm-linux-platform.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 8faa7ba8a..a04c8ece6 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -5954,14 +5954,8 @@ constructed (GObject *_object) nle = nl_socket_set_nonblocking (priv->nlh); g_assert (!nle); - /* The default buffer size wasn't enough for the testsuites. It might just - * as well happen with NetworkManager itself. For now let's hope 128KB is - * good enough. - * - * FIXME: it's unclear that this is still actually needed. The testsuite - * certainly doesn't fail for me. Maybe it can be removed. - */ - nle = nl_socket_set_buffer_size (priv->nlh, 131072, 0); + /* use 8 MB for receive socket kernel queue. */ + nle = nl_socket_set_buffer_size (priv->nlh, 8*1024*1024, 0); g_assert (!nle); nle = nl_socket_add_memberships (priv->nlh,