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 15 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
 	/* Clear session state */
80
 	/* Clear session state */
81
 	srp->state = 0;
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
 	if ( srp->retry_count >= SRP_MAX_RETRIES ) {
84
 	if ( srp->retry_count >= SRP_MAX_RETRIES ) {
90
-		srp->instant_rc = rc;
91
 		srp_scsi_done ( srp, rc );
85
 		srp_scsi_done ( srp, rc );
92
 		return;
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
 	srp_login ( srp );
93
 	srp_login ( srp );
97
 }
94
 }
98
 
95
 
445
 	struct srp_device *srp =
442
 	struct srp_device *srp =
446
 		container_of ( scsi->backend, struct srp_device, refcnt );
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
 	/* Store SCSI command */
445
 	/* Store SCSI command */
453
 	if ( srp->command ) {
446
 	if ( srp->command ) {
454
 		DBGC ( srp, "SRP %p cannot handle concurrent SCSI commands\n",
447
 		DBGC ( srp, "SRP %p cannot handle concurrent SCSI commands\n",

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

828
 	unsigned int state;
828
 	unsigned int state;
829
 	/** Retry counter */
829
 	/** Retry counter */
830
 	unsigned int retry_count;
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
 	/** Current SCSI command */
831
 	/** Current SCSI command */
838
 	struct scsi_command *command;
832
 	struct scsi_command *command;
839
 
833
 

Loading…
Cancel
Save