diff options
author | James Smart <james.smart@emulex.com> | 2010-10-22 11:05:36 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-10-25 17:35:36 -0400 |
commit | 5ac6b303834aa74855ecc3db98b4b1d9cad0de2f (patch) | |
tree | 62a3dc32a25d30dcdc4790151e1a01f51b431e9b /drivers/scsi/lpfc/lpfc_hbadisc.c | |
parent | 32622bdea031a5a6a6efd6dac9b317de46d5c6f8 (diff) |
[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 <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_hbadisc.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 79 |
1 files changed, 42 insertions, 37 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index a345dde16c86..0788bf670add 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
@@ -1803,6 +1803,16 @@ lpfc_mbx_cmpl_fcf_scan_read_fcf_rec(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) | |||
1803 | if ((phba->fcf.fcf_flag & FCF_IN_USE) && | 1803 | if ((phba->fcf.fcf_flag & FCF_IN_USE) && |
1804 | lpfc_sli4_fcf_record_match(phba, &phba->fcf.current_rec, | 1804 | lpfc_sli4_fcf_record_match(phba, &phba->fcf.current_rec, |
1805 | new_fcf_record, LPFC_FCOE_IGNORE_VID)) { | 1805 | new_fcf_record, LPFC_FCOE_IGNORE_VID)) { |
1806 | if (bf_get(lpfc_fcf_record_fcf_index, new_fcf_record) != | ||
1807 | phba->fcf.current_rec.fcf_indx) { | ||
1808 | lpfc_printf_log(phba, KERN_ERR, LOG_FIP, | ||
1809 | "2862 FCF (x%x) matches property " | ||
1810 | "of in-use FCF (x%x)\n", | ||
1811 | bf_get(lpfc_fcf_record_fcf_index, | ||
1812 | new_fcf_record), | ||
1813 | phba->fcf.current_rec.fcf_indx); | ||
1814 | goto read_next_fcf; | ||
1815 | } | ||
1806 | /* | 1816 | /* |
1807 | * In case the current in-use FCF record becomes | 1817 | * In case the current in-use FCF record becomes |
1808 | * invalid/unavailable during FCF discovery that | 1818 | * invalid/unavailable during FCF discovery that |
@@ -1844,22 +1854,29 @@ lpfc_mbx_cmpl_fcf_scan_read_fcf_rec(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) | |||
1844 | if (phba->fcf.fcf_flag & FCF_IN_USE) { | 1854 | if (phba->fcf.fcf_flag & FCF_IN_USE) { |
1845 | if (lpfc_sli4_fcf_record_match(phba, &phba->fcf.current_rec, | 1855 | if (lpfc_sli4_fcf_record_match(phba, &phba->fcf.current_rec, |
1846 | new_fcf_record, vlan_id)) { | 1856 | new_fcf_record, vlan_id)) { |
1847 | phba->fcf.fcf_flag |= FCF_AVAILABLE; | 1857 | if (bf_get(lpfc_fcf_record_fcf_index, new_fcf_record) == |
1848 | if (phba->fcf.fcf_flag & FCF_REDISC_PEND) | 1858 | phba->fcf.current_rec.fcf_indx) { |
1849 | /* Stop FCF redisc wait timer if pending */ | 1859 | phba->fcf.fcf_flag |= FCF_AVAILABLE; |
1850 | __lpfc_sli4_stop_fcf_redisc_wait_timer(phba); | 1860 | if (phba->fcf.fcf_flag & FCF_REDISC_PEND) |
1851 | else if (phba->fcf.fcf_flag & FCF_REDISC_FOV) | 1861 | /* Stop FCF redisc wait timer */ |
1852 | /* If in fast failover, mark it's completed */ | 1862 | __lpfc_sli4_stop_fcf_redisc_wait_timer( |
1853 | phba->fcf.fcf_flag &= ~FCF_REDISC_FOV; | 1863 | phba); |
1854 | spin_unlock_irq(&phba->hbalock); | 1864 | else if (phba->fcf.fcf_flag & FCF_REDISC_FOV) |
1855 | lpfc_printf_log(phba, KERN_INFO, LOG_FIP, | 1865 | /* Fast failover, mark completed */ |
1856 | "2836 The new FCF record (x%x) " | 1866 | phba->fcf.fcf_flag &= ~FCF_REDISC_FOV; |
1857 | "matches the in-use FCF record " | 1867 | spin_unlock_irq(&phba->hbalock); |
1858 | "(x%x)\n", | 1868 | lpfc_printf_log(phba, KERN_INFO, LOG_FIP, |
1859 | phba->fcf.current_rec.fcf_indx, | 1869 | "2836 New FCF matches in-use " |
1870 | "FCF (x%x)\n", | ||
1871 | phba->fcf.current_rec.fcf_indx); | ||
1872 | goto out; | ||
1873 | } else | ||
1874 | lpfc_printf_log(phba, KERN_ERR, LOG_FIP, | ||
1875 | "2863 New FCF (x%x) matches " | ||
1876 | "property of in-use FCF (x%x)\n", | ||
1860 | bf_get(lpfc_fcf_record_fcf_index, | 1877 | bf_get(lpfc_fcf_record_fcf_index, |
1861 | new_fcf_record)); | 1878 | new_fcf_record), |
1862 | goto out; | 1879 | phba->fcf.current_rec.fcf_indx); |
1863 | } | 1880 | } |
1864 | /* | 1881 | /* |
1865 | * Read next FCF record from HBA searching for the matching | 1882 | * Read next FCF record from HBA searching for the matching |
@@ -2069,28 +2086,6 @@ read_next_fcf: | |||
2069 | LPFC_FCOE_FCF_GET_FIRST); | 2086 | LPFC_FCOE_FCF_GET_FIRST); |
2070 | return; | 2087 | return; |
2071 | } | 2088 | } |
2072 | |||
2073 | /* | ||
2074 | * Otherwise, initial scan or post linkdown rescan, | ||
2075 | * register with the best FCF record found so far | ||
2076 | * through the FCF scanning process. | ||
2077 | */ | ||
2078 | |||
2079 | /* | ||
2080 | * Mark the initial FCF discovery completed and | ||
2081 | * the start of the first round of the roundrobin | ||
2082 | * FCF failover. | ||
2083 | */ | ||
2084 | spin_lock_irq(&phba->hbalock); | ||
2085 | phba->fcf.fcf_flag &= | ||
2086 | ~(FCF_INIT_DISC | FCF_REDISC_RRU); | ||
2087 | spin_unlock_irq(&phba->hbalock); | ||
2088 | /* | ||
2089 | * Set up the initial registered FCF index for FLOGI | ||
2090 | * round robin FCF failover | ||
2091 | */ | ||
2092 | phba->fcf.fcf_rr_init_indx = | ||
2093 | phba->fcf.current_rec.fcf_indx; | ||
2094 | /* Register to the new FCF record */ | 2089 | /* Register to the new FCF record */ |
2095 | lpfc_register_fcf(phba); | 2090 | lpfc_register_fcf(phba); |
2096 | } | 2091 | } |
@@ -3992,6 +3987,16 @@ lpfc_cleanup_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) | |||
3992 | } | 3987 | } |
3993 | 3988 | ||
3994 | spin_lock_irq(&phba->hbalock); | 3989 | spin_lock_irq(&phba->hbalock); |
3990 | /* Cleanup REG_LOGIN completions which are not yet processed */ | ||
3991 | list_for_each_entry(mb, &phba->sli.mboxq_cmpl, list) { | ||
3992 | if ((mb->u.mb.mbxCommand != MBX_REG_LOGIN64) || | ||
3993 | (ndlp != (struct lpfc_nodelist *) mb->context2)) | ||
3994 | continue; | ||
3995 | |||
3996 | mb->context2 = NULL; | ||
3997 | mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; | ||
3998 | } | ||
3999 | |||
3995 | list_for_each_entry_safe(mb, nextmb, &phba->sli.mboxq, list) { | 4000 | list_for_each_entry_safe(mb, nextmb, &phba->sli.mboxq, list) { |
3996 | if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && | 4001 | if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && |
3997 | (ndlp == (struct lpfc_nodelist *) mb->context2)) { | 4002 | (ndlp == (struct lpfc_nodelist *) mb->context2)) { |