1. 25 2月, 2010 1 次提交
  2. 06 9月, 2009 1 次提交
    • R
      IB/mthca: Annotate CQ locking · ffe063f3
      Roland Dreier 提交于
      mthca_ib_lock_cqs()/mthca_ib_unlock_cqs() are helper functions that
      lock/unlock both CQs attached to a QP in the proper order to avoid
      AB-BA deadlocks.  Annotate this so sparse can understand what's going
      on (and warn us if we misuse these functions).
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      ffe063f3
  3. 15 7月, 2008 3 次提交
  4. 17 4月, 2008 3 次提交
    • D
      IB/mthca: Update QP state if query QP succeeds · 5121df3a
      Dotan Barak 提交于
      If the QP was moved to another state (such as SQE) by the hardware,
      then after this change the user won't have to set the IBV_QP_CUR_STATE
      mask in order to execute modify QP in order to recover from this state.
      Signed-off-by: NDotan Barak <dotanb@dev.mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      5121df3a
    • 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/mthca: Add IPoIB checksum offload support · 680b575f
      Eli Cohen 提交于
      Arbel and Sinai devices support checksum generation and verification
      of TCP and UDP packets for UD IPoIB messages.  This patch checks if
      the HCA supports this and sets the IB_DEVICE_UD_IP_CSUM capability
      flag if it does.  It implements support for handling the IB_SEND_IP_CSUM
      send flag and setting the csum_ok field in receive work completions.
      Signed-off-by: NEli Cohen <eli@mellnaox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      680b575f
  5. 05 2月, 2008 1 次提交
  6. 16 10月, 2007 1 次提交
    • R
      IB/mthca: Avoid alignment traps when writing doorbells · ab8403c4
      Roland Dreier 提交于
      Architectures such as ia64 see alignment traps when doing a 64-bit 
      read from __be32 doorbell[2] arrays to do doorbell writes in 
      mthca_write64().  Fix this by just passing the two halves of the 
      doorbell value into mthca_write64().  This actually improves the 
      generated code by allowing the compiler to see what's going on better.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      ab8403c4
  7. 19 7月, 2007 4 次提交
    • R
      IB/mthca: Simplify use of size0 in work request posting · 43509d1f
      Roland Dreier 提交于
          
      Current code sets size0 to 0 at the start of work request posting
      functions and then handles size0 == 0 specially within the loop over
      work requests.  Change this so size0 is set along with f0 the first
      time through the loop (when nreq == 0).  This makes the code easier to
      understand by making it clearer that f0 and size0 are always
      initialized if nreq != 0 without having to know that size0 == 0
      implies nreq == 0.
      
      Also annotate size0 with uninitialized_var() so that this doesn't
      introduce a new compiler warning.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      43509d1f
    • R
      IB/mthca: Factor out setting WQE UD segment entries · e535c699
      Roland Dreier 提交于
          
      Factor code to set UD entries out of the work request posting
      functions into inline functions set_tavor_ud_seg() and
      set_arbel_ud_seg().  This doesn't change the generated code in any
      significant way, and makes the source easier on the eyes.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      e535c699
    • R
      IB/mthca: Factor out setting WQE remote address and atomic segment entries · 400ddc11
      Roland Dreier 提交于
          
      Factor code to set remote address and atomic segment entries out of the
      work request posting functions into inline functions set_raddr_seg()
      and set_atomic_seg().  This doesn't change the generated code in any
      significant way, and makes the source easier on the eyes.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      400ddc11
    • R
      IB/mthca: Factor out setting WQE data segment entries · 80885456
      Roland Dreier 提交于
      Factor code to set data segment entries out of the work request
      posting functions into inline functions mthca_set_data_seg() and
      mthca_set_data_seg_inval().  This makes the code more readable and
      also allows the compiler to do a better job -- on x86_64:
      
      add/remove: 0/0 grow/shrink: 0/6 up/down: 0/-69 (-69)
      function                                     old     new   delta
      mthca_arbel_post_srq_recv                    373     369      -4
      mthca_arbel_post_receive                     570     562      -8
      mthca_tavor_post_srq_recv                    520     508     -12
      mthca_tavor_post_send                       1344    1330     -14
      mthca_arbel_post_send                       1481    1467     -14
      mthca_tavor_post_receive                     792     775     -17
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      80885456
  8. 18 7月, 2007 2 次提交
    • R
      IB/mthca: Use uninitialized_var() for f0 · 6d7d080e
      Roland Dreier 提交于
      Commit 9db48926 ("drivers/infiniband/hw/mthca/mthca_qp: kill uninit'd
      var warning") added "= 0" to the declarations of f0 to shut up gcc
      warnings.  However, there's no point in making the code bigger by
      initializing f0 to a random value just to get rid of a warning;
      setting f0 to 0 is no safer than just using uninitialized_var(), which
      documents the situation better and gives smaller code too.  For example, 
      on x86_64:
      
      add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-16 (-16)
      function                                     old     new   delta
      mthca_tavor_post_send                       1352    1344      -8
      mthca_arbel_post_send                       1489    1481      -8
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      6d7d080e
    • J
      drivers/infiniband/hw/mthca/mthca_qp: kill uninit'd var warning · 9db48926
      Jeff Garzik 提交于
      drivers/infiniband/hw/mthca/mthca_qp.c: In function
        ‘mthca_tavor_post_send’:
      drivers/infiniband/hw/mthca/mthca_qp.c:1594: warning: ‘f0’ may be used
        uninitialized in this function
      drivers/infiniband/hw/mthca/mthca_qp.c: In function
        ‘mthca_arbel_post_send’:
      drivers/infiniband/hw/mthca/mthca_qp.c:1949: warning: ‘f0’ may be used
        uninitialized in this function
      
      Initializing 'f0' is not strictly necessary in either case, AFAICS.
      
      I was considering use of uninitialized_var(), but looking at the
      complex flow of control in each function, I feel it is wiser and
      safer to simply zero the var and be certain of ourselves.
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      9db48926
  9. 30 5月, 2007 1 次提交
  10. 22 5月, 2007 1 次提交
    • A
      Detach sched.h from mm.h · e8edc6e0
      Alexey Dobriyan 提交于
      First thing mm.h does is including sched.h solely for can_do_mlock() inline
      function which has "current" dereference inside. By dealing with can_do_mlock()
      mm.h can be detached from sched.h which is good. See below, why.
      
      This patch
      a) removes unconditional inclusion of sched.h from mm.h
      b) makes can_do_mlock() normal function in mm/mlock.c
      c) exports can_do_mlock() to not break compilation
      d) adds sched.h inclusions back to files that were getting it indirectly.
      e) adds less bloated headers to some files (asm/signal.h, jiffies.h) that were
         getting them indirectly
      
      Net result is:
      a) mm.h users would get less code to open, read, preprocess, parse, ... if
         they don't need sched.h
      b) sched.h stops being dependency for significant number of files:
         on x86_64 allmodconfig touching sched.h results in recompile of 4083 files,
         after patch it's only 3744 (-8.3%).
      
      Cross-compile tested on
      
      	all arm defconfigs, all mips defconfigs, all powerpc defconfigs,
      	alpha alpha-up
      	arm
      	i386 i386-up i386-defconfig i386-allnoconfig
      	ia64 ia64-up
      	m68k
      	mips
      	parisc parisc-up
      	powerpc powerpc-up
      	s390 s390-up
      	sparc sparc-up
      	sparc64 sparc64-up
      	um-x86_64
      	x86_64 x86_64-up x86_64-defconfig x86_64-allnoconfig
      
      as well as my two usual configs.
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e8edc6e0
  11. 19 5月, 2007 1 次提交
  12. 15 5月, 2007 1 次提交
  13. 01 5月, 2007 1 次提交
  14. 25 4月, 2007 1 次提交
    • R
      IB/mthca: Simplify CQ cleaning in mthca_free_qp() · 30c00986
      Roland Dreier 提交于
      mthca_free_qp() already has local variables to hold the QP's send_cq
      and recv_cq, so we can slightly clean up the calls to mthca_cq_clean()
      by using those local variables instead of expressions like
      to_mcq(qp->ibqp.send_cq).
      
      Also, by cleaning the recv_cq first, we can avoid worrying about
      whether the QP is attached to an SRQ for the second call, because we
      would only clean send_cq if send_cq is not equal to recv_cq, and that
      means send_cq cannot have any receive completions from the QP being
      destroyed.
      
      All this work even improves the generated code a bit:
      
      add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-5 (-5)
      function                                     old     new   delta
      mthca_free_qp                                510     505      -5
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      30c00986
  15. 02 3月, 2007 1 次提交
  16. 17 2月, 2007 1 次提交
  17. 11 2月, 2007 1 次提交
  18. 10 1月, 2007 1 次提交
  19. 09 12月, 2006 1 次提交
    • D
      [PATCH] LOG2: Implement a general integer log2 facility in the kernel · f0d1b0b3
      David Howells 提交于
      This facility provides three entry points:
      
      	ilog2()		Log base 2 of unsigned long
      	ilog2_u32()	Log base 2 of u32
      	ilog2_u64()	Log base 2 of u64
      
      These facilities can either be used inside functions on dynamic data:
      
      	int do_something(long q)
      	{
      		...;
      		y = ilog2(x)
      		...;
      	}
      
      Or can be used to statically initialise global variables with constant values:
      
      	unsigned n = ilog2(27);
      
      When performing static initialisation, the compiler will report "error:
      initializer element is not constant" if asked to take a log of zero or of
      something not reducible to a constant.  They treat negative numbers as
      unsigned.
      
      When not dealing with a constant, they fall back to using fls() which permits
      them to use arch-specific log calculation instructions - such as BSR on
      x86/x86_64 or SCAN on FRV - if available.
      
      [akpm@osdl.org: MMC fix]
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Wojtek Kaniewski <wojtekka@toxygen.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f0d1b0b3
  20. 30 11月, 2006 1 次提交
    • R
      IB/mthca: Fix section mismatches · f4f3d0f0
      Roland Dreier 提交于
      Commit b3b30f5e ("IB/mthca: Recover from catastrophic errors")
      introduced some section mismatch breakage, because the error recovery
      code tears down and reinitializes the device, which calls into lots of
      code originally marked __devinit and __devexit from regular .text.
      
      Fix this by getting rid of these now-incorrect section markers.
      
      Reported by Randy Dunlap <randy.dunlap@oracle.com>.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      f4f3d0f0
  21. 17 10月, 2006 1 次提交
    • A
      IB/mthca: Use mmiowb after doorbell ring · 1f5c23e2
      Arthur Kepner 提交于
      We discovered a problem when running IPoIB applications on multiple
      CPUs on an Altix system. Many messages such as:
      
      ib_mthca 0002:01:00.0: SQ 000014 full (19941644 head, 19941707 tail, 64 max, 0 nreq)
      
      appear in syslog, and the driver wedges up.
      
      Apparently this is because writes to the doorbells from different CPUs
      reach the device out of order. The following patch adds mmiowb() calls
      after doorbell rings to ensure the doorbell writes are ordered.
      Signed-off-by: NArthur Kepner <akepner@sgi.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      1f5c23e2
  22. 23 9月, 2006 4 次提交
  23. 11 8月, 2006 2 次提交
  24. 15 7月, 2006 1 次提交
  25. 05 7月, 2006 1 次提交
    • Z
      [PATCH] mthca: initialize send and receive queue locks separately · a46f9484
      Zach Brown 提交于
      mthca: initialize send and receive queue locks separately
      
      lockdep identifies a lock by the call site of its initialization.  By
      initializing the send and receive queue locks in mthca_wq_init() we confuse
      lockdep.  It warns that that the ordered acquiry of both locks in
      mthca_modify_qp() is recursive acquiry of one lock:
      
        =============================================
        [ INFO: possible recursive locking detected ]
        ---------------------------------------------
        modprobe/1192 is trying to acquire lock:
         (&wq->lock){....}, at: [<f892b4db>] mthca_modify_qp+0x60/0xa7b [ib_mthca]
        but task is already holding lock:
         (&wq->lock){....}, at: [<f892b4ce>] mthca_modify_qp+0x53/0xa7b [ib_mthca]
      
      Initializing the locks separately in mthca_alloc_qp_common() stops the
      warning and will let lockdep enforce proper ordering on paths that acquire
      both locks.
      Signed-off-by: NZach Brown <zach.brown@oracle.com>
      Cc: Roland Dreier <rolandd@cisco.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      a46f9484
  26. 18 6月, 2006 2 次提交
    • R
      IB/mthca: Make all device methods truly reentrant · c93b6fba
      Roland Dreier 提交于
      Documentation/infiniband/core_locking.txt says:
      
        All of the methods in struct ib_device exported by a low-level
        driver must be fully reentrant.  The low-level driver is required to
        perform all synchronization necessary to maintain consistency, even
        if multiple function calls using the same object are run
        simultaneously.
      
      However, mthca's modify_qp, modify_srq and resize_cq methods are
      currently not reentrant.  Add a mutex to the QP, SRQ and CQ structures
      so that these calls can be properly serialized.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      c93b6fba
    • R
      IB/mthca: Fix memory leak on modify_qp error paths · c9c5d9fe
      Roland Dreier 提交于
      Some error paths after the mthca_alloc_mailbox() call in mthca_modify_qp()
      just do a "return -EINVAL" without freeing the mailbox.  Convert these
      returns to "goto out" to avoid leaking the mailbox storage.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      c9c5d9fe
  27. 19 5月, 2006 1 次提交