]> git.baikalelectronics.ru Git - kernel.git/commit
net-zerocopy: Copy straggler unaligned data for TCP Rx. zerocopy.
authorArjun Roy <arjunroy@google.com>
Wed, 2 Dec 2020 22:53:42 +0000 (14:53 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 4 Dec 2020 21:40:52 +0000 (13:40 -0800)
commit4da6e99a9cb3e2ea8ab913c65edc3a50d858c030
tree60413d3b1c1889da65b1fe7bf49c123478fa85e9
parentdb2bca503d97ffe0cc7cfed024550d2798b5bdf9
net-zerocopy: Copy straggler unaligned data for TCP Rx. zerocopy.

When TCP receive zerocopy does not successfully map the entire
requested space, it outputs a 'hint' that the caller should recvmsg().

Augment zerocopy to accept a user buffer that it tries to copy this
hint into - if it is possible to copy the entire hint, it will do so.
This elides a recvmsg() call for received traffic that isn't exactly
page-aligned in size.

This was tested with RPC-style traffic of arbitrary sizes. Normally,
each received message required at least one getsockopt() call, and one
recvmsg() call for the remaining unaligned data.

With this change, almost all of the recvmsg() calls are eliminated,
leading to a savings of about 25%-50% in number of system calls
for RPC-style workloads.

Signed-off-by: Arjun Roy <arjunroy@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/uapi/linux/tcp.h
net/ipv4/tcp.c