1. 25 2月, 2010 1 次提交
    • A
      IB/uverbs: Convert *cdev to cdev in struct ib_uverbs_device · 055422dd
      Alexander Chiang 提交于
      Instead of storing a pointer to a cdev, embed the entire struct cdev.
      
      This change allows us to use the container_of() macro in
      ib_uverbs_open() in a future patch.
      
      This change increases the size of struct ib_uverbs_device to 168 bytes
      across 3 cachelines from 80 bytes in 2 cachelines.  However, we
      rearrange the members so that everything fits into the first cacheline
      except for the struct cdev. Finally, we don't touch the cdev in any
      fastpaths, so this change shouldn't negatively affect performance.
      Signed-off-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      055422dd
  2. 15 7月, 2008 1 次提交
  3. 20 4月, 2008 1 次提交
  4. 17 4月, 2008 1 次提交
    • R
      IB/uverbs: Don't store struct file * for event files · 1ae5c187
      Roland Dreier 提交于
      The file member of struct ib_uverbs_event_file was only used to keep
      track of whether the file had been closed or not.  The only thing we
      ever did with the value was check if it was NULL or not.  Simplify the
      code and get rid of the need to keep track of the struct file * we
      allocate by replacing the file member with an is_closed member.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      1ae5c187
  5. 10 10月, 2007 1 次提交
  6. 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
  7. 04 8月, 2006 1 次提交
  8. 18 6月, 2006 1 次提交
    • 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
  9. 21 3月, 2006 3 次提交
  10. 14 1月, 2006 1 次提交
  11. 30 11月, 2005 1 次提交
  12. 31 10月, 2005 1 次提交
  13. 29 10月, 2005 1 次提交
  14. 18 10月, 2005 2 次提交
    • R
      [IB] uverbs: Implement more commands · 67cdb40c
      Roland Dreier 提交于
      Add kernel support for userspace calling poll CQ, request CQ
      notification, post send, post receive, post SRQ receive, create AH and
      destroy AH commands.  These commands allow us to support userspace
      verbs for devices that can't perform these operations directly from
      userspace (eg the PathScale HCA).
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      67cdb40c
    • R
      [IB] uverbs: ABI-breaking fixes for userspace verbs · 6b73597e
      Roland Dreier 提交于
      Introduce new userspace verbs ABI version 3.  This eliminates some
      unneeded commands, and adds support for user-created completion
      channels.  This cleans up problems with file leaks on error paths, and
      also makes sure that file descriptors are always installed into the
      correct process.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      6b73597e
  15. 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
  16. 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
  17. 27 8月, 2005 3 次提交
    • R
      [PATCH] IB: move include files to include/rdma · a4d61e84
      Roland Dreier 提交于
      Move the InfiniBand headers from drivers/infiniband/include to include/rdma.
      This allows InfiniBand-using code to live elsewhere, and lets us remove the
      ugly EXTRA_CFLAGS include path from the InfiniBand Makefiles.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      a4d61e84
    • 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
    • R
      [PATCH] IB: Add copyright notices · 2a1d9b7f
      Roland Dreier 提交于
      Make some lawyers happy and add copyright notices for people who
      forgot to include them when they actually touched the code.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      2a1d9b7f
  18. 28 7月, 2005 1 次提交
  19. 08 7月, 2005 1 次提交