Commit 488d1469 authored by James Smart's avatar James Smart Committed by James Bottomley

[SCSI] lpfc 8.1.4 : Fix Discovery processing for NPorts that change their NPortId on the fly

Fix Discovery processing for NPorts that change their NPortId on the fly
due to a cable swap.
Signed-off-by: default avatarJames Smart <James.Smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 071a651e
...@@ -70,7 +70,7 @@ int lpfc_els_abort(struct lpfc_hba *, struct lpfc_nodelist * ndlp, ...@@ -70,7 +70,7 @@ int lpfc_els_abort(struct lpfc_hba *, struct lpfc_nodelist * ndlp,
int); int);
int lpfc_els_abort_flogi(struct lpfc_hba *); int lpfc_els_abort_flogi(struct lpfc_hba *);
int lpfc_initial_flogi(struct lpfc_hba *); int lpfc_initial_flogi(struct lpfc_hba *);
int lpfc_issue_els_plogi(struct lpfc_hba *, struct lpfc_nodelist *, uint8_t); int lpfc_issue_els_plogi(struct lpfc_hba *, uint32_t, uint8_t);
int lpfc_issue_els_prli(struct lpfc_hba *, struct lpfc_nodelist *, uint8_t); int lpfc_issue_els_prli(struct lpfc_hba *, struct lpfc_nodelist *, uint8_t);
int lpfc_issue_els_adisc(struct lpfc_hba *, struct lpfc_nodelist *, uint8_t); int lpfc_issue_els_adisc(struct lpfc_hba *, struct lpfc_nodelist *, uint8_t);
int lpfc_issue_els_logo(struct lpfc_hba *, struct lpfc_nodelist *, uint8_t); int lpfc_issue_els_logo(struct lpfc_hba *, struct lpfc_nodelist *, uint8_t);
...@@ -168,8 +168,9 @@ int lpfc_sli_abort_iocb(struct lpfc_hba *, struct lpfc_sli_ring *, uint16_t, ...@@ -168,8 +168,9 @@ int lpfc_sli_abort_iocb(struct lpfc_hba *, struct lpfc_sli_ring *, uint16_t,
void lpfc_mbox_timeout(unsigned long); void lpfc_mbox_timeout(unsigned long);
void lpfc_mbox_timeout_handler(struct lpfc_hba *); void lpfc_mbox_timeout_handler(struct lpfc_hba *);
struct lpfc_nodelist *lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, struct lpfc_nodelist *lpfc_findnode_did(struct lpfc_hba *, uint32_t, uint32_t);
uint32_t did); struct lpfc_nodelist *lpfc_findnode_wwpn(struct lpfc_hba *, uint32_t,
struct lpfc_name *);
int lpfc_sli_issue_mbox_wait(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmboxq, int lpfc_sli_issue_mbox_wait(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmboxq,
uint32_t timeout); uint32_t timeout);
......
This diff is collapsed.
...@@ -59,6 +59,7 @@ static void lpfc_disc_timeout_handler(struct lpfc_hba *); ...@@ -59,6 +59,7 @@ static void lpfc_disc_timeout_handler(struct lpfc_hba *);
static void static void
lpfc_process_nodev_timeout(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp) lpfc_process_nodev_timeout(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
{ {
uint8_t *name = (uint8_t *)&ndlp->nlp_portname;
int warn_on = 0; int warn_on = 0;
spin_lock_irq(phba->host->host_lock); spin_lock_irq(phba->host->host_lock);
...@@ -79,15 +80,23 @@ lpfc_process_nodev_timeout(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp) ...@@ -79,15 +80,23 @@ lpfc_process_nodev_timeout(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
if (warn_on) { if (warn_on) {
lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY,
"%d:0203 Nodev timeout on NPort x%x " "%d:0203 Nodev timeout on "
"Data: x%x x%x x%x\n", "WWPN %x:%x:%x:%x:%x:%x:%x:%x "
phba->brd_no, ndlp->nlp_DID, ndlp->nlp_flag, "NPort x%x Data: x%x x%x x%x\n",
phba->brd_no,
*name, *(name+1), *(name+2), *(name+3),
*(name+4), *(name+5), *(name+6), *(name+7),
ndlp->nlp_DID, ndlp->nlp_flag,
ndlp->nlp_state, ndlp->nlp_rpi); ndlp->nlp_state, ndlp->nlp_rpi);
} else { } else {
lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY,
"%d:0204 Nodev timeout on NPort x%x " "%d:0204 Nodev timeout on "
"Data: x%x x%x x%x\n", "WWPN %x:%x:%x:%x:%x:%x:%x:%x "
phba->brd_no, ndlp->nlp_DID, ndlp->nlp_flag, "NPort x%x Data: x%x x%x x%x\n",
phba->brd_no,
*name, *(name+1), *(name+2), *(name+3),
*(name+4), *(name+5), *(name+6), *(name+7),
ndlp->nlp_DID, ndlp->nlp_flag,
ndlp->nlp_state, ndlp->nlp_rpi); ndlp->nlp_state, ndlp->nlp_rpi);
} }
...@@ -945,7 +954,7 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb) ...@@ -945,7 +954,7 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb)
} }
ndlp->nlp_state = NLP_STE_PLOGI_ISSUE; ndlp->nlp_state = NLP_STE_PLOGI_ISSUE;
lpfc_nlp_list(phba, ndlp, NLP_PLOGI_LIST); lpfc_nlp_list(phba, ndlp, NLP_PLOGI_LIST);
lpfc_issue_els_plogi(phba, ndlp, 0); lpfc_issue_els_plogi(phba, NameServer_DID, 0);
if (phba->cfg_fdmi_on) { if (phba->cfg_fdmi_on) {
ndlp_fdmi = mempool_alloc(phba->nlp_mem_pool, ndlp_fdmi = mempool_alloc(phba->nlp_mem_pool,
GFP_KERNEL); GFP_KERNEL);
...@@ -953,7 +962,7 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb) ...@@ -953,7 +962,7 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb)
lpfc_nlp_init(phba, ndlp_fdmi, FDMI_DID); lpfc_nlp_init(phba, ndlp_fdmi, FDMI_DID);
ndlp_fdmi->nlp_type |= NLP_FABRIC; ndlp_fdmi->nlp_type |= NLP_FABRIC;
ndlp_fdmi->nlp_state = NLP_STE_PLOGI_ISSUE; ndlp_fdmi->nlp_state = NLP_STE_PLOGI_ISSUE;
lpfc_issue_els_plogi(phba, ndlp_fdmi, 0); lpfc_issue_els_plogi(phba, FDMI_DID, 0);
} }
} }
} }
...@@ -2516,6 +2525,49 @@ lpfc_findnode_rpi(struct lpfc_hba * phba, uint16_t rpi) ...@@ -2516,6 +2525,49 @@ lpfc_findnode_rpi(struct lpfc_hba * phba, uint16_t rpi)
return NULL; return NULL;
} }
/*
* This routine looks up the ndlp lists
* for the given WWPN. If WWPN found
* it return the node list pointer
* else return NULL.
*/
struct lpfc_nodelist *
lpfc_findnode_wwpn(struct lpfc_hba * phba, uint32_t order,
struct lpfc_name * wwpn)
{
struct lpfc_nodelist *ndlp;
struct list_head * lists[]={&phba->fc_nlpunmap_list,
&phba->fc_nlpmap_list,
&phba->fc_npr_list,
&phba->fc_plogi_list,
&phba->fc_adisc_list,
&phba->fc_reglogin_list,
&phba->fc_prli_list};
uint32_t search[]={NLP_SEARCH_UNMAPPED,
NLP_SEARCH_MAPPED,
NLP_SEARCH_NPR,
NLP_SEARCH_PLOGI,
NLP_SEARCH_ADISC,
NLP_SEARCH_REGLOGIN,
NLP_SEARCH_PRLI};
int i;
spin_lock_irq(phba->host->host_lock);
for (i = 0; i < ARRAY_SIZE(lists); i++ ) {
if (!(order & search[i]))
continue;
list_for_each_entry(ndlp, lists[i], nlp_listp) {
if (memcmp(&ndlp->nlp_portname, wwpn,
sizeof(struct lpfc_name)) == 0) {
spin_unlock_irq(phba->host->host_lock);
return ndlp;
}
}
}
spin_unlock_irq(phba->host->host_lock);
return NULL;
}
void void
lpfc_nlp_init(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, lpfc_nlp_init(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp,
uint32_t did) uint32_t did)
......
...@@ -880,7 +880,7 @@ lpfc_rcv_plogi_adisc_issue(struct lpfc_hba * phba, ...@@ -880,7 +880,7 @@ lpfc_rcv_plogi_adisc_issue(struct lpfc_hba * phba,
ndlp->nlp_prev_state = NLP_STE_ADISC_ISSUE; ndlp->nlp_prev_state = NLP_STE_ADISC_ISSUE;
ndlp->nlp_state = NLP_STE_PLOGI_ISSUE; ndlp->nlp_state = NLP_STE_PLOGI_ISSUE;
lpfc_nlp_list(phba, ndlp, NLP_PLOGI_LIST); lpfc_nlp_list(phba, ndlp, NLP_PLOGI_LIST);
lpfc_issue_els_plogi(phba, ndlp, 0); lpfc_issue_els_plogi(phba, ndlp->nlp_DID, 0);
return ndlp->nlp_state; return ndlp->nlp_state;
} }
...@@ -1506,8 +1506,9 @@ lpfc_rcv_plogi_npr_node(struct lpfc_hba * phba, ...@@ -1506,8 +1506,9 @@ lpfc_rcv_plogi_npr_node(struct lpfc_hba * phba,
ndlp->nlp_prev_state = NLP_STE_NPR_NODE; ndlp->nlp_prev_state = NLP_STE_NPR_NODE;
ndlp->nlp_state = NLP_STE_PLOGI_ISSUE; ndlp->nlp_state = NLP_STE_PLOGI_ISSUE;
lpfc_nlp_list(phba, ndlp, NLP_PLOGI_LIST); lpfc_nlp_list(phba, ndlp, NLP_PLOGI_LIST);
lpfc_issue_els_plogi(phba, ndlp, 0); lpfc_issue_els_plogi(phba, ndlp->nlp_DID, 0);
} }
return ndlp->nlp_state; return ndlp->nlp_state;
} }
...@@ -1539,8 +1540,9 @@ lpfc_rcv_prli_npr_node(struct lpfc_hba * phba, ...@@ -1539,8 +1540,9 @@ lpfc_rcv_prli_npr_node(struct lpfc_hba * phba,
ndlp->nlp_prev_state = NLP_STE_NPR_NODE; ndlp->nlp_prev_state = NLP_STE_NPR_NODE;
ndlp->nlp_state = NLP_STE_PLOGI_ISSUE; ndlp->nlp_state = NLP_STE_PLOGI_ISSUE;
lpfc_nlp_list(phba, ndlp, NLP_PLOGI_LIST); lpfc_nlp_list(phba, ndlp, NLP_PLOGI_LIST);
lpfc_issue_els_plogi(phba, ndlp, 0); lpfc_issue_els_plogi(phba, ndlp->nlp_DID, 0);
} }
} }
return ndlp->nlp_state; return ndlp->nlp_state;
} }
...@@ -1579,7 +1581,7 @@ lpfc_rcv_padisc_npr_node(struct lpfc_hba * phba, ...@@ -1579,7 +1581,7 @@ lpfc_rcv_padisc_npr_node(struct lpfc_hba * phba,
ndlp->nlp_prev_state = NLP_STE_NPR_NODE; ndlp->nlp_prev_state = NLP_STE_NPR_NODE;
ndlp->nlp_state = NLP_STE_PLOGI_ISSUE; ndlp->nlp_state = NLP_STE_PLOGI_ISSUE;
lpfc_nlp_list(phba, ndlp, NLP_PLOGI_LIST); lpfc_nlp_list(phba, ndlp, NLP_PLOGI_LIST);
lpfc_issue_els_plogi(phba, ndlp, 0); lpfc_issue_els_plogi(phba, ndlp->nlp_DID, 0);
} }
} }
return ndlp->nlp_state; return ndlp->nlp_state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment