• Jakub Kicinski's avatar
    tls: rx: do not use the standard strparser · 84c61fe1
    Jakub Kicinski authored
    TLS is a relatively poor fit for strparser. We pause the input
    every time a message is received, wait for a read which will
    decrypt the message, start the parser, repeat. strparser is
    built to delineate the messages, wrap them in individual skbs
    and let them float off into the stack or a different socket.
    TLS wants the data pages and nothing else. There's no need
    for TLS to keep cloning (and occasionally skb_unclone()'ing)
    the TCP rx queue.
    
    This patch uses a pre-allocated skb and attaches the skbs
    from the TCP rx queue to it as frags. TLS is careful never
    to modify the input skb without CoW'ing / detaching it first.
    
    Since we call TCP rx queue cleanup directly we also get back
    the benefit of skb deferred free.
    
    Overall this results in a 6% gain in my benchmarks.
    Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    84c61fe1
tls.h 13.3 KB