summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-01-25 15:22:44 +0100
committerThomas Haller <thaller@redhat.com>2016-01-25 15:48:09 +0100
commitf00c472ee8d121b1019263267651cbe5cf35dba8 (patch)
treecc3c7c8555a007878ea6ea48ecca5d054a32f96b
parent45df49ebddd6cbd632d5ad0411bc989da195f6d6 (diff)
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
-rw-r--r--src/platform/nm-linux-platform.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index 8faa7ba8ae..a04c8ece6c 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,