1. 28 Jul, 2022 18 commits
  2. 27 Jul, 2022 17 commits
  3. 26 Jul, 2022 5 commits
    • Jakub Kicinski's avatar
      Merge branch 'tls-rx-decrypt-from-the-tcp-queue' · 48c022d1
      Jakub Kicinski authored
      Jakub Kicinski says:
      
      ====================
      tls: rx: decrypt from the TCP queue
      
      This is the final part of my TLS Rx rework. It switches from
      strparser to decrypting data from skbs queued in TCP. We don't
      need the full strparser for TLS, its needs are very basic.
      This set gives us a small but measurable (6%) performance
      improvement (continuous stream).
      ====================
      
      Link: https://lore.kernel.org/r/20220722235033.2594446-1-kuba@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      48c022d1
    • 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
    • Jakub Kicinski's avatar
      tls: rx: device: add input CoW helper · 8b3c59a7
      Jakub Kicinski authored
      Wrap the remaining skb_cow_data() into a helper, so it's easier
      to replace down the lane. The new version will change the skb
      so make sure relevant pointers get reloaded after the call.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8b3c59a7
    • Jakub Kicinski's avatar
      tcp: allow tls to decrypt directly from the tcp rcv queue · 3f92a64e
      Jakub Kicinski authored
      Expose TCP rx queue accessor and cleanup, so that TLS can
      decrypt directly from the TCP queue. The expectation
      is that the caller can access the skb returned from
      tcp_recv_skb() and up to inq bytes worth of data (some
      of which may be in ->next skbs) and then call
      tcp_read_done() when data has been consumed.
      The socket lock must be held continuously across
      those two operations.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3f92a64e
    • Jakub Kicinski's avatar
      tls: rx: device: keep the zero copy status with offload · d4e5db64
      Jakub Kicinski authored
      The non-zero-copy path assumes a full skb with decrypted contents.
      This means the device offload would have to CoW the data. Try
      to keep the zero-copy status instead, copy the data to user space.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d4e5db64