1. 23 9月, 2006 1 次提交
  2. 18 6月, 2006 2 次提交
  3. 10 5月, 2006 1 次提交
    • R
      IB/mthca: Fix race in reference counting · a3285aa4
      Roland Dreier 提交于
      Fix races in in destroying various objects.  If a destroy routine
      waits for an object to become free by doing
      
      	wait_event(&obj->wait, !atomic_read(&obj->refcount));
      	/* now clean up and destroy the object */
      
      and another place drops a reference to the object by doing
      
      	if (atomic_dec_and_test(&obj->refcount))
      		wake_up(&obj->wait);
      
      then this is susceptible to a race where the wait_event() and final
      freeing of the object occur between the atomic_dec_and_test() and the
      wake_up().  And this is a use-after-free, since wake_up() will be
      called on part of the already-freed object.
      
      Fix this in mthca by replacing the atomic_t refcounts with plain old
      integers protected by a spinlock.  This makes it possible to do the
      decrement of the reference count and the wake_up() so that it appears
      as a single atomic operation to the code waiting on the wait queue.
      
      While touching this code, also simplify mthca_cq_clean(): the CQ being
      cleaned cannot go away, because it still has a QP attached to it.  So
      there's no reason to be paranoid and look up the CQ by number; it's
      perfectly safe to use the pointer that the callers already have.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      a3285aa4
  4. 30 3月, 2006 1 次提交
  5. 21 3月, 2006 3 次提交
    • R
      IB/mthca: Add device-specific support for resizing CQs · 4885bf64
      Roland Dreier 提交于
      Add low-level driver support for resizing CQs (both kernel and
      userspace) to mthca.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      4885bf64
    • R
      IB/mthca: Get rid of might_sleep() annotations · 399d7921
      Roland Dreier 提交于
      The might_sleep() annotations in mthca are silly -- they all occur
      shortly before calls that will end up in core functions like kmalloc()
      that will print the same warning in an unsafe context anyway.  In
      fact, beyond cluttering the source, we're actually bloating text with
      CONFIG_DEBUG_SPINLOCK_SLEEP and/or CONFIG_PREEMPT_VOLUNTARY set.
      
      With both options set, getting rid of the might_sleep()s saves a lot:
      add/remove: 0/0 grow/shrink: 0/7 up/down: 0/-171 (-171)
      function                                     old     new   delta
      mthca_pd_alloc                               132     109     -23
      mthca_init_cq                                969     946     -23
      mthca_mr_alloc                               592     568     -24
      mthca_pd_free                                 67      42     -25
      mthca_free_mr                                219     194     -25
      mthca_free_cq                                570     545     -25
      mthca_fmr_alloc                              742     716     -26
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      399d7921
    • R
      IB/mthca: Make functions that never fail return void · d9b98b0f
      Roland Dreier 提交于
      The function mthca_free_err_wqe() can never fail, so get rid of its
      return value.  That means handle_error_cqe() doesn't have to check
      what mthca_free_err_wqe() returns, which means it can't fail either
      and doesn't have to return anything either.  All this results in
      simpler source code and a slight object code improvement:
      
      add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-10 (-10)
      function                                     old     new   delta
      mthca_free_err_wqe                            83      81      -2
      mthca_poll_cq                               1758    1750      -8
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      d9b98b0f
  6. 07 1月, 2006 1 次提交
  7. 16 12月, 2005 1 次提交
  8. 11 11月, 2005 1 次提交
  9. 29 10月, 2005 1 次提交
  10. 27 8月, 2005 6 次提交
  11. 28 7月, 2005 1 次提交
  12. 08 7月, 2005 1 次提交
  13. 28 6月, 2005 5 次提交
  14. 17 4月, 2005 4 次提交