aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_els.c
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2011-07-22 18:37:06 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-07-27 07:12:19 -0400
commit5248a7498e5f6f3d6d276080466946f82f0ea56a (patch)
tree902e39cd0c393453094a631a0ced072cdc885f6e /drivers/scsi/lpfc/lpfc_els.c
parent7851fe2c7f294d0beccf4c3d6af52e8247b89f00 (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/lpfc_els.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index d3a712a27e3..1725b81770e 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 }