Browse Source

[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.
tags/v0.9.8
Michael Brown 14 years ago
parent
commit
965a0f7a75
2 changed files with 5 additions and 18 deletions
  1. 5
    12
      src/drivers/block/srp.c
  2. 0
    6
      src/include/gpxe/srp.h

+ 5
- 12
src/drivers/block/srp.c View File

@@ -80,19 +80,16 @@ static void srp_fail ( struct srp_device *srp, int rc ) {
80 80
 	/* Clear session state */
81 81
 	srp->state = 0;
82 82
 
83
-	/* Increment retry count */
84
-	srp->retry_count++;
85
-
86
-	/* If we have reached the retry limit, permanently abort the
87
-	 * session.
88
-	 */
83
+	/* If we have reached the retry limit, report the failure */
89 84
 	if ( srp->retry_count >= SRP_MAX_RETRIES ) {
90
-		srp->instant_rc = rc;
91 85
 		srp_scsi_done ( srp, rc );
92 86
 		return;
93 87
 	}
94 88
 
95
-	/* Otherwise, try to reopen the connection */
89
+	/* Otherwise, increment the retry count and try to reopen the
90
+	 * connection
91
+	 */
92
+	srp->retry_count++;
96 93
 	srp_login ( srp );
97 94
 }
98 95
 
@@ -445,10 +442,6 @@ static int srp_command ( struct scsi_device *scsi,
445 442
 	struct srp_device *srp =
446 443
 		container_of ( scsi->backend, struct srp_device, refcnt );
447 444
 
448
-	/* Return instant failure, if we have already aborted the session */
449
-	if ( srp->instant_rc )
450
-		return srp->instant_rc;
451
-
452 445
 	/* Store SCSI command */
453 446
 	if ( srp->command ) {
454 447
 		DBGC ( srp, "SRP %p cannot handle concurrent SCSI commands\n",

+ 0
- 6
src/include/gpxe/srp.h View File

@@ -828,12 +828,6 @@ struct srp_device {
828 828
 	unsigned int state;
829 829
 	/** Retry counter */
830 830
 	unsigned int retry_count;
831
-	/** Instant return status code
832
-	 *
833
-	 * Used to avoid retrying the connection on every new SCSI
834
-	 * command after the retry count has been exceeded.
835
-	 */
836
-	int instant_rc;
837 831
 	/** Current SCSI command */
838 832
 	struct scsi_command *command;
839 833
 

Loading…
Cancel
Save