···40504050}4051405140524052/**40534053- * lpfc_sli4_perform_inuse_fcf_recovery - Perform inuse fcf recovery40544054- * @vport: pointer to lpfc hba data structure.40554055- *40564056- * This routine is to perform FCF recovery when the in-use FCF either dead or40574057- * got modified.40584058- **/40594059-static void40604060-lpfc_sli4_perform_inuse_fcf_recovery(struct lpfc_hba *phba,40614061- struct lpfc_acqe_fip *acqe_fip)40624062-{40634063- int rc;40644064-40654065- spin_lock_irq(&phba->hbalock);40664066- /* Mark the fast failover process in progress */40674067- phba->fcf.fcf_flag |= FCF_DEAD_DISC;40684068- spin_unlock_irq(&phba->hbalock);40694069-40704070- lpfc_printf_log(phba, KERN_INFO, LOG_FIP | LOG_DISCOVERY,40714071- "2771 Start FCF fast failover process due to in-use "40724072- "FCF DEAD/MODIFIED event: evt_tag:x%x, index:x%x\n",40734073- acqe_fip->event_tag, acqe_fip->index);40744074- rc = lpfc_sli4_redisc_fcf_table(phba);40754075- if (rc) {40764076- lpfc_printf_log(phba, KERN_ERR, LOG_FIP | LOG_DISCOVERY,40774077- "2772 Issue FCF rediscover mabilbox command "40784078- "failed, fail through to FCF dead event\n");40794079- spin_lock_irq(&phba->hbalock);40804080- phba->fcf.fcf_flag &= ~FCF_DEAD_DISC;40814081- spin_unlock_irq(&phba->hbalock);40824082- /*40834083- * Last resort will fail over by treating this as a link40844084- * down to FCF registration.40854085- */40864086- lpfc_sli4_fcf_dead_failthrough(phba);40874087- } else {40884088- /* Reset FCF roundrobin bmask for new discovery */40894089- lpfc_sli4_clear_fcf_rr_bmask(phba);40904090- /*40914091- * Handling fast FCF failover to a DEAD FCF event is40924092- * considered equalivant to receiving CVL to all vports.40934093- */40944094- lpfc_sli4_perform_all_vport_cvl(phba);40954095- }40964096-}40974097-40984098-/**40994053 * lpfc_sli4_async_fip_evt - Process the asynchronous FCoE FIP event41004054 * @phba: pointer to lpfc hba data structure.41014055 * @acqe_link: pointer to the async fcoe completion queue entry.···41144160 break;41154161 }4116416241174117- /* If FCF has been in discovered state, perform rediscovery41184118- * only if the FCF with the same index of the in-use FCF got41194119- * modified during normal operation. Otherwise, do nothing.41204120- */41214121- if (phba->pport->port_state > LPFC_FLOGI) {41634163+ /* If the FCF has been in discovered state, do nothing. */41644164+ if (phba->fcf.fcf_flag & FCF_SCAN_DONE) {41224165 spin_unlock_irq(&phba->hbalock);41234123- if (phba->fcf.current_rec.fcf_indx ==41244124- acqe_fip->index) {41254125- lpfc_printf_log(phba, KERN_ERR, LOG_FIP,41264126- "3300 In-use FCF (%d) "41274127- "modified, perform FCF "41284128- "rediscovery\n",41294129- acqe_fip->index);41304130- lpfc_sli4_perform_inuse_fcf_recovery(phba,41314131- acqe_fip);41324132- }41334166 break;41344167 }41354168 spin_unlock_irq(&phba->hbalock);···41694228 * is no longer valid as we are not in the middle of FCF41704229 * failover process already.41714230 */41724172- lpfc_sli4_perform_inuse_fcf_recovery(phba, acqe_fip);42314231+ spin_lock_irq(&phba->hbalock);42324232+ /* Mark the fast failover process in progress */42334233+ phba->fcf.fcf_flag |= FCF_DEAD_DISC;42344234+ spin_unlock_irq(&phba->hbalock);42354235+42364236+ lpfc_printf_log(phba, KERN_INFO, LOG_FIP | LOG_DISCOVERY,42374237+ "2771 Start FCF fast failover process due to "42384238+ "FCF DEAD event: evt_tag:x%x, fcf_index:x%x "42394239+ "\n", acqe_fip->event_tag, acqe_fip->index);42404240+ rc = lpfc_sli4_redisc_fcf_table(phba);42414241+ if (rc) {42424242+ lpfc_printf_log(phba, KERN_ERR, LOG_FIP |42434243+ LOG_DISCOVERY,42444244+ "2772 Issue FCF rediscover mabilbox "42454245+ "command failed, fail through to FCF "42464246+ "dead event\n");42474247+ spin_lock_irq(&phba->hbalock);42484248+ phba->fcf.fcf_flag &= ~FCF_DEAD_DISC;42494249+ spin_unlock_irq(&phba->hbalock);42504250+ /*42514251+ * Last resort will fail over by treating this42524252+ * as a link down to FCF registration.42534253+ */42544254+ lpfc_sli4_fcf_dead_failthrough(phba);42554255+ } else {42564256+ /* Reset FCF roundrobin bmask for new discovery */42574257+ lpfc_sli4_clear_fcf_rr_bmask(phba);42584258+ /*42594259+ * Handling fast FCF failover to a DEAD FCF event is42604260+ * considered equalivant to receiving CVL to all vports.42614261+ */42624262+ lpfc_sli4_perform_all_vport_cvl(phba);42634263+ }41734264 break;41744265 case LPFC_FIP_EVENT_TYPE_CVL:41754266 phba->fcoe_cvl_eventtag = acqe_fip->event_tag;