1. 15 7月, 2008 1 次提交
  2. 17 4月, 2008 2 次提交
    • R
      IB/core: Add support for "send with invalidate" work requests · 0f39cf3d
      Roland Dreier 提交于
      Add a new IB_WR_SEND_WITH_INV send opcode that can be used to mark a
      "send with invalidate" work request as defined in the iWARP verbs and
      the InfiniBand base memory management extensions.  Also put "imm_data"
      and a new "invalidate_rkey" member in a new "ex" union in struct
      ib_send_wr. The invalidate_rkey member can be used to pass in an
      R_Key/STag to be invalidated.  Add this new union to struct
      ib_uverbs_send_wr.  Add code to copy the invalidate_rkey field in
      ib_uverbs_post_send().
      
      Fix up low-level drivers to deal with the change to struct ib_send_wr,
      and just remove the imm_data initialization from net/sunrpc/xprtrdma/,
      since that code never does any send with immediate operations.
      
      Also, move the existing IB_DEVICE_SEND_W_INV flag to a new bit, since
      the iWARP drivers currently in the tree set the bit.  The amso1100
      driver at least will silently fail to honor the IB_SEND_INVALIDATE bit
      if passed in as part of userspace send requests (since it does not
      implement kernel bypass work request queueing).  Remove the flag from
      all existing drivers that set it until we know which ones are OK.
      
      The values chosen for the new flag is not consecutive to avoid clashing
      with flags defined in the XRC patches, which are not merged yet but
      which are already in use and are likely to be merged soon.
      
      This resurrects a patch sent long ago by Mikkel Hagen <mhagen@iol.unh.edu>.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      0f39cf3d
    • E
      IB/core: Add creation flags to struct ib_qp_init_attr · b846f25a
      Eli Cohen 提交于
      Add a create_flags member to struct ib_qp_init_attr that will allow a
      kernel verbs consumer to create a pass special flags when creating a QP.
      Add a flag value for telling low-level drivers that a QP will be used
      for IPoIB UD LSO.  The create_flags member will also be useful for XRC
      and ehca low-latency QP support.
      
      Since no create_flags handling is implemented yet, add code to all
      low-level drivers to return -EINVAL if create_flags is non-zero.
      Signed-off-by: NEli Cohen <eli@mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      b846f25a
  3. 20 10月, 2007 1 次提交
    • R
      IB/uverbs: Fix checking of userspace object ownership · cbfb50e6
      Roland Dreier 提交于
          
      Commit 9ead190b ("IB/uverbs: Don't serialize with ib_uverbs_idr_mutex")
      rewrote how userspace objects are looked up in the uverbs module's
      idrs, and introduced a severe bug in the process: there is no checking
      that an operation is being performed by the right process any more.
      Fix this by adding the missing check of uobj->context in __idr_get_uobj().
      
      Apparently everyone is being very careful to only touch their own
      objects, because this bug was introduced in June 2006 in 2.6.18, and
      has gone undetected until now.
      
      Cc: stable <stable@kernel.org>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      cbfb50e6
  4. 09 5月, 2007 1 次提交
    • R
      IB/uverbs: Export ib_umem_get()/ib_umem_release() to modules · f7c6a7b5
      Roland Dreier 提交于
      Export ib_umem_get()/ib_umem_release() and put low-level drivers in
      control of when to call ib_umem_get() to pin and DMA map userspace,
      rather than always calling it in ib_uverbs_reg_mr() before calling the
      low-level driver's reg_user_mr method.
      
      Also move these functions to be in the ib_core module instead of
      ib_uverbs, so that driver modules using them do not depend on
      ib_uverbs.
      
      This has a number of advantages:
       - It is better design from the standpoint of making generic code a
         library that can be used or overridden by device-specific code as
         the details of specific devices dictate.
       - Drivers that do not need to pin userspace memory regions do not
         need to take the performance hit of calling ib_mem_get().  For
         example, although I have not tried to implement it in this patch,
         the ipath driver should be able to avoid pinning memory and just
         use copy_{to,from}_user() to access userspace memory regions.
       - Buffers that need special mapping treatment can be identified by
         the low-level driver.  For example, it may be possible to solve
         some Altix-specific memory ordering issues with mthca CQs in
         userspace by mapping CQ buffers with extra flags.
       - Drivers that need to pin and DMA map userspace memory for things
         other than memory regions can use ib_umem_get() directly, instead
         of hacks using extra parameters to their reg_phys_mr method.  For
         example, the mlx4 driver that is pending being merged needs to pin
         and DMA map QP and CQ buffers, but it does not need to create a
         memory key for these buffers.  So the cleanest solution is for mlx4
         to call ib_umem_get() in the create_qp and create_cq methods.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      f7c6a7b5
  5. 07 5月, 2007 1 次提交
    • M
      IB: Add CQ comp_vector support · f4fd0b22
      Michael S. Tsirkin 提交于
      Add a num_comp_vectors member to struct ib_device and extend
      ib_create_cq() to pass in a comp_vector parameter -- this parallels
      the userspace libibverbs API.  Update all hardware drivers to set
      num_comp_vectors to 1 and have all ULPs pass 0 for the comp_vector
      value.  Pass the value of num_comp_vectors to userspace rather than
      hard-coding a value of 1.
      
      We want multiple CQ event vector support (via MSI-X or similar for
      adapters that can generate multiple interrupts), but it's not clear
      how many vectors we want, or how we want to deal with policy issues
      such as how to decide which vector to use or how to set up interrupt
      affinity.  This patch is useful for experimenting, since no core
      changes will be necessary when updating a driver to support multiple
      vectors, and we know that we want to make at least these changes
      anyway.
      Signed-off-by: NMichael S. Tsirkin <mst@dev.mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      f4fd0b22
  6. 23 2月, 2007 1 次提交
    • R
      IB/uverbs: Return correct error for invalid PD in register MR · aaf1aef5
      Roland Dreier 提交于
      If no matching PD is found in ib_uverbs_reg_mr(), then the function
      jumps to err_release without setting the return value ret.  This means
      that ret will hold the return value of the call to ib_umem_get() a few
      lines earlier; if the function reaches the point where it looks for
      the PD, we know that ib_umem_get() must have returned 0, so
      ib_uverbs_reg_mr() ends up return 0 for a bad PD ID.  Fix this by
      setting ret to -EINVAL before jumping to the exit path when no PD is
      found.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      aaf1aef5
  7. 05 2月, 2007 1 次提交
    • M
      IB: Return qp pointer as part of ib_wc · 062dbb69
      Michael S. Tsirkin 提交于
      struct ib_wc currently only includes the local QP number: this matches
      the IB spec, but seems mostly useless. The following patch replaces
      this with the pointer to qp itself, and updates all low level drivers
      and all users.
      
      This has the following advantages:
      - Ability to get a per-qp context through wc->qp->qp_context
      - Existing drivers already have the qp pointer ready in poll cq, so
        this change actually saves a tiny bit (extra memory read) on data path
        (for ehca it would actually be expensive to find the QP pointer when
        polling a CQ, but ehca does not support SRQ so we can leave wc->qp as
        NULL for ehca)
      - Users that need the QP number can still get it through wc->qp->qp_num
      
      Use case:
      
      In IPoIB connected mode code, I have a common CQ shared by multiple
      QPs.  To track connection usage, I need a way to get at some per-QP
      context upon the completion, and I would like to avoid allocating
      context object per work request just to stick a QP pointer into it.
      With this code, I can just use wc->qp->qp_context.
      Signed-off-by: NMichael S. Tsirkin <mst@mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      062dbb69
  8. 31 10月, 2006 1 次提交
  9. 23 9月, 2006 5 次提交
  10. 24 7月, 2006 2 次提交
  11. 01 7月, 2006 1 次提交
  12. 22 6月, 2006 1 次提交
  13. 18 6月, 2006 4 次提交
    • R
      IB/uverbs: Don't serialize with ib_uverbs_idr_mutex · 9ead190b
      Roland Dreier 提交于
      Currently, all userspace verbs operations that call into the kernel
      are serialized by ib_uverbs_idr_mutex.  This can be a scalability
      issue for some workloads, especially for devices driven by the ipath
      driver, which needs to call into the kernel even for datapath
      operations.
      
      Fix this by adding reference counts to the userspace objects, and then
      converting ib_uverbs_idr_mutex into a spinlock that only protects the
      idrs long enough to take a reference on the object being looked up.
      Because remove operations may fail, we have to do a slightly funky
      two-step deletion, which is described in the comments at the top of
      uverbs_cmd.c.
      
      This also still leaves ib_uverbs_idr_lock as a single lock that is
      possibly subject to contention.  However, the lock hold time will only
      be a single idr operation, so multiple threads should still be able to
      make progress, even if ib_uverbs_idr_lock is being ping-ponged.
      
      Surprisingly, these changes even shrink the object code:
      
      add/remove: 23/5 grow/shrink: 4/21 up/down: 633/-693 (-60)
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      9ead190b
    • R
      IB/uverbs: Factor out common idr code · 3463175d
      Roland Dreier 提交于
      Factor out common code for adding a userspace object to an idr into a
      function idr_add_uobj().  This shrinks both the source and object code:
      
      add/remove: 1/0 grow/shrink: 0/6 up/down: 57/-220 (-163)
      function                                     old     new   delta
      idr_add_uobj                                   -      57     +57
      ib_uverbs_create_ah                          543     512     -31
      ib_uverbs_create_srq                         662     630     -32
      ib_uverbs_reg_mr                             737     699     -38
      ib_uverbs_create_cq                          639     600     -39
      ib_uverbs_alloc_pd                           485     446     -39
      ib_uverbs_create_qp                         1020     979     -41
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      3463175d
    • R
      IB/uverbs: Don't decrement usecnt on error paths · 92b15822
      Roland Dreier 提交于
      In error paths when destroying an object, uverbs should not decrement
      associated objects' usecnt, since ib_dereg_mr(), ib_destroy_qp(),
      etc. already do that.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      92b15822
    • G
      IB/uverbs: Release lock on error path · 77f76013
      Ganapathi CH 提交于
      If ibdev->alloc_ucontext() fails then ib_uverbs_get_context() does not
      unlock file->mutex before returning error.
      
      Signed-off by: Ganapathi CH <cganapathi@novell.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      77f76013
  14. 21 3月, 2006 7 次提交
  15. 14 1月, 2006 1 次提交
  16. 10 1月, 2006 1 次提交
  17. 07 1月, 2006 3 次提交
  18. 30 11月, 2005 1 次提交
  19. 11 11月, 2005 1 次提交
  20. 31 10月, 2005 1 次提交
  21. 29 10月, 2005 1 次提交
  22. 18 10月, 2005 2 次提交