]> Pileus Git - ~andy/linux/blobdiff - drivers/scsi/lpfc/lpfc_els.c
[SCSI] lpfc 8.3.6 : FCoE Protocol Fixes
[~andy/linux] / drivers / scsi / lpfc / lpfc_els.c
index 45337cd23feb9ad434cc45aed8678d666165813a..e9e423f28f8ae97bb809c0ce6fbe6f2209f91bbc 100644 (file)
@@ -173,13 +173,26 @@ lpfc_prep_els_iocb(struct lpfc_vport *vport, uint8_t expectRsp,
         * in FIP mode send FLOGI, FDISC and LOGO as FIP frames.
         */
        if ((did == Fabric_DID) &&
-               bf_get(lpfc_fip_flag, &phba->sli4_hba.sli4_flags) &&
+               (phba->hba_flag & HBA_FIP_SUPPORT) &&
                ((elscmd == ELS_CMD_FLOGI) ||
                 (elscmd == ELS_CMD_FDISC) ||
                 (elscmd == ELS_CMD_LOGO)))
-               elsiocb->iocb_flag |= LPFC_FIP_ELS;
+               switch (elscmd) {
+               case ELS_CMD_FLOGI:
+               elsiocb->iocb_flag |= ((ELS_ID_FLOGI << LPFC_FIP_ELS_ID_SHIFT)
+                                       & LPFC_FIP_ELS_ID_MASK);
+               break;
+               case ELS_CMD_FDISC:
+               elsiocb->iocb_flag |= ((ELS_ID_FDISC << LPFC_FIP_ELS_ID_SHIFT)
+                                       & LPFC_FIP_ELS_ID_MASK);
+               break;
+               case ELS_CMD_LOGO:
+               elsiocb->iocb_flag |= ((ELS_ID_LOGO << LPFC_FIP_ELS_ID_SHIFT)
+                                       & LPFC_FIP_ELS_ID_MASK);
+               break;
+               }
        else
-               elsiocb->iocb_flag &= ~LPFC_FIP_ELS;
+               elsiocb->iocb_flag &= ~LPFC_FIP_ELS_ID_MASK;
 
        icmd = &elsiocb->iocb;
 
@@ -591,7 +604,7 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
        } else {
                ndlp->nlp_type |= NLP_FABRIC;
                lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE);
-               if (vport->vfi_state & LPFC_VFI_REGISTERED) {
+               if (vport->vpi_state & LPFC_VPI_REGISTERED) {
                        lpfc_start_fdiscs(phba);
                        lpfc_do_scr_ns_plogi(phba, vport);
                } else
@@ -2452,6 +2465,7 @@ lpfc_els_retry_delay_handler(struct lpfc_nodelist *ndlp)
         */
        del_timer_sync(&ndlp->nlp_delayfunc);
        retry = ndlp->nlp_retry;
+       ndlp->nlp_retry = 0;
 
        switch (cmd) {
        case ELS_CMD_FLOGI:
@@ -2711,12 +2725,16 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
            !lpfc_error_lost_link(irsp)) {
                /* FLOGI retry policy */
                retry = 1;
-               maxretry = 48;
-               if (cmdiocb->retry >= 32)
+               /* retry forever */
+               maxretry = 0;
+               if (cmdiocb->retry >= 100)
+                       delay = 5000;
+               else if (cmdiocb->retry >= 32)
                        delay = 1000;
        }
 
-       if ((++cmdiocb->retry) >= maxretry) {
+       cmdiocb->retry++;
+       if (maxretry && (cmdiocb->retry >= maxretry)) {
                phba->fc_stat.elsRetryExceeded++;
                retry = 0;
        }
@@ -5396,7 +5414,7 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
        if (lpfc_els_chk_latt(vport))
                goto dropit;
 
-       /* Ignore traffic recevied during vport shutdown. */
+       /* Ignore traffic received during vport shutdown. */
        if (vport->load_flag & FC_UNLOADING)
                goto dropit;
 
@@ -5670,7 +5688,7 @@ dropit:
  *    NULL - No vport with the matching @vpi found
  *    Otherwise - Address to the vport with the matching @vpi.
  **/
-static struct lpfc_vport *
+struct lpfc_vport *
 lpfc_find_vport_by_vpid(struct lpfc_hba *phba, uint16_t vpi)
 {
        struct lpfc_vport *vport;