]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
lpfc: Fix for the cable swap issue discovered during DI testing.
authorMartin K. Petersen <martin.petersen@oracle.com>
Fri, 15 Jun 2012 15:31:01 +0000 (11:31 -0400)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 24 Jul 2012 21:38:08 +0000 (17:38 -0400)
Signed-off-by: Vaios Papadimitriou <vaios.papadimitriou@emulex.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_els.c
drivers/scsi/lpfc/lpfc_version.h

index 86edc015554cc6431704c42205c670faaee424ec..0764c8cfdfef79da92910840b7c077e80e04d27a 100644 (file)
@@ -1445,6 +1445,10 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
                return ndlp;
        memset(&rrq.xri_bitmap, 0, sizeof(new_ndlp->active_rrqs.xri_bitmap));
 
+       lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
+                "1201 PLOGI confirm: ndlp %p x%x: new_ndlp %p\n",
+                ndlp, ndlp->nlp_DID, new_ndlp);
+
        if (!new_ndlp) {
                rc = memcmp(&ndlp->nlp_portname, name,
                            sizeof(struct lpfc_name));
@@ -1496,6 +1500,9 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
                /* The new_ndlp is replacing ndlp totally, so we need
                 * to put ndlp on UNUSED list and try to free it.
                 */
+               lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
+                        "1202 PLOGI confirm NEW: %x %x\n",
+                        new_ndlp->nlp_DID, keepDID);
 
                /* Fix up the rport accordingly */
                rport =  ndlp->rport;
@@ -1528,23 +1535,34 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
                lpfc_drop_node(vport, ndlp);
        }
        else {
+               lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
+                        "1203 PLOGI confirm SWAP: %x %x\n",
+                        new_ndlp->nlp_DID, keepDID);
+
                lpfc_unreg_rpi(vport, ndlp);
+
                /* Two ndlps cannot have the same did */
                ndlp->nlp_DID = keepDID;
                if (phba->sli_rev == LPFC_SLI_REV4)
                        memcpy(&ndlp->active_rrqs.xri_bitmap,
                                &rrq.xri_bitmap,
                                sizeof(ndlp->active_rrqs.xri_bitmap));
+
                /* Since we are swapping the ndlp passed in with the new one
-                * and the did has already been swapped, copy over the
-                * state and names.
+                * and the did has already been swapped, copy over state.
+                * The new WWNs are already in new_ndlp since thats what
+                * we looked it up by in the begining of this routine.
                 */
-               memcpy(&new_ndlp->nlp_portname, &ndlp->nlp_portname,
-                       sizeof(struct lpfc_name));
-               memcpy(&new_ndlp->nlp_nodename, &ndlp->nlp_nodename,
-                       sizeof(struct lpfc_name));
                new_ndlp->nlp_state = ndlp->nlp_state;
-               lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE);
+
+               /* Since we are switching over to the new_ndlp, the old
+                * ndlp should be put in the NPR state, unless we have
+                * already started re-discovery on it.
+                */
+               if ((ndlp->nlp_state == NLP_STE_UNMAPPED_NODE) ||
+                   (ndlp->nlp_state == NLP_STE_MAPPED_NODE))
+                       lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE);
+
                /* Fix up the rport accordingly */
                rport = ndlp->rport;
                if (rport) {
index f02b0b4b8ce759f2a4b09a0701fdf8ce998eb4b6..d8cc1a600a595a188b8070965d742825819fbc09 100644 (file)
@@ -18,7 +18,7 @@
  * included with this package.                                     *
  *******************************************************************/
 
-#define LPFC_DRIVER_VERSION "8.3.5.68.6p"
+#define LPFC_DRIVER_VERSION "8.3.5.68.8p"
 #define LPFC_DRIVER_NAME               "lpfc"
 #define LPFC_SP_DRIVER_HANDLER_NAME    "lpfc:sp"
 #define LPFC_FP_DRIVER_HANDLER_NAME    "lpfc:fp"