diff options
author | James Smart <James.Smart@Emulex.Com> | 2008-12-04 22:39:13 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-12-29 12:24:26 -0500 |
commit | eada272dfc32ba3dcd33e7ca5875337defb13c54 (patch) | |
tree | 89e52427d2458a59db3a1aca0fdc01453bf1f748 /drivers/scsi/lpfc/lpfc_vport.c | |
parent | 109f6ed05aadb7dd1cc9671a63603658d3ba518e (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_vport.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_vport.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/drivers/scsi/lpfc/lpfc_vport.c b/drivers/scsi/lpfc/lpfc_vport.c index a7de1cc02b40..63b54c66756c 100644 --- a/drivers/scsi/lpfc/lpfc_vport.c +++ b/drivers/scsi/lpfc/lpfc_vport.c | |||
@@ -288,10 +288,8 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) | |||
288 | int vpi; | 288 | int vpi; |
289 | int rc = VPORT_ERROR; | 289 | int rc = VPORT_ERROR; |
290 | int status; | 290 | int status; |
291 | int size; | ||
292 | 291 | ||
293 | if ((phba->sli_rev < 3) || | 292 | if ((phba->sli_rev < 3) || !(phba->cfg_enable_npiv)) { |
294 | !(phba->sli3_options & LPFC_SLI3_NPIV_ENABLED)) { | ||
295 | lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, | 293 | lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, |
296 | "1808 Create VPORT failed: " | 294 | "1808 Create VPORT failed: " |
297 | "NPIV is not enabled: SLImode:%d\n", | 295 | "NPIV is not enabled: SLImode:%d\n", |
@@ -351,20 +349,6 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) | |||
351 | 349 | ||
352 | memcpy(vport->fc_portname.u.wwn, vport->fc_sparam.portName.u.wwn, 8); | 350 | memcpy(vport->fc_portname.u.wwn, vport->fc_sparam.portName.u.wwn, 8); |
353 | memcpy(vport->fc_nodename.u.wwn, vport->fc_sparam.nodeName.u.wwn, 8); | 351 | memcpy(vport->fc_nodename.u.wwn, vport->fc_sparam.nodeName.u.wwn, 8); |
354 | size = strnlen(fc_vport->symbolic_name, LPFC_VNAME_LEN); | ||
355 | if (size) { | ||
356 | vport->vname = kzalloc(size+1, GFP_KERNEL); | ||
357 | if (!vport->vname) { | ||
358 | lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, | ||
359 | "1814 Create VPORT failed. " | ||
360 | "vname allocation failed.\n"); | ||
361 | rc = VPORT_ERROR; | ||
362 | lpfc_free_vpi(phba, vpi); | ||
363 | destroy_port(vport); | ||
364 | goto error_out; | ||
365 | } | ||
366 | memcpy(vport->vname, fc_vport->symbolic_name, size+1); | ||
367 | } | ||
368 | if (fc_vport->node_name != 0) | 352 | if (fc_vport->node_name != 0) |
369 | u64_to_wwn(fc_vport->node_name, vport->fc_nodename.u.wwn); | 353 | u64_to_wwn(fc_vport->node_name, vport->fc_nodename.u.wwn); |
370 | if (fc_vport->port_name != 0) | 354 | if (fc_vport->port_name != 0) |
@@ -394,6 +378,9 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) | |||
394 | goto error_out; | 378 | goto error_out; |
395 | } | 379 | } |
396 | 380 | ||
381 | /* Create binary sysfs attribute for vport */ | ||
382 | lpfc_alloc_sysfs_attr(vport); | ||
383 | |||
397 | *(struct lpfc_vport **)fc_vport->dd_data = vport; | 384 | *(struct lpfc_vport **)fc_vport->dd_data = vport; |
398 | vport->fc_vport = fc_vport; | 385 | vport->fc_vport = fc_vport; |
399 | 386 | ||
@@ -405,6 +392,7 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) | |||
405 | } | 392 | } |
406 | 393 | ||
407 | if (disable) { | 394 | if (disable) { |
395 | lpfc_vport_set_state(vport, FC_VPORT_DISABLED); | ||
408 | rc = VPORT_OK; | 396 | rc = VPORT_OK; |
409 | goto out; | 397 | goto out; |
410 | } | 398 | } |
@@ -587,8 +575,12 @@ lpfc_vport_delete(struct fc_vport *fc_vport) | |||
587 | spin_lock_irq(&phba->hbalock); | 575 | spin_lock_irq(&phba->hbalock); |
588 | vport->load_flag |= FC_UNLOADING; | 576 | vport->load_flag |= FC_UNLOADING; |
589 | spin_unlock_irq(&phba->hbalock); | 577 | spin_unlock_irq(&phba->hbalock); |
590 | kfree(vport->vname); | 578 | |
579 | lpfc_free_sysfs_attr(vport); | ||
580 | |||
591 | lpfc_debugfs_terminate(vport); | 581 | lpfc_debugfs_terminate(vport); |
582 | |||
583 | /* Remove FC host and then SCSI host with the vport */ | ||
592 | fc_remove_host(lpfc_shost_from_vport(vport)); | 584 | fc_remove_host(lpfc_shost_from_vport(vport)); |
593 | scsi_remove_host(lpfc_shost_from_vport(vport)); | 585 | scsi_remove_host(lpfc_shost_from_vport(vport)); |
594 | 586 | ||