Skip to content
Commit 6231e47b authored by Tahsin Erdogan's avatar Tahsin Erdogan Committed by Jakub Kicinski
Browse files

tun: avoid high-order page allocation for packet header



When gso.hdr_len is zero and a packet is transmitted via write() or
writev(), all payload is treated as header which requires a contiguous
memory allocation. This allocation request is harder to satisfy, and may
even fail if there is enough fragmentation.

Note that sendmsg() code path limits the linear copy length, so this change
makes write()/writev() and sendmsg() paths more consistent.

Signed-off-by: default avatarTahsin Erdogan <trdgn@amazon.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/20230809164753.2247594-1-trdgn@amazon.com
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 5604ac35
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment