[SCSI] lpfc 8.3.7: Fix NPIV operation errors
authorJames Smart <james.smart@emulex.com>
Mon, 21 Dec 2009 22:02:00 +0000 (17:02 -0500)
committerJames Bottomley <James.Bottomley@suse.de>
Mon, 4 Jan 2010 17:39:43 +0000 (11:39 -0600)
Fix NPIV operation errors:
- Fix vport not logging out of fabric when being deleted
- Fix vport fails to discover targets after devloss timeout.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/lpfc/lpfc_els.c
drivers/scsi/lpfc/lpfc_hbadisc.c
drivers/scsi/lpfc/lpfc_vport.c

index ce522702a6c13b951e1790a846b7758fa9c71e97..bb2e43a9e96cee49d1c7a1a7cc48be1ff2c3cd68 100644 (file)
@@ -5948,8 +5948,8 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
                                lpfc_initial_fdisc(vport);
                        break;
                }
-
        } else {
+               vport->vpi_state |= LPFC_VPI_REGISTERED;
                if (vport == phba->pport)
                        if (phba->sli_rev < LPFC_SLI_REV4)
                                lpfc_issue_fabric_reglogin(vport);
index 3b9424427652a630f60bf197b1cd1146d4953d43..401167de4ff096d33186af30564eabb0468efa95 100755 (executable)
@@ -2260,6 +2260,7 @@ lpfc_mbx_cmpl_unreg_vpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
                break;
        }
        vport->vpi_state &= ~LPFC_VPI_REGISTERED;
+       vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI;
        vport->unreg_vpi_cmpl = VPORT_OK;
        mempool_free(pmb, phba->mbox_mem_pool);
        /*
index 7d6dd83d35926d039efde743a819c3bbf835d65e..c3a70c4c9433a785d3720d350ba4f4770d3af7ef 100644 (file)
@@ -700,7 +700,7 @@ lpfc_vport_delete(struct fc_vport *fc_vport)
                        }
                        spin_unlock_irq(&phba->ndlp_lock);
                }
-               if (vport->vpi_state != LPFC_VPI_REGISTERED)
+               if (!(vport->vpi_state & LPFC_VPI_REGISTERED))
                        goto skip_logo;
                vport->unreg_vpi_cmpl = VPORT_INVAL;
                timeout = msecs_to_jiffies(phba->fc_ratov * 2000);