1. 14 1月, 2020 3 次提交
  2. 23 10月, 2019 1 次提交
  3. 25 4月, 2019 2 次提交
  4. 02 4月, 2019 2 次提交
  5. 21 12月, 2018 1 次提交
  6. 19 12月, 2018 1 次提交
  7. 23 11月, 2018 2 次提交
  8. 21 9月, 2018 1 次提交
    • J
      RDMA/ucontext: Add a core API for mmaping driver IO memory · 5f9794dc
      Jason Gunthorpe 提交于
      To support disassociation and PCI hot unplug, we have to track all the
      VMAs that refer to the device IO memory. When disassociation occurs the
      VMAs have to be revised to point to the zero page, not the IO memory, to
      allow the physical HW to be unplugged.
      
      The three drivers supporting this implemented three different versions
      of this algorithm, all leaving something to be desired. This new common
      implementation has a few differences from the driver versions:
      
      - Track all VMAs, including splitting/truncating/etc. Tie the lifetime of
        the private data allocation to the lifetime of the vma. This avoids any
        tricks with setting vm_ops which Linus didn't like. (see link)
      - Support multiple mms, and support properly tracking mmaps triggered by
        processes other than the one first opening the uverbs fd. This makes
        fork behavior of disassociation enabled drivers the same as fork support
        in normal drivers.
      - Don't use crazy get_task stuff.
      - Simplify the approach for to racing between vm_ops close and
        disassociation, fixing the related bugs most of the driver
        implementations had. Since we are in core code the tracking list can be
        placed in struct ib_uverbs_ufile, which has a lifetime strictly longer
        than any VMAs created by mmap on the uverbs FD.
      
      Link: https://www.spinics.net/lists/stable/msg248747.html
      Link: https://lkml.kernel.org/r/CA+55aFxJTV_g46AQPoPXen-UPiqR1HGMZictt7VpC-SMFbm3Cw@mail.gmail.comSigned-off-by: NJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      5f9794dc
  9. 20 9月, 2018 1 次提交
  10. 11 9月, 2018 1 次提交
  11. 06 9月, 2018 2 次提交
  12. 13 8月, 2018 1 次提交
  13. 11 8月, 2018 1 次提交
    • J
      IB/uverbs: Build the specs into a radix tree at runtime · 9ed3e5f4
      Jason Gunthorpe 提交于
      This radix tree datastructure is intended to replace the 'hash' structure
      used today for parsing ioctl methods during system calls. This first
      commit introduces the structure and builds it from the existing .rodata
      descriptions.
      
      The so-called hash arrangement is actually a 5 level open coded radix tree.
      This new version uses a 3 level radix tree built using the radix tree
      library.
      
      Overall this is much less code and much easier to build as the radix tree
      API allows for dynamic modification during the building. There is a small
      memory penalty to pay for this, but since the radix tree is allocated on
      a per device basis, a few kb of RAM seems immaterial considering the
      gained simplicity.
      
      The radix tree is similar to the existing tree, but also has a 'attr_bkey'
      concept, which is a small value'd index for each method attribute. This is
      used to simplify and improve performance of everything in the next
      patches.
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      Reviewed-by: NLeon Romanovsky <leonro@mellanox.com>
      Reviewed-by: NMichael J. Ruhl <michael.j.ruhl@intel.com>
      9ed3e5f4
  14. 02 8月, 2018 2 次提交
    • J
      IB/uverbs: Do not block disassociate during write() · a9b66d64
      Jason Gunthorpe 提交于
      Now that all the callbacks are safe to run concurrently with
      disassociation this test can be eliminated. The ufile core infrastructure
      becomes entirely self contained and is not sensitive to disassociation.
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      a9b66d64
    • J
      IB/uverbs: Do not pass struct ib_device to the write based methods · bbd51e88
      Jason Gunthorpe 提交于
      This is a step to get rid of the global check for disassociation. In this
      model, the ib_dev is not proven to be valid by the core code and cannot be
      provided to the method. Instead, every method decides if it is able to
      run after disassociation and obtains the ib_dev using one of three
      different approaches:
      
      - Call srcu_dereference on the udevice's ib_dev. As before, this means
        the method cannot be called after disassociation begins.
        (eg alloc ucontext)
      - Retrieve the ib_dev from the ucontext, via ib_uverbs_get_ucontext()
      - Retrieve the ib_dev from the uobject->object after checking
        under SRCU if disassociation has started (eg uobj_get)
      
      Largely, the code is all ready for this, the main work is to provide a
      ib_dev after calling uobj_alloc(). The few other places simply use
      ib_uverbs_get_ucontext() to get the ib_dev.
      
      This flexibility will let the next patches allow destroy to operate
      after disassociation.
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      bbd51e88
  15. 26 7月, 2018 3 次提交
    • J
      IB/uverbs: Fix locking around struct ib_uverbs_file ucontext · 22fa27fb
      Jason Gunthorpe 提交于
      We have a parallel unlocked reader and writer with ib_uverbs_get_context()
      vs everything else, and nothing guarantees this works properly.
      
      Audit and fix all of the places that access ucontext to use one of the
      following locking schemes:
      - Call ib_uverbs_get_ucontext() under SRCU and check for failure
      - Access the ucontext through an struct ib_uobject context member
        while holding a READ or WRITE lock on the uobject.
        This value cannot be NULL and has no race.
      - Hold the ucontext_lock and check for ufile->ucontext !NULL
      
      This also re-implements ib_uverbs_get_ucontext() in a way that is safe
      against concurrent ib_uverbs_get_context() and disassociation.
      
      As a side effect, every access to ucontext in the commands is via
      ib_uverbs_get_context() with an error check, or via the uobject, so there
      is no longer any need for the core code to check ucontext on every command
      call. These checks are also removed.
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      22fa27fb
    • J
      IB/uverbs: Rework the locking for cleaning up the ucontext · e951747a
      Jason Gunthorpe 提交于
      The locking here has always been a bit crazy and spread out, upon some
      careful analysis we can simplify things.
      
      Create a single function uverbs_destroy_ufile_hw() that internally handles
      all locking. This pulls together pieces of this process that were
      sprinkled all over the places into one place, and covers them with one
      lock.
      
      This eliminates several duplicate/confusing locks and makes the control
      flow in ib_uverbs_close() and ib_uverbs_free_hw_resources() extremely
      simple.
      
      Unfortunately we have to keep an extra mutex, ucontext_lock.  This lock is
      logically part of the rwsem and provides the 'down write, fail if write
      locked, wait if read locked' semantic we require.
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      e951747a
    • J
      IB/uverbs: Revise and clarify the rwsem and uobjects_lock · 87064277
      Jason Gunthorpe 提交于
      Rename 'cleanup_rwsem' to 'hw_destroy_rwsem' which is held across any call
      to the type destroy function (aka 'hw' destroy). The main purpose of this
      lock is to prevent normal add and destroy from running concurrently with
      uverbs_cleanup_ufile()
      
      Since the uobjects list is always manipulated under the 'hw_destroy_rwsem'
      we can eliminate the uobjects_lock in the cleanup function. This allows
      converting that lock to a very simple spinlock with a narrow critical
      section.
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      87064277
  16. 11 7月, 2018 1 次提交
  17. 10 7月, 2018 3 次提交
  18. 05 7月, 2018 1 次提交
  19. 30 6月, 2018 1 次提交
    • Y
      IB: Improve uverbs_cleanup_ucontext algorithm · 1c77483e
      Yishai Hadas 提交于
      Improve uverbs_cleanup_ucontext algorithm to work properly when the
      topology graph of the objects cannot be determined at compile time.  This
      is the case with objects created via the devx interface in mlx5.
      
      Typically uverbs objects must be created in a strict topologically sorted
      order, so that LIFO ordering will generally cause them to be freed
      properly. There are only a few cases (eg memory windows) where objects can
      point to things out of the strict LIFO order.
      
      Instead of using an explicit ordering scheme where the HW destroy is not
      allowed to fail, go over the list multiple times and allow the destroy
      function to fail. If progress halts then a final, desperate, cleanup is
      done before leaking the memory. This indicates a driver bug.
      Signed-off-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      1c77483e
  20. 02 6月, 2018 2 次提交
  21. 06 4月, 2018 1 次提交
  22. 05 4月, 2018 4 次提交
    • M
      IB/uverbs: Introduce ESP steering match filter · 56ab0b38
      Matan Barak 提交于
      Adding a new ESP steering match filter that could match against
      spi and seq used in IPSec protocol.
      Reviewed-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      56ab0b38
    • M
      IB/uverbs: Add action_handle flow steering specification · 9b828441
      Matan Barak 提交于
      Binding a flow_action to flow steering rule requires using a new
      specification. Therefore, adding such an IB_FLOW_SPEC_ACTION_HANDLE flow
      specification.
      
      Flow steering rules could use flow_action(s) and as of that we need to
      avoid deleting flow_action(s) as long as they're being used.
      Moreover, when the attached rules are deleted, action_handle reference
      count should be decremented. Introducing a new mechanism of flow
      resources to keep track on the attached action_handle(s). Later on, this
      mechanism should be extended to other attached flow steering resources
      like flow counters.
      Reviewed-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      9b828441
    • M
      IB/uverbs: Add flow_action create and destroy verbs · 2eb9beae
      Matan Barak 提交于
      A verbs application may receive and transmits packets using a data
      path pipeline. Sometimes, the first stage in the receive pipeline or
      the last stage in the transmit pipeline involves transforming a
      packet, either in order to make it easier for later stages to process
      it or to prepare it for transmission over the wire. Such transformation
      could be stripping/encapsulating the packet (i.e. vxlan),
      decrypting/encrypting it (i.e. ipsec), altering headers, doing some
      complex FPGA changes, etc.
      
      Some hardware could do such transformations without software data path
      intervention at all. The flow steering API supports steering a
      packet (either to a QP or dropping it) and some simple packet
      immutable actions (i.e. tagging a packet). Complex actions, that may
      change the packet, could bloat the flow steering API extensively.
      Sometimes the same action should be applied to several flows.
      In this case, it's easier to bind several flows to the same action and
      modify it than change all matching flows.
      
      Introducing a new flow_action object that abstracts any packet
      transformation (out of a standard and well defined set of actions).
      This flow_action object could be tied to a flow steering rule via a
      new specification.
      
      Currently, we support esp flow_action, which encrypts or decrypts a
      packet according to the given parameters. However, we present a
      flexible schema that could be used to other transformation actions tied
      to flow rules.
      Reviewed-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      2eb9beae
    • M
      IB/uverbs: Refactor kern_spec_to_ib_spec_filter · 766d8551
      Matan Barak 提交于
      The current implementation of kern_spec_to_ib_spec_filter, which takes
      a uAPI based flow steering specification and creates the respective kernel
      API flow steering structure, gets a ib_uverbs_flow_spec structure.
      The new flow_action uAPI gets a match mask and filter from user-space
      which aren't encoded in the flow steering's ib_uverbs_flow_spec structure.
      Exporting the logic out of kern_spec_to_ib_spec_filter to get user-space
      blobs rather than ib_uverbs_flow_spec structure.
      Reviewed-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      766d8551
  23. 20 3月, 2018 3 次提交