lpfc 8.3.12: Fix discovery issues
Subsystems (2)
PATCH 6/7 lpfc 8.3.12: Fix discovery issues
- Add code to prevent unreg_vpi mailbox command from failing.
- Add code to reset the HBA if unreg_vpi mailbox fails with busy status.
- Remove code that was clearing the nlp_type stored during rport discovery.
Signed-off-by Alex Iannicelli <[email protected]>
Signed-off-by James Smart <[email protected]>
---
lpfc_crtn.h | 1 lpfc_disc.h | 1 lpfc_els.c | 2 + lpfc_hbadisc.c | 15 ++++++++++++-- lpfc_init.c | 20 ++++++++++++++++--- lpfc_nportdisc.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ lpfc_sli.c | 15 ++++++++++++++ 7 files changed, 105 insertions(+), 5 deletions(-)
drivers/scsi/lpfc/lpfc_crtn.h +1 -0
@@ -65,6 +65,7 @@ void lpfc_mbx_cmpl_read_la(struct lpfc_hvoid lpfc_init_vpi_cmpl (struct lpfc_hba *,LPFC_MBOXQ_t *);void lpfc_cancel_all_vport_retry_delay_timer (struct lpfc_hba *);void lpfc_retry_pport_discovery (struct lpfc_hba *); +void lpfc_release_rpi (struct lpfc_hba *,struct lpfc_vport *,uint16_t );void lpfc_mbx_cmpl_reg_login (struct lpfc_hba *,LPFC_MBOXQ_t *);void lpfc_mbx_cmpl_dflt_rpi (struct lpfc_hba *,LPFC_MBOXQ_t *);
drivers/scsi/lpfc/lpfc_disc.h +1 -0
@@ -38,6 +38,7 @@ enum lpfc_work_type {LPFC_EVT_ELS_RETRY ,LPFC_EVT_DEV_LOSS ,LPFC_EVT_FASTPATH_MGMT_EVT , + LPFC_EVT_RESET_HBA, };/* structure used to queue event to the discovery tasklet */
drivers/scsi/lpfc/lpfc_els.c +2 -0
@@ -583,6 +583,7 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_vspin_unlock_irq (shost->host_lock);lpfc_unreg_rpi (vport, np); } +lpfc_cleanup_pending_mbox (vport);if (phba->sli3_options &LPFC_SLI3_NPIV_ENABLED ) {lpfc_mbx_unreg_vpi (vport);spin_lock_irq (shost->host_lock);
@@ -6315,6 +6316,7 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phbspin_unlock_irq (shost->host_lock);lpfc_unreg_rpi (vport, np); } +lpfc_cleanup_pending_mbox (vport);lpfc_mbx_unreg_vpi (vport);spin_lock_irq (shost->host_lock); vport->fc_flag |=FC_VPORT_NEEDS_REG_VPI ;
drivers/scsi/lpfc/lpfc_hbadisc.c +13 -2
@@ -474,6 +474,10 @@ lpfc_work_list_done(struct lpfc_hba *phblpfc_send_fastpath_evt (phba, evtp); free_evt =0 ;break ; +case LPFC_EVT_RESET_HBA : +if (!(phba->pport->load_flag &FC_UNLOADING )) +lpfc_reset_hba (phba); +break ; }if (free_evt)kfree (evtp);
@@ -2736,11 +2740,18 @@ lpfc_mbx_cmpl_unreg_vpi(struct lpfc_hbaswitch (mb->mbxStatus) {case 0x0011 :case 0x0020 : -case 0x9700 :lpfc_printf_vlog (vport,KERN_INFO ,LOG_NODE ,"0911 cmpl_unreg_vpi, mb status = 0x%x\n" , mb->mbxStatus);break ; +/* If VPI is busy, reset the HBA */ +case 0x9700 : +lpfc_printf_vlog (vport,KERN_ERR ,LOG_NODE , +"2798 Unreg_vpi failed vpi 0x%x, mb status = 0x%x\n" , + vport->vpi, mb->mbxStatus); +if (!(phba->pport->load_flag &FC_UNLOADING )) +lpfc_workq_post_event (phba,NULL ,NULL , +LPFC_EVT_RESET_HBA ); }spin_lock_irq (shost->host_lock); vport->vpi_state &= ~LPFC_VPI_REGISTERED ;
@@ -3232,7 +3243,6 @@ lpfc_nlp_state_cleanup(struct lpfc_vportstruct Scsi_Host *shost =lpfc_shost_from_vport (vport);if (new_state ==NLP_STE_UNMAPPED_NODE ) { - ndlp->nlp_type &= ~(NLP_FCP_TARGET |NLP_FCP_INITIATOR ); ndlp->nlp_flag &= ~NLP_NODEV_REMOVE ; ndlp->nlp_type |=NLP_FC_NODE ; }
@@ -4990,6 +5000,7 @@ lpfc_unregister_fcf_prep(struct lpfc_hba ndlp =lpfc_findnode_did (vports[i], Fabric_DID);if (ndlp)lpfc_cancel_retry_delay_tmo (vports[i], ndlp); +lpfc_cleanup_pending_mbox (vports[i]);lpfc_mbx_unreg_vpi (vports[i]); shost =lpfc_shost_from_vport (vports[i]);spin_lock_irq (shost->host_lock);
drivers/scsi/lpfc/lpfc_init.c +17 -3
@@ -3226,12 +3226,26 @@ lpfc_sli4_perform_vport_cvl(struct lpfc_if (!vport)return NULL ; - ndlp =lpfc_findnode_did (vport, Fabric_DID); -if (!ndlp) -return NULL ; phba = vport->phba;if (!phba)return NULL ; + ndlp =lpfc_findnode_did (vport, Fabric_DID); +if (!ndlp) { +/* Cannot find existing Fabric ndlp, so allocate a new one */ + ndlp =mempool_alloc (phba->nlp_mem_pool,GFP_KERNEL ); +if (!ndlp) +return 0 ; +lpfc_nlp_init (vport, ndlp, Fabric_DID); +/* Set the node type */ + ndlp->nlp_type |=NLP_FABRIC ; +/* Put ndlp onto node list */ +lpfc_enqueue_node (vport, ndlp); + }else if (!NLP_CHK_NODE_ACT (ndlp)) { +/* re-setup ndlp without removing from node list */ + ndlp =lpfc_enable_node (vport, ndlp,NLP_STE_UNUSED_NODE ); +if (!ndlp) +return 0 ; + }if (phba->pport->port_state <=LPFC_FLOGI )return NULL ;/* If virtual link is not yet instantiated ignore CVL */
drivers/scsi/lpfc/lpfc_nportdisc.c +56 -0
73 lines not on this page · raw message
drivers/scsi/lpfc/lpfc_sli.c +15 -0
@@ -12660,6 +12660,7 @@ lpfc_cleanup_pending_mbox(struct lpfc_vpstruct lpfc_hba *phba = vport->phba;LPFC_MBOXQ_t *mb, *nextmb;struct lpfc_dmabuf *mp; +struct lpfc_nodelist *ndlp;spin_lock_irq (&phba->hbalock);list_for_each_entry_safe (mb, nextmb, &phba->sli.mboxq, list) {
@@ -12676,6 +12677,11 @@ lpfc_cleanup_pending_mbox(struct lpfc_vp__lpfc_mbuf_free (phba, mp->virt, mp->phys);kfree (mp); } + ndlp = (struct lpfc_nodelist *) mb->context2; +if (ndlp) { +lpfc_nlp_put (ndlp); + mb->context2 =NULL ; + } }list_del (&mb->list);mempool_free (mb, phba->mbox_mem_pool);
@@ -12685,6 +12691,15 @@ lpfc_cleanup_pending_mbox(struct lpfc_vpif ((mb->u.mb.mbxCommand ==MBX_REG_LOGIN64 ) || (mb->u.mb.mbxCommand ==MBX_REG_VPI )) mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; +if (mb->u.mb.mbxCommand ==MBX_REG_LOGIN64 ) { + ndlp = (struct lpfc_nodelist *) mb->context2; +if (ndlp) { +lpfc_nlp_put (ndlp); + mb->context2 =NULL ; + } +/* Unregister the RPI when mailbox complete */ + mb->mbox_flag |=LPFC_MBX_IMED_UNREG ; + } }spin_unlock_irq (&phba->hbalock); }