Lines Matching full:vport

71 static void lpfc_disc_flush_list(struct lpfc_vport *vport);
117 if (!ndlp->vport) { in lpfc_rport_invalid()
118 pr_err("**** %s: Null vport on ndlp x%px, DID x%x rport x%px " in lpfc_rport_invalid()
131 struct lpfc_vport *vport; in lpfc_terminate_rport_io() local
138 vport = ndlp->vport; in lpfc_terminate_rport_io()
139 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_terminate_rport_io()
144 lpfc_sli_abort_iocb(vport, ndlp->nlp_sid, 0, LPFC_CTX_TGT); in lpfc_terminate_rport_io()
154 struct lpfc_vport *vport; in lpfc_dev_loss_tmo_callbk() local
163 vport = ndlp->vport; in lpfc_dev_loss_tmo_callbk()
164 phba = vport->phba; in lpfc_dev_loss_tmo_callbk()
166 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_dev_loss_tmo_callbk()
170 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_dev_loss_tmo_callbk()
174 vport->load_flag, kref_read(&ndlp->kref), in lpfc_dev_loss_tmo_callbk()
177 /* Don't schedule a worker thread event if the vport is going down. */ in lpfc_dev_loss_tmo_callbk()
178 if ((vport->load_flag & FC_UNLOADING) || in lpfc_dev_loss_tmo_callbk()
219 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_dev_loss_tmo_callbk()
227 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_dev_loss_tmo_callbk()
267 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_dev_loss_tmo_callbk()
272 vport->load_flag, kref_read(&ndlp->kref)); in lpfc_dev_loss_tmo_callbk()
278 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_dev_loss_tmo_callbk()
285 * lpfc_check_inactive_vmid_one - VMID inactivity checker for a vport
286 * @vport: Pointer to vport context object.
288 * This function checks for idle VMID entries related to a particular vport. If
291 static void lpfc_check_inactive_vmid_one(struct lpfc_vport *vport) in lpfc_check_inactive_vmid_one() argument
299 write_lock(&vport->vmid_lock); in lpfc_check_inactive_vmid_one()
301 if (!vport->cur_vmid_cnt) in lpfc_check_inactive_vmid_one()
305 hash_for_each(vport->hash_table, bucket, vmp, hnode) { in lpfc_check_inactive_vmid_one()
316 if ((vport->vmid_inactivity_timeout * in lpfc_check_inactive_vmid_one()
328 write_unlock(&vport->vmid_lock); in lpfc_check_inactive_vmid_one()
329 if (vport->vmid_priority_tagging) in lpfc_check_inactive_vmid_one()
330 r = lpfc_vmid_uvem(vport, vmp, false); in lpfc_check_inactive_vmid_one()
332 r = lpfc_vmid_cmd(vport, in lpfc_check_inactive_vmid_one()
338 write_lock(&vport->vmid_lock); in lpfc_check_inactive_vmid_one()
342 vport->cur_vmid_cnt--; in lpfc_check_inactive_vmid_one()
352 write_unlock(&vport->vmid_lock); in lpfc_check_inactive_vmid_one()
367 struct lpfc_vport *vport; in lpfc_check_inactive_vmid() local
377 vport = phba->pport; in lpfc_check_inactive_vmid()
379 vport = vports[i]; in lpfc_check_inactive_vmid()
380 if (!vport) in lpfc_check_inactive_vmid()
383 lpfc_check_inactive_vmid_one(vport); in lpfc_check_inactive_vmid()
390 * @vport: Pointer to vport object.
398 lpfc_check_nlp_post_devloss(struct lpfc_vport *vport, in lpfc_check_nlp_post_devloss() argument
408 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY | LOG_NODE, in lpfc_check_nlp_post_devloss()
413 ndlp->nlp_flag, vport->port_state); in lpfc_check_nlp_post_devloss()
432 struct lpfc_vport *vport; in lpfc_dev_loss_tmo_handler() local
441 vport = ndlp->vport; in lpfc_dev_loss_tmo_handler()
443 phba = vport->phba; in lpfc_dev_loss_tmo_handler()
448 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_dev_loss_tmo_handler()
452 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_dev_loss_tmo_handler()
459 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_dev_loss_tmo_handler()
483 fc_vport = vport->fc_vport; in lpfc_dev_loss_tmo_handler()
525 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_dev_loss_tmo_handler()
532 vport->port_state); in lpfc_dev_loss_tmo_handler()
541 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_dev_loss_tmo_handler()
548 vport->port_state); in lpfc_dev_loss_tmo_handler()
561 lpfc_sli_abort_iocb(vport, ndlp->nlp_sid, 0, LPFC_CTX_TGT); in lpfc_dev_loss_tmo_handler()
565 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_dev_loss_tmo_handler()
575 lpfc_printf_vlog(vport, KERN_INFO, LOG_TRACE_EVENT, in lpfc_dev_loss_tmo_handler()
597 lpfc_disc_state_machine(vport, ndlp, NULL, NLP_EVT_DEVICE_RM); in lpfc_dev_loss_tmo_handler()
604 struct lpfc_vport *vport; in lpfc_check_vmid_qfpa_issue() local
614 vport = phba->pport; in lpfc_check_vmid_qfpa_issue()
616 vport = vports[i]; in lpfc_check_vmid_qfpa_issue()
617 if (!vport) in lpfc_check_vmid_qfpa_issue()
620 if (vport->vmid_flag & LPFC_VMID_ISSUE_QFPA) { in lpfc_check_vmid_qfpa_issue()
621 if (!lpfc_issue_els_qfpa(vport)) in lpfc_check_vmid_qfpa_issue()
622 vport->vmid_flag &= ~LPFC_VMID_ISSUE_QFPA; in lpfc_check_vmid_qfpa_issue()
765 shost = lpfc_shost_from_vport(fast_evt_data->vport); in lpfc_send_fastpath_evt()
862 lpfc_sli_abts_recover_port(ndlp->vport, ndlp); in lpfc_work_list_done()
932 struct lpfc_vport *vport; in lpfc_work_done() local
1006 vport = phba->pport; in lpfc_work_done()
1008 vport = vports[i]; in lpfc_work_done()
1009 if (vport == NULL) in lpfc_work_done()
1011 spin_lock_irq(&vport->work_port_lock); in lpfc_work_done()
1012 work_port_events = vport->work_port_events; in lpfc_work_done()
1013 vport->work_port_events &= ~work_port_events; in lpfc_work_done()
1014 spin_unlock_irq(&vport->work_port_lock); in lpfc_work_done()
1018 lpfc_disc_timeout_handler(vport); in lpfc_work_done()
1020 lpfc_els_timeout_handler(vport); in lpfc_work_done()
1030 lpfc_delayed_disc_timeout_handler(vport); in lpfc_work_done()
1150 lpfc_cleanup_rpis(struct lpfc_vport *vport, int remove) in lpfc_cleanup_rpis() argument
1152 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_cleanup_rpis()
1153 struct lpfc_hba *phba = vport->phba; in lpfc_cleanup_rpis()
1156 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_cleanup_rpis()
1158 ((vport->port_type == LPFC_NPIV_PORT) && in lpfc_cleanup_rpis()
1162 lpfc_unreg_rpi(vport, ndlp); in lpfc_cleanup_rpis()
1174 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_cleanup_rpis()
1181 lpfc_sli4_unreg_all_rpis(vport); in lpfc_cleanup_rpis()
1182 lpfc_mbx_unreg_vpi(vport); in lpfc_cleanup_rpis()
1184 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; in lpfc_cleanup_rpis()
1190 lpfc_port_link_failure(struct lpfc_vport *vport) in lpfc_port_link_failure() argument
1192 lpfc_vport_set_state(vport, FC_VPORT_LINKDOWN); in lpfc_port_link_failure()
1195 lpfc_cleanup_rcv_buffers(vport); in lpfc_port_link_failure()
1198 lpfc_els_flush_rscn(vport); in lpfc_port_link_failure()
1201 lpfc_els_flush_cmd(vport); in lpfc_port_link_failure()
1203 lpfc_cleanup_rpis(vport, 0); in lpfc_port_link_failure()
1206 lpfc_can_disctmo(vport); in lpfc_port_link_failure()
1210 lpfc_linkdown_port(struct lpfc_vport *vport) in lpfc_linkdown_port() argument
1212 struct lpfc_hba *phba = vport->phba; in lpfc_linkdown_port()
1213 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_linkdown_port()
1215 if (vport->cfg_enable_fc4_type != LPFC_ENABLE_NVME) in lpfc_linkdown_port()
1219 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_linkdown_port()
1221 vport->port_state, vport->fc_ns_retry, vport->fc_flag); in lpfc_linkdown_port()
1223 lpfc_port_link_failure(vport); in lpfc_linkdown_port()
1227 vport->fc_flag &= ~FC_DISC_DELAYED; in lpfc_linkdown_port()
1229 del_timer_sync(&vport->delayed_disc_tmo); in lpfc_linkdown_port()
1232 vport->port_type == LPFC_PHYSICAL_PORT && in lpfc_linkdown_port()
1242 struct lpfc_vport *vport = phba->pport; in lpfc_linkdown() local
1243 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_linkdown()
1288 if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || in lpfc_linkdown()
1289 (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { in lpfc_linkdown()
1306 mb->vport = vport; in lpfc_linkdown()
1321 mb->vport = vport; in lpfc_linkdown()
1336 lpfc_linkup_cleanup_nodes(struct lpfc_vport *vport) in lpfc_linkup_cleanup_nodes() argument
1340 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_linkup_cleanup_nodes()
1350 lpfc_unreg_rpi(vport, ndlp); in lpfc_linkup_cleanup_nodes()
1351 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_linkup_cleanup_nodes()
1356 lpfc_unreg_rpi(vport, ndlp); in lpfc_linkup_cleanup_nodes()
1362 lpfc_linkup_port(struct lpfc_vport *vport) in lpfc_linkup_port() argument
1364 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_linkup_port()
1365 struct lpfc_hba *phba = vport->phba; in lpfc_linkup_port()
1367 if ((vport->load_flag & FC_UNLOADING) != 0) in lpfc_linkup_port()
1370 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_linkup_port()
1376 (vport != phba->pport)) in lpfc_linkup_port()
1379 if (vport->cfg_enable_fc4_type != LPFC_ENABLE_NVME) in lpfc_linkup_port()
1385 vport->fc_flag &= ~(FC_ABORT_DISCOVERY | FC_RSCN_MODE | in lpfc_linkup_port()
1388 vport->fc_flag &= ~(FC_PT2PT | FC_PT2PT_PLOGI | in lpfc_linkup_port()
1391 vport->fc_flag |= FC_NDISC_ACTIVE; in lpfc_linkup_port()
1392 vport->fc_ns_retry = 0; in lpfc_linkup_port()
1394 lpfc_setup_fdmi_mask(vport); in lpfc_linkup_port()
1396 lpfc_linkup_cleanup_nodes(vport); in lpfc_linkup_port()
1441 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_clear_la() local
1442 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_clear_la()
1454 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_clear_la()
1457 mb->mbxStatus, vport->port_state); in lpfc_mbx_cmpl_clear_la()
1462 if (vport->port_type == LPFC_PHYSICAL_PORT) in lpfc_mbx_cmpl_clear_la()
1477 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_mbx_cmpl_clear_la()
1482 vport->fc_flag &= ~FC_ABORT_DISCOVERY; in lpfc_mbx_cmpl_clear_la()
1485 lpfc_can_disctmo(vport); in lpfc_mbx_cmpl_clear_la()
1503 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_local_config_link() local
1520 vport->fc_flag & FC_PUBLIC_LOOP && in lpfc_mbx_cmpl_local_config_link()
1521 !(vport->fc_flag & FC_LBIT)) { in lpfc_mbx_cmpl_local_config_link()
1526 lpfc_set_disctmo(vport); in lpfc_mbx_cmpl_local_config_link()
1533 if (vport->port_state != LPFC_FLOGI) { in lpfc_mbx_cmpl_local_config_link()
1549 sparam_mb->vport = vport; in lpfc_mbx_cmpl_local_config_link()
1560 lpfc_initial_flogi(vport); in lpfc_mbx_cmpl_local_config_link()
1563 if (vport->fc_flag & FC_PT2PT) in lpfc_mbx_cmpl_local_config_link()
1564 lpfc_disc_start(vport); in lpfc_mbx_cmpl_local_config_link()
1569 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_local_config_link()
1571 status, vport->port_state); in lpfc_mbx_cmpl_local_config_link()
1576 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_local_config_link()
1578 vport->port_state); in lpfc_mbx_cmpl_local_config_link()
1580 lpfc_issue_clear_la(phba, vport); in lpfc_mbx_cmpl_local_config_link()
1609 struct lpfc_vport *vport = mboxq->vport; in lpfc_mbx_cmpl_reg_fcfi() local
1612 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_reg_fcfi()
1615 vport->port_state); in lpfc_mbx_cmpl_reg_fcfi()
1635 if (vport->port_state != LPFC_FLOGI) { in lpfc_mbx_cmpl_reg_fcfi()
1638 lpfc_issue_init_vfi(vport); in lpfc_mbx_cmpl_reg_fcfi()
1907 fcf_mbxq->vport = phba->pport; in lpfc_register_fcf()
2375 * @vport: Pointer to vport object.
2384 int lpfc_sli4_fcf_rr_next_proc(struct lpfc_vport *vport, uint16_t fcf_index) in lpfc_sli4_fcf_rr_next_proc() argument
2386 struct lpfc_hba *phba = vport->phba; in lpfc_sli4_fcf_rr_next_proc()
2448 lpfc_can_disctmo(vport); in lpfc_sli4_fcf_rr_next_proc()
3155 struct lpfc_vport *vport = mboxq->vport; in lpfc_init_vfi_cmpl() local
3165 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_init_vfi_cmpl()
3169 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_init_vfi_cmpl()
3173 lpfc_initial_flogi(vport); in lpfc_init_vfi_cmpl()
3180 * @vport: pointer to lpfc_vport data structure.
3186 lpfc_issue_init_vfi(struct lpfc_vport *vport) in lpfc_issue_init_vfi() argument
3190 struct lpfc_hba *phba = vport->phba; in lpfc_issue_init_vfi()
3194 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_init_vfi()
3199 lpfc_init_vfi(mboxq, vport); in lpfc_issue_init_vfi()
3203 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_issue_init_vfi()
3205 mempool_free(mboxq, vport->phba->mbox_mem_pool); in lpfc_issue_init_vfi()
3219 struct lpfc_vport *vport = mboxq->vport; in lpfc_init_vpi_cmpl() local
3221 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_init_vpi_cmpl()
3224 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_init_vpi_cmpl()
3228 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_init_vpi_cmpl()
3232 vport->fc_flag &= ~FC_VPORT_NEEDS_INIT_VPI; in lpfc_init_vpi_cmpl()
3236 if ((phba->pport == vport) || (vport->port_state == LPFC_FDISC)) { in lpfc_init_vpi_cmpl()
3237 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_init_vpi_cmpl()
3239 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_init_vpi_cmpl()
3244 lpfc_register_new_vport(phba, vport, ndlp); in lpfc_init_vpi_cmpl()
3250 lpfc_initial_fdisc(vport); in lpfc_init_vpi_cmpl()
3252 lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP); in lpfc_init_vpi_cmpl()
3253 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_init_vpi_cmpl()
3262 * @vport: pointer to lpfc_vport data structure.
3265 * VPI for the vport.
3268 lpfc_issue_init_vpi(struct lpfc_vport *vport) in lpfc_issue_init_vpi() argument
3273 if ((vport->port_type != LPFC_PHYSICAL_PORT) && (!vport->vpi)) { in lpfc_issue_init_vpi()
3274 vpi = lpfc_alloc_vpi(vport->phba); in lpfc_issue_init_vpi()
3276 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_issue_init_vpi()
3277 "3303 Failed to obtain vport vpi\n"); in lpfc_issue_init_vpi()
3278 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_issue_init_vpi()
3281 vport->vpi = vpi; in lpfc_issue_init_vpi()
3284 mboxq = mempool_alloc(vport->phba->mbox_mem_pool, GFP_KERNEL); in lpfc_issue_init_vpi()
3286 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_init_vpi()
3291 lpfc_init_vpi(vport->phba, mboxq, vport->vpi); in lpfc_issue_init_vpi()
3292 mboxq->vport = vport; in lpfc_issue_init_vpi()
3294 rc = lpfc_sli_issue_mbox(vport->phba, mboxq, MBX_NOWAIT); in lpfc_issue_init_vpi()
3296 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_issue_init_vpi()
3298 mempool_free(mboxq, vport->phba->mbox_mem_pool); in lpfc_issue_init_vpi()
3320 /* There are no vpi for this vport */ in lpfc_start_fdiscs()
3353 struct lpfc_vport *vport = mboxq->vport; in lpfc_mbx_cmpl_reg_vfi() local
3354 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_reg_vfi()
3364 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_reg_vfi()
3367 mboxq->u.mb.mbxStatus, vport->port_state); in lpfc_mbx_cmpl_reg_vfi()
3370 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_reg_vfi()
3372 lpfc_disc_start(vport); in lpfc_mbx_cmpl_reg_vfi()
3375 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_reg_vfi()
3383 if (vport->fc_flag & FC_VFI_REGISTERED) in lpfc_mbx_cmpl_reg_vfi()
3385 vport->fc_flag & FC_PT2PT)) in lpfc_mbx_cmpl_reg_vfi()
3390 vport->vpi_state |= LPFC_VPI_REGISTERED; in lpfc_mbx_cmpl_reg_vfi()
3391 vport->fc_flag |= FC_VFI_REGISTERED; in lpfc_mbx_cmpl_reg_vfi()
3392 vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI; in lpfc_mbx_cmpl_reg_vfi()
3393 vport->fc_flag &= ~FC_VPORT_NEEDS_INIT_VPI; in lpfc_mbx_cmpl_reg_vfi()
3403 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, in lpfc_mbx_cmpl_reg_vfi()
3406 vport->port_state, vport->fc_flag, vport->fc_myDID, in lpfc_mbx_cmpl_reg_vfi()
3407 vport->phba->alpa_map[0], in lpfc_mbx_cmpl_reg_vfi()
3410 if (vport->port_state == LPFC_FABRIC_CFG_LINK) { in lpfc_mbx_cmpl_reg_vfi()
3415 if ((vport->fc_flag & FC_PT2PT) || in lpfc_mbx_cmpl_reg_vfi()
3417 !(vport->fc_flag & FC_PUBLIC_LOOP))) { in lpfc_mbx_cmpl_reg_vfi()
3420 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_reg_vfi()
3422 if (vport->fc_flag & FC_PT2PT) in lpfc_mbx_cmpl_reg_vfi()
3423 vport->port_state = LPFC_VPORT_READY; in lpfc_mbx_cmpl_reg_vfi()
3425 lpfc_disc_start(vport); in lpfc_mbx_cmpl_reg_vfi()
3428 lpfc_do_scr_ns_plogi(phba, vport); in lpfc_mbx_cmpl_reg_vfi()
3441 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_read_sparam() local
3442 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_read_sparam()
3443 struct serv_parm *sp = &vport->fc_sparam; in lpfc_mbx_cmpl_read_sparam()
3449 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_read_sparam()
3452 mb->mbxStatus, vport->port_state); in lpfc_mbx_cmpl_read_sparam()
3457 memcpy((uint8_t *) &vport->fc_sparam, (uint8_t *) mp->virt, in lpfc_mbx_cmpl_read_sparam()
3471 lpfc_update_vport_wwn(vport); in lpfc_mbx_cmpl_read_sparam()
3472 fc_host_port_name(shost) = wwn_to_u64(vport->fc_portname.u.wwn); in lpfc_mbx_cmpl_read_sparam()
3473 if (vport->port_type == LPFC_PHYSICAL_PORT) { in lpfc_mbx_cmpl_read_sparam()
3474 memcpy(&phba->wwnn, &vport->fc_nodename, sizeof(phba->wwnn)); in lpfc_mbx_cmpl_read_sparam()
3475 memcpy(&phba->wwpn, &vport->fc_portname, sizeof(phba->wwnn)); in lpfc_mbx_cmpl_read_sparam()
3484 lpfc_initial_flogi(vport); in lpfc_mbx_cmpl_read_sparam()
3491 lpfc_issue_clear_la(phba, vport); in lpfc_mbx_cmpl_read_sparam()
3497 struct lpfc_vport *vport = phba->pport; in lpfc_mbx_process_link_up() local
3540 shost = lpfc_shost_from_vport(vport); in lpfc_mbx_process_link_up()
3555 vport->fc_myDID = bf_get(lpfc_mbx_read_top_alpa_granted, la); in lpfc_mbx_process_link_up()
3561 if (vport->cfg_log_verbose & LOG_LINK_EVENT) { in lpfc_mbx_process_link_up()
3601 vport->fc_myDID = phba->fc_pref_DID; in lpfc_mbx_process_link_up()
3608 vport->fc_flag |= fc_flags; in lpfc_mbx_process_link_up()
3624 sparam_mbox->vport = vport; in lpfc_mbx_process_link_up()
3636 vport->port_state = LPFC_LOCAL_CFG_LINK; in lpfc_mbx_process_link_up()
3638 cfglink_mbox->vport = vport; in lpfc_mbx_process_link_up()
3646 vport->port_state = LPFC_VPORT_UNKNOWN; in lpfc_mbx_process_link_up()
3710 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_process_link_up()
3711 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_process_link_up()
3713 vport->port_state, sparam_mbox, cfglink_mbox); in lpfc_mbx_process_link_up()
3714 lpfc_issue_clear_la(phba, vport); in lpfc_mbx_process_link_up()
3753 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_read_topology() local
3754 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_read_topology()
3771 mb->mbxStatus, vport->port_state); in lpfc_mbx_cmpl_read_topology()
3784 vport->fc_flag |= FC_BYPASSED_MODE; in lpfc_mbx_cmpl_read_topology()
3786 vport->fc_flag &= ~FC_BYPASSED_MODE; in lpfc_mbx_cmpl_read_topology()
3837 phba->pport->port_state, vport->fc_flag); in lpfc_mbx_cmpl_read_topology()
3843 phba->pport->port_state, vport->fc_flag, in lpfc_mbx_cmpl_read_topology()
3850 phba->pport->port_state, vport->fc_flag, in lpfc_mbx_cmpl_read_topology()
3874 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_reg_login() local
3885 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI | LOG_NODE | LOG_DISCOVERY, in lpfc_mbx_cmpl_reg_login()
3913 lpfc_unreg_rpi(vport, ndlp); in lpfc_mbx_cmpl_reg_login()
3917 lpfc_disc_state_machine(vport, ndlp, pmb, NLP_EVT_CMPL_REG_LOGIN); in lpfc_mbx_cmpl_reg_login()
3933 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_unreg_vpi() local
3934 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_unreg_vpi()
3939 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_mbx_cmpl_unreg_vpi()
3945 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_unreg_vpi()
3947 vport->vpi, mb->mbxStatus); in lpfc_mbx_cmpl_unreg_vpi()
3953 vport->vpi_state &= ~LPFC_VPI_REGISTERED; in lpfc_mbx_cmpl_unreg_vpi()
3954 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; in lpfc_mbx_cmpl_unreg_vpi()
3957 lpfc_cleanup_vports_rrqs(vport, NULL); in lpfc_mbx_cmpl_unreg_vpi()
3962 if ((vport->load_flag & FC_UNLOADING) && (vport != phba->pport)) in lpfc_mbx_cmpl_unreg_vpi()
3967 lpfc_mbx_unreg_vpi(struct lpfc_vport *vport) in lpfc_mbx_unreg_vpi() argument
3969 struct lpfc_hba *phba = vport->phba; in lpfc_mbx_unreg_vpi()
3977 lpfc_unreg_vpi(phba, vport->vpi, mbox); in lpfc_mbx_unreg_vpi()
3978 mbox->vport = vport; in lpfc_mbx_unreg_vpi()
3982 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_unreg_vpi()
3993 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_reg_vpi() local
3994 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_reg_vpi()
4001 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_mbx_cmpl_reg_vpi()
4004 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_reg_vpi()
4006 vport->fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP); in lpfc_mbx_cmpl_reg_vpi()
4008 vport->fc_myDID = 0; in lpfc_mbx_cmpl_reg_vpi()
4010 if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || in lpfc_mbx_cmpl_reg_vpi()
4011 (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { in lpfc_mbx_cmpl_reg_vpi()
4015 lpfc_nvme_update_localport(vport); in lpfc_mbx_cmpl_reg_vpi()
4021 vport->vpi_state |= LPFC_VPI_REGISTERED; in lpfc_mbx_cmpl_reg_vpi()
4022 vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI; in lpfc_mbx_cmpl_reg_vpi()
4024 vport->num_disc_nodes = 0; in lpfc_mbx_cmpl_reg_vpi()
4026 if (vport->fc_npr_cnt) in lpfc_mbx_cmpl_reg_vpi()
4027 lpfc_els_disc_plogi(vport); in lpfc_mbx_cmpl_reg_vpi()
4029 if (!vport->num_disc_nodes) { in lpfc_mbx_cmpl_reg_vpi()
4031 vport->fc_flag &= ~FC_NDISC_ACTIVE; in lpfc_mbx_cmpl_reg_vpi()
4033 lpfc_can_disctmo(vport); in lpfc_mbx_cmpl_reg_vpi()
4035 vport->port_state = LPFC_VPORT_READY; in lpfc_mbx_cmpl_reg_vpi()
4060 struct lpfc_vport *vport; in lpfc_create_static_vport() local
4100 pmb->vport = phba->pport; in lpfc_create_static_vport()
4170 " create vport\n"); in lpfc_create_static_vport()
4174 vport = *(struct lpfc_vport **)new_fc_vport->dd_data; in lpfc_create_static_vport()
4175 vport->vport_flag |= STATIC_VPORT; in lpfc_create_static_vport()
4193 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_fabric_reg_login() local
4201 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_fabric_reg_login()
4207 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_fabric_reg_login()
4210 lpfc_disc_start(vport); in lpfc_mbx_cmpl_fabric_reg_login()
4218 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_fabric_reg_login()
4230 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_mbx_cmpl_fabric_reg_login()
4232 if (vport->port_state == LPFC_FABRIC_CFG_LINK) { in lpfc_mbx_cmpl_fabric_reg_login()
4234 * vport discovery */ in lpfc_mbx_cmpl_fabric_reg_login()
4235 if (!(vport->fc_flag & FC_LOGO_RCVD_DID_CHNG)) in lpfc_mbx_cmpl_fabric_reg_login()
4238 shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_fabric_reg_login()
4240 vport->fc_flag &= ~FC_LOGO_RCVD_DID_CHNG ; in lpfc_mbx_cmpl_fabric_reg_login()
4243 lpfc_do_scr_ns_plogi(phba, vport); in lpfc_mbx_cmpl_fabric_reg_login()
4260 lpfc_issue_gidft(struct lpfc_vport *vport) in lpfc_issue_gidft() argument
4263 if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || in lpfc_issue_gidft()
4264 (vport->cfg_enable_fc4_type == LPFC_ENABLE_FCP)) { in lpfc_issue_gidft()
4265 if (lpfc_ns_cmd(vport, SLI_CTNS_GID_FT, 0, SLI_CTPT_FCP)) { in lpfc_issue_gidft()
4269 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_gidft()
4277 vport->gidft_inp++; in lpfc_issue_gidft()
4280 if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || in lpfc_issue_gidft()
4281 (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { in lpfc_issue_gidft()
4282 if (lpfc_ns_cmd(vport, SLI_CTNS_GID_FT, 0, SLI_CTPT_NVME)) { in lpfc_issue_gidft()
4286 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_gidft()
4292 vport->gidft_inp); in lpfc_issue_gidft()
4293 if (vport->gidft_inp == 0) in lpfc_issue_gidft()
4296 vport->gidft_inp++; in lpfc_issue_gidft()
4298 return vport->gidft_inp; in lpfc_issue_gidft()
4303 * @vport: The virtual port for which this call is being executed.
4312 lpfc_issue_gidpt(struct lpfc_vport *vport) in lpfc_issue_gidpt() argument
4315 if (lpfc_ns_cmd(vport, SLI_CTNS_GID_PT, 0, GID_PT_N_PORT)) { in lpfc_issue_gidpt()
4319 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_issue_gidpt()
4326 vport->gidft_inp++; in lpfc_issue_gidpt()
4341 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_ns_reg_login() local
4345 vport->gidft_inp = 0; in lpfc_mbx_cmpl_ns_reg_login()
4348 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_ns_reg_login()
4376 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_ns_reg_login()
4379 lpfc_disc_start(vport); in lpfc_mbx_cmpl_ns_reg_login()
4382 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_ns_reg_login()
4390 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_mbx_cmpl_ns_reg_login()
4391 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE | LOG_DISCOVERY, in lpfc_mbx_cmpl_ns_reg_login()
4397 if (vport->port_state < LPFC_VPORT_READY) { in lpfc_mbx_cmpl_ns_reg_login()
4399 lpfc_ns_cmd(vport, SLI_CTNS_RNN_ID, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
4400 lpfc_ns_cmd(vport, SLI_CTNS_RSNN_NN, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
4401 lpfc_ns_cmd(vport, SLI_CTNS_RSPN_ID, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
4402 lpfc_ns_cmd(vport, SLI_CTNS_RFT_ID, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
4404 if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || in lpfc_mbx_cmpl_ns_reg_login()
4405 (vport->cfg_enable_fc4_type == LPFC_ENABLE_FCP)) in lpfc_mbx_cmpl_ns_reg_login()
4406 lpfc_ns_cmd(vport, SLI_CTNS_RFF_ID, 0, FC_TYPE_FCP); in lpfc_mbx_cmpl_ns_reg_login()
4408 if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || in lpfc_mbx_cmpl_ns_reg_login()
4409 (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) in lpfc_mbx_cmpl_ns_reg_login()
4410 lpfc_ns_cmd(vport, SLI_CTNS_RFF_ID, 0, in lpfc_mbx_cmpl_ns_reg_login()
4414 lpfc_issue_els_scr(vport, 0); in lpfc_mbx_cmpl_ns_reg_login()
4425 rc = lpfc_issue_els_edc(vport, 0); in lpfc_mbx_cmpl_ns_reg_login()
4432 lpfc_issue_els_edc(vport, 0); in lpfc_mbx_cmpl_ns_reg_login()
4434 lpfc_issue_els_rdf(vport, 0); in lpfc_mbx_cmpl_ns_reg_login()
4438 vport->fc_ns_retry = 0; in lpfc_mbx_cmpl_ns_reg_login()
4439 if (lpfc_issue_gidft(vport) == 0) in lpfc_mbx_cmpl_ns_reg_login()
4462 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_fc_reg_login() local
4468 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_fc_reg_login()
4474 lpfc_check_nlp_post_devloss(vport, ndlp); in lpfc_mbx_cmpl_fc_reg_login()
4479 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_mbx_cmpl_fc_reg_login()
4487 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_mbx_cmpl_fc_reg_login()
4499 lpfc_register_remote_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_register_remote_port() argument
4501 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_register_remote_port()
4505 struct lpfc_hba *phba = vport->phba; in lpfc_register_remote_port()
4508 if (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME) in lpfc_register_remote_port()
4518 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_register_remote_port()
4523 if (vport->load_flag & FC_UNLOADING) in lpfc_register_remote_port()
4564 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_register_remote_port()
4581 struct lpfc_vport *vport = ndlp->vport; in lpfc_unregister_remote_port() local
4583 if (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME) in lpfc_unregister_remote_port()
4586 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_unregister_remote_port()
4590 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_unregister_remote_port()
4601 lpfc_nlp_counters(struct lpfc_vport *vport, int state, int count) in lpfc_nlp_counters() argument
4603 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_nlp_counters()
4609 vport->fc_unused_cnt += count; in lpfc_nlp_counters()
4612 vport->fc_plogi_cnt += count; in lpfc_nlp_counters()
4615 vport->fc_adisc_cnt += count; in lpfc_nlp_counters()
4618 vport->fc_reglogin_cnt += count; in lpfc_nlp_counters()
4621 vport->fc_prli_cnt += count; in lpfc_nlp_counters()
4624 vport->fc_unmap_cnt += count; in lpfc_nlp_counters()
4627 vport->fc_map_cnt += count; in lpfc_nlp_counters()
4630 if (vport->fc_npr_cnt == 0 && count == -1) in lpfc_nlp_counters()
4631 vport->fc_npr_cnt = 0; in lpfc_nlp_counters()
4633 vport->fc_npr_cnt += count; in lpfc_nlp_counters()
4641 lpfc_nlp_reg_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_nlp_reg_node() argument
4645 lpfc_check_nlp_post_devloss(vport, ndlp); in lpfc_nlp_reg_node()
4654 lpfc_nvme_rescan_port(vport, ndlp); in lpfc_nlp_reg_node()
4663 vport->phba->nport_event_cnt++; in lpfc_nlp_reg_node()
4668 lpfc_register_remote_port(vport, ndlp); in lpfc_nlp_reg_node()
4676 if (vport->phba->sli_rev >= LPFC_SLI_REV4 && in lpfc_nlp_reg_node()
4678 if (vport->phba->nvmet_support == 0) { in lpfc_nlp_reg_node()
4684 vport->phba->nport_event_cnt++; in lpfc_nlp_reg_node()
4685 lpfc_nvme_register_port(vport, ndlp); in lpfc_nlp_reg_node()
4698 lpfc_nlp_unreg_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_nlp_unreg_node() argument
4705 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_nlp_unreg_node()
4719 vport->phba->nport_event_cnt++; in lpfc_nlp_unreg_node()
4722 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_nlp_unreg_node()
4732 vport->phba->nport_event_cnt++; in lpfc_nlp_unreg_node()
4733 if (vport->phba->nvmet_support == 0) { in lpfc_nlp_unreg_node()
4736 lpfc_nvme_unregister_port(vport, ndlp); in lpfc_nlp_unreg_node()
4749 lpfc_handle_adisc_state(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_handle_adisc_state() argument
4770 lpfc_nlp_reg_node(vport, ndlp); in lpfc_handle_adisc_state()
4783 lpfc_nlp_unreg_node(vport, ndlp); in lpfc_handle_adisc_state()
4790 lpfc_nlp_state_cleanup(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_nlp_state_cleanup() argument
4796 lpfc_handle_adisc_state(vport, ndlp, new_state); in lpfc_nlp_state_cleanup()
4816 !lpfc_is_link_up(vport->phba)) in lpfc_nlp_state_cleanup()
4817 lpfc_nlp_unreg_node(vport, ndlp); in lpfc_nlp_state_cleanup()
4822 lpfc_nlp_reg_node(vport, ndlp); in lpfc_nlp_state_cleanup()
4838 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_nlp_state_cleanup()
4865 lpfc_nlp_set_state(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_nlp_set_state() argument
4868 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_nlp_set_state()
4873 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_nlp_set_state()
4879 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_set_state()
4891 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_nlp_set_state()
4899 list_add_tail(&ndlp->nlp_listp, &vport->fc_nodes); in lpfc_nlp_set_state()
4902 lpfc_nlp_counters(vport, old_state, -1); in lpfc_nlp_set_state()
4905 lpfc_nlp_counters(vport, state, 1); in lpfc_nlp_set_state()
4906 lpfc_nlp_state_cleanup(vport, ndlp, old_state, state); in lpfc_nlp_set_state()
4910 lpfc_enqueue_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_enqueue_node() argument
4912 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_enqueue_node()
4916 list_add_tail(&ndlp->nlp_listp, &vport->fc_nodes); in lpfc_enqueue_node()
4922 lpfc_dequeue_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_dequeue_node() argument
4924 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_dequeue_node()
4926 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_dequeue_node()
4928 lpfc_nlp_counters(vport, ndlp->nlp_state, -1); in lpfc_dequeue_node()
4932 lpfc_nlp_state_cleanup(vport, ndlp, ndlp->nlp_state, in lpfc_dequeue_node()
4938 * @vport: Pointer to Virtual Port object.
4945 * @vport, a direct reference to phba is taken here by @ndlp. This is due
4946 * to the life-span of the @ndlp might go beyond the existence of @vport as
4951 lpfc_initialize_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_initialize_node() argument
4960 ndlp->vport = vport; in lpfc_initialize_node()
4961 ndlp->phba = vport->phba; in lpfc_initialize_node()
4966 ndlp->cmd_qdepth = vport->cfg_tgt_queue_depth; in lpfc_initialize_node()
4971 lpfc_drop_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_drop_node() argument
4976 * release the ndlp from the vport when conditions are correct. in lpfc_drop_node()
4980 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNUSED_NODE); in lpfc_drop_node()
4981 if (vport->phba->sli_rev == LPFC_SLI_REV4) { in lpfc_drop_node()
4982 lpfc_cleanup_vports_rrqs(vport, ndlp); in lpfc_drop_node()
4983 lpfc_unreg_rpi(vport, ndlp); in lpfc_drop_node()
5004 lpfc_set_disctmo(struct lpfc_vport *vport) in lpfc_set_disctmo() argument
5006 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_set_disctmo()
5007 struct lpfc_hba *phba = vport->phba; in lpfc_set_disctmo()
5010 if (vport->port_state == LPFC_LOCAL_CFG_LINK) { in lpfc_set_disctmo()
5021 if (!timer_pending(&vport->fc_disctmo)) { in lpfc_set_disctmo()
5022 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_set_disctmo()
5024 tmo, vport->port_state, vport->fc_flag); in lpfc_set_disctmo()
5027 mod_timer(&vport->fc_disctmo, jiffies + msecs_to_jiffies(1000 * tmo)); in lpfc_set_disctmo()
5029 vport->fc_flag |= FC_DISC_TMO; in lpfc_set_disctmo()
5033 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_set_disctmo()
5036 vport->port_state, tmo, in lpfc_set_disctmo()
5037 (unsigned long)&vport->fc_disctmo, vport->fc_plogi_cnt, in lpfc_set_disctmo()
5038 vport->fc_adisc_cnt); in lpfc_set_disctmo()
5047 lpfc_can_disctmo(struct lpfc_vport *vport) in lpfc_can_disctmo() argument
5049 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_can_disctmo()
5052 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_can_disctmo()
5054 vport->port_state, vport->fc_ns_retry, vport->fc_flag); in lpfc_can_disctmo()
5057 if (vport->fc_flag & FC_DISC_TMO || in lpfc_can_disctmo()
5058 timer_pending(&vport->fc_disctmo)) { in lpfc_can_disctmo()
5060 vport->fc_flag &= ~FC_DISC_TMO; in lpfc_can_disctmo()
5062 del_timer_sync(&vport->fc_disctmo); in lpfc_can_disctmo()
5063 spin_lock_irqsave(&vport->work_port_lock, iflags); in lpfc_can_disctmo()
5064 vport->work_port_events &= ~WORKER_DISC_TMO; in lpfc_can_disctmo()
5065 spin_unlock_irqrestore(&vport->work_port_lock, iflags); in lpfc_can_disctmo()
5069 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_can_disctmo()
5072 vport->port_state, vport->fc_flag, in lpfc_can_disctmo()
5073 vport->fc_plogi_cnt, vport->fc_adisc_cnt); in lpfc_can_disctmo()
5087 struct lpfc_vport *vport = ndlp->vport; in lpfc_check_sli_ndlp() local
5092 if (iocb->vport != vport) in lpfc_check_sli_ndlp()
5213 struct lpfc_vport *vport = pmb->vport; in lpfc_nlp_logo_unreg() local
5219 lpfc_issue_els_logo(vport, ndlp, 0); in lpfc_nlp_logo_unreg()
5224 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_nlp_logo_unreg()
5232 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); in lpfc_nlp_logo_unreg()
5236 lpfc_sli4_free_rpi(vport->phba, ndlp->nlp_rpi); in lpfc_nlp_logo_unreg()
5261 lpfc_set_unreg_login_mbx_cmpl(struct lpfc_hba *phba, struct lpfc_vport *vport, in lpfc_set_unreg_login_mbx_cmpl() argument
5277 (!(vport->load_flag & FC_UNLOADING)) && in lpfc_set_unreg_login_mbx_cmpl()
5283 if (vport->load_flag & FC_UNLOADING) { in lpfc_set_unreg_login_mbx_cmpl()
5304 lpfc_unreg_rpi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_unreg_rpi() argument
5306 struct lpfc_hba *phba = vport->phba; in lpfc_unreg_rpi()
5314 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_unreg_rpi()
5326 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_unreg_rpi()
5344 lpfc_unreg_login(phba, vport->vpi, rpi, mbox); in lpfc_unreg_rpi()
5345 mbox->vport = vport; in lpfc_unreg_rpi()
5346 lpfc_set_unreg_login_mbx_cmpl(phba, vport, ndlp, mbox); in lpfc_unreg_rpi()
5359 (!(vport->fc_flag & FC_OFFLINE_MODE))) in lpfc_unreg_rpi()
5362 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_unreg_rpi()
5378 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_unreg_rpi()
5391 if (!(vport->load_flag & FC_UNLOADING)) { in lpfc_unreg_rpi()
5393 lpfc_issue_els_logo(vport, ndlp, 0); in lpfc_unreg_rpi()
5395 lpfc_nlp_set_state(vport, ndlp, in lpfc_unreg_rpi()
5433 "2884 Vport array allocation failed \n"); in lpfc_unreg_hba_rpis()
5453 lpfc_unreg_all_rpis(struct lpfc_vport *vport) in lpfc_unreg_all_rpis() argument
5455 struct lpfc_hba *phba = vport->phba; in lpfc_unreg_all_rpis()
5460 lpfc_sli4_unreg_all_rpis(vport); in lpfc_unreg_all_rpis()
5466 lpfc_unreg_login(phba, vport->vpi, LPFC_UNREG_ALL_RPIS_VPORT, in lpfc_unreg_all_rpis()
5468 mbox->vport = vport; in lpfc_unreg_all_rpis()
5476 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_unreg_all_rpis()
5484 lpfc_unreg_default_rpis(struct lpfc_vport *vport) in lpfc_unreg_default_rpis() argument
5486 struct lpfc_hba *phba = vport->phba; in lpfc_unreg_default_rpis()
5496 lpfc_unreg_did(phba, vport->vpi, LPFC_UNREG_ALL_DFLT_RPIS, in lpfc_unreg_default_rpis()
5498 mbox->vport = vport; in lpfc_unreg_default_rpis()
5506 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_unreg_default_rpis()
5518 lpfc_cleanup_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_cleanup_node() argument
5520 struct lpfc_hba *phba = vport->phba; in lpfc_cleanup_node()
5524 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_cleanup_node()
5529 lpfc_dequeue_node(vport, ndlp); in lpfc_cleanup_node()
5581 lpfc_cleanup_vports_rrqs(vport, ndlp); in lpfc_cleanup_node()
5590 lpfc_matchdid(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_matchdid() argument
5603 mydid.un.word = vport->fc_myDID; in lpfc_matchdid()
5624 vport->phba->fc_topology == in lpfc_matchdid()
5646 __lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did) in __lpfc_findnode_did() argument
5651 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in __lpfc_findnode_did()
5652 if (lpfc_matchdid(vport, ndlp, did)) { in __lpfc_findnode_did()
5657 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in __lpfc_findnode_did()
5668 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in __lpfc_findnode_did()
5674 lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did) in lpfc_findnode_did() argument
5676 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_findnode_did()
5681 ndlp = __lpfc_findnode_did(vport, did); in lpfc_findnode_did()
5687 lpfc_findnode_mapped(struct lpfc_vport *vport) in lpfc_findnode_mapped() argument
5689 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_findnode_mapped()
5696 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_findnode_mapped()
5704 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_findnode_mapped()
5716 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_findnode_mapped()
5722 lpfc_setup_disc_node(struct lpfc_vport *vport, uint32_t did) in lpfc_setup_disc_node() argument
5726 ndlp = lpfc_findnode_did(vport, did); in lpfc_setup_disc_node()
5728 if (vport->phba->nvmet_support) in lpfc_setup_disc_node()
5730 if ((vport->fc_flag & FC_RSCN_MODE) != 0 && in lpfc_setup_disc_node()
5731 lpfc_rscn_payload_check(vport, did) == 0) in lpfc_setup_disc_node()
5733 ndlp = lpfc_nlp_init(vport, did); in lpfc_setup_disc_node()
5736 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_setup_disc_node()
5738 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_setup_disc_node()
5742 ndlp->nlp_state, vport->fc_flag); in lpfc_setup_disc_node()
5754 if ((vport->fc_flag & FC_RSCN_MODE) && in lpfc_setup_disc_node()
5755 !(vport->fc_flag & FC_NDISC_ACTIVE)) { in lpfc_setup_disc_node()
5756 if (lpfc_rscn_payload_check(vport, did)) { in lpfc_setup_disc_node()
5761 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_setup_disc_node()
5763 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_setup_disc_node()
5767 ndlp->nlp_state, vport->fc_flag); in lpfc_setup_disc_node()
5774 if (vport->phba->nvmet_support) in lpfc_setup_disc_node()
5787 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_setup_disc_node()
5795 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_setup_disc_node()
5799 ndlp->nlp_state, vport->fc_flag); in lpfc_setup_disc_node()
5803 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_setup_disc_node()
5807 ndlp->nlp_state, vport->fc_flag); in lpfc_setup_disc_node()
5815 (!vport->phba->nvmet_support && in lpfc_setup_disc_node()
5819 if (vport->phba->nvmet_support) in lpfc_setup_disc_node()
5825 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_setup_disc_node()
5836 lpfc_disc_list_loopmap(struct lpfc_vport *vport) in lpfc_disc_list_loopmap() argument
5838 struct lpfc_hba *phba = vport->phba; in lpfc_disc_list_loopmap()
5852 if (((vport->fc_myDID & 0xff) == alpa) || (alpa == 0)) in lpfc_disc_list_loopmap()
5854 lpfc_setup_disc_node(vport, alpa); in lpfc_disc_list_loopmap()
5862 if (vport->cfg_scan_down) in lpfc_disc_list_loopmap()
5867 if ((vport->fc_myDID & 0xff) == alpa) in lpfc_disc_list_loopmap()
5869 lpfc_setup_disc_node(vport, alpa); in lpfc_disc_list_loopmap()
5877 lpfc_issue_clear_la(struct lpfc_hba *phba, struct lpfc_vport *vport) in lpfc_issue_clear_la() argument
5890 (vport->port_type != LPFC_PHYSICAL_PORT) || in lpfc_issue_clear_la()
5899 mbox->vport = vport; in lpfc_issue_clear_la()
5903 lpfc_disc_flush_list(vport); in lpfc_issue_clear_la()
5913 lpfc_issue_reg_vpi(struct lpfc_hba *phba, struct lpfc_vport *vport) in lpfc_issue_reg_vpi() argument
5919 lpfc_reg_vpi(vport, regvpimbox); in lpfc_issue_reg_vpi()
5921 regvpimbox->vport = vport; in lpfc_issue_reg_vpi()
5931 lpfc_disc_start(struct lpfc_vport *vport) in lpfc_disc_start() argument
5933 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_disc_start()
5934 struct lpfc_hba *phba = vport->phba; in lpfc_disc_start()
5939 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, in lpfc_disc_start()
5950 if (vport->port_state < LPFC_VPORT_READY) in lpfc_disc_start()
5951 vport->port_state = LPFC_DISC_AUTH; in lpfc_disc_start()
5953 lpfc_set_disctmo(vport); in lpfc_disc_start()
5955 vport->fc_prevDID = vport->fc_myDID; in lpfc_disc_start()
5956 vport->num_disc_nodes = 0; in lpfc_disc_start()
5959 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_disc_start()
5962 vport->port_state, vport->fc_flag, vport->fc_plogi_cnt, in lpfc_disc_start()
5963 vport->fc_adisc_cnt, vport->fc_npr_cnt); in lpfc_disc_start()
5966 num_sent = lpfc_els_disc_adisc(vport); in lpfc_disc_start()
5973 !(vport->fc_flag & FC_PT2PT) && in lpfc_disc_start()
5974 !(vport->fc_flag & FC_RSCN_MODE) && in lpfc_disc_start()
5976 lpfc_issue_clear_la(phba, vport); in lpfc_disc_start()
5977 lpfc_issue_reg_vpi(phba, vport); in lpfc_disc_start()
5985 if (vport->port_state < LPFC_VPORT_READY && !clear_la_pending) { in lpfc_disc_start()
5987 lpfc_issue_clear_la(phba, vport); in lpfc_disc_start()
5989 if (!(vport->fc_flag & FC_ABORT_DISCOVERY)) { in lpfc_disc_start()
5990 vport->num_disc_nodes = 0; in lpfc_disc_start()
5992 if (vport->fc_npr_cnt) in lpfc_disc_start()
5993 lpfc_els_disc_plogi(vport); in lpfc_disc_start()
5995 if (!vport->num_disc_nodes) { in lpfc_disc_start()
5997 vport->fc_flag &= ~FC_NDISC_ACTIVE; in lpfc_disc_start()
5999 lpfc_can_disctmo(vport); in lpfc_disc_start()
6002 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_start()
6005 num_sent = lpfc_els_disc_plogi(vport); in lpfc_disc_start()
6010 if (vport->fc_flag & FC_RSCN_MODE) { in lpfc_disc_start()
6014 if ((vport->fc_rscn_id_cnt == 0) && in lpfc_disc_start()
6015 (!(vport->fc_flag & FC_RSCN_DISCOVERY))) { in lpfc_disc_start()
6017 vport->fc_flag &= ~FC_RSCN_MODE; in lpfc_disc_start()
6019 lpfc_can_disctmo(vport); in lpfc_disc_start()
6021 lpfc_els_handle_rscn(vport); in lpfc_disc_start()
6083 lpfc_disc_flush_list(struct lpfc_vport *vport) in lpfc_disc_flush_list() argument
6086 struct lpfc_hba *phba = vport->phba; in lpfc_disc_flush_list()
6088 if (vport->fc_plogi_cnt || vport->fc_adisc_cnt) { in lpfc_disc_flush_list()
6089 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, in lpfc_disc_flush_list()
6101 * @vport: Pointer to Virtual Port object.
6110 lpfc_notify_xport_npr(struct lpfc_vport *vport) in lpfc_notify_xport_npr() argument
6114 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, in lpfc_notify_xport_npr()
6116 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_notify_xport_npr()
6120 lpfc_cleanup_discovery_resources(struct lpfc_vport *vport) in lpfc_cleanup_discovery_resources() argument
6122 lpfc_els_flush_rscn(vport); in lpfc_cleanup_discovery_resources()
6123 lpfc_els_flush_cmd(vport); in lpfc_cleanup_discovery_resources()
6124 lpfc_disc_flush_list(vport); in lpfc_cleanup_discovery_resources()
6125 if (pci_channel_offline(vport->phba->pcidev)) in lpfc_cleanup_discovery_resources()
6126 lpfc_notify_xport_npr(vport); in lpfc_cleanup_discovery_resources()
6147 struct lpfc_vport *vport = from_timer(vport, t, fc_disctmo); in lpfc_disc_timeout() local
6148 struct lpfc_hba *phba = vport->phba; in lpfc_disc_timeout()
6155 spin_lock_irqsave(&vport->work_port_lock, flags); in lpfc_disc_timeout()
6156 tmo_posted = vport->work_port_events & WORKER_DISC_TMO; in lpfc_disc_timeout()
6158 vport->work_port_events |= WORKER_DISC_TMO; in lpfc_disc_timeout()
6159 spin_unlock_irqrestore(&vport->work_port_lock, flags); in lpfc_disc_timeout()
6167 lpfc_disc_timeout_handler(struct lpfc_vport *vport) in lpfc_disc_timeout_handler() argument
6169 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_disc_timeout_handler()
6170 struct lpfc_hba *phba = vport->phba; in lpfc_disc_timeout_handler()
6176 if (!(vport->fc_flag & FC_DISC_TMO)) in lpfc_disc_timeout_handler()
6180 vport->fc_flag &= ~FC_DISC_TMO; in lpfc_disc_timeout_handler()
6183 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_disc_timeout_handler()
6185 vport->port_state, vport->fc_ns_retry, vport->fc_flag); in lpfc_disc_timeout_handler()
6187 switch (vport->port_state) { in lpfc_disc_timeout_handler()
6194 lpfc_printf_vlog(vport, KERN_WARNING, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
6198 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, in lpfc_disc_timeout_handler()
6204 lpfc_drop_node(vport, ndlp); in lpfc_disc_timeout_handler()
6210 lpfc_unreg_rpi(vport, ndlp); in lpfc_disc_timeout_handler()
6213 if (vport->port_state != LPFC_FLOGI) { in lpfc_disc_timeout_handler()
6215 lpfc_initial_flogi(vport); in lpfc_disc_timeout_handler()
6217 lpfc_issue_init_vfi(vport); in lpfc_disc_timeout_handler()
6226 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6229 vport->vpi ? "FDISC" : "FLOGI"); in lpfc_disc_timeout_handler()
6236 lpfc_disc_list_loopmap(vport); in lpfc_disc_timeout_handler()
6239 lpfc_disc_start(vport); in lpfc_disc_timeout_handler()
6245 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6250 ndlp = lpfc_findnode_did(vport, NameServer_DID); in lpfc_disc_timeout_handler()
6259 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6263 vport->fc_ns_retry, LPFC_MAX_NS_RETRY); in lpfc_disc_timeout_handler()
6265 if (vport->fc_ns_retry < LPFC_MAX_NS_RETRY) { in lpfc_disc_timeout_handler()
6267 vport->fc_ns_retry++; in lpfc_disc_timeout_handler()
6268 vport->gidft_inp = 0; in lpfc_disc_timeout_handler()
6269 rc = lpfc_issue_gidft(vport); in lpfc_disc_timeout_handler()
6273 vport->fc_ns_retry = 0; in lpfc_disc_timeout_handler()
6283 lpfc_issue_reg_vpi(phba, vport); in lpfc_disc_timeout_handler()
6285 lpfc_issue_clear_la(phba, vport); in lpfc_disc_timeout_handler()
6286 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_timeout_handler()
6293 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6305 initlinkmbox->vport = vport; in lpfc_disc_timeout_handler()
6316 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6319 lpfc_disc_flush_list(vport); in lpfc_disc_timeout_handler()
6327 lpfc_issue_reg_vpi(phba, vport); in lpfc_disc_timeout_handler()
6329 lpfc_issue_clear_la(phba, vport); in lpfc_disc_timeout_handler()
6330 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_timeout_handler()
6336 if (vport->fc_flag & FC_RSCN_MODE) { in lpfc_disc_timeout_handler()
6337 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6341 vport->fc_ns_retry, LPFC_MAX_NS_RETRY, in lpfc_disc_timeout_handler()
6342 vport->port_state, vport->gidft_inp); in lpfc_disc_timeout_handler()
6345 lpfc_els_flush_cmd(vport); in lpfc_disc_timeout_handler()
6347 lpfc_els_flush_rscn(vport); in lpfc_disc_timeout_handler()
6348 lpfc_disc_flush_list(vport); in lpfc_disc_timeout_handler()
6353 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6356 "vport State x%x\n", vport->port_state); in lpfc_disc_timeout_handler()
6363 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6370 lpfc_issue_clear_la(phba, vport); in lpfc_disc_timeout_handler()
6378 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6390 lpfc_disc_flush_list(vport); in lpfc_disc_timeout_handler()
6397 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_timeout_handler()
6413 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_fdmi_reg_login() local
6421 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_mbx_cmpl_fdmi_reg_login()
6422 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE | LOG_DISCOVERY, in lpfc_mbx_cmpl_fdmi_reg_login()
6433 if (vport->port_type == LPFC_PHYSICAL_PORT) { in lpfc_mbx_cmpl_fdmi_reg_login()
6435 lpfc_fdmi_cmd(vport, ndlp, SLI_MGMT_DHBA, 0); in lpfc_mbx_cmpl_fdmi_reg_login()
6437 lpfc_fdmi_cmd(vport, ndlp, SLI_MGMT_DPRT, 0); in lpfc_mbx_cmpl_fdmi_reg_login()
6465 __lpfc_find_node(struct lpfc_vport *vport, node_filter filter, void *param) in __lpfc_find_node() argument
6469 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in __lpfc_find_node()
6471 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in __lpfc_find_node()
6482 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in __lpfc_find_node()
6492 __lpfc_findnode_rpi(struct lpfc_vport *vport, uint16_t rpi) in __lpfc_findnode_rpi() argument
6494 return __lpfc_find_node(vport, lpfc_filter_by_rpi, &rpi); in __lpfc_findnode_rpi()
6502 lpfc_findnode_wwpn(struct lpfc_vport *vport, struct lpfc_name *wwpn) in lpfc_findnode_wwpn() argument
6504 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_findnode_wwpn()
6508 ndlp = __lpfc_find_node(vport, lpfc_filter_by_wwpn, wwpn); in lpfc_findnode_wwpn()
6519 lpfc_findnode_rpi(struct lpfc_vport *vport, uint16_t rpi) in lpfc_findnode_rpi() argument
6521 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_findnode_rpi()
6526 ndlp = __lpfc_findnode_rpi(vport, rpi); in lpfc_findnode_rpi()
6532 * lpfc_find_vport_by_vpid - Find a vport on a HBA through vport identifier
6536 * This routine finds a vport on a HBA (referred by @phba) through a
6537 * @vpi. The function walks the HBA's vport list and returns the address
6538 * of the vport with the matching @vpi.
6541 * NULL - No vport with the matching @vpi found
6542 * Otherwise - Address to the vport with the matching @vpi.
6547 struct lpfc_vport *vport; in lpfc_find_vport_by_vpid() local
6555 * vport stores the logical vpi. in lpfc_find_vport_by_vpid()
6564 "2936 Could not find Vport mapped " in lpfc_find_vport_by_vpid()
6571 list_for_each_entry(vport, &phba->port_list, listentry) { in lpfc_find_vport_by_vpid()
6572 if (vport->vpi == i) { in lpfc_find_vport_by_vpid()
6574 return vport; in lpfc_find_vport_by_vpid()
6582 lpfc_nlp_init(struct lpfc_vport *vport, uint32_t did) in lpfc_nlp_init() argument
6587 if (vport->phba->sli_rev == LPFC_SLI_REV4) { in lpfc_nlp_init()
6588 rpi = lpfc_sli4_alloc_rpi(vport->phba); in lpfc_nlp_init()
6593 ndlp = mempool_alloc(vport->phba->nlp_mem_pool, GFP_KERNEL); in lpfc_nlp_init()
6595 if (vport->phba->sli_rev == LPFC_SLI_REV4) in lpfc_nlp_init()
6596 lpfc_sli4_free_rpi(vport->phba, rpi); in lpfc_nlp_init()
6604 lpfc_initialize_node(vport, ndlp, did); in lpfc_nlp_init()
6606 if (vport->phba->sli_rev == LPFC_SLI_REV4) { in lpfc_nlp_init()
6608 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE | LOG_DISCOVERY, in lpfc_nlp_init()
6615 mempool_alloc(vport->phba->active_rrq_pool, in lpfc_nlp_init()
6624 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_init()
6639 struct lpfc_vport *vport = ndlp->vport; in lpfc_nlp_release() local
6641 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_release()
6645 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_nlp_release()
6651 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_nlp_release()
6652 lpfc_cleanup_node(vport, ndlp); in lpfc_nlp_release()
6664 lpfc_sli4_free_rpi(vport->phba, ndlp->nlp_rpi); in lpfc_nlp_release()
6672 ndlp->vport = NULL; in lpfc_nlp_release()
6694 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_get()
6706 lpfc_printf_vlog(ndlp->vport, KERN_WARNING, LOG_NODE, in lpfc_nlp_get()
6726 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_put()
6808 struct lpfc_vport *vport = mboxq->vport; in lpfc_unregister_vfi_cmpl() local
6809 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_unregister_vfi_cmpl()
6815 mboxq->u.mb.mbxStatus, vport->port_state); in lpfc_unregister_vfi_cmpl()
6834 struct lpfc_vport *vport = mboxq->vport; in lpfc_unregister_fcfi_cmpl() local
6840 mboxq->u.mb.mbxStatus, vport->port_state); in lpfc_unregister_fcfi_cmpl()
6935 mbox->vport = phba->pport; in lpfc_sli4_unregister_fcf()
7289 * @vport: Pointer to lpfc_vport data structure.
7303 lpfc_error_lost_link(struct lpfc_vport *vport, u32 ulp_status, u32 ulp_word4) in lpfc_error_lost_link() argument
7312 lpfc_printf_vlog(vport, KERN_WARNING, LOG_SLI | LOG_ELS, in lpfc_error_lost_link()