1. 22 10月, 2015 1 次提交
  2. 04 9月, 2015 1 次提交
    • S
      IB/srp: Fix possible protection fault · 7fbc67df
      Sagi Grimberg 提交于
      srp_destroy_qp is designed to indicate we are safe to continue with
      freeing the channel resources by modifying the qp error state,
      posting a dummy wr on the queue-pair and waiting for it to flush.
      This also holds for the channel registration pool as we are unmapping
      the memory region when handling a scsi response. Destroying the
      channel registration pool before we make sure we processed all the
      inflight IO might introduce a use-after-free of the registration pool.
      
      This use-after-free is demonstrated in the stack trace below where
      srp is trying to unmap a used FMR after the fmr_pool was already destroyed.
      
      general protection fault: 0000 [#1] SMP
      RIP: 0010:[<ffffffff8151121b>]  [<ffffffff8151121b>] _raw_spin_lock_irqsave+0x1b/0x50
      Call Trace:
       [<ffffffffa055d88a>] ib_fmr_pool_unmap+0x1a/0xb0 [ib_core]
       [<ffffffffa06c00ed>] srp_unmap_data.isra.28+0x17d/0x250 [ib_srp]
       [<ffffffffa06c01eb>] srp_free_req+0x2b/0x60 [ib_srp]
       [<ffffffffa06c0c94>] srp_recv_completion+0x174/0x580 [ib_srp]
       [<ffffffffa04580fe>] mlx4_eq_int+0x4de/0xe50 [mlx4_core]
       [<ffffffffa0458b00>] mlx4_msi_x_interrupt+0x10/0x20 [mlx4_core]
       [<ffffffff810abc45>] handle_irq_event_percpu+0x35/0x1b0
       [<ffffffff810abdf2>] handle_irq_event+0x32/0x50
       [<ffffffff810ae5cf>] handle_edge_irq+0x6f/0x120
       [<ffffffff8100455a>] handle_irq+0x1a/0x30
       [<ffffffff8151b475>] do_IRQ+0x45/0xb0
       [<ffffffff8151162d>] common_interrupt+0x6d/0x6d
       [<ffffffff813e4d2f>] cpuidle_enter_state+0x4f/0xc0
       [<ffffffff813e4e6c>] cpuidle_idle_call+0xcc/0x210
       [<ffffffff8100b9ea>] arch_cpu_idle+0xa/0x30
       [<ffffffff810ab1e1>] cpu_startup_entry+0xe1/0x270
       [<ffffffff81030b3a>] start_secondary+0x21a/0x2c0
      Reported-by: NEliott Kespi <eliottk@mellanox.com>
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      7fbc67df
  3. 31 8月, 2015 15 次提交
  4. 15 7月, 2015 2 次提交
  5. 13 6月, 2015 1 次提交
  6. 28 5月, 2015 1 次提交
    • L
      kernel/params: constify struct kernel_param_ops uses · 9c27847d
      Luis R. Rodriguez 提交于
      Most code already uses consts for the struct kernel_param_ops,
      sweep the kernel for the last offending stragglers. Other than
      include/linux/moduleparam.h and kernel/params.c all other changes
      were generated with the following Coccinelle SmPL patch. Merge
      conflicts between trees can be handled with Coccinelle.
      
      In the future git could get Coccinelle merge support to deal with
      patch --> fail --> grammar --> Coccinelle --> new patch conflicts
      automatically for us on patches where the grammar is available and
      the patch is of high confidence. Consider this a feature request.
      
      Test compiled on x86_64 against:
      
      	* allnoconfig
      	* allmodconfig
      	* allyesconfig
      
      @ const_found @
      identifier ops;
      @@
      
      const struct kernel_param_ops ops = {
      };
      
      @ const_not_found depends on !const_found @
      identifier ops;
      @@
      
      -struct kernel_param_ops ops = {
      +const struct kernel_param_ops ops = {
      };
      
      Generated-by: Coccinelle SmPL
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Junio C Hamano <gitster@pobox.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: cocci@systeme.lip6.fr
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NLuis R. Rodriguez <mcgrof@suse.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      9c27847d
  7. 19 5月, 2015 10 次提交
  8. 16 4月, 2015 1 次提交
  9. 16 12月, 2014 1 次提交
  10. 04 12月, 2014 1 次提交
  11. 24 11月, 2014 3 次提交
  12. 12 11月, 2014 3 次提交
    • B
      IB/srp: Fix a race condition triggered by destroying a queue pair · 7dad6b2e
      Bart Van Assche 提交于
      At least LID reassignment can trigger a race condition in the SRP
      initiator driver, namely the receive completion handler trying to
      post a request on a QP during or after QP destruction and before
      the CQ's have been destroyed. Avoid this race by modifying a QP
      into the error state and by waiting until all receive completions
      have been processed before destroying a QP.
      Reported-by: NMax Gurtuvoy <maxg@mellanox.com>
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Reviewed-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      7dad6b2e
    • B
      IB/srp: Add multichannel support · d92c0da7
      Bart Van Assche 提交于
      Improve performance by using multiple RDMA/RC channels per SCSI
      host for communication with an SRP target. About the
      implementation:
      - Introduce a loop over all channels in the code that uses
        target->ch.
      - Set the SRP_MULTICHAN_MULTI flag during login for the creation
        of the second and subsequent channels.
      - RDMA completion vectors are chosen such that RDMA completion
        interrupts are handled by the CPU socket that submitted the I/O
        request. As one can see in this patch it has been assumed if a
        system contains n CPU sockets and m RDMA completion vectors
        have been assigned to an RDMA HCA that IRQ affinity has been
        configured such that completion vectors [i*m/n..(i+1)*m/n) are
        bound to CPU socket i with 0 <= i < n.
      - Modify srp_free_ch_ib() and srp_free_req_data() such that it
        becomes safe to invoke these functions after the corresponding
        allocation function failed.
      - Add a ch_count sysfs attribute per target port.
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Reviewed-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      d92c0da7
    • B
      IB/srp: Use block layer tags · 77f2c1a4
      Bart Van Assche 提交于
      Since the block layer already contains functionality to assign
      a tag to each request, use that functionality instead of
      reimplementing that functionality in the SRP initiator driver.
      This change makes the free_reqs list superfluous. Hence remove
      that list.
      
      [hch: updated to use .use_blk_tags instead scsi_activate_tcq]
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Reviewed-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      77f2c1a4