Lines Matching refs:vport

49 inline void lpfc_vport_set_state(struct lpfc_vport *vport,
52 struct fc_vport *fc_vport = vport->fc_vport;
72 vport->port_state = LPFC_VPORT_FAILED;
75 vport->port_state = LPFC_VPORT_UNKNOWN;
114 lpfc_vport_sparm(struct lpfc_hba *phba, struct lpfc_vport *vport)
127 rc = lpfc_read_sparam(phba, pmb, vport->vpi);
140 pmb->vport = vport;
144 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT | LOG_VPORT,
153 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT | LOG_VPORT,
165 memcpy(&vport->fc_sparam, mp->virt, sizeof (struct serv_parm));
166 memcpy(&vport->fc_nodename, &vport->fc_sparam.nodeName,
168 memcpy(&vport->fc_portname, &vport->fc_sparam.portName,
203 struct lpfc_vport *vport;
207 list_for_each_entry(vport, &phba->port_list, listentry) {
208 if (vport == new_vport)
211 if (memcmp(&vport->fc_sparam.portName,
224 * @vport: The virtual port for which this call is being executed.
227 * to enforce a synchronous execution of vport
237 static void lpfc_discovery_wait(struct lpfc_vport *vport)
239 struct lpfc_hba *phba = vport->phba;
256 if ((vport->num_disc_nodes > 0) ||
257 (vport->fc_flag & wait_flags) ||
258 ((vport->port_state > LPFC_VPORT_FAILED) &&
259 (vport->port_state < LPFC_VPORT_READY))) {
260 lpfc_printf_vlog(vport, KERN_INFO, LOG_VPORT,
265 vport->port_state, vport->fc_flag,
266 vport->num_disc_nodes,
271 lpfc_printf_vlog(vport, KERN_INFO, LOG_VPORT,
275 vport->port_state, vport->fc_flag,
283 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
286 vport->port_state, vport->fc_flag,
297 struct lpfc_vport *vport = NULL;
332 vport = lpfc_create_port(phba, instance, &fc_vport->dev);
333 if (!vport) {
341 vport->vpi = vpi;
342 lpfc_debugfs_initialize(vport);
344 if ((status = lpfc_vport_sparm(phba, vport))) {
346 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
350 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
356 destroy_port(vport);
360 u64_to_wwn(fc_vport->node_name, vport->fc_nodename.u.wwn);
361 u64_to_wwn(fc_vport->port_name, vport->fc_portname.u.wwn);
363 memcpy(&vport->fc_sparam.portName, vport->fc_portname.u.wwn, 8);
364 memcpy(&vport->fc_sparam.nodeName, vport->fc_nodename.u.wwn, 8);
366 if (!lpfc_valid_wwn_format(phba, &vport->fc_sparam.nodeName, "WWNN") ||
367 !lpfc_valid_wwn_format(phba, &vport->fc_sparam.portName, "WWPN")) {
368 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
372 destroy_port(vport);
377 if (!lpfc_unique_wwpn(phba, vport)) {
378 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
382 destroy_port(vport);
387 /* Create binary sysfs attribute for vport */
388 lpfc_alloc_sysfs_attr(vport);
391 vport->cfg_lun_queue_depth = phba->pport->cfg_lun_queue_depth;
393 *(struct lpfc_vport **)fc_vport->dd_data = vport;
394 vport->fc_vport = fc_vport;
402 rc = lpfc_sli4_init_vpi(vport);
416 vport->fc_flag |= FC_VPORT_NEEDS_INIT_VPI;
417 lpfc_vport_set_state(vport, FC_VPORT_LINKDOWN);
425 lpfc_vport_set_state(vport, FC_VPORT_LINKDOWN);
431 lpfc_vport_set_state(vport, FC_VPORT_DISABLED);
443 lpfc_set_disctmo(vport);
444 lpfc_initial_fdisc(vport);
446 lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP);
447 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
451 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
456 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
458 lpfc_host_attrib_init(lpfc_shost_from_vport(vport));
466 struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data;
467 struct lpfc_hba *phba = vport->phba;
470 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
472 ndlp = lpfc_findnode_did(vport, Fabric_DID);
475 vport->unreg_vpi_cmpl = VPORT_INVAL;
477 if (!lpfc_issue_els_npiv_logo(vport, ndlp))
478 while (vport->unreg_vpi_cmpl == VPORT_INVAL && timeout)
482 lpfc_sli_host_down(vport);
485 * calling lpfc_cleanup_rpis(vport, 1)
487 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) {
492 lpfc_disc_state_machine(vport, ndlp, NULL,
495 lpfc_cleanup_rpis(vport, 1);
497 lpfc_stop_vport_timers(vport);
498 lpfc_unreg_all_rpis(vport);
499 lpfc_unreg_default_rpis(vport);
502 * scsi_host_put() to release the vport.
504 lpfc_mbx_unreg_vpi(vport);
506 vport->fc_flag |= FC_VPORT_NEEDS_INIT_VPI;
509 lpfc_vport_set_state(vport, FC_VPORT_DISABLED);
510 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
518 struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data;
519 struct lpfc_hba *phba = vport->phba;
521 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
525 lpfc_vport_set_state(vport, FC_VPORT_LINKDOWN);
530 vport->load_flag |= FC_LOADING;
531 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI;
541 lpfc_set_disctmo(vport);
542 lpfc_initial_fdisc(vport);
544 lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP);
545 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
549 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
551 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
571 struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data;
572 struct lpfc_hba *phba = vport->phba;
576 if (vport->port_type == LPFC_PHYSICAL_PORT) {
577 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
583 /* If the vport is a static vport fail the deletion. */
584 if ((vport->vport_flag & STATIC_VPORT) &&
586 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
588 "static vport.\n");
592 vport->load_flag |= FC_UNLOADING;
596 * from happening until after this vport's discovery is finished.
601 vport->port_state > LPFC_VPORT_FAILED &&
602 vport->port_state < LPFC_VPORT_READY) {
606 if (vport->port_state > LPFC_VPORT_FAILED &&
607 vport->port_state < LPFC_VPORT_READY)
620 * bottom of the function -- after delinking the vport. And we
631 lpfc_free_sysfs_attr(vport);
633 lpfc_debugfs_terminate(vport);
641 ndlp = lpfc_findnode_did(vport, NameServer_DID);
647 /* Remove FC host and then SCSI host with the vport */
648 fc_remove_host(lpfc_shost_from_vport(vport));
649 scsi_remove_host(lpfc_shost_from_vport(vport));
662 ndlp = lpfc_findnode_did(vport, Fabric_DID);
666 ndlp = lpfc_enable_node(vport, ndlp,
671 /* Remove ndlp from vport npld list */
672 lpfc_dequeue_node(vport, ndlp);
689 if (vport->cfg_enable_da_id) {
691 if (!lpfc_ns_cmd(vport, SLI_CTNS_DA_ID, 0, 0))
692 while (vport->ct_flags && timeout)
695 lpfc_printf_log(vport->phba, KERN_WARNING,
701 ndlp = lpfc_findnode_did(vport, Fabric_DID);
707 lpfc_nlp_init(vport, ndlp, Fabric_DID);
712 ndlp = lpfc_enable_node(vport, ndlp,
718 /* Remove ndlp from vport list */
719 lpfc_dequeue_node(vport, ndlp);
737 if (!(vport->vpi_state & LPFC_VPI_REGISTERED)) {
742 vport->unreg_vpi_cmpl = VPORT_INVAL;
744 if (!lpfc_issue_els_npiv_logo(vport, ndlp))
745 while (vport->unreg_vpi_cmpl == VPORT_INVAL && timeout)
750 lpfc_discovery_wait(vport);
759 ndlp = lpfc_findnode_did(vport, NameServer_DID);
763 lpfc_cleanup(vport);
764 lpfc_sli_host_down(vport);
766 lpfc_stop_vport_timers(vport);
769 lpfc_unreg_all_rpis(vport);
770 lpfc_unreg_default_rpis(vport);
773 * does the scsi_host_put() to release the vport.
775 if (lpfc_mbx_unreg_vpi(vport))
780 lpfc_free_vpi(phba, vport->vpi);
781 vport->work_port_events = 0;
783 list_del_init(&vport->listentry);
785 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
807 "1801 Create vport work array FAILED: "
830 * lpfc_vport_reset_stat_data - Reset the statistical data for the vport
831 * @vport: Pointer to vport object.
833 * This function resets the statistical data for the vport. This function
837 lpfc_vport_reset_stat_data(struct lpfc_vport *vport)
841 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) {
853 * @vport: Pointer to vport object.
856 * nodes of the vport to collect statistical data.
859 lpfc_alloc_bucket(struct lpfc_vport *vport)
863 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) {
876 lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE,
886 * @vport: Pointer to vport object.
889 * nodes of the vport.
892 lpfc_free_bucket(struct lpfc_vport *vport)
896 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) {