Add README

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
IB/srp: Reduce failover time

Using a lower timeout than the transport layer timeout has been made
safe by the introduction of srp_claim_req() in a previous commit.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
IB/srp: Maintain a single connection per I_T nexus

The sysfs attribute 'add_target' may be used to relogin to a
target. An SRP target that receives a second login request from
an initiator will disconnect the previous connection. So before
trying to reconnect, check whether another connection to the
same SRP target identifier already exists. If so, remove the
target port.  Add a target to the target list before connecting
instead of after such that this algorithm has a chance to work.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
IB/srp: Micro-optimize completion handlers

Reduce completion queue lock contention by polling for multiple
work completions at once.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
IB/srp: Scan LUNs asynchronously

This avoids that srp_daemon blocks if a communication error occurs
during the scsi_scan_target() call invoked by writing into the
add_target sysfs attribute.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
srp_transport: Add transport layer error handling

Add the necessary functions in the SRP transport module to allow
an SRP initiator driver to implement transport error handling.
This includes:
- Support for implementing fast_io_fail_tmo, the time that should
  elapse after having detected a transport layer problem and
  before failing I/O.
- Support for implementing dev_loss_tmo, the time that should
  elapse after having detected a transport layer problem and
  before removing a remote port.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
IB/srp: Add dev_loss_tmo support

Remove an SRP host if either dev_loss_tmo expired or the target
closed the IB connection.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
scsi_transport_srp: Fail I/O faster

Let the dev_loss_tmo and fast_io_fail_tmo timers start when a failure
occurs instead of when it is reported. Also, if a SCSI timeout occurs
during port removal, stop the SCSI EH.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
scsi_transport_srp: Eliminate srp_stop_rport()

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
IB/srp: Fix srp_abort()

The SCSI error handler assumes that the transport layer is
operational if an eh_abort_handler() returns SUCCESS. Hence let
srp_abort() only return SUCCESS if sending the ABORT TASK task
management function succeeded.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
IB/srp: Skip host settle delay

The SRP initiator implements host reset by reconnecting to the SRP
target. That means that communication with the target is possible
as soon as host reset finished. Hence skip the host settle delay.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
SRP transport: Remove host if a device is offline

The SCSI EH can offline all SCSI devices associated with a SCSI
host without giving the LLD a chance to recover. So remove a SCSI
host if the SCSI EH has offlined the SCSI devices associated with
that host. A side effect of this patch is that if a SCSI device is
offlined via sysfs that the SCSI host also will be removed.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
IB/srp: Bump driver version

Signed-off-by: Bart Van Assche <bvanassche@acm.org>