• Home
  • Raw
  • Download

Lines Matching refs:vport

53 inline void lpfc_vport_set_state(struct lpfc_vport *vport,  in lpfc_vport_set_state()  argument
56 struct fc_vport *fc_vport = vport->fc_vport; in lpfc_vport_set_state()
76 vport->port_state = LPFC_VPORT_FAILED; in lpfc_vport_set_state()
79 vport->port_state = LPFC_VPORT_UNKNOWN; in lpfc_vport_set_state()
118 lpfc_vport_sparm(struct lpfc_hba *phba, struct lpfc_vport *vport) in lpfc_vport_sparm() argument
131 rc = lpfc_read_sparam(phba, pmb, vport->vpi); in lpfc_vport_sparm()
144 pmb->vport = vport; in lpfc_vport_sparm()
148 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_sparm()
157 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_sparm()
169 memcpy(&vport->fc_sparam, mp->virt, sizeof (struct serv_parm)); in lpfc_vport_sparm()
170 memcpy(&vport->fc_nodename, &vport->fc_sparam.nodeName, in lpfc_vport_sparm()
172 memcpy(&vport->fc_portname, &vport->fc_sparam.portName, in lpfc_vport_sparm()
207 struct lpfc_vport *vport; in lpfc_unique_wwpn() local
211 list_for_each_entry(vport, &phba->port_list, listentry) { in lpfc_unique_wwpn()
212 if (vport == new_vport) in lpfc_unique_wwpn()
215 if (memcmp(&vport->fc_sparam.portName, in lpfc_unique_wwpn()
241 static void lpfc_discovery_wait(struct lpfc_vport *vport) in lpfc_discovery_wait() argument
243 struct lpfc_hba *phba = vport->phba; in lpfc_discovery_wait()
260 if ((vport->num_disc_nodes > 0) || in lpfc_discovery_wait()
261 (vport->fc_flag & wait_flags) || in lpfc_discovery_wait()
262 ((vport->port_state > LPFC_VPORT_FAILED) && in lpfc_discovery_wait()
263 (vport->port_state < LPFC_VPORT_READY))) { in lpfc_discovery_wait()
264 lpfc_printf_vlog(vport, KERN_INFO, LOG_VPORT, in lpfc_discovery_wait()
269 vport->port_state, vport->fc_flag, in lpfc_discovery_wait()
270 vport->num_disc_nodes, in lpfc_discovery_wait()
275 lpfc_printf_vlog(vport, KERN_INFO, LOG_VPORT, in lpfc_discovery_wait()
279 vport->port_state, vport->fc_flag, in lpfc_discovery_wait()
287 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_discovery_wait()
290 vport->port_state, vport->fc_flag, in lpfc_discovery_wait()
301 struct lpfc_vport *vport = NULL; in lpfc_vport_create() local
345 vport = lpfc_create_port(phba, instance, &fc_vport->dev); in lpfc_vport_create()
346 if (!vport) { in lpfc_vport_create()
354 vport->vpi = vpi; in lpfc_vport_create()
355 lpfc_debugfs_initialize(vport); in lpfc_vport_create()
357 if ((status = lpfc_vport_sparm(phba, vport))) { in lpfc_vport_create()
359 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_create()
363 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_create()
369 destroy_port(vport); in lpfc_vport_create()
373 u64_to_wwn(fc_vport->node_name, vport->fc_nodename.u.wwn); in lpfc_vport_create()
374 u64_to_wwn(fc_vport->port_name, vport->fc_portname.u.wwn); in lpfc_vport_create()
376 memcpy(&vport->fc_sparam.portName, vport->fc_portname.u.wwn, 8); in lpfc_vport_create()
377 memcpy(&vport->fc_sparam.nodeName, vport->fc_nodename.u.wwn, 8); in lpfc_vport_create()
379 if (!lpfc_valid_wwn_format(phba, &vport->fc_sparam.nodeName, "WWNN") || in lpfc_vport_create()
380 !lpfc_valid_wwn_format(phba, &vport->fc_sparam.portName, "WWPN")) { in lpfc_vport_create()
381 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_create()
385 destroy_port(vport); in lpfc_vport_create()
390 if (!lpfc_unique_wwpn(phba, vport)) { in lpfc_vport_create()
391 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_create()
395 destroy_port(vport); in lpfc_vport_create()
401 lpfc_alloc_sysfs_attr(vport); in lpfc_vport_create()
404 vport->cfg_lun_queue_depth = phba->pport->cfg_lun_queue_depth; in lpfc_vport_create()
407 vport->cfg_enable_fc4_type = LPFC_ENABLE_FCP; in lpfc_vport_create()
409 *(struct lpfc_vport **)fc_vport->dd_data = vport; in lpfc_vport_create()
410 vport->fc_vport = fc_vport; in lpfc_vport_create()
413 vport->load_flag |= FC_ALLOW_FDMI; in lpfc_vport_create()
417 vport->fdmi_hba_mask = phba->pport->fdmi_hba_mask; in lpfc_vport_create()
418 vport->fdmi_port_mask = phba->pport->fdmi_port_mask; in lpfc_vport_create()
427 rc = lpfc_sli4_init_vpi(vport); in lpfc_vport_create()
441 vport->fc_flag |= FC_VPORT_NEEDS_INIT_VPI; in lpfc_vport_create()
442 lpfc_vport_set_state(vport, FC_VPORT_LINKDOWN); in lpfc_vport_create()
450 lpfc_vport_set_state(vport, FC_VPORT_LINKDOWN); in lpfc_vport_create()
456 lpfc_vport_set_state(vport, FC_VPORT_DISABLED); in lpfc_vport_create()
468 lpfc_set_disctmo(vport); in lpfc_vport_create()
469 lpfc_initial_fdisc(vport); in lpfc_vport_create()
471 lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP); in lpfc_vport_create()
472 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_create()
476 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_vport_create()
481 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_create()
483 lpfc_host_attrib_init(lpfc_shost_from_vport(vport)); in lpfc_vport_create()
491 struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data; in disable_vport() local
492 struct lpfc_hba *phba = vport->phba; in disable_vport()
495 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in disable_vport()
497 ndlp = lpfc_findnode_did(vport, Fabric_DID); in disable_vport()
500 vport->unreg_vpi_cmpl = VPORT_INVAL; in disable_vport()
502 if (!lpfc_issue_els_npiv_logo(vport, ndlp)) in disable_vport()
503 while (vport->unreg_vpi_cmpl == VPORT_INVAL && timeout) in disable_vport()
507 lpfc_sli_host_down(vport); in disable_vport()
512 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { in disable_vport()
517 lpfc_disc_state_machine(vport, ndlp, NULL, in disable_vport()
520 lpfc_cleanup_rpis(vport, 1); in disable_vport()
522 lpfc_stop_vport_timers(vport); in disable_vport()
523 lpfc_unreg_all_rpis(vport); in disable_vport()
524 lpfc_unreg_default_rpis(vport); in disable_vport()
529 lpfc_mbx_unreg_vpi(vport); in disable_vport()
532 vport->fc_flag |= FC_VPORT_NEEDS_INIT_VPI; in disable_vport()
536 lpfc_vport_set_state(vport, FC_VPORT_DISABLED); in disable_vport()
537 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in disable_vport()
545 struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data; in enable_vport() local
546 struct lpfc_hba *phba = vport->phba; in enable_vport()
548 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in enable_vport()
552 lpfc_vport_set_state(vport, FC_VPORT_LINKDOWN); in enable_vport()
557 vport->load_flag |= FC_LOADING; in enable_vport()
558 if (vport->fc_flag & FC_VPORT_NEEDS_INIT_VPI) { in enable_vport()
560 lpfc_issue_init_vpi(vport); in enable_vport()
564 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; in enable_vport()
574 lpfc_set_disctmo(vport); in enable_vport()
575 lpfc_initial_fdisc(vport); in enable_vport()
577 lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP); in enable_vport()
578 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in enable_vport()
582 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in enable_vport()
586 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in enable_vport()
605 struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data; in lpfc_vport_delete() local
606 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_vport_delete()
607 struct lpfc_hba *phba = vport->phba; in lpfc_vport_delete()
611 if (vport->port_type == LPFC_PHYSICAL_PORT) { in lpfc_vport_delete()
612 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_delete()
619 if ((vport->vport_flag & STATIC_VPORT) && in lpfc_vport_delete()
621 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_delete()
627 vport->load_flag |= FC_UNLOADING; in lpfc_vport_delete()
636 vport->port_state > LPFC_VPORT_FAILED && in lpfc_vport_delete()
637 vport->port_state < LPFC_VPORT_READY) { in lpfc_vport_delete()
641 if (vport->port_state > LPFC_VPORT_FAILED && in lpfc_vport_delete()
642 vport->port_state < LPFC_VPORT_READY) in lpfc_vport_delete()
655 lpfc_free_sysfs_attr(vport); in lpfc_vport_delete()
657 lpfc_debugfs_terminate(vport); in lpfc_vport_delete()
665 ndlp = lpfc_findnode_did(vport, NameServer_DID); in lpfc_vport_delete()
686 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_vport_delete()
690 ndlp = lpfc_enable_node(vport, ndlp, in lpfc_vport_delete()
696 lpfc_dequeue_node(vport, ndlp); in lpfc_vport_delete()
713 if (vport->cfg_enable_da_id) { in lpfc_vport_delete()
715 if (!lpfc_ns_cmd(vport, SLI_CTNS_DA_ID, 0, 0)) in lpfc_vport_delete()
716 while (vport->ct_flags && timeout) in lpfc_vport_delete()
719 lpfc_printf_log(vport->phba, KERN_WARNING, in lpfc_vport_delete()
725 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_vport_delete()
728 ndlp = lpfc_nlp_init(vport, Fabric_DID); in lpfc_vport_delete()
735 ndlp = lpfc_enable_node(vport, ndlp, in lpfc_vport_delete()
742 lpfc_dequeue_node(vport, ndlp); in lpfc_vport_delete()
760 if (!(vport->vpi_state & LPFC_VPI_REGISTERED)) { in lpfc_vport_delete()
765 vport->unreg_vpi_cmpl = VPORT_INVAL; in lpfc_vport_delete()
767 if (!lpfc_issue_els_npiv_logo(vport, ndlp)) in lpfc_vport_delete()
768 while (vport->unreg_vpi_cmpl == VPORT_INVAL && timeout) in lpfc_vport_delete()
773 lpfc_discovery_wait(vport); in lpfc_vport_delete()
782 ndlp = lpfc_findnode_did(vport, NameServer_DID); in lpfc_vport_delete()
786 lpfc_cleanup(vport); in lpfc_vport_delete()
787 lpfc_sli_host_down(vport); in lpfc_vport_delete()
789 lpfc_stop_vport_timers(vport); in lpfc_vport_delete()
792 lpfc_unreg_all_rpis(vport); in lpfc_vport_delete()
793 lpfc_unreg_default_rpis(vport); in lpfc_vport_delete()
798 if (!(vport->vpi_state & LPFC_VPI_REGISTERED) || in lpfc_vport_delete()
799 lpfc_mbx_unreg_vpi(vport)) in lpfc_vport_delete()
805 lpfc_free_vpi(phba, vport->vpi); in lpfc_vport_delete()
806 vport->work_port_events = 0; in lpfc_vport_delete()
808 list_del_init(&vport->listentry); in lpfc_vport_delete()
810 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_delete()
863 lpfc_vport_reset_stat_data(struct lpfc_vport *vport) in lpfc_vport_reset_stat_data() argument
867 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_vport_reset_stat_data()
885 lpfc_alloc_bucket(struct lpfc_vport *vport) in lpfc_alloc_bucket() argument
889 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_alloc_bucket()
902 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_alloc_bucket()
919 lpfc_free_bucket(struct lpfc_vport *vport) in lpfc_free_bucket() argument
923 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_free_bucket()