We don't need to PRLI into the NS so when we enter the
PRLI state we check if the rport is the NS and if so
we just return. It's the PLOGI response handler that
calls the PRLI request function. This patch checks
if the rport is the NS in PLOGI response before calling
PRLI request.

Signed-off-by: Robert Love <[EMAIL PROTECTED]>
---

 drivers/scsi/libfc/fc_rport.c |   37 ++++++++++++++++++++-----------------
 1 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 71238d2..24f8837 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -503,6 +503,7 @@ static void fc_rport_plogi_resp(struct fc_seq *sp, struct 
fc_frame *fp,
        u8 op;
        struct fc_rport *rport = rp_arg;
        struct fc_rport_libfc_priv *rp = rport->dd_data;
+       struct fc_lport *lp = rp->local_port;
 
        if (!IS_ERR(fp)) {
                op = fc_frame_payload_op(fp);
@@ -525,8 +526,25 @@ static void fc_rport_plogi_resp(struct fc_seq *sp, struct 
fc_frame *fp,
                        rp->max_seq = csp_seq;
                        rport->maxframe_size =
                                fc_plogi_get_maxframe(plp, rp->local_port->mfs);
-                       if (rp->rp_state == RPORT_ST_PLOGI)
-                               fc_rport_enter_prli(rport);
+                       if (rp->rp_state == RPORT_ST_PLOGI) {
+                               /*
+                                * Skip PRLI and RTV for any special ports
+                                * such as the name server. Notify the local
+                                * port if one of these well known ports is
+                                * READY.
+                                */
+                               if (rport->port_id >= FC_FID_DOM_MGR) {
+                                       fc_rport_state_enter(rport, 
RPORT_ST_READY);
+                                       if (fc_rp_debug)
+                                               FC_DBG("remote %6x ready", 
rport->port_id);
+                                       
+                                       fc_lport_lock(lp);
+                                       del_timer(&lp->state_timer);
+                                       lp->tt.lport_event_callback(lp, rport, 
LPORT_EV_RPORT_SUCCESS);
+                                       fc_lport_unlock(lp);
+                               } else
+                                       fc_rport_enter_prli(rport);
+                       }
                } else {
                        if (fc_rp_debug)
                                FC_DBG("bad PLOGI response");
@@ -704,21 +722,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_state_enter(rport, RPORT_ST_READY);
-               if (fc_rp_debug)
-                       FC_DBG("remote %6x ready", rport->port_id);
-               fc_lport_lock(lp);
-               del_timer(&lp->state_timer);
-               lp->tt.lport_event_callback(lp, rport, LPORT_EV_RPORT_SUCCESS);
-               fc_lport_unlock(lp);
-               return;
-       }
        fp = fc_frame_alloc(lp, sizeof(*pp));
        if (!fp)
                return fc_rport_retry(rport);

_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel

Reply via email to