1. 16 2月, 2013 2 次提交
    • J
      IB/mlx4: Adjust duplicate test · 6950a235
      Julia Lawall 提交于
      Delete successive tests to the same location.  The code tested the result
      of a previous allocation, that itself was already tested.  It is changed to
      test the result of the most recent allocation.
      
      A simplified version of the semantic match that finds this problem is as
      follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @s exists@
      local idexpression y;
      expression x,e;
      @@
      
      *if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
       { ... when forall
         return ...; }
      ... when != \(y = e\|y += e\|y -= e\|y |= e\|y &= e\|y++\|y--\|&y\)
          when != \(XT_GETPAGE(...,y)\|WMI_CMD_BUF(...)\)
      *if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
       { ... when forall
         return ...; }
      // </smpl>
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      6950a235
    • D
      IB/mlx4: Fix bug unwinding on error in mlx4_ib_init_sriov() · cab66d12
      Dan Carpenter 提交于
      We have to decrement "i" before calling mlx4_ib_free_demux_ctx() or we
      free something that wasn't allocated.  That's fine for free_pv_object()
      but it would lead to a NULL dereference calling mlx4_ib_free_demux_ctx().
      The null dereference is because ->tun is NULL when we check:
      
      	if (!ctx->tun[i])
      
      Also we didn't free ->sriov.demux[0] so it was a small leak.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      cab66d12
  2. 06 2月, 2013 2 次提交
    • M
      IB/qib: Fix for broken sparse warning fix · d359f354
      Mike Marciniszyn 提交于
      Commit 1fb9fed6 ("IB/qib: Fix QP RCU sparse warning") broke QP
      hash list deletion in qp_remove() badly.
      
      This patch restores the former for loop behavior, while still fixing
      the sparse warnings.
      
      Cc: <stable@vger.kernel.org>
      Reviewed-by: NGary Leshner <gary.s.leshner@intel.com>
      Signed-off-by: NMike Marciniszyn <mike.marciniszyn@intel.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      d359f354
    • S
      IPoIB: Fix crash due to skb double destruct · 7e5a90c2
      Shlomo Pongratz 提交于
      After commit b13912bb ("IPoIB: Call skb_dst_drop() once skb is
      enqueued for sending"), using connected mode and running multithreaded
      iperf for long time, ie
      
          iperf -c <IP> -P 16 -t 3600
      
      results in a crash.
      
      After the above-mentioned patch, the driver is calling skb_orphan() and
      skb_dst_drop() after calling post_send() in ipoib_cm.c::ipoib_cm_send()
      (also in ipoib_ib.c::ipoib_send())
      
      The problem with this is, as is written in a comment in both routines,
      "it's entirely possible that the completion handler will run before we
      execute anything after the post_send()."  This leads to running the
      skb cleanup routines simultaneously in two different contexts.
      
      The solution is to always perform the skb_orphan() and skb_dst_drop()
      before queueing the send work request.  If an error occurs, then it
      will be no different than the regular case where dev_free_skb_any() in
      the completion path, which is assumed to be after these two routines.
      Signed-off-by: NShlomo Pongratz <shlomop@mellanox.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      7e5a90c2
  3. 04 1月, 2013 1 次提交
    • G
      Drivers: infinband: remove __dev* attributes. · 1e6d9abe
      Greg Kroah-Hartman 提交于
      CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
      markings need to be removed.
      
      This change removes the use of __devinit, __devexit_p, __devinitdata,
      and __devexit from these drivers.
      
      Based on patches originally written by Bill Pemberton, but redone by me
      in order to handle some of the coding style issues better, by hand.
      
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Cc: Tom Tucker <tom@opengridcomputing.com>
      Cc: Steve Wise <swise@opengridcomputing.com>
      Cc: Roland Dreier <roland@kernel.org>
      Cc: Sean Hefty <sean.hefty@intel.com>
      Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
      Cc: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
      Cc: Christoph Raisch <raisch@de.ibm.com>
      Cc: Mike Marciniszyn <infinipath@intel.com>
      Cc: Faisal Latif <faisal.latif@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1e6d9abe
  4. 20 12月, 2012 4 次提交
    • V
      RDMA/cxgb4: Fix bug for active and passive LE hash collision path · 793dad94
      Vipul Pandya 提交于
      Retries active opens for INUSE errors.
      
      Logs any active ofld_connect_wr error replies.
      
      Sends ofld_connect_wr on same ctrlq. It needs to go  on the same control txq as
      regular CPL active/passive messages.
      
      Retries on active open replies with EADDRINUSE.
      
      Uses active open fw wr only if active filter region is set.
      
      Adds stat for ofld_connect_wr failures.
      
      This patch also adds debugfs file to show endpoints.
      Signed-off-by: NVipul Pandya <vipul@chelsio.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      793dad94
    • V
      RDMA/cxgb4: Fix LE hash collision bug for passive open connection · 1cab775c
      Vipul Pandya 提交于
      It establishes passive open connection through firmware work request. Passive
      open connection will go through this path as now instead of listening server we
      create a server filter which will redirect the incoming SYN packet to the
      offload queue. After this driver tries to establish the connection using
      firmware work request.
      Signed-off-by: NVipul Pandya <vipul@chelsio.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      1cab775c
    • V
      RDMA/cxgb4: Fix LE hash collision bug for active open connection · 5be78ee9
      Vipul Pandya 提交于
      It enables establishing active open connection using fw_ofld_connection work
      request when cpl_act_open_rpl says TCAM full error which may be because
      of LE hash collision. Current support is only for IPv4 active open connections.
      
      Sets ntuple bits in active open requests. For T4 firmware greater than 1.4.10.0
      ntuple bits are required to be set.
      
      Adds nocong and enable_ecn module parameter options.
      Signed-off-by: NVipul Pandya <vipul@chelsio.com>
      
      [ Move all FW return values to t4fw_api.h.  - Roland ]
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      5be78ee9
    • R
      IPoIB: Call skb_dst_drop() once skb is enqueued for sending · b13912bb
      Roland Dreier 提交于
      Currently, IPoIB delays collecting send completions for TX packets in
      order to batch work more efficiently.  It does skb_orphan() right after
      queuing the packets so that destructors run early, to avoid problems
      like holding socket send buffers for too long (since we might not
      collect a send completion until a long time after the packet is
      actually sent).
      
      However, IPoIB clears IFF_XMIT_DST_RELEASE because it actually looks
      at skb_dst() to update the PMTU when it gets a too-long packet.  This
      means that the packets sitting in the TX ring with uncollected send
      completions are holding a reference on the dst.  We've seen this lead
      to pathological behavior with respect to route and neighbour GC.  The
      easy fix for this is to call skb_dst_drop() when we call skb_orphan().
      
      Also, give packets sent via connected mode (CM) the same skb_orphan()
      / skb_dst_drop() treatment that packets sent via datagram mode get.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      b13912bb
  5. 08 12月, 2012 3 次提交
  6. 01 12月, 2012 12 次提交
  7. 30 11月, 2012 2 次提交
    • S
      RDMA/cm: Change return value from find_gid_port() · 63f05be2
      shefty 提交于
      Problem reported by Dan Carpenter <dan.carpenter@oracle.com>:
      
      The patch 3c86aa70: "RDMA/cm: Add RDMA CM support for IBoE
      devices" from Oct 13, 2010, leads to the following warning:
      net/sunrpc/xprtrdma/svc_rdma_transport.c:722 svc_rdma_create()
      	 error: passing non neg 1 to ERR_PTR
      
      This bug would result in a NULL dereference.  svc_rdma_create() is
      supposed to return ERR_PTRs or valid pointers, but instead it returns
      ERR_PTRs, valid pointers and 1.
      
      The call tree is:
      
      svc_rdma_create()
         => rdma_bind_addr()
            => cma_acquire_dev()
               => find_gid_port()
      
      rdma_bind_addr() should return a valid errno.  Fix this by having
      find_gid_port() also return a valid errno.  If we can't find the
      specified GID on a given port, return -EADDRNOTAVAIL, rather than
      -EAGAIN, to better indicate the error.  We also drop using the
      special return value of '1' and instead pass through the error
      returned by the underlying verbs call.  On such errors, rather
      than aborting the search,  we simply continue to check the next
      device/port.
      Signed-off-by: NSean Hefty <sean.hefty@intel.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      63f05be2
    • J
      IB/mlx4: Fix spinlock order to avoid lockdep warnings · ceb7decb
      Jack Morgenstein 提交于
      lockdep warns about taking a hard-irq-unsafe lock (sriov->id_map_lock)
      inside a hard-irq-safe lock (sriov->going_down_lock).
      
      Since id_map_lock is never taken in the interrupt context, we can
      simply reverse the order of taking the two spinlocks, thus avoiding
      the warning and the depencency.
      Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      ceb7decb
  8. 29 11月, 2012 1 次提交
  9. 28 11月, 2012 1 次提交
    • N
      ib_srpt: Convert I/O path to target_submit_cmd + drop legacy ioctx->kref · 9474b043
      Nicholas Bellinger 提交于
      This patch converts the main srpt_handle_cmd() I/O path to use modern
      target_submit_cmd() with TARGET_SCF_ACK_KREF flag usage.  This includes
      dropping the original internal ioctx->kref + srpt_put_send_ioctx() usage
      in favor of target_put_sess_cmd() w/ se_cmd_t->cmd_kref within ib_srpt
      response callbacks.
      
      It also updates srpt_abort_cmd() to call target_put_sess_cmd() for
      completion of aborted commands, and adds target_wait_for_sess_cmds() into
      srpt_release_channel_work() to allow outstanding I/O to complete during
      session shutdown.
      
      Also, go ahead and update srpt_handle_tsk_mgmt() to make the remaining
      transport_init_se_cmd() to setup the ioctx->cmd with se_tmr_req.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Bart Van Assche <bvanassche@acm.org>
      Cc: Roland Dreier <roland@kernel.org>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      9474b043
  10. 27 11月, 2012 3 次提交
    • J
      RDMA/cxgb3: use WARN · 5107c2a3
      Julia Lawall 提交于
      Use WARN rather than printk followed by WARN_ON(1), for conciseness.
      
      A simplified version of the semantic patch that makes this transformation
      is as follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @@
      expression list es;
      @@
      
      -printk(
      +WARN(1,
        es);
      -WARN_ON(1);
      // </smpl>
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Acked-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      5107c2a3
    • J
      RDMA/cxgb4: use WARN · 76f267b7
      Julia Lawall 提交于
      Use WARN rather than printk followed by WARN_ON(1), for conciseness.
      
      A simplified version of the semantic patch that makes this transformation
      is as follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @@
      expression list es;
      @@
      
      -printk(
      +WARN(1,
        es);
      -WARN_ON(1);
      // </smpl>
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Acked-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      76f267b7
    • O
      mlx4: 64-byte CQE/EQE support · 08ff3235
      Or Gerlitz 提交于
      ConnectX-3 devices can use either 64- or 32-byte completion queue
      entries (CQEs) and event queue entries (EQEs).  Using 64-byte
      EQEs/CQEs performs better because each entry is aligned to a complete
      cacheline.  This patch queries the HCA's capabilities, and if it
      supports 64-byte CQEs and EQES the driver will configure the HW to
      work in 64-byte mode.
      
      The 32-byte vs 64-byte mode is global per HCA and not per CQ or EQ.
      
      Since this mode is global, userspace (libmlx4) must be updated to work
      with the configured CQE size, and guests using SR-IOV virtual
      functions need to know both EQE and CQE size.
      
      In case one of the 64-byte CQE/EQE capabilities is activated, the
      patch makes sure that older guest drivers that use the QUERY_DEV_FUNC
      command (e.g as done in mlx4_core of Linux 3.3..3.6) will notice that
      they need an update to be able to work with the PPF. This is done by
      changing the returned pf_context_behaviour not to be zero any more. In
      case none of these capabilities is activated that value remains zero
      and older guest drivers can run OK.
      
      The SRIOV related flow is as follows
      
      1. the PPF does the detection of the new capabilities using
         QUERY_DEV_CAP command.
      
      2. the PPF activates the new capabilities using INIT_HCA.
      
      3. the VF detects if the PPF activated the capabilities using
         QUERY_HCA, and if this is the case activates them for itself too.
      
      Note that the VF detects that it must be aware to the new PF behaviour
      using QUERY_FUNC_CAP.  Steps 1 and 2 apply also for native mode.
      
      User space notification is done through a new field introduced in
      struct mlx4_ib_ucontext which holds device capabilities for which user
      space must take action. This changes the binary interface so the ABI
      towards libmlx4 exposed through uverbs is bumped from 3 to 4 but only
      when **needed** i.e. only when the driver does use 64-byte CQEs or
      future device capabilities which must be in sync by user space. This
      practice allows to work with unmodified libmlx4 on older devices (e.g
      A0, B0) which don't support 64-byte CQEs.
      
      In order to keep existing systems functional when they update to a
      newer kernel that contains these changes in VF and userspace ABI, a
      module parameter enable_64b_cqe_eqe must be set to enable 64-byte
      mode; the default is currently false.
      Signed-off-by: NEli Cohen <eli@mellanox.com>
      Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      08ff3235
  11. 22 11月, 2012 7 次提交
  12. 15 11月, 2012 1 次提交
  13. 07 11月, 2012 1 次提交
    • C
      target: pass sense_reason as a return value · de103c93
      Christoph Hellwig 提交于
      Pass the sense reason as an explicit return value from the I/O submission
      path instead of storing it in struct se_cmd and using negative return
      values.  This cleans up a lot of the code pathes, and with the sparse
      annotations for the new sense_reason_t type allows for much better
      error checking.
      
      (nab: Convert spc_emulate_modesense + spc_emulate_modeselect to use
            sense_reason_t with Roland's MODE SELECT changes)
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      de103c93