aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2008-12-04 22:39:13 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-12-29 12:24:26 -0500
commiteada272dfc32ba3dcd33e7ca5875337defb13c54 (patch)
tree89e52427d2458a59db3a1aca0fdc01453bf1f748 /drivers/scsi/lpfc/lpfc_init.c
parent109f6ed05aadb7dd1cc9671a63603658d3ba518e (diff)
[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.c13
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)
2041 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 2041 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
2042 struct lpfc_hba *phba = vport->phba; 2042 struct lpfc_hba *phba = vport->phba;
2043 2043
2044 kfree(vport->vname);
2045
2046 lpfc_debugfs_terminate(vport); 2044 lpfc_debugfs_terminate(vport);
2047 fc_remove_host(shost); 2045 fc_remove_host(shost);
2048 scsi_remove_host(shost); 2046 scsi_remove_host(shost);
@@ -2716,18 +2714,27 @@ lpfc_pci_remove_one(struct pci_dev *pdev)
2716{ 2714{
2717 struct Scsi_Host *shost = pci_get_drvdata(pdev); 2715 struct Scsi_Host *shost = pci_get_drvdata(pdev);
2718 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; 2716 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
2717 struct lpfc_vport **vports;
2719 struct lpfc_hba *phba = vport->phba; 2718 struct lpfc_hba *phba = vport->phba;
2719 int i;
2720 int bars = pci_select_bars(pdev, IORESOURCE_MEM); 2720 int bars = pci_select_bars(pdev, IORESOURCE_MEM);
2721 2721
2722 spin_lock_irq(&phba->hbalock); 2722 spin_lock_irq(&phba->hbalock);
2723 vport->load_flag |= FC_UNLOADING; 2723 vport->load_flag |= FC_UNLOADING;
2724 spin_unlock_irq(&phba->hbalock); 2724 spin_unlock_irq(&phba->hbalock);
2725 2725
2726 kfree(vport->vname);
2727 lpfc_free_sysfs_attr(vport); 2726 lpfc_free_sysfs_attr(vport);
2728 2727
2729 kthread_stop(phba->worker_thread); 2728 kthread_stop(phba->worker_thread);
2730 2729
2730 /* Release all the vports against this physical port */
2731 vports = lpfc_create_vport_work_array(phba);
2732 if (vports != NULL)
2733 for (i = 1; i <= phba->max_vpi && vports[i] != NULL; i++)
2734 fc_vport_terminate(vports[i]->fc_vport);
2735 lpfc_destroy_vport_work_array(phba, vports);
2736
2737 /* Remove FC host and then SCSI host with the physical port */
2731 fc_remove_host(shost); 2738 fc_remove_host(shost);
2732 scsi_remove_host(shost); 2739 scsi_remove_host(shost);
2733 lpfc_cleanup(vport); 2740 lpfc_cleanup(vport);