1. 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
  2. 31 10月, 2006 1 次提交
  3. 23 9月, 2006 5 次提交
  4. 24 7月, 2006 2 次提交
  5. 01 7月, 2006 1 次提交
  6. 22 6月, 2006 1 次提交
  7. 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
  8. 21 3月, 2006 7 次提交
  9. 14 1月, 2006 1 次提交
  10. 10 1月, 2006 1 次提交
  11. 07 1月, 2006 3 次提交
  12. 30 11月, 2005 1 次提交
  13. 11 11月, 2005 1 次提交
  14. 31 10月, 2005 1 次提交
  15. 29 10月, 2005 1 次提交
  16. 18 10月, 2005 4 次提交
  17. 27 9月, 2005 1 次提交
    • R
      [IB] uverbs: Close some exploitable races · 63c47c28
      Roland Dreier 提交于
      Al Viro pointed out that the current IB userspace verbs interface
      allows userspace to cause mischief by closing file descriptors before
      we're ready, or issuing the same command twice at the same time.  This
      patch closes those races, and fixes other obvious problems such as a
      module reference leak.
      
      Some other interface bogosities will require an ABI change to fix
      properly, so I'm deferring those fixes until 2.6.15.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      63c47c28
  18. 10 9月, 2005 1 次提交
    • R
      Make sure that userspace does not retrieve stale asynchronous or · 63aaf647
      Roland Dreier 提交于
      completion events after destroying a CQ, QP or SRQ.  We do this by
      sweeping the event lists before returning from a destroy calls, and
      then return the number of events already reported before the destroy
      call.  This allows userspace wait until it has processed all events
      for an object returned from the kernel before it frees its context for
      the object.
      
      The ABI of the destroy CQ, destroy QP and destroy SRQ commands has to
      change to return the event count, so bump the ABI version from 1 to 2.
      The userspace libibverbs library has already been updated to handle
      both the old and new ABI versions.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      63aaf647
  19. 27 8月, 2005 1 次提交
    • R
      [PATCH] IB: userspace SRQ support · f520ba5a
      Roland Dreier 提交于
      Add SRQ support to userspace verbs module.  This adds several commands
      and associated structures, but it's OK to do this without bumping the
      ABI version because the commands are added at the end of the list so
      they don't change the existing numbering.  There are two cases to
      worry about:
      
      1. New kernel, old userspace.  This is OK because old userspace simply
         won't try to use the new SRQ commands.  None of the old commands are
         changed.
      
      2. Old kernel, new userspace.  This works perfectly as long as
         userspace doesn't try to use SRQ commands.  If userspace tries to
         use SRQ commands, it will get EINVAL, which is perfectly
         reasonable: the kernel doesn't support SRQs, so we couldn't do any
         better.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      f520ba5a
  20. 08 7月, 2005 1 次提交