From 5ac6b303834aa74855ecc3db98b4b1d9cad0de2f Mon Sep 17 00:00:00 2001 From: James Smart Date: Fri, 22 Oct 2010 11:05:36 -0400 Subject: [SCSI] lpfc 8.3.18: FC/FCoE Discovery fixes FC/FCoE Discovery fixes: - Call the lpfc_drain_txq only for SLI4 hba - In lpfc_cmpl_els_fdisc, fix code path that does not free IOCB. - Treated firmware matching FCF property with different index as error - Propagate error returns from lpfc_issue_els_flogi() - Refactored lpfc_unregister_unused_fcf() to create a post lpfc_dev_loss_tmo handler call for SLI-4 devices. Allows checking of fcf after last ndlp released so that fcf can be released if no longer in use. - Replaced individual FCF_XXXX_DISC flag clearing in lieu of aggregate FCF_DISCOVERY flag upon succesful completion of flogi. - Correct setting of altBbCredit value in sparams to correct issue with logins with remote loop-based devices. Signed-off-by: Alex Iannicelli Signed-off-by: James Smart Signed-off-by: James Bottomley --- drivers/scsi/lpfc/lpfc_els.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'drivers/scsi/lpfc/lpfc_els.c') diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index e6ca12f6c6cb..b16311d60c66 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -523,12 +523,6 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, spin_lock_irq(shost->host_lock); vport->fc_flag |= FC_PUBLIC_LOOP; spin_unlock_irq(shost->host_lock); - } else { - /* - * If we are a N-port connected to a Fabric, fixup sparam's so - * logins to devices on remote loops work. - */ - vport->fc_sparam.cmn.altBbCredit = 1; } vport->fc_myDID = irsp->un.ulpWord[4] & Mask_DID; @@ -1175,12 +1169,13 @@ lpfc_initial_flogi(struct lpfc_vport *vport) return 0; } - if (lpfc_issue_els_flogi(vport, ndlp, 0)) + if (lpfc_issue_els_flogi(vport, ndlp, 0)) { /* This decrement of reference count to node shall kick off * the release of the node. */ lpfc_nlp_put(ndlp); - + return 0; + } return 1; } @@ -1645,6 +1640,13 @@ lpfc_issue_els_plogi(struct lpfc_vport *vport, uint32_t did, uint8_t retry) memcpy(pcmd, &vport->fc_sparam, sizeof(struct serv_parm)); sp = (struct serv_parm *) pcmd; + /* + * If we are a N-port connected to a Fabric, fix-up paramm's so logins + * to device on remote loops work. + */ + if ((vport->fc_flag & FC_FABRIC) && !(vport->fc_flag & FC_PUBLIC_LOOP)) + sp->cmn.altBbCredit = 1; + if (sp->cmn.fcphLow < FC_PH_4_3) sp->cmn.fcphLow = FC_PH_4_3; @@ -6452,7 +6454,7 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, * to update the MAC address. */ lpfc_register_new_vport(phba, vport, ndlp); - return ; + goto out; } if (vport->fc_flag & FC_VPORT_NEEDS_INIT_VPI) -- cgit v1.2.3