diff options
author | James Smart <james.smart@emulex.com> | 2011-07-22 18:37:06 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-07-27 07:12:19 -0400 |
commit | 5248a7498e5f6f3d6d276080466946f82f0ea56a (patch) | |
tree | 902e39cd0c393453094a631a0ced072cdc885f6e /drivers/scsi/lpfc | |
parent | 7851fe2c7f294d0beccf4c3d6af52e8247b89f00 (diff) |
[SCSI] lpfc 8.3.25: Fabric and Target Discovery Fixes
Fabric and Target Discovery Fixes
- Clear FC_VPORT_NEEDS_INIT_VPI flag during completion of REG_VFI mailbox
command.
- Prevent SLI3 Code from unregistering the physical VPI.
- Add an else clause to the code that checks and sets
sp->cmn.request_multiple_Nport to clear the bit.
- Remove a redundant mbox free.
- Modified lpfc_sli4_async_fip_evt to pass in physical VPI toi
lpfc_find_vport_by_vpid function.
- Modified lpfc_find_vport_by_vpid to translate physical VPI to logical VPI
before comparing with vport VPI.
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_els.c | 33 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 4 |
3 files changed, 18 insertions, 21 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index d3a712a27e31..1725b81770e9 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c | |||
@@ -647,21 +647,15 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | |||
647 | } | 647 | } |
648 | lpfc_cleanup_pending_mbox(vport); | 648 | lpfc_cleanup_pending_mbox(vport); |
649 | 649 | ||
650 | if (phba->sli_rev == LPFC_SLI_REV4) | 650 | if (phba->sli_rev == LPFC_SLI_REV4) { |
651 | lpfc_sli4_unreg_all_rpis(vport); | 651 | lpfc_sli4_unreg_all_rpis(vport); |
652 | |||
653 | if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) { | ||
654 | lpfc_mbx_unreg_vpi(vport); | 652 | lpfc_mbx_unreg_vpi(vport); |
655 | spin_lock_irq(shost->host_lock); | 653 | spin_lock_irq(shost->host_lock); |
656 | vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; | 654 | vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; |
657 | spin_unlock_irq(shost->host_lock); | 655 | /* |
658 | } | 656 | * If VPI is unreged, driver need to do INIT_VPI |
659 | /* | 657 | * before re-registering |
660 | * If VPI is unreged, driver need to do INIT_VPI | 658 | */ |
661 | * before re-registering | ||
662 | */ | ||
663 | if (phba->sli_rev == LPFC_SLI_REV4) { | ||
664 | spin_lock_irq(shost->host_lock); | ||
665 | vport->fc_flag |= FC_VPORT_NEEDS_INIT_VPI; | 659 | vport->fc_flag |= FC_VPORT_NEEDS_INIT_VPI; |
666 | spin_unlock_irq(shost->host_lock); | 660 | spin_unlock_irq(shost->host_lock); |
667 | } | 661 | } |
@@ -1096,11 +1090,14 @@ lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | |||
1096 | /* Set the fcfi to the fcfi we registered with */ | 1090 | /* Set the fcfi to the fcfi we registered with */ |
1097 | elsiocb->iocb.ulpContext = phba->fcf.fcfi; | 1091 | elsiocb->iocb.ulpContext = phba->fcf.fcfi; |
1098 | } | 1092 | } |
1099 | } else if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) { | 1093 | } else { |
1100 | sp->cmn.request_multiple_Nport = 1; | 1094 | if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) { |
1101 | /* For FLOGI, Let FLOGI rsp set the NPortID for VPI 0 */ | 1095 | sp->cmn.request_multiple_Nport = 1; |
1102 | icmd->ulpCt_h = 1; | 1096 | /* For FLOGI, Let FLOGI rsp set the NPortID for VPI 0 */ |
1103 | icmd->ulpCt_l = 0; | 1097 | icmd->ulpCt_h = 1; |
1098 | icmd->ulpCt_l = 0; | ||
1099 | } else | ||
1100 | sp->cmn.request_multiple_Nport = 0; | ||
1104 | } | 1101 | } |
1105 | 1102 | ||
1106 | if (phba->fc_topology != LPFC_TOPOLOGY_LOOP) { | 1103 | if (phba->fc_topology != LPFC_TOPOLOGY_LOOP) { |
@@ -6608,7 +6605,7 @@ lpfc_find_vport_by_vpid(struct lpfc_hba *phba, uint16_t vpi) | |||
6608 | { | 6605 | { |
6609 | struct lpfc_vport *vport; | 6606 | struct lpfc_vport *vport; |
6610 | unsigned long flags; | 6607 | unsigned long flags; |
6611 | int i; | 6608 | int i = 0; |
6612 | 6609 | ||
6613 | /* The physical ports are always vpi 0 - translate is unnecessary. */ | 6610 | /* The physical ports are always vpi 0 - translate is unnecessary. */ |
6614 | if (vpi > 0) { | 6611 | if (vpi > 0) { |
@@ -6631,7 +6628,7 @@ lpfc_find_vport_by_vpid(struct lpfc_hba *phba, uint16_t vpi) | |||
6631 | 6628 | ||
6632 | spin_lock_irqsave(&phba->hbalock, flags); | 6629 | spin_lock_irqsave(&phba->hbalock, flags); |
6633 | list_for_each_entry(vport, &phba->port_list, listentry) { | 6630 | list_for_each_entry(vport, &phba->port_list, listentry) { |
6634 | if (vport->vpi == vpi) { | 6631 | if (vport->vpi == i) { |
6635 | spin_unlock_irqrestore(&phba->hbalock, flags); | 6632 | spin_unlock_irqrestore(&phba->hbalock, flags); |
6636 | return vport; | 6633 | return vport; |
6637 | } | 6634 | } |
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 18d0dbfda2bc..bef17e3e419a 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
@@ -2247,7 +2247,6 @@ read_next_fcf: | |||
2247 | spin_lock_irq(&phba->hbalock); | 2247 | spin_lock_irq(&phba->hbalock); |
2248 | phba->fcf.fcf_flag |= FCF_REDISC_FOV; | 2248 | phba->fcf.fcf_flag |= FCF_REDISC_FOV; |
2249 | spin_unlock_irq(&phba->hbalock); | 2249 | spin_unlock_irq(&phba->hbalock); |
2250 | lpfc_sli4_mbox_cmd_free(phba, mboxq); | ||
2251 | lpfc_sli4_fcf_scan_read_fcf_rec(phba, | 2250 | lpfc_sli4_fcf_scan_read_fcf_rec(phba, |
2252 | LPFC_FCOE_FCF_GET_FIRST); | 2251 | LPFC_FCOE_FCF_GET_FIRST); |
2253 | return; | 2252 | return; |
@@ -2645,6 +2644,7 @@ lpfc_mbx_cmpl_reg_vfi(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) | |||
2645 | vport->vpi_state |= LPFC_VPI_REGISTERED; | 2644 | vport->vpi_state |= LPFC_VPI_REGISTERED; |
2646 | vport->fc_flag |= FC_VFI_REGISTERED; | 2645 | vport->fc_flag |= FC_VFI_REGISTERED; |
2647 | vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI; | 2646 | vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI; |
2647 | vport->fc_flag &= ~FC_VPORT_NEEDS_INIT_VPI; | ||
2648 | spin_unlock_irq(shost->host_lock); | 2648 | spin_unlock_irq(shost->host_lock); |
2649 | 2649 | ||
2650 | if (vport->port_state == LPFC_FABRIC_CFG_LINK) { | 2650 | if (vport->port_state == LPFC_FABRIC_CFG_LINK) { |
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index bf999b2600f4..9d3e8affccb8 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -3649,7 +3649,7 @@ lpfc_sli4_async_fip_evt(struct lpfc_hba *phba, | |||
3649 | " tag 0x%x\n", acqe_fip->index, acqe_fip->event_tag); | 3649 | " tag 0x%x\n", acqe_fip->index, acqe_fip->event_tag); |
3650 | 3650 | ||
3651 | vport = lpfc_find_vport_by_vpid(phba, | 3651 | vport = lpfc_find_vport_by_vpid(phba, |
3652 | acqe_fip->index - phba->vpi_base); | 3652 | acqe_fip->index); |
3653 | ndlp = lpfc_sli4_perform_vport_cvl(vport); | 3653 | ndlp = lpfc_sli4_perform_vport_cvl(vport); |
3654 | if (!ndlp) | 3654 | if (!ndlp) |
3655 | break; | 3655 | break; |
@@ -4518,7 +4518,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) | |||
4518 | } | 4518 | } |
4519 | } | 4519 | } |
4520 | 4520 | ||
4521 | return rc; | 4521 | return 0; |
4522 | 4522 | ||
4523 | out_free_fcp_eq_hdl: | 4523 | out_free_fcp_eq_hdl: |
4524 | kfree(phba->sli4_hba.fcp_eq_hdl); | 4524 | kfree(phba->sli4_hba.fcp_eq_hdl); |