From 807fddc4cd9ecb12ba64e1b7fa26d86b6c2f19b0 Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Wed, 8 May 2013 13:52:27 +0200 Subject: [PATCH] nl: Increase receive buffer size to 4 pages 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 --- lib/nl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nl.c b/lib/nl.c index 0445e35..565747a 100644 --- 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);