[Open-FCoE] [PATCH 11/28] libfc: move the skip PRLI for the NS port check

Robert Love robert.w.love at intel.com
Tue Sep 30 18:25:46 UTC 2008


We skip PRLI and RTV for the NS port. Currently we process
the PLOGI response, call enter_prli() and then check if it's
the NS port. We shouldn't even enter the PRLI state. We should
check for NS port in the PLOGI response and if it's the NS
then we skip PRLI and RTV and go straight to READY.

Signed-off-by: Robert Love <robert.w.love at intel.com>
---

 drivers/scsi/libfc/fc_rport.c |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 7d1416a..b596b3e 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -488,7 +488,14 @@ static void fc_rport_plogi_resp(struct fc_seq *sp, struct fc_frame *fp,
 			rport->maxframe_size =
 				fc_plogi_get_maxframe(plp,
 						      rdata->local_port->mfs);
-			if (rdata->rp_state == RPORT_ST_PLOGI)
+
+			/*
+			 * If the rport is one of the well known addresses
+			 * we skip PRLI and RTV and go straight to READY.
+			 */
+			if (rport->port_id >= FC_FID_DOM_MGR)
+				fc_rport_enter_ready(rport);
+			else
 				fc_rport_enter_prli(rport);
 		} else {
 			if (fc_rp_debug)
@@ -648,15 +655,6 @@ static void fc_rport_enter_prli(struct fc_rport *rport)
 
 	fc_rport_state_enter(rport, RPORT_ST_PRLI);
 
-	/*
-	 * Special case if session is for name server or any other
-	 * well-known address:	Skip the PRLI step.
-	 * This should be made more general, possibly moved to the FCP layer.
-	 */
-	if (rport->port_id >= FC_FID_DOM_MGR) {
-		fc_rport_enter_ready(rport);
-		return;
-	}
 	fp = fc_frame_alloc(lport, sizeof(*pp));
 	if (!fp)
 		return fc_rport_error(rport, fp);




More information about the devel mailing list