1. 28 Jul, 2022 14 commits
  2. 27 Jul, 2022 17 commits
  3. 26 Jul, 2022 9 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
    • Jakub Kicinski's avatar
      tls: rx: don't free the output in case of zero-copy · b93f5700
      Jakub Kicinski authored
      In the future we'll want to reuse the input skb in case of
      zero-copy so we shouldn't always free darg.skb. Move the
      freeing of darg.skb into the non-zc cases. All cases will
      now free ctx->recv_pkt (inside let tls_rx_rec_done()).
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b93f5700
    • Jakub Kicinski's avatar
      tls: rx: factor SW handling out of tls_rx_one_record() · dd47ed36
      Jakub Kicinski authored
      After recent changes the SW side of tls_rx_one_record() can
      be nicely encapsulated in its own function. Move the pad handling
      as well. This will be useful for ->zc handling in tls_decrypt_device().
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      dd47ed36
    • Jakub Kicinski's avatar
      tls: rx: wrap recv_pkt accesses in helpers · b92a13d4
      Jakub Kicinski authored
      To allow for the logic to change later wrap accesses
      which interrogate the input skb in helper functions.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b92a13d4
    • Jakub Kicinski's avatar
      Merge branch 'implement-dev-info-and-dev-flash-for-line-cards' · 4fd310c7
      Jakub Kicinski authored
      Jiri Pirko says:
      
      ====================
      Implement dev info and dev flash for line cards
      
      This patchset implements two features:
      1) "devlink dev info" is exposed for line card (patches 6-9)
      2) "devlink dev flash" is implemented for line card gearbox
         flashing (patch 10)
      
      For every line card, "a nested" auxiliary device is created which
      allows to bind the features mentioned above (patch 4).
      
      The relationship between line card and its auxiliary dev devlink
      is carried over extra line card netlink attribute (patches 3 and 5).
      
      The first patch removes devlink_mutex from devlink_register/unregister()
      which eliminates possible deadlock during devlink reload command. The
      second patchset follows up with putting net pointer check into new
      helper.
      
      Examples:
      
      $ devlink lc show pci/0000:01:00.0 lc 1
      pci/0000:01:00.0:
        lc 1 state active type 16x100G nested_devlink auxiliary/mlxsw_core.lc.0
          supported_types:
             16x100G
      
      $ devlink dev show auxiliary/mlxsw_core.lc.0
      auxiliary/mlxsw_core.lc.0
      
      $ devlink dev info auxiliary/mlxsw_core.lc.0
      auxiliary/mlxsw_core.lc.0:
        versions:
            fixed:
              hw.revision 0
              fw.psid MT_0000000749
            running:
              ini.version 4
              fw 19.2010.1312
      
      $ devlink dev flash auxiliary/mlxsw_core.lc.0 file mellanox/fw-AGB-rel-19_2010_1312-022-EVB.mfa2
      ====================
      
      Link: https://lore.kernel.org/r/20220725082925.366455-1-jiri@resnulli.usSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4fd310c7