public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Yi Zou <yi.zou@intel.com>
To: linux-scsi@vger.kernel.org
Cc: robert.w.love@intel.com, Vasu Dev <vasu.dev@intel.com>,
	Yi Zou <yi.zou@intel.com>
Subject: [PATCH 3/4] libfc: avoid exchanges collision during lport reset
Date: Fri, 28 Oct 2011 11:34:17 -0700	[thread overview]
Message-ID: <20111028183417.15165.77742.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20111028183305.15165.96974.stgit@localhost6.localdomain6>

From: Vasu Dev <vasu.dev@intel.com>

Currently timer delay is large and is using msleep to avoid
avoid exchanges collision across lport reset, so instead
do this by initializing exches pool indexes during
reset also.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Yi Zou <yi.zou@intel.com>
---

 drivers/scsi/libfc/fc_exch.c  |    4 ++++
 drivers/scsi/libfc/fc_lport.c |   10 +---------
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index 81235f3..1b22130 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -1793,6 +1793,9 @@ restart:
 			goto restart;
 		}
 	}
+	pool->next_index = 0;
+	pool->left = FC_XID_UNKNOWN;
+	pool->right = FC_XID_UNKNOWN;
 	spin_unlock_bh(&pool->lock);
 }
 
@@ -2281,6 +2284,7 @@ struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *lport,
 		goto free_mempool;
 	for_each_possible_cpu(cpu) {
 		pool = per_cpu_ptr(mp->pool, cpu);
+		pool->next_index = 0;
 		pool->left = FC_XID_UNKNOWN;
 		pool->right = FC_XID_UNKNOWN;
 		spin_lock_init(&pool->lock);
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 628f347..e0fb891 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -1030,16 +1030,8 @@ static void fc_lport_enter_reset(struct fc_lport *lport)
 			   FCH_EVT_LIPRESET, 0);
 	fc_vports_linkchange(lport);
 	fc_lport_reset_locked(lport);
-	if (lport->link_up) {
-		/*
-		 * Wait upto resource allocation time out before
-		 * doing re-login since incomplete FIP exchanged
-		 * from last session may collide with exchanges
-		 * in new session.
-		 */
-		msleep(lport->r_a_tov);
+	if (lport->link_up)
 		fc_lport_enter_flogi(lport);
-	}
 }
 
 /**


  parent reply	other threads:[~2011-10-28 18:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28 18:34 [PATCH 0/4] Open-FCoE.org libfc and fcoe updates for scsi-misc Yi Zou
2011-10-28 18:34 ` [PATCH 1/4] drivers/firmware/edd: Treat "XPRS" host bus type the same as "PCI" Yi Zou
2011-10-28 18:34 ` [PATCH 2/4] libfc: fix checking FC_TYPE_BLS Yi Zou
2011-10-28 18:34 ` Yi Zou [this message]
2011-10-28 18:34 ` [PATCH 4/4] libfc: improve flogi retries to avoid lport stuck Yi Zou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111028183417.15165.77742.stgit@localhost6.localdomain6 \
    --to=yi.zou@intel.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=robert.w.love@intel.com \
    --cc=vasu.dev@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox