]> 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)
commit4ab1e4730a833a5e9a4d9c820b71707e79fb9bd1
tree60413d3b1c1889da65b1fe7bf49c123478fa85e9
parentdf4a4f34d58e2a73f5161687c665929746a808a7
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