]> git.baikalelectronics.ru Git - kernel.git/commit
netlink: autosize skb lengthes
authorEric Dumazet <edumazet@google.com>
Fri, 7 Mar 2014 20:02:33 +0000 (12:02 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Mar 2014 17:56:26 +0000 (13:56 -0400)
commit5be28810e2021fc63f8d21ecb0eb5eefa635c208
treec63b6774f68574b9197fb083af77029d9d4e52c6
parenta70d9a6ff245ee986981e940c4f8899cbc7c688c
netlink: autosize skb lengthes

One known problem with netlink is the fact that NLMSG_GOODSIZE is
really small on PAGE_SIZE==4096 architectures, and it is difficult
to know in advance what buffer size is used by the application.

This patch adds an automatic learning of the size.

First netlink message will still be limited to ~4K, but if user used
bigger buffers, then following messages will be able to use up to 16KB.

This speedups dump() operations by a large factor and should be safe
for legacy applications.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Thomas Graf <tgraf@suug.ch>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netlink/af_netlink.c
net/netlink/af_netlink.h