IB/srp: Remove stale connection retry mechanism
authorBart Van Assche <bvanassche@acm.org>
Thu, 30 Oct 2014 13:46:55 +0000 (14:46 +0100)
committerChristoph Hellwig <hch@lst.de>
Wed, 12 Nov 2014 10:32:02 +0000 (11:32 +0100)
Attempting to connect three times may be insufficient after an
initiator system tries to relogin, especially if the relogin
attempt occurs before the SRP target service ID has been
registered. Since the srp_daemon retries a failed login attempt
anyway, remove the stale connection retry mechanism.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/infiniband/ulp/srp/ib_srp.c

index 819ebc9e7c8bb50481eb23ce902bfd0fb798dad1..e07a04a91273d15e6fd82aa89f6548e47b727690 100644 (file)
@@ -904,7 +904,6 @@ static void srp_rport_delete(struct srp_rport *rport)
 
 static int srp_connect_target(struct srp_target_port *target)
 {
-       int retries = 3;
        int ret;
 
        WARN_ON_ONCE(target->connected);
@@ -945,19 +944,10 @@ static int srp_connect_target(struct srp_target_port *target)
                        break;
 
                case SRP_STALE_CONN:
-                       /* Our current CM id was stale, and is now in timewait.
-                        * Try to reconnect with a new one.
-                        */
-                       if (!retries-- || srp_new_cm_id(target)) {
-                               shost_printk(KERN_ERR, target->scsi_host, PFX
-                                            "giving up on stale connection\n");
-                               target->status = -ECONNRESET;
-                               return target->status;
-                       }
-
                        shost_printk(KERN_ERR, target->scsi_host, PFX
-                                    "retrying stale connection\n");
-                       break;
+                                    "giving up on stale connection\n");
+                       target->status = -ECONNRESET;
+                       return target->status;
 
                default:
                        return target->status;