Skip to content

Commit

Permalink
nl: Increase receive buffer size to 4 pages
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tgraf committed May 8, 2013
1 parent 8983fa9 commit 807fddc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/nl.c
Expand Up @@ -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);
Expand Down

0 comments on commit 807fddc

Please sign in to comment.