diff options
author | James Smart <James.Smart@Emulex.Com> | 2008-12-05 06:39:13 +0300 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-12-29 20:24:26 +0300 |
commit | eada272dfc32ba3dcd33e7ca5875337defb13c54 (patch) | |
tree | 89e52427d2458a59db3a1aca0fdc01453bf1f748 /drivers/scsi/lpfc/lpfc_init.c | |
parent | 109f6ed05aadb7dd1cc9671a63603658d3ba518e (diff) | |
download | linux-eada272dfc32ba3dcd33e7ca5875337defb13c54.tar.xz |
[SCSI] lpfc 8.3.0 : Fix multiple NPIV issues
- Fix lock up on rmmod with vports defined by having
lpfc_pci_remove_one() invoke fc_vport_terminate() to remove all the
vports before invoking fc_remove_host() for the physical port
- Fix echotest failure when NPIV is enabled
- Add the vport_disable function to the physical port's transport
template to make the vport disable attribute visible
- Set the vport state to DISABLE on create if the disable flag is
true
- Call lpfc_alloc_sysfs_attr() for vports so that statistical data
collection works on them
- Support setting a vport's symbolic name via sysfs by writing to
/sys/class/fc_vport/vportX/symbolic_name
- Fix create vport fails when link is down or in loop mode. Should be
able to be create vports any time NPIV is enabled
- Fix slow vport deletes when deleting multiple vports at once
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index b213d1d01fee..56ed5282117c 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -2041,8 +2041,6 @@ destroy_port(struct lpfc_vport *vport) struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_hba *phba = vport->phba; - kfree(vport->vname); - lpfc_debugfs_terminate(vport); fc_remove_host(shost); scsi_remove_host(shost); @@ -2716,18 +2714,27 @@ lpfc_pci_remove_one(struct pci_dev *pdev) { struct Scsi_Host *shost = pci_get_drvdata(pdev); struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; + struct lpfc_vport **vports; struct lpfc_hba *phba = vport->phba; + int i; int bars = pci_select_bars(pdev, IORESOURCE_MEM); spin_lock_irq(&phba->hbalock); vport->load_flag |= FC_UNLOADING; spin_unlock_irq(&phba->hbalock); - kfree(vport->vname); lpfc_free_sysfs_attr(vport); kthread_stop(phba->worker_thread); + /* Release all the vports against this physical port */ + vports = lpfc_create_vport_work_array(phba); + if (vports != NULL) + for (i = 1; i <= phba->max_vpi && vports[i] != NULL; i++) + fc_vport_terminate(vports[i]->fc_vport); + lpfc_destroy_vport_work_array(phba, vports); + + /* Remove FC host and then SCSI host with the physical port */ fc_remove_host(shost); scsi_remove_host(shost); lpfc_cleanup(vport); |