udp6: don't make extra copies of iflow
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 27 Jan 2022 00:36:29 +0000 (00:36 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 28 Jan 2022 03:46:11 +0000 (19:46 -0800)
commit5298953e742dc9211d3b724fb5394da8a1f3ed04
tree94c45d64fd12ef2e4e08b913518733906aa8fcc8
parentf37a4cc6bb0ba08c2d9fd7d18a1da87161cbb7f9
udp6: don't make extra copies of iflow

udpv6_sendmsg() first initialises an on-stack 88B struct flowi6 and then
copies it into cork, which is expensive. Avoid the copy in corkless case
by initialising on-stack cork->fl directly.

The main part is a couple of lines under !corkreq check. The rest
converts fl6 variable to be a pointer.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv6/udp.c