]> granicus.if.org Git - libnl/commitdiff
nl: Increase receive buffer size to 4 pages
authorThomas Graf <tgraf@suug.ch>
Wed, 8 May 2013 11:52:27 +0000 (13:52 +0200)
committerThomas Graf <tgraf@suug.ch>
Wed, 8 May 2013 11:52:27 +0000 (13:52 +0200)
Assuming that the kernel does not send more than a page is no longer valid,
and enabling MSG_PEEK'ing by default to figure out the exact message buffer
requirements can have a negative influence on the performance of existing
applications. Bumping the default receive buffer space to 4 pages seems
a sane default.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
lib/nl.c

index 0445e35d5b86912710665771d5d447db2316e1f3..565747a32bad45f59e4626608fa5d12764ec27d4 100644 (file)
--- a/lib/nl.c
+++ b/lib/nl.c
@@ -597,7 +597,7 @@ int nl_recv(struct nl_sock *sk, struct sockaddr_nl *nla,
                flags |= MSG_PEEK | MSG_TRUNC;
 
        if (page_size == 0)
-               page_size = getpagesize();
+               page_size = getpagesize() * 4;
 
        iov.iov_len = sk->s_bufsize ? : page_size;
        iov.iov_base = malloc(iov.iov_len);