summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2009-08-10 03:20:21 +0200
committerMichael Brown2009-08-10 23:30:56 +0200
commit965a0f7a75ef0011062413a6fa62ab6404e0b1ea (patch)
tree75e1d2a262b40b9a78a49bec495d42c7bcc5bd28
parent[infiniband] Generate more specific errors in response to failure MADs (diff)
downloadipxe-965a0f7a75ef0011062413a6fa62ab6404e0b1ea.tar.gz
ipxe-965a0f7a75ef0011062413a6fa62ab6404e0b1ea.tar.xz
ipxe-965a0f7a75ef0011062413a6fa62ab6404e0b1ea.zip
[infiniband] Allow SRP reconnection attempts even after reporting failures
With iSCSI, connection attempts are expensive; it may take many seconds to determine that a connection will fail. SRP connection attempts are much less expensive, so we may as well avoid the "optimisation" of declaring a state of permanent failure after a certain number of attempts. This allows a gPXE SRP initiator to resume operations after an arbitrary amount of SRP target downtime.
-rw-r--r--src/drivers/block/srp.c17
-rw-r--r--src/include/gpxe/srp.h6
2 files changed, 5 insertions, 18 deletions
diff --git a/src/drivers/block/srp.c b/src/drivers/block/srp.c
index f50f194b..1d0799ab 100644
--- a/src/drivers/block/srp.c
+++ b/src/drivers/block/srp.c
@@ -80,19 +80,16 @@ static void srp_fail ( struct srp_device *srp, int rc ) {
/* Clear session state */
srp->state = 0;
- /* Increment retry count */
- srp->retry_count++;
-
- /* If we have reached the retry limit, permanently abort the
- * session.
- */
+ /* If we have reached the retry limit, report the failure */
if ( srp->retry_count >= SRP_MAX_RETRIES ) {
- srp->instant_rc = rc;
srp_scsi_done ( srp, rc );
return;
}
- /* Otherwise, try to reopen the connection */
+ /* Otherwise, increment the retry count and try to reopen the
+ * connection
+ */
+ srp->retry_count++;
srp_login ( srp );
}
@@ -445,10 +442,6 @@ static int srp_command ( struct scsi_device *scsi,
struct srp_device *srp =
container_of ( scsi->backend, struct srp_device, refcnt );
- /* Return instant failure, if we have already aborted the session */
- if ( srp->instant_rc )
- return srp->instant_rc;
-
/* Store SCSI command */
if ( srp->command ) {
DBGC ( srp, "SRP %p cannot handle concurrent SCSI commands\n",
diff --git a/src/include/gpxe/srp.h b/src/include/gpxe/srp.h
index 75ec7b83..85f39b93 100644
--- a/src/include/gpxe/srp.h
+++ b/src/include/gpxe/srp.h
@@ -828,12 +828,6 @@ struct srp_device {
unsigned int state;
/** Retry counter */
unsigned int retry_count;
- /** Instant return status code
- *
- * Used to avoid retrying the connection on every new SCSI
- * command after the retry count has been exceeded.
- */
- int instant_rc;
/** Current SCSI command */
struct scsi_command *command;