diff options
author | James Smart <james.smart@emulex.com> | 2011-04-16 11:03:17 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2011-05-01 12:03:38 -0400 |
commit | 9589b062f53e314ea3abfaca8de7a260b4ef69c2 (patch) | |
tree | e1a1e7138e2950aac7a83a7833fe50a9271b8288 /drivers/scsi/lpfc | |
parent | 86a80846a68eeb8575119db61f6b262f49522e6f (diff) |
[SCSI] lpfc 8.3.23: Miscellaneous fixes
Miscellaneous fixes
- Do not limit RPI Count to a minimum of 64
- Fix FCFI incorrect on received unsolicited frames.
- Save the FCFI returned in the REG_FCFI mailbox command if it was successful.
- Fixed Vports not sending FDISC after lips.
- Align based on the SLI4_PAGE_SIZE.
- Fixed double byte swap on received RRQ.
- Fixed mask size for the wq_id mask from 0x7F to 0x7FFF.
- Clear FC_FABRIC flag when NPIV LOGO completes (and add a log message).
- Modified driver to skip round robin only when ulpStatus==LOCAL_REJECT
and word4=SEQUENCE_TIMEOUT to prevent FLOGI to disconnected FCF.
- Don't add rport if driver unloading
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')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_els.c | 27 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 6 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hw4.h | 4 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 7 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_mbox.c | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 7 |
6 files changed, 39 insertions, 14 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index d34b69f9cdb1..04a5aeb41470 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c | |||
@@ -670,6 +670,7 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | |||
670 | * Driver needs to re-reg VPI in order for f/w | 670 | * Driver needs to re-reg VPI in order for f/w |
671 | * to update the MAC address. | 671 | * to update the MAC address. |
672 | */ | 672 | */ |
673 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); | ||
673 | lpfc_register_new_vport(phba, vport, ndlp); | 674 | lpfc_register_new_vport(phba, vport, ndlp); |
674 | return 0; | 675 | return 0; |
675 | } | 676 | } |
@@ -869,8 +870,8 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, | |||
869 | */ | 870 | */ |
870 | if ((phba->hba_flag & HBA_FIP_SUPPORT) && | 871 | if ((phba->hba_flag & HBA_FIP_SUPPORT) && |
871 | (phba->fcf.fcf_flag & FCF_DISCOVERY) && | 872 | (phba->fcf.fcf_flag & FCF_DISCOVERY) && |
872 | (irsp->ulpStatus != IOSTAT_LOCAL_REJECT) && | 873 | !((irsp->ulpStatus == IOSTAT_LOCAL_REJECT) && |
873 | (irsp->un.ulpWord[4] != IOERR_SLI_ABORTED)) { | 874 | (irsp->un.ulpWord[4] == IOERR_SLI_ABORTED))) { |
874 | lpfc_printf_log(phba, KERN_WARNING, LOG_FIP | LOG_ELS, | 875 | lpfc_printf_log(phba, KERN_WARNING, LOG_FIP | LOG_ELS, |
875 | "2611 FLOGI failed on FCF (x%x), " | 876 | "2611 FLOGI failed on FCF (x%x), " |
876 | "status:x%x/x%x, tmo:x%x, perform " | 877 | "status:x%x/x%x, tmo:x%x, perform " |
@@ -4107,13 +4108,13 @@ lpfc_els_clear_rrq(struct lpfc_vport *vport, | |||
4107 | pcmd += sizeof(uint32_t); | 4108 | pcmd += sizeof(uint32_t); |
4108 | rrq = (struct RRQ *)pcmd; | 4109 | rrq = (struct RRQ *)pcmd; |
4109 | rrq->rrq_exchg = be32_to_cpu(rrq->rrq_exchg); | 4110 | rrq->rrq_exchg = be32_to_cpu(rrq->rrq_exchg); |
4110 | rxid = be16_to_cpu(bf_get(rrq_rxid, rrq)); | 4111 | rxid = bf_get(rrq_rxid, rrq); |
4111 | 4112 | ||
4112 | lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, | 4113 | lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, |
4113 | "2883 Clear RRQ for SID:x%x OXID:x%x RXID:x%x" | 4114 | "2883 Clear RRQ for SID:x%x OXID:x%x RXID:x%x" |
4114 | " x%x x%x\n", | 4115 | " x%x x%x\n", |
4115 | be32_to_cpu(bf_get(rrq_did, rrq)), | 4116 | be32_to_cpu(bf_get(rrq_did, rrq)), |
4116 | be16_to_cpu(bf_get(rrq_oxid, rrq)), | 4117 | bf_get(rrq_oxid, rrq), |
4117 | rxid, | 4118 | rxid, |
4118 | iocb->iotag, iocb->iocb.ulpContext); | 4119 | iocb->iotag, iocb->iocb.ulpContext); |
4119 | 4120 | ||
@@ -4121,7 +4122,7 @@ lpfc_els_clear_rrq(struct lpfc_vport *vport, | |||
4121 | "Clear RRQ: did:x%x flg:x%x exchg:x%.08x", | 4122 | "Clear RRQ: did:x%x flg:x%x exchg:x%.08x", |
4122 | ndlp->nlp_DID, ndlp->nlp_flag, rrq->rrq_exchg); | 4123 | ndlp->nlp_DID, ndlp->nlp_flag, rrq->rrq_exchg); |
4123 | if (vport->fc_myDID == be32_to_cpu(bf_get(rrq_did, rrq))) | 4124 | if (vport->fc_myDID == be32_to_cpu(bf_get(rrq_did, rrq))) |
4124 | xri = be16_to_cpu(bf_get(rrq_oxid, rrq)); | 4125 | xri = bf_get(rrq_oxid, rrq); |
4125 | else | 4126 | else |
4126 | xri = rxid; | 4127 | xri = rxid; |
4127 | prrq = lpfc_get_active_rrq(vport, xri, ndlp->nlp_DID); | 4128 | prrq = lpfc_get_active_rrq(vport, xri, ndlp->nlp_DID); |
@@ -7290,8 +7291,9 @@ lpfc_cmpl_els_npiv_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, | |||
7290 | struct lpfc_vport *vport = cmdiocb->vport; | 7291 | struct lpfc_vport *vport = cmdiocb->vport; |
7291 | IOCB_t *irsp; | 7292 | IOCB_t *irsp; |
7292 | struct lpfc_nodelist *ndlp; | 7293 | struct lpfc_nodelist *ndlp; |
7293 | ndlp = (struct lpfc_nodelist *)cmdiocb->context1; | 7294 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); |
7294 | 7295 | ||
7296 | ndlp = (struct lpfc_nodelist *)cmdiocb->context1; | ||
7295 | irsp = &rspiocb->iocb; | 7297 | irsp = &rspiocb->iocb; |
7296 | lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, | 7298 | lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, |
7297 | "LOGO npiv cmpl: status:x%x/x%x did:x%x", | 7299 | "LOGO npiv cmpl: status:x%x/x%x did:x%x", |
@@ -7302,6 +7304,19 @@ lpfc_cmpl_els_npiv_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, | |||
7302 | 7304 | ||
7303 | /* Trigger the release of the ndlp after logo */ | 7305 | /* Trigger the release of the ndlp after logo */ |
7304 | lpfc_nlp_put(ndlp); | 7306 | lpfc_nlp_put(ndlp); |
7307 | |||
7308 | /* NPIV LOGO completes to NPort <nlp_DID> */ | ||
7309 | lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, | ||
7310 | "2928 NPIV LOGO completes to NPort x%x " | ||
7311 | "Data: x%x x%x x%x x%x\n", | ||
7312 | ndlp->nlp_DID, irsp->ulpStatus, irsp->un.ulpWord[4], | ||
7313 | irsp->ulpTimeout, vport->num_disc_nodes); | ||
7314 | |||
7315 | if (irsp->ulpStatus == IOSTAT_SUCCESS) { | ||
7316 | spin_lock_irq(shost->host_lock); | ||
7317 | vport->fc_flag &= ~FC_FABRIC; | ||
7318 | spin_unlock_irq(shost->host_lock); | ||
7319 | } | ||
7305 | } | 7320 | } |
7306 | 7321 | ||
7307 | /** | 7322 | /** |
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 301498301a8f..7a35df5e2038 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2004-2009 Emulex. All rights reserved. * | 4 | * Copyright (C) 2004-2011 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * | 7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * |
@@ -3569,6 +3569,10 @@ lpfc_register_remote_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) | |||
3569 | "rport add: did:x%x flg:x%x type x%x", | 3569 | "rport add: did:x%x flg:x%x type x%x", |
3570 | ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_type); | 3570 | ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_type); |
3571 | 3571 | ||
3572 | /* Don't add the remote port if unloading. */ | ||
3573 | if (vport->load_flag & FC_UNLOADING) | ||
3574 | return; | ||
3575 | |||
3572 | ndlp->rport = rport = fc_remote_port_add(shost, 0, &rport_ids); | 3576 | ndlp->rport = rport = fc_remote_port_add(shost, 0, &rport_ids); |
3573 | if (!rport || !get_device(&rport->dev)) { | 3577 | if (!rport || !get_device(&rport->dev)) { |
3574 | dev_printk(KERN_WARNING, &phba->pcidev->dev, | 3578 | dev_printk(KERN_WARNING, &phba->pcidev->dev, |
diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h index 8433ac0d9fb4..a8e2c6993d41 100644 --- a/drivers/scsi/lpfc/lpfc_hw4.h +++ b/drivers/scsi/lpfc/lpfc_hw4.h | |||
@@ -2108,6 +2108,8 @@ struct lpfc_mbx_pc_sli4_params { | |||
2108 | #define sgl_pp_align_WORD word12 | 2108 | #define sgl_pp_align_WORD word12 |
2109 | uint32_t rsvd_13_63[51]; | 2109 | uint32_t rsvd_13_63[51]; |
2110 | }; | 2110 | }; |
2111 | #define SLI4_PAGE_ALIGN(addr) (((addr)+((SLI4_PAGE_SIZE)-1)) \ | ||
2112 | &(~((SLI4_PAGE_SIZE)-1))) | ||
2111 | 2113 | ||
2112 | struct lpfc_sli4_parameters { | 2114 | struct lpfc_sli4_parameters { |
2113 | uint32_t word0; | 2115 | uint32_t word0; |
@@ -2524,7 +2526,7 @@ struct wqe_common { | |||
2524 | #define wqe_wqes_WORD word10 | 2526 | #define wqe_wqes_WORD word10 |
2525 | /* Note that this field overlaps above fields */ | 2527 | /* Note that this field overlaps above fields */ |
2526 | #define wqe_wqid_SHIFT 1 | 2528 | #define wqe_wqid_SHIFT 1 |
2527 | #define wqe_wqid_MASK 0x0000007f | 2529 | #define wqe_wqid_MASK 0x00007fff |
2528 | #define wqe_wqid_WORD word10 | 2530 | #define wqe_wqid_WORD word10 |
2529 | #define wqe_pri_SHIFT 16 | 2531 | #define wqe_pri_SHIFT 16 |
2530 | #define wqe_pri_MASK 0x00000007 | 2532 | #define wqe_pri_MASK 0x00000007 |
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 505f88443b5c..7b6a089796d7 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -4906,6 +4906,7 @@ lpfc_sli4_create_rpi_hdr(struct lpfc_hba *phba) | |||
4906 | uint16_t rpi_limit, curr_rpi_range; | 4906 | uint16_t rpi_limit, curr_rpi_range; |
4907 | struct lpfc_dmabuf *dmabuf; | 4907 | struct lpfc_dmabuf *dmabuf; |
4908 | struct lpfc_rpi_hdr *rpi_hdr; | 4908 | struct lpfc_rpi_hdr *rpi_hdr; |
4909 | uint32_t rpi_count; | ||
4909 | 4910 | ||
4910 | rpi_limit = phba->sli4_hba.max_cfg_param.rpi_base + | 4911 | rpi_limit = phba->sli4_hba.max_cfg_param.rpi_base + |
4911 | phba->sli4_hba.max_cfg_param.max_rpi - 1; | 4912 | phba->sli4_hba.max_cfg_param.max_rpi - 1; |
@@ -4920,7 +4921,9 @@ lpfc_sli4_create_rpi_hdr(struct lpfc_hba *phba) | |||
4920 | * and to allow the full max_rpi range per port. | 4921 | * and to allow the full max_rpi range per port. |
4921 | */ | 4922 | */ |
4922 | if ((curr_rpi_range + (LPFC_RPI_HDR_COUNT - 1)) > rpi_limit) | 4923 | if ((curr_rpi_range + (LPFC_RPI_HDR_COUNT - 1)) > rpi_limit) |
4923 | return NULL; | 4924 | rpi_count = rpi_limit - curr_rpi_range; |
4925 | else | ||
4926 | rpi_count = LPFC_RPI_HDR_COUNT; | ||
4924 | 4927 | ||
4925 | /* | 4928 | /* |
4926 | * First allocate the protocol header region for the port. The | 4929 | * First allocate the protocol header region for the port. The |
@@ -4961,7 +4964,7 @@ lpfc_sli4_create_rpi_hdr(struct lpfc_hba *phba) | |||
4961 | * The next_rpi stores the next module-64 rpi value to post | 4964 | * The next_rpi stores the next module-64 rpi value to post |
4962 | * in any subsequent rpi memory region postings. | 4965 | * in any subsequent rpi memory region postings. |
4963 | */ | 4966 | */ |
4964 | phba->sli4_hba.next_rpi += LPFC_RPI_HDR_COUNT; | 4967 | phba->sli4_hba.next_rpi += rpi_count; |
4965 | spin_unlock_irq(&phba->hbalock); | 4968 | spin_unlock_irq(&phba->hbalock); |
4966 | return rpi_hdr; | 4969 | return rpi_hdr; |
4967 | 4970 | ||
diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c index fbab9734e9b4..e6ce9033f85e 100644 --- a/drivers/scsi/lpfc/lpfc_mbox.c +++ b/drivers/scsi/lpfc/lpfc_mbox.c | |||
@@ -1736,7 +1736,7 @@ lpfc_sli4_config(struct lpfc_hba *phba, struct lpfcMboxq *mbox, | |||
1736 | } | 1736 | } |
1737 | 1737 | ||
1738 | /* Setup for the none-embedded mbox command */ | 1738 | /* Setup for the none-embedded mbox command */ |
1739 | pcount = (PAGE_ALIGN(length))/SLI4_PAGE_SIZE; | 1739 | pcount = (SLI4_PAGE_ALIGN(length))/SLI4_PAGE_SIZE; |
1740 | pcount = (pcount > LPFC_SLI4_MBX_SGE_MAX_PAGES) ? | 1740 | pcount = (pcount > LPFC_SLI4_MBX_SGE_MAX_PAGES) ? |
1741 | LPFC_SLI4_MBX_SGE_MAX_PAGES : pcount; | 1741 | LPFC_SLI4_MBX_SGE_MAX_PAGES : pcount; |
1742 | /* Allocate record for keeping SGE virtual addresses */ | 1742 | /* Allocate record for keeping SGE virtual addresses */ |
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index dacabbe0a586..580b00bc35ce 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -5018,10 +5018,11 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) | |||
5018 | lpfc_reg_fcfi(phba, mboxq); | 5018 | lpfc_reg_fcfi(phba, mboxq); |
5019 | mboxq->vport = phba->pport; | 5019 | mboxq->vport = phba->pport; |
5020 | rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); | 5020 | rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); |
5021 | if (rc == MBX_SUCCESS) | 5021 | if (rc != MBX_SUCCESS) |
5022 | rc = 0; | ||
5023 | else | ||
5024 | goto out_unset_queue; | 5022 | goto out_unset_queue; |
5023 | rc = 0; | ||
5024 | phba->fcf.fcfi = bf_get(lpfc_reg_fcfi_fcfi, | ||
5025 | &mboxq->u.mqe.un.reg_fcfi); | ||
5025 | } | 5026 | } |
5026 | /* | 5027 | /* |
5027 | * The port is ready, set the host's link state to LINK_DOWN | 5028 | * The port is ready, set the host's link state to LINK_DOWN |