mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-18 23:19:34 +02:00
docs: netlink: Correct buffer sizing info
Update the docs to match the code (include/linux/netlink.h): /* * skb should fit one page. This choice is good for headerless malloc. * But we should limit to 8K so that userspace does not have to * use enormous buffer sizes on recvmsg() calls just to avoid * MSG_TRUNC when PAGE_SIZE is very large. */ #if PAGE_SIZE < 8192UL #define NLMSG_GOODSIZE SKB_WITH_OVERHEAD(PAGE_SIZE) #else #define NLMSG_GOODSIZE SKB_WITH_OVERHEAD(8192UL) #endif Signed-off-by: Konstantin Shabanov <mail@etehtsea.me> Link: https://patch.msgid.link/20260512103101.1076173-1-mail@etehtsea.me Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
822d4a8e39
commit
55834f0d74
@@ -526,8 +526,8 @@ of the recvmsg() system call, *not* a Netlink header).
|
||||
|
||||
Upon truncation the remaining part of the message is discarded.
|
||||
|
||||
Netlink expects that the user buffer will be at least 8kB or a page
|
||||
size of the CPU architecture, whichever is bigger. Particular Netlink
|
||||
Netlink expects that the user buffer will be at most 8kB or a page
|
||||
size of the CPU architecture, whichever is smaller. Particular Netlink
|
||||
families may, however, require a larger buffer. 32kB buffer is recommended
|
||||
for most efficient handling of dumps (larger buffer fits more dumped
|
||||
objects and therefore fewer recvmsg() calls are needed).
|
||||
|
||||
Reference in New Issue
Block a user