1. 26 1月, 2008 7 次提交
    • P
      IPoIB/cm: Add connected mode support for devices without SRQs · 68e995a2
      Pradeep Satyanarayana 提交于
      Some IB adapters (notably IBM's eHCA) do not implement SRQs (shared
      receive queues).  The current IPoIB connected mode support only works
      on devices that support SRQs.
      
      Fix this by adding support for using the receive queue of each
      connected mode receive QP.  The disadvantage of this compared to using
      an SRQ is that it means a full queue of receives must be posted for
      each remote connected mode peer, which means that total memory usage
      is potentially much higher than when using SRQs.  To manage this, add
      a new module parameter "max_nonsrq_conn_qp" that limits the number of
      connections allowed per interface.
      
      The rest of the changes are fairly straightforward: we use a table of
      struct ipoib_cm_rx to hold all the active connections, and put the
      table index of the connection in the high bits of receive WR IDs.
      This is needed because we cannot rely on the struct ib_wc.qp field for
      non-SRQ receive completions.  Most of the rest of the changes just
      test whether or not an SRQ is available, and post receives or find
      received packets in the right place depending on the answer.
      
      Cleaning up dead connections actually becomes simpler, because we do
      not have to do the "last WQE reached" dance that is required to
      destroy QPs attached to an SRQ.  We just move the QP to the error
      state and wait for all pending receives to be flushed.
      Signed-off-by: NPradeep Satyanarayana <pradeeps@linux.vnet.ibm.com>
      
      [ Completely rewritten and split up, based on Pradeep's work.  Several
        bugs fixed and no doubt several bugs introduced.  - Roland ]
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      68e995a2
    • R
      IPoIB/cm: Factor out ipoib_cm_free_rx_reap_list() · efcd9971
      Roland Dreier 提交于
      Factor out the code for going through the rx_reap list of struct
      ipoib_cm_rx and freeing each one.  This consolidates the code
      duplicated between ipoib_cm_dev_stop() and ipoib_cm_rx_reap() and
      reduces the risk of error when adding additional accounting.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      efcd9971
    • R
      IPoIB/cm: Factor out ipoib_cm_create_srq() · 7b3687df
      Roland Dreier 提交于
      Factor out the code to create an SRQ and allocate the receive ring in
      ipoib_cm_dev_init() into a new function ipoib_cm_create_srq().  This
      will make the code neater when support for devices that don't implement
      SRQs is added.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      7b3687df
    • R
      IPoIB/cm: Factor out ipoib_cm_free_rx_ring() · 1efb6144
      Roland Dreier 提交于
      Factor out the code to unmap/free skbs and free the receive ring in
      ipoib_cm_dev_cleanup() into a new function ipoib_cm_free_rx_ring().
      This function will be called from a couple of other places when
      support for devices that don't implement SRQs is added.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      1efb6144
    • R
      IPoIB: Trivial formatting cleanups · 2337f809
      Roland Dreier 提交于
      Fix whitespace blunders, convert "foo* bar" to "foo *bar", etc.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      2337f809
    • R
      IB/ipath: Fix crash on unload introduced by sysfs changes · 657c2f2c
      Roland Dreier 提交于
      Commit 23b9c1ab ("Infiniband: make ipath driver use default driver
      groups.") introduced a bug in the ipath driver where
      ipath_device_create_group() fell through into the error path, even on
      success, which meant that the sysfs groups it created would always get
      removed right away.  This made ipath_device_remove_group() hit the
      BUG_ON() in sysfs_remove_group() when it tried to remove those groups a
      second time.
      
      Correct the return path so that the groups stick around until they are
      supposed to be cleaned up.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      657c2f2c
    • K
      fix oops on rmmod capidrv · eb36f4fc
      Karsten Keil 提交于
      Fix overwriting the stack with the version string
      (it is currently 10 bytes + zero) when unloading the
      capidrv module. Safeguard against overwriting it
      should the version string grow in the future.
      
      Should fix Kernel Bug Tracker Bug 9696.
      Signed-off-by: NGerd v. Egidy <gerd.von.egidy@intra2net.com>
      Acked-by: NKarsten Keil <kkeil@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      eb36f4fc
  2. 25 1月, 2008 33 次提交