]> git.karo-electronics.de Git - karo-tx-linux.git/commit
netlink: allow large data transfers from user-space
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 3 Jun 2013 09:46:28 +0000 (09:46 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Jun 2013 23:26:34 +0000 (16:26 -0700)
commitc05cdb1b864f548c0c3d8ae3b51264e6739a69b1
tree47eea1f60be0c0f7cfe57a0a594e6a606c37eea9
parent1b5acd292336da029535de010af568533df9b665
netlink: allow large data transfers from user-space

I can hit ENOBUFS in the sendmsg() path with a large batch that is
composed of many netlink messages. Here that limit is 8 MBytes of
skbuff data area as kmalloc does not manage to get more than that.

While discussing atomic rule-set for nftables with Patrick McHardy,
we decided to put all rule-set updates that need to be applied
atomically in one single batch to simplify the existing approach.
However, as explained above, the existing netlink code limits us
to a maximum of ~20000 rules that fit in one single batch without
hitting ENOBUFS. iptables does not have such limitation as it is
using vmalloc.

This patch adds netlink_alloc_large_skb() which is only used in
the netlink_sendmsg() path. It uses alloc_skb if the memory
requested is <= one memory page, that should be the common case
for most subsystems, else vmalloc for higher memory allocations.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netlink/af_netlink.c