lpfc 8.3.18: Adapter Shutdown and Unregistration cleanup
Subsystems (2)
PATCH 4/7 lpfc 8.3.18: Adapter Shutdown and Unregistration cleanup
Adapter Shutdown and Unregistration cleanup
- Correct the logic around hba shutdown. Prior to final reset, the driver must wait for all XRIs to return from the adapter. Added logic to poll, progressively slowing the poll rate as delay gets longer.
- Correct behavior around the rsvd1 field in UNREG_RPI_ALL mailbox completion and final rpi cleanup.
- Updated logic to move pending VPI registrations to their completion in cases where a CVL may be received while registration in progress.
- Added unreg all rpi mailbox command before unreg vpi.
Signed-off-by Alex Iannicelli <[email protected]>
Signed-off-by James Smart <[email protected]>
---
lpfc_crtn.h | 3 + lpfc_els.c | 10 +++ lpfc_hbadisc.c | 9 +++ lpfc_init.c | 52 ++++++++++++++++++ lpfc_mbox.c | 28 ++++++++++ lpfc_sli.c | 158 ++++++++++++++++++++++++++++++++++++++++++++++----------- lpfc_sli4.h | 3 + 7 files changed, 235 insertions(+), 28 deletions(-)
drivers/scsi/lpfc/lpfc_crtn.h +3 -0
@@ -44,6 +44,8 @@ int lpfc_reg_rpi(struct lpfc_hba *, uintvoid lpfc_set_var (struct lpfc_hba *,LPFC_MBOXQ_t *,uint32_t ,uint32_t );void lpfc_unreg_login (struct lpfc_hba *,uint16_t ,uint32_t ,LPFC_MBOXQ_t *);void lpfc_unreg_did (struct lpfc_hba *,uint16_t ,uint32_t ,LPFC_MBOXQ_t *); +void lpfc_sli4_unreg_all_rpis (struct lpfc_vport *); +void lpfc_reg_vpi (struct lpfc_vport *,LPFC_MBOXQ_t *);void lpfc_register_new_vport (struct lpfc_hba *,struct lpfc_vport *,struct lpfc_nodelist *);
@@ -272,6 +274,7 @@ int lpfc_sli_issue_iocb(struct lpfc_hbavoid lpfc_sli_pcimem_bcopy (void *,void *,uint32_t );void lpfc_sli_bemem_bcopy (void *,void *,uint32_t );void lpfc_sli_abort_iocb_ring (struct lpfc_hba *,struct lpfc_sli_ring *); +void lpfc_sli_hba_iocb_abort (struct lpfc_hba *);void lpfc_sli_flush_fcp_rings (struct lpfc_hba *);int lpfc_sli_ringpostbuf_put (struct lpfc_hba *,struct lpfc_sli_ring *,struct lpfc_dmabuf *);
drivers/scsi/lpfc/lpfc_els.c +10 -0
@@ -580,6 +580,10 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_vlpfc_unreg_rpi (vport, np); }lpfc_cleanup_pending_mbox (vport); + +if (phba->sli_rev ==LPFC_SLI_REV4 ) +lpfc_sli4_unreg_all_rpis (vport); +if (phba->sli3_options &LPFC_SLI3_NPIV_ENABLED ) {lpfc_mbx_unreg_vpi (vport);spin_lock_irq (shost->host_lock);
@@ -6482,6 +6486,8 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hbadefault :/* Try to recover from this error */ +if (phba->sli_rev ==LPFC_SLI_REV4 ) +lpfc_sli4_unreg_all_rpis (vport);lpfc_mbx_unreg_vpi (vport);spin_lock_irq (shost->host_lock); vport->fc_flag |=FC_VPORT_NEEDS_REG_VPI ;
@@ -6749,6 +6755,10 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phblpfc_unreg_rpi (vport, np); }lpfc_cleanup_pending_mbox (vport); + +if (phba->sli_rev ==LPFC_SLI_REV4 ) +lpfc_sli4_unreg_all_rpis (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 +9 -0
@@ -793,6 +793,8 @@ lpfc_cleanup_rpis(struct lpfc_vport *vpo : NLP_EVT_DEVICE_RECOVERY); }if (phba->sli3_options &LPFC_SLI3_VPORT_TEARDOWN ) { +if (phba->sli_rev ==LPFC_SLI_REV4 ) +lpfc_sli4_unreg_all_rpis (vport);lpfc_mbx_unreg_vpi (vport);spin_lock_irq (shost->host_lock); vport->fc_flag |=FC_VPORT_NEEDS_REG_VPI ;
@@ -4079,6 +4081,11 @@ lpfc_unreg_all_rpis(struct lpfc_vport *vLPFC_MBOXQ_t *mbox;int rc; +if (phba->sli_rev ==LPFC_SLI_REV4 ) { +lpfc_sli4_unreg_all_rpis (vport); +return ; + } + mbox =mempool_alloc (phba->mbox_mem_pool,GFP_KERNEL );if (mbox) {lpfc_unreg_login (phba, vport->vpi,0xffff , mbox);
@@ -5353,6 +5360,8 @@ lpfc_unregister_fcf_prep(struct lpfc_hbaif (ndlp)lpfc_cancel_retry_delay_tmo (vports[i], ndlp);lpfc_cleanup_pending_mbox (vports[i]); +if (phba->sli_rev ==LPFC_SLI_REV4 ) +lpfc_sli4_unreg_all_rpis (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 +52 -0
70 lines not on this page · raw message
drivers/scsi/lpfc/lpfc_mbox.c +28 -0
@@ -797,6 +797,34 @@ lpfc_unreg_login(struct lpfc_hba *phba, }/** +* lpfc_sli4_unreg_all_rpis - unregister all RPIs for a vport on SLI4 HBA. +* @vport: pointer to a vport object. +* +* This routine sends mailbox command to unregister all active RPIs for +* a vport. +**/ +void +lpfc_sli4_unreg_all_rpis (struct lpfc_vport *vport) +{ +struct lpfc_hba *phba = vport->phba; +LPFC_MBOXQ_t *mbox; +int rc; + + mbox =mempool_alloc (phba->mbox_mem_pool,GFP_KERNEL ); +if (mbox) { +lpfc_unreg_login (phba, vport->vpi, + vport->vpi + phba->vpi_base, mbox); + mbox->u.mb.un.varUnregLogin.rsvd1 =0x4000 ; + mbox->vport = vport; + mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; + mbox->context1 =NULL ; + rc =lpfc_sli_issue_mbox (phba, mbox,MBX_NOWAIT ); +if (rc ==MBX_NOT_FINISHED ) +mempool_free (mbox, phba->mbox_mem_pool); + } +} + +/** * lpfc_reg_vpi - Prepare a mailbox command for registering vport identifier * @phba: pointer to lpfc hba data structure. * @vpi: virtual N_Port identifier.
drivers/scsi/lpfc/lpfc_sli4.h +3 -0
@@ -19,6 +19,9 @@*******************************************************************/ #define LPFC_ACTIVE_MBOX_WAIT_CNT 100 +#define LPFC_XRI_EXCH_BUSY_WAIT_TMO 10000 +#define LPFC_XRI_EXCH_BUSY_WAIT_T1 10 +#define LPFC_XRI_EXCH_BUSY_WAIT_T2 30000#define LPFC_RELEASE_NOTIFICATION_INTERVAL 32#define LPFC_GET_QE_REL_INT 32#define LPFC_RPI_LOW_WATER_MARK 10
drivers/scsi/lpfc/lpfc_sli.c +130 -28
214 lines not on this page · raw message