]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: avoid partial copy for zc
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 12 Jul 2022 20:52:25 +0000 (21:52 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 19 Jul 2022 02:58:03 +0000 (19:58 -0700)
commit25073b673291a7bef36f701664c120544a2aae67
treeebc67f292b3513e9ca1cfac0599daccf59cb01af
parent0c8b98e40f9d61a6792a879de085b19667a1f51b
ipv4: avoid partial copy for zc

Even when zerocopy transmission is requested and possible,
__ip_append_data() will still copy a small chunk of data just because it
allocated some extra linear space (e.g. 148 bytes). It wastes CPU cycles
on copy and iter manipulations and also misalignes potentially aligned
data. Avoid such copies. And as a bonus we can allocate smaller skb.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/ip_output.c