• Arjun Roy's avatar
    net-zerocopy: Copy straggler unaligned data for TCP Rx. zerocopy. · 18fb76ed
    Arjun Roy authored
    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: default avatarArjun Roy <arjunroy@google.com>
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Signed-off-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    18fb76ed
tcp.h 11.4 KB