1. 09 11月, 2013 4 次提交
  2. 12 7月, 2013 1 次提交
  3. 02 7月, 2013 4 次提交
  4. 28 6月, 2013 3 次提交
  5. 26 2月, 2013 4 次提交
    • 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
    • B
      IB/srp: Avoid endless SCSI error handling loop · c7c4e7ff
      Bart Van Assche 提交于
      If a SCSI command times out it is passed to the SCSI error
      handler. The SCSI error handler will try to abort the commands that
      timed out.  If aborting fails, a device reset will be attempted.  If
      the device reset also fails a host reset will be attempted.  If the
      host reset also fails the whole procedure will be repeated.
      
      srp_abort() and srp_reset_device() fail for a QP in the error state.
      srp_reset_host() fails after host removal has started.  Hence if the
      SCSI error handler gets invoked after host removal has started and
      with the QP in the error state an endless loop will be triggered.
      
      Modify the SCSI error handling functions in ib_srp as follows:
      - Abort SCSI commands properly even if the QP is in the error state.
      - Make srp_reset_host() reset SCSI requests even after host removal
        has already started or if reconnecting fails.
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Acked-by: NDavid Dillow <dave@thedillows.org>
      Cc: <stable@vger.kernel.org> # 3.8
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      c7c4e7ff
    • B
      IB/srp: Avoid sending a task management function needlessly · 3780d1f0
      Bart Van Assche 提交于
      Do not send a task management function if sending will fail anyway
      because either there is no RDMA/RC connection or the QP is in the
      error state.
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Acked-by: NDavid Dillow <dave@thedillows.org>
      Cc: <stable@vger.kernel.org> # 3.8
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      3780d1f0
    • B
      IB/srp: Track connection state properly · e1b2f13a
      Bart Van Assche 提交于
      Remove an assignment that incorrectly overwrites the connection state
      update by srp_connect_target().
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Acked-by: NDavid Dillow <dave@thedillows.org>
      Cc: <stable@vger.kernel.org> # 3.8
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      e1b2f13a
  6. 01 12月, 2012 12 次提交
  7. 01 10月, 2012 2 次提交
  8. 16 8月, 2012 1 次提交
  9. 28 2月, 2012 2 次提交
  10. 27 7月, 2011 1 次提交
  11. 14 7月, 2011 1 次提交
    • B
      IB/srp: Avoid duplicate devices from LUN scan · fd1b6c4a
      Bart Van Assche 提交于
      SCSI scanning of a channel:id:lun triplet in Linux works as follows
      (function scsi_scan_target() in drivers/scsi/scsi_scan.c):
      
      - If lun == SCAN_WILD_CARD, send a REPORT LUNS command to the target
        and process the result.
      
      - If lun != SCAN_WILD_CARD, send an INQUIRY command to the LUN
        corresponding to the specified channel:id:lun triplet to verify
        whether the LUN exists.
      
      So a SCSI driver must either take the channel and target id values in
      account in its quecommand() function or it should declare that it only
      supports one channel and one target id.
      
      Currently the ib_srp driver does neither.  As a result scanning the
      SCSI bus via e.g. rescan-scsi-bus.sh causes many duplicate SCSI
      devices to be created. For each 0:0:L device, several duplicates are
      created with the same LUN number and with (C:I) != (0:0). Fix this by
      declaring that the ib_srp driver only supports one channel and one
      target id.
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Cc: <stable@kernel.org>
      Acked-by: NDavid Dillow <dillowda@ornl.gov>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      fd1b6c4a
  12. 24 5月, 2011 1 次提交
  13. 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