1. 31 8月, 2015 1 次提交
  2. 19 5月, 2015 2 次提交
    • B
      IB/srp: Add 64-bit LUN support · 985aa495
      Bart Van Assche 提交于
      The SCSI standard defines 64-bit values for LUNs. Large arrays
      employing large or hierarchical LUN numbers become more and more
      common. So update the SRP initiator to use 64-bit LUN numbers.
      See also Hannes Reinecke, commit 9cb78c16 ("scsi: use 64-bit LUNs"),
      June 2014.
      
      The largest LUN number that has been tested is 0xd2003fff00000000.
      
      Checked the following structure sizes with gdb:
      * sizeof(struct srp_cmd) = 48
      * sizeof(struct srp_tsk_mgmt) = 48
      * sizeof(struct srp_aer_req) = 36
      
      The ibmvscsi changes have been compile tested only (on a PPC system).
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Reviewed-by: NSagi Grimberg <sagig@mellanox.com>
      Reviewed-by: NYann Droneaud <ydroneaud@opteya.com>
      Cc: Sebastian Parschauer <sebastian.riemer@profitbricks.com>
      Cc: Brian King <brking@linux.vnet.ibm.com>
      Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
      Cc: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      985aa495
    • B
      IB/srp: Fix connection state tracking · c014c8cd
      Bart Van Assche 提交于
      Reception of a DREQ message only causes the state of a single
      channel to change. Hence move the 'connected' member variable
      from the target to the channel data structure. This patch
      avoids that following false positive warning can be reported
      by srp_destroy_qp():
      
      WARNING: at drivers/infiniband/ulp/srp/ib_srp.c:617 srp_destroy_qp+0xa6/0x120 [ib_srp]()
      Call Trace:
      [<ffffffff8106e10f>] warn_slowpath_common+0x7f/0xc0
      [<ffffffff8106e16a>] warn_slowpath_null+0x1a/0x20
      [<ffffffffa0440226>] srp_destroy_qp+0xa6/0x120 [ib_srp]
      [<ffffffffa0440322>] srp_free_ch_ib+0x82/0x1e0 [ib_srp]
      [<ffffffffa044408b>] srp_create_target+0x7ab/0x998 [ib_srp]
      [<ffffffff81346f60>] dev_attr_store+0x20/0x30
      [<ffffffff811dd90f>] sysfs_write_file+0xef/0x170
      [<ffffffff8116d248>] vfs_write+0xc8/0x190
      [<ffffffff8116d411>] sys_write+0x51/0x90
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Sebastian Parschauer <sebastian.riemer@profitbricks.com>
      Cc: <stable@vger.kernel.org> #v3.19
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      c014c8cd
  3. 12 11月, 2014 6 次提交
    • 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
    • B
      IB/srp: Separate target and channel variables · 509c07bc
      Bart Van Assche 提交于
      Changes in this patch:
      - Move channel variables into a new structure (struct srp_rdma_ch).
      - Add an srp_target_port pointer, 'lock' and 'comp_vector' members
        in struct srp_rdma_ch.
      - Add code to initialize these three new member variables.
      - Many boring "target->" into "ch->" changes.
      - The cm_id and completion handler context pointers are now of type
        srp_rdma_ch * instead of srp_target_port *.
      - Three kzalloc(a * b, f) calls have been changed into kcalloc(a, b, f)
        to avoid that this patch would trigger a checkpatch warning.
      - Two casts from u64 into unsigned long long have been left out
        because these are superfluous. Since considerable time u64 is
        defined as unsigned long long for all architectures supported by
        the Linux kernel.
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Acked-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      509c07bc
    • B
      IB/srp: Introduce two new srp_target_port member variables · 747fe000
      Bart Van Assche 提交于
      Introduce the srp_target_port member variables 'sgid' and 'pkey'.
      Change the type of 'orig_dgid' from __be16[8] into union ib_gid.
      This patch does not change any functionality but makes the
      "Separate target and channel variables" patch easier to verify.
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Reviewed-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      747fe000
    • B
      IB/srp: Avoid that I/O hangs due to a cable pull during LUN scanning · 34aa654e
      Bart Van Assche 提交于
      If a cable is pulled during LUN scanning it can happen that the
      SRP rport and the SCSI host have been created but no LUNs have been
      added to the SCSI host. Since multipathd only sends SCSI commands
      to a SCSI target if one or more SCSI devices are present and since
      there is no keepalive mechanism for IB queue pairs this means that
      after a LUN scan failed and after a reconnect has succeeded no
      data will be sent over the QP and hence that a subsequent cable
      pull will not be detected. Avoid this by not creating an rport or
      SCSI host if a cable is pulled during a SCSI LUN scan.
      
      Note: so far the above behavior has only been observed with the
      kernel module parameter ch_count set to a value >= 2.
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Reviewed-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      34aa654e
  4. 21 5月, 2014 3 次提交
    • B
      IB/srp: Add fast registration support · 5cfb1782
      Bart Van Assche 提交于
      Certain HCA types (e.g. Connect-IB) and certain configurations (e.g.
      ConnectX VF) support fast registration but not FMR. Hence add fast
      registration support.
      
      In function srp_rport_reconnect(), move the the srp_finish_req()
      loop from after to before the srp_create_target_ib() call. This is
      needed to avoid that srp_finish_req() tries to queue any
      invalidation requests for rkeys associated with the old queue pair
      on the newly allocated queue pair. Invoking srp_finish_req() before
      the queue pair has been reallocated is safe since srp_claim_req()
      handles completions correctly that arrive after srp_finish_req()
      has been invoked.
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      5cfb1782
    • B
      IB/srp: Rename FMR-related variables · 52ede08f
      Bart Van Assche 提交于
      The next patch will cause the renamed variables to be shared between
      the code for FMR and for FR memory registration. Make the names of
      these variables independent of the memory registration mode. This
      patch does not change any functionality. The start of this patch was
      the changes applied via the following shell command:
      
      sed -i.orig 's/SRP_FMR_SIZE/SRP_MAX_PAGES_PER_MR/g; \
          s/fmr_page_mask/mr_page_mask/g;s/fmr_page_size/mr_page_size/g; \
          s/fmr_page_shift/mr_page_shift/g;s/fmr_max_size/mr_max_size/g; \
          s/max_pages_per_fmr/max_pages_per_mr/g;s/nfmr/nmdesc/g; \
          s/fmr_len/dma_len/g' drivers/infiniband/ulp/srp/ib_srp.[ch]
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      52ede08f
    • B
      IB/srp: One FMR pool per SRP connection · d1b4289e
      Bart Van Assche 提交于
      Allocate one FMR pool per SRP connection instead of one SRP pool
      per HCA. This improves scalability of the SRP initiator.
      
      Only request the SCSI mid-layer to retry a SCSI command after a
      temporary mapping failure (-ENOMEM) but not after a permanent
      mapping failure. This avoids that SCSI commands are retried
      indefinitely if a permanent memory mapping failure occurs.
      
      Tell the SCSI mid-layer to reduce queue depth temporarily in the
      unlikely case where an application is queuing many requests with
      more than max_pages_per_fmr sg-list elements.
      
      For FMR pool allocation, base the max_pages_per_fmr parameter on
      the HCA memory registration limit. Only try to allocate an FMR
      pool if FMR is supported.
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      d1b4289e
  5. 25 3月, 2014 1 次提交
  6. 09 11月, 2013 5 次提交
  7. 02 7月, 2013 1 次提交
  8. 26 2月, 2013 1 次提交
    • B
      IB/srp: Fail I/O requests if the transport is offline · 2ce19e72
      Bart Van Assche 提交于
      If an SRP target is no longer reachable and srp_reset_host() fails to
      reconnect then ib_srp will invoke scsi_remove_host().  That function
      will invoke __scsi_remove_device() for each LUN.  And that last
      function will change the device state from SDEV_TRANSPORT_OFFLINE into
      SDEV_CANCEL.  Certain user space software, e.g. older versions of
      multipathd, continue queueing I/O to SCSI devices that are in the
      SDEV_CANCEL state.
      
      If these I/O requests are submitted as SG_IO that means that the
      REQ_PREEMPT flag will be set and hence that these requests will be
      passed to srp_queuecommand().  These requests will time out.  If new
      requests are queued fast enough from user space these active requests
      will prevent __scsi_remove_device() to finish.
      
      Avoid this by failing I/O requests in the SDEV_CANCEL state if the
      transport is offline.  Introduce a new variable to keep track of the
      transport state instead of failing requests if (!target->connected ||
      target->qp_in_error), so that the SCSI error handler has a chance to
      retry commands after a transport layer failure occurred.
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Cc: <stable@vger.kernel.org> # 3.8
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      2ce19e72
  9. 01 12月, 2012 5 次提交
  10. 16 3月, 2011 4 次提交
    • D
      IB/srp: try to use larger FMR sizes to cover our mappings · be8b9814
      David Dillow 提交于
      Now that we can get larger SG lists, we can take advantage of HCAs that
      allow us to use larger FMR sizes. In many cases, we can use up to 512
      entries, so start there and work our way down.
      Signed-off-by: NDavid Dillow <dillowda@ornl.gov>
      be8b9814
    • D
      IB/srp: add support for indirect tables that don't fit in SRP_CMD · c07d424d
      David Dillow 提交于
      This allows us to guarantee the ability to submit up to 8 MB requests
      based on the current value of SCSI_MAX_SG_CHAIN_SEGMENTS. While FMR will
      usually condense the requests into 8 SG entries, it is imperative that
      the target support external tables in case the FMR mapping fails or is
      not supported.
      
      We add a safety valve to allow targets without the needed support to
      reap the benefits of the large tables, but fail in a manner that lets
      the user know that the data didn't make it to the device. The user must
      add "allow_ext_sg=1" to the target parameters to indicate that the
      target has the needed support.
      
      If indirect_sg_entries is not specified in the modules options, then
      the sg_tablesize for the target will default to cmd_sg_entries unless
      overridden by the target options.
      Signed-off-by: NDavid Dillow <dillowda@ornl.gov>
      c07d424d
    • D
      IB/srp: rework mapping engine to use multiple FMR entries · 8f26c9ff
      David Dillow 提交于
      Instead of forcing all of the S/G entries to fit in one FMR, and falling
      back to indirect descriptors if that fails, allow the use of as many
      FMRs as needed to map the request. This lays the groundwork for allowing
      indirect descriptor tables that are larger than can fit in the command
      IU, but should marginally improve performance now by reducing the number
      of indirect descriptors needed.
      
      We increase the minimum page size for the FMR pool to 4K, as larger
      pages help increase the coverage of each FMR, and it is rare that the
      kernel would send down a request with scattered 512 byte fragments.
      
      This patch also move some of the target initialization code afte the
      parsing of options, to keep it together with the new code that needs to
      allocate memory based on the options given.
      Signed-off-by: NDavid Dillow <dillowda@ornl.gov>
      8f26c9ff
    • D
      IB/srp: allow sg_tablesize to be set for each target · 49248644
      David Dillow 提交于
      Different configurations of target software allow differing max sizes of
      the command IU. Allowing this to be changed per-target allows all
      targets on an initiator to get an optimal setting.
      
      We deprecate srp_sg_tablesize and replace it with cmd_sg_entries in
      preparation for allowing more indirect descriptors than can fit in the
      IU.
      Signed-off-by: NDavid Dillow <dillowda@ornl.gov>
      49248644
  11. 11 1月, 2011 4 次提交
  12. 06 1月, 2011 2 次提交
  13. 23 10月, 2010 2 次提交
  14. 02 3月, 2010 1 次提交
  15. 15 7月, 2008 1 次提交
  16. 20 4月, 2008 1 次提交