Lines Matching refs:vport
71 static void lpfc_disc_flush_list(struct lpfc_vport *vport);
117 if (!ndlp->vport) { 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()
178 if (test_bit(FC_UNLOADING, &vport->load_flag) || in lpfc_dev_loss_tmo_callbk()
224 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_dev_loss_tmo_callbk()
232 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_dev_loss_tmo_callbk()
272 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_dev_loss_tmo_callbk()
277 vport->load_flag, kref_read(&ndlp->kref)); in lpfc_dev_loss_tmo_callbk()
283 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_dev_loss_tmo_callbk()
296 static void lpfc_check_inactive_vmid_one(struct lpfc_vport *vport) in lpfc_check_inactive_vmid_one() argument
304 write_lock(&vport->vmid_lock); in lpfc_check_inactive_vmid_one()
306 if (!vport->cur_vmid_cnt) in lpfc_check_inactive_vmid_one()
310 hash_for_each(vport->hash_table, bucket, vmp, hnode) { in lpfc_check_inactive_vmid_one()
321 if ((vport->vmid_inactivity_timeout * in lpfc_check_inactive_vmid_one()
333 write_unlock(&vport->vmid_lock); in lpfc_check_inactive_vmid_one()
334 if (vport->vmid_priority_tagging) in lpfc_check_inactive_vmid_one()
335 r = lpfc_vmid_uvem(vport, vmp, false); in lpfc_check_inactive_vmid_one()
337 r = lpfc_vmid_cmd(vport, in lpfc_check_inactive_vmid_one()
343 write_lock(&vport->vmid_lock); in lpfc_check_inactive_vmid_one()
347 vport->cur_vmid_cnt--; in lpfc_check_inactive_vmid_one()
357 write_unlock(&vport->vmid_lock); in lpfc_check_inactive_vmid_one()
372 struct lpfc_vport *vport; in lpfc_check_inactive_vmid() local
382 vport = phba->pport; in lpfc_check_inactive_vmid()
384 vport = vports[i]; in lpfc_check_inactive_vmid()
385 if (!vport) in lpfc_check_inactive_vmid()
388 lpfc_check_inactive_vmid_one(vport); in lpfc_check_inactive_vmid()
403 lpfc_check_nlp_post_devloss(struct lpfc_vport *vport, in lpfc_check_nlp_post_devloss() argument
413 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY | LOG_NODE, in lpfc_check_nlp_post_devloss()
418 ndlp->nlp_flag, vport->port_state); in lpfc_check_nlp_post_devloss()
437 struct lpfc_vport *vport; in lpfc_dev_loss_tmo_handler() local
446 vport = ndlp->vport; in lpfc_dev_loss_tmo_handler()
448 phba = vport->phba; in lpfc_dev_loss_tmo_handler()
453 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_dev_loss_tmo_handler()
457 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_dev_loss_tmo_handler()
464 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_dev_loss_tmo_handler()
488 fc_vport = vport->fc_vport; in lpfc_dev_loss_tmo_handler()
534 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_dev_loss_tmo_handler()
541 vport->port_state); in lpfc_dev_loss_tmo_handler()
551 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_dev_loss_tmo_handler()
558 vport->port_state); in lpfc_dev_loss_tmo_handler()
568 lpfc_sli_abort_iocb(vport, ndlp->nlp_sid, 0, LPFC_CTX_TGT); in lpfc_dev_loss_tmo_handler()
572 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_dev_loss_tmo_handler()
582 lpfc_printf_vlog(vport, KERN_INFO, LOG_TRACE_EVENT, in lpfc_dev_loss_tmo_handler()
604 lpfc_disc_state_machine(vport, ndlp, NULL, NLP_EVT_DEVICE_RM); in lpfc_dev_loss_tmo_handler()
611 struct lpfc_vport *vport; in lpfc_check_vmid_qfpa_issue() local
621 vport = phba->pport; in lpfc_check_vmid_qfpa_issue()
623 vport = vports[i]; in lpfc_check_vmid_qfpa_issue()
624 if (!vport) in lpfc_check_vmid_qfpa_issue()
627 if (vport->vmid_flag & LPFC_VMID_ISSUE_QFPA) { in lpfc_check_vmid_qfpa_issue()
628 if (!lpfc_issue_els_qfpa(vport)) in lpfc_check_vmid_qfpa_issue()
629 vport->vmid_flag &= ~LPFC_VMID_ISSUE_QFPA; in lpfc_check_vmid_qfpa_issue()
773 shost = lpfc_shost_from_vport(fast_evt_data->vport); in lpfc_send_fastpath_evt()
870 lpfc_sli_abts_recover_port(ndlp->vport, ndlp); in lpfc_work_list_done()
940 struct lpfc_vport *vport; in lpfc_work_done() local
1011 vport = phba->pport; in lpfc_work_done()
1013 vport = vports[i]; in lpfc_work_done()
1014 if (vport == NULL) in lpfc_work_done()
1016 spin_lock_irq(&vport->work_port_lock); in lpfc_work_done()
1017 work_port_events = vport->work_port_events; in lpfc_work_done()
1018 vport->work_port_events &= ~work_port_events; in lpfc_work_done()
1019 spin_unlock_irq(&vport->work_port_lock); in lpfc_work_done()
1023 lpfc_disc_timeout_handler(vport); in lpfc_work_done()
1025 lpfc_els_timeout_handler(vport); in lpfc_work_done()
1035 lpfc_delayed_disc_timeout_handler(vport); in lpfc_work_done()
1155 lpfc_cleanup_rpis(struct lpfc_vport *vport, int remove) in lpfc_cleanup_rpis() argument
1157 struct lpfc_hba *phba = vport->phba; in lpfc_cleanup_rpis()
1160 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_cleanup_rpis()
1162 ((vport->port_type == LPFC_NPIV_PORT) && in lpfc_cleanup_rpis()
1166 lpfc_unreg_rpi(vport, ndlp); in lpfc_cleanup_rpis()
1178 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_cleanup_rpis()
1185 lpfc_sli4_unreg_all_rpis(vport); in lpfc_cleanup_rpis()
1186 lpfc_mbx_unreg_vpi(vport); in lpfc_cleanup_rpis()
1187 set_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag); in lpfc_cleanup_rpis()
1192 lpfc_port_link_failure(struct lpfc_vport *vport) in lpfc_port_link_failure() argument
1194 lpfc_vport_set_state(vport, FC_VPORT_LINKDOWN); in lpfc_port_link_failure()
1197 lpfc_cleanup_rcv_buffers(vport); in lpfc_port_link_failure()
1200 lpfc_els_flush_rscn(vport); in lpfc_port_link_failure()
1203 lpfc_els_flush_cmd(vport); in lpfc_port_link_failure()
1205 lpfc_cleanup_rpis(vport, 0); in lpfc_port_link_failure()
1208 lpfc_can_disctmo(vport); in lpfc_port_link_failure()
1212 lpfc_linkdown_port(struct lpfc_vport *vport) in lpfc_linkdown_port() argument
1214 struct lpfc_hba *phba = vport->phba; in lpfc_linkdown_port()
1215 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_linkdown_port()
1217 if (vport->cfg_enable_fc4_type != LPFC_ENABLE_NVME) in lpfc_linkdown_port()
1221 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_linkdown_port()
1223 vport->port_state, vport->fc_ns_retry, vport->fc_flag); in lpfc_linkdown_port()
1225 lpfc_port_link_failure(vport); in lpfc_linkdown_port()
1228 clear_bit(FC_DISC_DELAYED, &vport->fc_flag); 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()
1293 if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || in lpfc_linkdown()
1294 (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { in lpfc_linkdown()
1311 mb->vport = vport; in lpfc_linkdown()
1326 mb->vport = vport; in lpfc_linkdown()
1342 lpfc_linkup_cleanup_nodes(struct lpfc_vport *vport) in lpfc_linkup_cleanup_nodes() argument
1346 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_linkup_cleanup_nodes()
1356 lpfc_unreg_rpi(vport, ndlp); in lpfc_linkup_cleanup_nodes()
1357 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_linkup_cleanup_nodes()
1362 lpfc_unreg_rpi(vport, ndlp); in lpfc_linkup_cleanup_nodes()
1368 lpfc_linkup_port(struct lpfc_vport *vport) in lpfc_linkup_port() argument
1370 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_linkup_port()
1371 struct lpfc_hba *phba = vport->phba; in lpfc_linkup_port()
1373 if (test_bit(FC_UNLOADING, &vport->load_flag)) in lpfc_linkup_port()
1376 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_linkup_port()
1382 (vport != phba->pport)) in lpfc_linkup_port()
1386 clear_bit(FC_ABORT_DISCOVERY, &vport->fc_flag); in lpfc_linkup_port()
1387 clear_bit(FC_RSCN_MODE, &vport->fc_flag); in lpfc_linkup_port()
1388 clear_bit(FC_NLP_MORE, &vport->fc_flag); in lpfc_linkup_port()
1389 clear_bit(FC_RSCN_DISCOVERY, &vport->fc_flag); in lpfc_linkup_port()
1391 clear_bit(FC_PT2PT, &vport->fc_flag); in lpfc_linkup_port()
1392 clear_bit(FC_PT2PT_PLOGI, &vport->fc_flag); in lpfc_linkup_port()
1393 clear_bit(FC_ABORT_DISCOVERY, &vport->fc_flag); in lpfc_linkup_port()
1394 clear_bit(FC_RSCN_MODE, &vport->fc_flag); in lpfc_linkup_port()
1395 clear_bit(FC_NLP_MORE, &vport->fc_flag); in lpfc_linkup_port()
1396 clear_bit(FC_RSCN_DISCOVERY, &vport->fc_flag); in lpfc_linkup_port()
1398 set_bit(FC_NDISC_ACTIVE, &vport->fc_flag); in lpfc_linkup_port()
1401 vport->fc_ns_retry = 0; in lpfc_linkup_port()
1403 lpfc_setup_fdmi_mask(vport); in lpfc_linkup_port()
1405 lpfc_linkup_cleanup_nodes(vport); in lpfc_linkup_port()
1451 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_clear_la() local
1463 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_clear_la()
1466 mb->mbxStatus, vport->port_state); in lpfc_mbx_cmpl_clear_la()
1471 if (vport->port_type == LPFC_PHYSICAL_PORT) in lpfc_mbx_cmpl_clear_la()
1486 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_mbx_cmpl_clear_la()
1490 clear_bit(FC_ABORT_DISCOVERY, &vport->fc_flag); in lpfc_mbx_cmpl_clear_la()
1492 lpfc_can_disctmo(vport); in lpfc_mbx_cmpl_clear_la()
1510 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_local_config_link() local
1527 test_bit(FC_PUBLIC_LOOP, &vport->fc_flag) && in lpfc_mbx_cmpl_local_config_link()
1528 !test_bit(FC_LBIT, &vport->fc_flag)) { in lpfc_mbx_cmpl_local_config_link()
1533 lpfc_set_disctmo(vport); in lpfc_mbx_cmpl_local_config_link()
1540 if (vport->port_state != LPFC_FLOGI) { in lpfc_mbx_cmpl_local_config_link()
1556 sparam_mb->vport = vport; in lpfc_mbx_cmpl_local_config_link()
1567 lpfc_initial_flogi(vport); in lpfc_mbx_cmpl_local_config_link()
1570 if (test_bit(FC_PT2PT, &vport->fc_flag)) in lpfc_mbx_cmpl_local_config_link()
1571 lpfc_disc_start(vport); 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 status, vport->port_state); in lpfc_mbx_cmpl_local_config_link()
1583 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_local_config_link()
1585 vport->port_state); in lpfc_mbx_cmpl_local_config_link()
1587 lpfc_issue_clear_la(phba, vport); in lpfc_mbx_cmpl_local_config_link()
1616 struct lpfc_vport *vport = mboxq->vport; in lpfc_mbx_cmpl_reg_fcfi() local
1619 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_reg_fcfi()
1622 vport->port_state); in lpfc_mbx_cmpl_reg_fcfi()
1643 if (vport->port_state != LPFC_FLOGI) { in lpfc_mbx_cmpl_reg_fcfi()
1645 lpfc_issue_init_vfi(vport); in lpfc_mbx_cmpl_reg_fcfi()
1909 fcf_mbxq->vport = phba->pport; in lpfc_register_fcf()
2386 int lpfc_sli4_fcf_rr_next_proc(struct lpfc_vport *vport, uint16_t fcf_index) in lpfc_sli4_fcf_rr_next_proc() argument
2388 struct lpfc_hba *phba = vport->phba; in lpfc_sli4_fcf_rr_next_proc()
2449 lpfc_can_disctmo(vport); in lpfc_sli4_fcf_rr_next_proc()
3153 struct lpfc_vport *vport = mboxq->vport; in lpfc_init_vfi_cmpl() local
3163 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_init_vfi_cmpl()
3167 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_init_vfi_cmpl()
3171 lpfc_initial_flogi(vport); in lpfc_init_vfi_cmpl()
3184 lpfc_issue_init_vfi(struct lpfc_vport *vport) in lpfc_issue_init_vfi() argument
3188 struct lpfc_hba *phba = vport->phba; in lpfc_issue_init_vfi()
3192 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_init_vfi()
3197 lpfc_init_vfi(mboxq, vport); in lpfc_issue_init_vfi()
3201 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_issue_init_vfi()
3203 mempool_free(mboxq, vport->phba->mbox_mem_pool); in lpfc_issue_init_vfi()
3217 struct lpfc_vport *vport = mboxq->vport; in lpfc_init_vpi_cmpl() local
3221 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_init_vpi_cmpl()
3225 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_init_vpi_cmpl()
3228 clear_bit(FC_VPORT_NEEDS_INIT_VPI, &vport->fc_flag); in lpfc_init_vpi_cmpl()
3231 if ((phba->pport == vport) || (vport->port_state == LPFC_FDISC)) { in lpfc_init_vpi_cmpl()
3232 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_init_vpi_cmpl()
3234 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_init_vpi_cmpl()
3239 lpfc_register_new_vport(phba, vport, ndlp); in lpfc_init_vpi_cmpl()
3245 lpfc_initial_fdisc(vport); in lpfc_init_vpi_cmpl()
3247 lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP); in lpfc_init_vpi_cmpl()
3248 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_init_vpi_cmpl()
3263 lpfc_issue_init_vpi(struct lpfc_vport *vport) in lpfc_issue_init_vpi() argument
3268 if ((vport->port_type != LPFC_PHYSICAL_PORT) && (!vport->vpi)) { in lpfc_issue_init_vpi()
3269 vpi = lpfc_alloc_vpi(vport->phba); in lpfc_issue_init_vpi()
3271 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_issue_init_vpi()
3273 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_issue_init_vpi()
3276 vport->vpi = vpi; in lpfc_issue_init_vpi()
3279 mboxq = mempool_alloc(vport->phba->mbox_mem_pool, GFP_KERNEL); in lpfc_issue_init_vpi()
3281 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_init_vpi()
3286 lpfc_init_vpi(vport->phba, mboxq, vport->vpi); in lpfc_issue_init_vpi()
3287 mboxq->vport = vport; in lpfc_issue_init_vpi()
3289 rc = lpfc_sli_issue_mbox(vport->phba, mboxq, MBX_NOWAIT); in lpfc_issue_init_vpi()
3291 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_issue_init_vpi()
3293 mempool_free(mboxq, vport->phba->mbox_mem_pool); in lpfc_issue_init_vpi()
3349 struct lpfc_vport *vport = mboxq->vport; in lpfc_mbx_cmpl_reg_vfi() local
3350 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_reg_vfi()
3360 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_reg_vfi()
3363 mboxq->u.mb.mbxStatus, vport->port_state); in lpfc_mbx_cmpl_reg_vfi()
3366 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_reg_vfi()
3368 lpfc_disc_start(vport); in lpfc_mbx_cmpl_reg_vfi()
3371 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_reg_vfi()
3379 if (test_bit(FC_VFI_REGISTERED, &vport->fc_flag)) in lpfc_mbx_cmpl_reg_vfi()
3381 test_bit(FC_PT2PT, &vport->fc_flag))) in lpfc_mbx_cmpl_reg_vfi()
3385 set_bit(FC_VFI_REGISTERED, &vport->fc_flag); in lpfc_mbx_cmpl_reg_vfi()
3386 clear_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag); in lpfc_mbx_cmpl_reg_vfi()
3387 clear_bit(FC_VPORT_NEEDS_INIT_VPI, &vport->fc_flag); in lpfc_mbx_cmpl_reg_vfi()
3389 vport->vpi_state |= LPFC_VPI_REGISTERED; in lpfc_mbx_cmpl_reg_vfi()
3399 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, in lpfc_mbx_cmpl_reg_vfi()
3402 vport->port_state, vport->fc_flag, vport->fc_myDID, in lpfc_mbx_cmpl_reg_vfi()
3403 vport->phba->alpa_map[0], in lpfc_mbx_cmpl_reg_vfi()
3406 if (vport->port_state == LPFC_FABRIC_CFG_LINK) { in lpfc_mbx_cmpl_reg_vfi()
3411 if (test_bit(FC_PT2PT, &vport->fc_flag) || in lpfc_mbx_cmpl_reg_vfi()
3413 !test_bit(FC_PUBLIC_LOOP, &vport->fc_flag))) { in lpfc_mbx_cmpl_reg_vfi()
3416 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_reg_vfi()
3418 if (test_bit(FC_PT2PT, &vport->fc_flag)) in lpfc_mbx_cmpl_reg_vfi()
3419 vport->port_state = LPFC_VPORT_READY; in lpfc_mbx_cmpl_reg_vfi()
3421 lpfc_disc_start(vport); in lpfc_mbx_cmpl_reg_vfi()
3424 lpfc_do_scr_ns_plogi(phba, vport); in lpfc_mbx_cmpl_reg_vfi()
3437 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_read_sparam() local
3438 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_read_sparam()
3439 struct serv_parm *sp = &vport->fc_sparam; in lpfc_mbx_cmpl_read_sparam()
3445 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_read_sparam()
3448 mb->mbxStatus, vport->port_state); in lpfc_mbx_cmpl_read_sparam()
3453 memcpy((uint8_t *) &vport->fc_sparam, (uint8_t *) mp->virt, in lpfc_mbx_cmpl_read_sparam()
3467 lpfc_update_vport_wwn(vport); in lpfc_mbx_cmpl_read_sparam()
3468 fc_host_port_name(shost) = wwn_to_u64(vport->fc_portname.u.wwn); in lpfc_mbx_cmpl_read_sparam()
3469 if (vport->port_type == LPFC_PHYSICAL_PORT) { in lpfc_mbx_cmpl_read_sparam()
3470 memcpy(&phba->wwnn, &vport->fc_nodename, sizeof(phba->wwnn)); in lpfc_mbx_cmpl_read_sparam()
3471 memcpy(&phba->wwpn, &vport->fc_portname, sizeof(phba->wwnn)); in lpfc_mbx_cmpl_read_sparam()
3480 lpfc_initial_flogi(vport); in lpfc_mbx_cmpl_read_sparam()
3487 lpfc_issue_clear_la(phba, vport); in lpfc_mbx_cmpl_read_sparam()
3493 struct lpfc_vport *vport = phba->pport; in lpfc_mbx_process_link_up() local
3546 set_bit(FC_LBIT, &vport->fc_flag); in lpfc_mbx_process_link_up()
3548 vport->fc_myDID = bf_get(lpfc_mbx_read_top_alpa_granted, la); in lpfc_mbx_process_link_up()
3554 if (vport->cfg_log_verbose & LOG_LINK_EVENT) { in lpfc_mbx_process_link_up()
3594 vport->fc_myDID = phba->fc_pref_DID; in lpfc_mbx_process_link_up()
3595 set_bit(FC_LBIT, &vport->fc_flag); in lpfc_mbx_process_link_up()
3611 sparam_mbox->vport = vport; in lpfc_mbx_process_link_up()
3623 vport->port_state = LPFC_LOCAL_CFG_LINK; in lpfc_mbx_process_link_up()
3625 cfglink_mbox->vport = vport; in lpfc_mbx_process_link_up()
3633 vport->port_state = LPFC_VPORT_UNKNOWN; in lpfc_mbx_process_link_up()
3695 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_process_link_up()
3696 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_process_link_up()
3698 vport->port_state, sparam_mbox, cfglink_mbox); in lpfc_mbx_process_link_up()
3699 lpfc_issue_clear_la(phba, vport); in lpfc_mbx_process_link_up()
3738 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_read_topology() local
3754 mb->mbxStatus, vport->port_state); in lpfc_mbx_cmpl_read_topology()
3766 set_bit(FC_BYPASSED_MODE, &vport->fc_flag); in lpfc_mbx_cmpl_read_topology()
3768 clear_bit(FC_BYPASSED_MODE, &vport->fc_flag); in lpfc_mbx_cmpl_read_topology()
3818 phba->pport->port_state, vport->fc_flag); in lpfc_mbx_cmpl_read_topology()
3824 phba->pport->port_state, vport->fc_flag, in lpfc_mbx_cmpl_read_topology()
3831 phba->pport->port_state, vport->fc_flag, in lpfc_mbx_cmpl_read_topology()
3855 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_reg_login() local
3866 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI | LOG_NODE | LOG_DISCOVERY, in lpfc_mbx_cmpl_reg_login()
3894 lpfc_unreg_rpi(vport, ndlp); in lpfc_mbx_cmpl_reg_login()
3898 lpfc_disc_state_machine(vport, ndlp, pmb, NLP_EVT_CMPL_REG_LOGIN); in lpfc_mbx_cmpl_reg_login()
3914 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_unreg_vpi() local
3915 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_unreg_vpi()
3920 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_mbx_cmpl_unreg_vpi()
3926 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_unreg_vpi()
3928 vport->vpi, mb->mbxStatus); in lpfc_mbx_cmpl_unreg_vpi()
3934 set_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag); in lpfc_mbx_cmpl_unreg_vpi()
3936 vport->vpi_state &= ~LPFC_VPI_REGISTERED; in lpfc_mbx_cmpl_unreg_vpi()
3939 lpfc_cleanup_vports_rrqs(vport, NULL); in lpfc_mbx_cmpl_unreg_vpi()
3944 if (test_bit(FC_UNLOADING, &vport->load_flag) && vport != phba->pport) in lpfc_mbx_cmpl_unreg_vpi()
3949 lpfc_mbx_unreg_vpi(struct lpfc_vport *vport) in lpfc_mbx_unreg_vpi() argument
3951 struct lpfc_hba *phba = vport->phba; in lpfc_mbx_unreg_vpi()
3959 lpfc_unreg_vpi(phba, vport->vpi, mbox); in lpfc_mbx_unreg_vpi()
3960 mbox->vport = vport; in lpfc_mbx_unreg_vpi()
3964 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_unreg_vpi()
3975 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_reg_vpi() local
3976 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_reg_vpi()
3983 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_mbx_cmpl_reg_vpi()
3986 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_reg_vpi()
3987 clear_bit(FC_FABRIC, &vport->fc_flag); in lpfc_mbx_cmpl_reg_vpi()
3988 clear_bit(FC_PUBLIC_LOOP, &vport->fc_flag); in lpfc_mbx_cmpl_reg_vpi()
3989 vport->fc_myDID = 0; in lpfc_mbx_cmpl_reg_vpi()
3991 if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || in lpfc_mbx_cmpl_reg_vpi()
3992 (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { in lpfc_mbx_cmpl_reg_vpi()
3996 lpfc_nvme_update_localport(vport); in lpfc_mbx_cmpl_reg_vpi()
4001 clear_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag); in lpfc_mbx_cmpl_reg_vpi()
4003 vport->vpi_state |= LPFC_VPI_REGISTERED; in lpfc_mbx_cmpl_reg_vpi()
4005 vport->num_disc_nodes = 0; in lpfc_mbx_cmpl_reg_vpi()
4007 if (atomic_read(&vport->fc_npr_cnt)) in lpfc_mbx_cmpl_reg_vpi()
4008 lpfc_els_disc_plogi(vport); in lpfc_mbx_cmpl_reg_vpi()
4010 if (!vport->num_disc_nodes) { in lpfc_mbx_cmpl_reg_vpi()
4011 clear_bit(FC_NDISC_ACTIVE, &vport->fc_flag); in lpfc_mbx_cmpl_reg_vpi()
4012 lpfc_can_disctmo(vport); in lpfc_mbx_cmpl_reg_vpi()
4014 vport->port_state = LPFC_VPORT_READY; in lpfc_mbx_cmpl_reg_vpi()
4039 struct lpfc_vport *vport; in lpfc_create_static_vport() local
4079 pmb->vport = phba->pport; in lpfc_create_static_vport()
4153 vport = *(struct lpfc_vport **)new_fc_vport->dd_data; in lpfc_create_static_vport()
4154 vport->vport_flag |= STATIC_VPORT; in lpfc_create_static_vport()
4172 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_fabric_reg_login() local
4179 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_fabric_reg_login()
4185 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_fabric_reg_login()
4188 lpfc_disc_start(vport); in lpfc_mbx_cmpl_fabric_reg_login()
4196 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_fabric_reg_login()
4208 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_mbx_cmpl_fabric_reg_login()
4210 if (vport->port_state == LPFC_FABRIC_CFG_LINK) { in lpfc_mbx_cmpl_fabric_reg_login()
4213 if (!test_and_clear_bit(FC_LOGO_RCVD_DID_CHNG, &vport->fc_flag)) in lpfc_mbx_cmpl_fabric_reg_login()
4215 lpfc_do_scr_ns_plogi(phba, vport); in lpfc_mbx_cmpl_fabric_reg_login()
4232 lpfc_issue_gidft(struct lpfc_vport *vport) in lpfc_issue_gidft() argument
4235 if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || in lpfc_issue_gidft()
4236 (vport->cfg_enable_fc4_type == LPFC_ENABLE_FCP)) { in lpfc_issue_gidft()
4237 if (lpfc_ns_cmd(vport, SLI_CTNS_GID_FT, 0, SLI_CTPT_FCP)) { in lpfc_issue_gidft()
4241 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_gidft()
4249 vport->gidft_inp++; in lpfc_issue_gidft()
4252 if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || in lpfc_issue_gidft()
4253 (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { in lpfc_issue_gidft()
4254 if (lpfc_ns_cmd(vport, SLI_CTNS_GID_FT, 0, SLI_CTPT_NVME)) { in lpfc_issue_gidft()
4258 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_gidft()
4264 vport->gidft_inp); in lpfc_issue_gidft()
4265 if (vport->gidft_inp == 0) in lpfc_issue_gidft()
4268 vport->gidft_inp++; in lpfc_issue_gidft()
4270 return vport->gidft_inp; in lpfc_issue_gidft()
4284 lpfc_issue_gidpt(struct lpfc_vport *vport) in lpfc_issue_gidpt() argument
4287 if (lpfc_ns_cmd(vport, SLI_CTNS_GID_PT, 0, GID_PT_N_PORT)) { in lpfc_issue_gidpt()
4291 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_issue_gidpt()
4298 vport->gidft_inp++; in lpfc_issue_gidpt()
4313 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_ns_reg_login() local
4317 vport->gidft_inp = 0; in lpfc_mbx_cmpl_ns_reg_login()
4320 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_ns_reg_login()
4348 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_ns_reg_login()
4351 lpfc_disc_start(vport); in lpfc_mbx_cmpl_ns_reg_login()
4354 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_ns_reg_login()
4362 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_mbx_cmpl_ns_reg_login()
4363 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE | LOG_DISCOVERY, in lpfc_mbx_cmpl_ns_reg_login()
4369 if (vport->port_state < LPFC_VPORT_READY) { in lpfc_mbx_cmpl_ns_reg_login()
4371 lpfc_ns_cmd(vport, SLI_CTNS_RNN_ID, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
4372 lpfc_ns_cmd(vport, SLI_CTNS_RSNN_NN, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
4373 lpfc_ns_cmd(vport, SLI_CTNS_RSPN_ID, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
4374 lpfc_ns_cmd(vport, SLI_CTNS_RFT_ID, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
4376 if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || in lpfc_mbx_cmpl_ns_reg_login()
4377 (vport->cfg_enable_fc4_type == LPFC_ENABLE_FCP)) in lpfc_mbx_cmpl_ns_reg_login()
4378 lpfc_ns_cmd(vport, SLI_CTNS_RFF_ID, 0, FC_TYPE_FCP); in lpfc_mbx_cmpl_ns_reg_login()
4380 if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || in lpfc_mbx_cmpl_ns_reg_login()
4381 (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) in lpfc_mbx_cmpl_ns_reg_login()
4382 lpfc_ns_cmd(vport, SLI_CTNS_RFF_ID, 0, in lpfc_mbx_cmpl_ns_reg_login()
4386 lpfc_issue_els_scr(vport, 0); in lpfc_mbx_cmpl_ns_reg_login()
4397 rc = lpfc_issue_els_edc(vport, 0); in lpfc_mbx_cmpl_ns_reg_login()
4404 lpfc_issue_els_edc(vport, 0); in lpfc_mbx_cmpl_ns_reg_login()
4406 lpfc_issue_els_rdf(vport, 0); in lpfc_mbx_cmpl_ns_reg_login()
4410 vport->fc_ns_retry = 0; in lpfc_mbx_cmpl_ns_reg_login()
4411 if (lpfc_issue_gidft(vport) == 0) in lpfc_mbx_cmpl_ns_reg_login()
4434 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_fc_reg_login() local
4440 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_fc_reg_login()
4446 lpfc_check_nlp_post_devloss(vport, ndlp); in lpfc_mbx_cmpl_fc_reg_login()
4451 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_mbx_cmpl_fc_reg_login()
4459 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_mbx_cmpl_fc_reg_login()
4471 lpfc_register_remote_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_register_remote_port() argument
4473 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_register_remote_port()
4477 struct lpfc_hba *phba = vport->phba; in lpfc_register_remote_port()
4480 if (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME) in lpfc_register_remote_port()
4490 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_register_remote_port()
4495 if (test_bit(FC_UNLOADING, &vport->load_flag)) in lpfc_register_remote_port()
4536 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_register_remote_port()
4553 struct lpfc_vport *vport = ndlp->vport; in lpfc_unregister_remote_port() local
4555 if (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME) in lpfc_unregister_remote_port()
4558 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_unregister_remote_port()
4562 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_unregister_remote_port()
4573 lpfc_nlp_counters(struct lpfc_vport *vport, int state, int count) in lpfc_nlp_counters() argument
4577 atomic_add(count, &vport->fc_unused_cnt); in lpfc_nlp_counters()
4580 atomic_add(count, &vport->fc_plogi_cnt); in lpfc_nlp_counters()
4583 atomic_add(count, &vport->fc_adisc_cnt); in lpfc_nlp_counters()
4586 atomic_add(count, &vport->fc_reglogin_cnt); in lpfc_nlp_counters()
4589 atomic_add(count, &vport->fc_prli_cnt); in lpfc_nlp_counters()
4592 atomic_add(count, &vport->fc_unmap_cnt); in lpfc_nlp_counters()
4595 atomic_add(count, &vport->fc_map_cnt); in lpfc_nlp_counters()
4598 if (!atomic_read(&vport->fc_npr_cnt) && count == -1) in lpfc_nlp_counters()
4599 atomic_set(&vport->fc_npr_cnt, 0); in lpfc_nlp_counters()
4601 atomic_add(count, &vport->fc_npr_cnt); in lpfc_nlp_counters()
4608 lpfc_nlp_reg_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_nlp_reg_node() argument
4612 lpfc_check_nlp_post_devloss(vport, ndlp); in lpfc_nlp_reg_node()
4621 lpfc_nvme_rescan_port(vport, ndlp); in lpfc_nlp_reg_node()
4630 vport->phba->nport_event_cnt++; in lpfc_nlp_reg_node()
4635 lpfc_register_remote_port(vport, ndlp); in lpfc_nlp_reg_node()
4643 if (vport->phba->sli_rev >= LPFC_SLI_REV4 && in lpfc_nlp_reg_node()
4645 if (vport->phba->nvmet_support == 0) { in lpfc_nlp_reg_node()
4651 vport->phba->nport_event_cnt++; in lpfc_nlp_reg_node()
4652 lpfc_nvme_register_port(vport, ndlp); in lpfc_nlp_reg_node()
4665 lpfc_nlp_unreg_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_nlp_unreg_node() argument
4672 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_nlp_unreg_node()
4686 vport->phba->nport_event_cnt++; in lpfc_nlp_unreg_node()
4689 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_nlp_unreg_node()
4699 vport->phba->nport_event_cnt++; in lpfc_nlp_unreg_node()
4700 if (vport->phba->nvmet_support == 0) { in lpfc_nlp_unreg_node()
4703 lpfc_nvme_unregister_port(vport, ndlp); in lpfc_nlp_unreg_node()
4716 lpfc_handle_adisc_state(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_handle_adisc_state() argument
4737 lpfc_nlp_reg_node(vport, ndlp); in lpfc_handle_adisc_state()
4750 lpfc_nlp_unreg_node(vport, ndlp); in lpfc_handle_adisc_state()
4757 lpfc_nlp_state_cleanup(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_nlp_state_cleanup() argument
4763 lpfc_handle_adisc_state(vport, ndlp, new_state); in lpfc_nlp_state_cleanup()
4783 !lpfc_is_link_up(vport->phba)) in lpfc_nlp_state_cleanup()
4784 lpfc_nlp_unreg_node(vport, ndlp); in lpfc_nlp_state_cleanup()
4789 lpfc_nlp_reg_node(vport, ndlp); in lpfc_nlp_state_cleanup()
4805 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_nlp_state_cleanup()
4832 lpfc_nlp_set_state(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_nlp_set_state() argument
4840 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_nlp_set_state()
4846 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_set_state()
4858 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_nlp_set_state()
4865 spin_lock_irqsave(&vport->fc_nodes_list_lock, iflags); in lpfc_nlp_set_state()
4866 list_add_tail(&ndlp->nlp_listp, &vport->fc_nodes); in lpfc_nlp_set_state()
4867 spin_unlock_irqrestore(&vport->fc_nodes_list_lock, iflags); in lpfc_nlp_set_state()
4869 lpfc_nlp_counters(vport, old_state, -1); in lpfc_nlp_set_state()
4872 lpfc_nlp_counters(vport, state, 1); in lpfc_nlp_set_state()
4873 lpfc_nlp_state_cleanup(vport, ndlp, old_state, state); in lpfc_nlp_set_state()
4877 lpfc_enqueue_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_enqueue_node() argument
4882 spin_lock_irqsave(&vport->fc_nodes_list_lock, iflags); in lpfc_enqueue_node()
4883 list_add_tail(&ndlp->nlp_listp, &vport->fc_nodes); in lpfc_enqueue_node()
4884 spin_unlock_irqrestore(&vport->fc_nodes_list_lock, iflags); in lpfc_enqueue_node()
4889 lpfc_dequeue_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_dequeue_node() argument
4893 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_dequeue_node()
4895 lpfc_nlp_counters(vport, ndlp->nlp_state, -1); in lpfc_dequeue_node()
4896 spin_lock_irqsave(&vport->fc_nodes_list_lock, iflags); in lpfc_dequeue_node()
4898 spin_unlock_irqrestore(&vport->fc_nodes_list_lock, iflags); in lpfc_dequeue_node()
4899 lpfc_nlp_state_cleanup(vport, ndlp, ndlp->nlp_state, in lpfc_dequeue_node()
4918 lpfc_initialize_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_initialize_node() argument
4927 ndlp->vport = vport; in lpfc_initialize_node()
4928 ndlp->phba = vport->phba; in lpfc_initialize_node()
4933 ndlp->cmd_qdepth = vport->cfg_tgt_queue_depth; in lpfc_initialize_node()
4938 lpfc_drop_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_drop_node() argument
4947 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNUSED_NODE); in lpfc_drop_node()
4948 if (vport->phba->sli_rev == LPFC_SLI_REV4) { in lpfc_drop_node()
4949 lpfc_cleanup_vports_rrqs(vport, ndlp); in lpfc_drop_node()
4950 lpfc_unreg_rpi(vport, ndlp); in lpfc_drop_node()
4971 lpfc_set_disctmo(struct lpfc_vport *vport) in lpfc_set_disctmo() argument
4973 struct lpfc_hba *phba = vport->phba; in lpfc_set_disctmo()
4976 if (vport->port_state == LPFC_LOCAL_CFG_LINK) { in lpfc_set_disctmo()
4987 if (!timer_pending(&vport->fc_disctmo)) { in lpfc_set_disctmo()
4988 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_set_disctmo()
4990 tmo, vport->port_state, vport->fc_flag); in lpfc_set_disctmo()
4993 mod_timer(&vport->fc_disctmo, jiffies + msecs_to_jiffies(1000 * tmo)); in lpfc_set_disctmo()
4994 set_bit(FC_DISC_TMO, &vport->fc_flag); in lpfc_set_disctmo()
4997 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_set_disctmo()
5000 vport->port_state, tmo, in lpfc_set_disctmo()
5001 (unsigned long)&vport->fc_disctmo, in lpfc_set_disctmo()
5002 atomic_read(&vport->fc_plogi_cnt), in lpfc_set_disctmo()
5003 atomic_read(&vport->fc_adisc_cnt)); in lpfc_set_disctmo()
5012 lpfc_can_disctmo(struct lpfc_vport *vport) in lpfc_can_disctmo() argument
5016 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_can_disctmo()
5018 vport->port_state, vport->fc_ns_retry, vport->fc_flag); in lpfc_can_disctmo()
5021 if (test_bit(FC_DISC_TMO, &vport->fc_flag) || in lpfc_can_disctmo()
5022 timer_pending(&vport->fc_disctmo)) { in lpfc_can_disctmo()
5023 clear_bit(FC_DISC_TMO, &vport->fc_flag); in lpfc_can_disctmo()
5024 del_timer_sync(&vport->fc_disctmo); in lpfc_can_disctmo()
5025 spin_lock_irqsave(&vport->work_port_lock, iflags); in lpfc_can_disctmo()
5026 vport->work_port_events &= ~WORKER_DISC_TMO; in lpfc_can_disctmo()
5027 spin_unlock_irqrestore(&vport->work_port_lock, iflags); in lpfc_can_disctmo()
5031 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_can_disctmo()
5034 vport->port_state, vport->fc_flag, in lpfc_can_disctmo()
5035 atomic_read(&vport->fc_plogi_cnt), in lpfc_can_disctmo()
5036 atomic_read(&vport->fc_adisc_cnt)); in lpfc_can_disctmo()
5050 struct lpfc_vport *vport = ndlp->vport; in lpfc_check_sli_ndlp() local
5055 if (iocb->vport != vport) in lpfc_check_sli_ndlp()
5176 struct lpfc_vport *vport = pmb->vport; in lpfc_nlp_logo_unreg() local
5182 lpfc_issue_els_logo(vport, ndlp, 0); in lpfc_nlp_logo_unreg()
5187 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_nlp_logo_unreg()
5195 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); in lpfc_nlp_logo_unreg()
5199 lpfc_sli4_free_rpi(vport->phba, ndlp->nlp_rpi); in lpfc_nlp_logo_unreg()
5224 lpfc_set_unreg_login_mbx_cmpl(struct lpfc_hba *phba, struct lpfc_vport *vport, in lpfc_set_unreg_login_mbx_cmpl() argument
5240 !test_bit(FC_UNLOADING, &vport->load_flag) && in lpfc_set_unreg_login_mbx_cmpl()
5246 if (test_bit(FC_UNLOADING, &vport->load_flag)) { in lpfc_set_unreg_login_mbx_cmpl()
5267 lpfc_unreg_rpi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_unreg_rpi() argument
5269 struct lpfc_hba *phba = vport->phba; in lpfc_unreg_rpi()
5277 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_unreg_rpi()
5289 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_unreg_rpi()
5307 lpfc_unreg_login(phba, vport->vpi, rpi, mbox); in lpfc_unreg_rpi()
5308 mbox->vport = vport; in lpfc_unreg_rpi()
5309 lpfc_set_unreg_login_mbx_cmpl(phba, vport, ndlp, mbox); in lpfc_unreg_rpi()
5322 (!test_bit(FC_OFFLINE_MODE, &vport->fc_flag))) in lpfc_unreg_rpi()
5325 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_unreg_rpi()
5341 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_unreg_rpi()
5354 if (!test_bit(FC_UNLOADING, &vport->load_flag)) { in lpfc_unreg_rpi()
5356 lpfc_issue_els_logo(vport, ndlp, 0); in lpfc_unreg_rpi()
5358 lpfc_nlp_set_state(vport, ndlp, in lpfc_unreg_rpi()
5417 lpfc_unreg_all_rpis(struct lpfc_vport *vport) in lpfc_unreg_all_rpis() argument
5419 struct lpfc_hba *phba = vport->phba; in lpfc_unreg_all_rpis()
5424 lpfc_sli4_unreg_all_rpis(vport); in lpfc_unreg_all_rpis()
5430 lpfc_unreg_login(phba, vport->vpi, LPFC_UNREG_ALL_RPIS_VPORT, in lpfc_unreg_all_rpis()
5432 mbox->vport = vport; in lpfc_unreg_all_rpis()
5440 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_unreg_all_rpis()
5448 lpfc_unreg_default_rpis(struct lpfc_vport *vport) in lpfc_unreg_default_rpis() argument
5450 struct lpfc_hba *phba = vport->phba; in lpfc_unreg_default_rpis()
5460 lpfc_unreg_did(phba, vport->vpi, LPFC_UNREG_ALL_DFLT_RPIS, in lpfc_unreg_default_rpis()
5462 mbox->vport = vport; in lpfc_unreg_default_rpis()
5470 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_unreg_default_rpis()
5482 lpfc_cleanup_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_cleanup_node() argument
5484 struct lpfc_hba *phba = vport->phba; in lpfc_cleanup_node()
5488 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_cleanup_node()
5493 lpfc_dequeue_node(vport, ndlp); in lpfc_cleanup_node()
5545 lpfc_cleanup_vports_rrqs(vport, ndlp); in lpfc_cleanup_node()
5554 lpfc_matchdid(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_matchdid() argument
5567 mydid.un.word = vport->fc_myDID; in lpfc_matchdid()
5588 vport->phba->fc_topology == in lpfc_matchdid()
5610 __lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did) in __lpfc_findnode_did() argument
5615 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in __lpfc_findnode_did()
5616 if (lpfc_matchdid(vport, ndlp, did)) { in __lpfc_findnode_did()
5621 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE_VERBOSE, in __lpfc_findnode_did()
5632 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in __lpfc_findnode_did()
5638 lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did) in lpfc_findnode_did() argument
5640 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_findnode_did()
5645 ndlp = __lpfc_findnode_did(vport, did); in lpfc_findnode_did()
5651 lpfc_findnode_mapped(struct lpfc_vport *vport) in lpfc_findnode_mapped() argument
5657 spin_lock_irqsave(&vport->fc_nodes_list_lock, iflags); in lpfc_findnode_mapped()
5659 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_findnode_mapped()
5666 spin_unlock_irqrestore(&vport->fc_nodes_list_lock, in lpfc_findnode_mapped()
5668 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE_VERBOSE, in lpfc_findnode_mapped()
5677 spin_unlock_irqrestore(&vport->fc_nodes_list_lock, iflags); in lpfc_findnode_mapped()
5680 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_findnode_mapped()
5686 lpfc_setup_disc_node(struct lpfc_vport *vport, uint32_t did) in lpfc_setup_disc_node() argument
5690 ndlp = lpfc_findnode_did(vport, did); in lpfc_setup_disc_node()
5692 if (vport->phba->nvmet_support) in lpfc_setup_disc_node()
5694 if (test_bit(FC_RSCN_MODE, &vport->fc_flag) && in lpfc_setup_disc_node()
5695 lpfc_rscn_payload_check(vport, did) == 0) in lpfc_setup_disc_node()
5697 ndlp = lpfc_nlp_init(vport, did); in lpfc_setup_disc_node()
5700 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_setup_disc_node()
5702 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_setup_disc_node()
5706 ndlp->nlp_state, vport->fc_flag); in lpfc_setup_disc_node()
5718 if (test_bit(FC_RSCN_MODE, &vport->fc_flag) && in lpfc_setup_disc_node()
5719 !test_bit(FC_NDISC_ACTIVE, &vport->fc_flag)) { in lpfc_setup_disc_node()
5720 if (lpfc_rscn_payload_check(vport, did)) { in lpfc_setup_disc_node()
5725 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_setup_disc_node()
5727 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_setup_disc_node()
5731 ndlp->nlp_state, vport->fc_flag); in lpfc_setup_disc_node()
5738 if (vport->phba->nvmet_support) in lpfc_setup_disc_node()
5743 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_setup_disc_node()
5751 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_setup_disc_node()
5755 ndlp->nlp_state, vport->fc_flag); in lpfc_setup_disc_node()
5759 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_setup_disc_node()
5763 ndlp->nlp_state, vport->fc_flag); in lpfc_setup_disc_node()
5771 (!vport->phba->nvmet_support && in lpfc_setup_disc_node()
5775 if (vport->phba->nvmet_support) in lpfc_setup_disc_node()
5781 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_setup_disc_node()
5792 lpfc_disc_list_loopmap(struct lpfc_vport *vport) in lpfc_disc_list_loopmap() argument
5794 struct lpfc_hba *phba = vport->phba; in lpfc_disc_list_loopmap()
5808 if (((vport->fc_myDID & 0xff) == alpa) || (alpa == 0)) in lpfc_disc_list_loopmap()
5810 lpfc_setup_disc_node(vport, alpa); in lpfc_disc_list_loopmap()
5818 if (vport->cfg_scan_down) in lpfc_disc_list_loopmap()
5823 if ((vport->fc_myDID & 0xff) == alpa) in lpfc_disc_list_loopmap()
5825 lpfc_setup_disc_node(vport, alpa); in lpfc_disc_list_loopmap()
5833 lpfc_issue_clear_la(struct lpfc_hba *phba, struct lpfc_vport *vport) in lpfc_issue_clear_la() argument
5846 (vport->port_type != LPFC_PHYSICAL_PORT) || in lpfc_issue_clear_la()
5855 mbox->vport = vport; in lpfc_issue_clear_la()
5859 lpfc_disc_flush_list(vport); in lpfc_issue_clear_la()
5869 lpfc_issue_reg_vpi(struct lpfc_hba *phba, struct lpfc_vport *vport) in lpfc_issue_reg_vpi() argument
5875 lpfc_reg_vpi(vport, regvpimbox); in lpfc_issue_reg_vpi()
5877 regvpimbox->vport = vport; in lpfc_issue_reg_vpi()
5887 lpfc_disc_start(struct lpfc_vport *vport) in lpfc_disc_start() argument
5889 struct lpfc_hba *phba = vport->phba; in lpfc_disc_start()
5894 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, in lpfc_disc_start()
5905 if (vport->port_state < LPFC_VPORT_READY) in lpfc_disc_start()
5906 vport->port_state = LPFC_DISC_AUTH; in lpfc_disc_start()
5908 lpfc_set_disctmo(vport); in lpfc_disc_start()
5910 vport->fc_prevDID = vport->fc_myDID; in lpfc_disc_start()
5911 vport->num_disc_nodes = 0; in lpfc_disc_start()
5914 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_disc_start()
5917 vport->port_state, vport->fc_flag, in lpfc_disc_start()
5918 atomic_read(&vport->fc_plogi_cnt), in lpfc_disc_start()
5919 atomic_read(&vport->fc_adisc_cnt), in lpfc_disc_start()
5920 atomic_read(&vport->fc_npr_cnt)); in lpfc_disc_start()
5923 num_sent = lpfc_els_disc_adisc(vport); in lpfc_disc_start()
5930 !test_bit(FC_PT2PT, &vport->fc_flag) && in lpfc_disc_start()
5931 !test_bit(FC_RSCN_MODE, &vport->fc_flag) && in lpfc_disc_start()
5933 lpfc_issue_clear_la(phba, vport); in lpfc_disc_start()
5934 lpfc_issue_reg_vpi(phba, vport); in lpfc_disc_start()
5942 if (vport->port_state < LPFC_VPORT_READY && !clear_la_pending) { in lpfc_disc_start()
5944 lpfc_issue_clear_la(phba, vport); in lpfc_disc_start()
5946 if (!test_bit(FC_ABORT_DISCOVERY, &vport->fc_flag)) { in lpfc_disc_start()
5947 vport->num_disc_nodes = 0; in lpfc_disc_start()
5949 if (atomic_read(&vport->fc_npr_cnt)) in lpfc_disc_start()
5950 lpfc_els_disc_plogi(vport); in lpfc_disc_start()
5952 if (!vport->num_disc_nodes) { in lpfc_disc_start()
5953 clear_bit(FC_NDISC_ACTIVE, &vport->fc_flag); in lpfc_disc_start()
5954 lpfc_can_disctmo(vport); in lpfc_disc_start()
5957 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_start()
5960 num_sent = lpfc_els_disc_plogi(vport); in lpfc_disc_start()
5965 if (test_bit(FC_RSCN_MODE, &vport->fc_flag)) { in lpfc_disc_start()
5969 if (vport->fc_rscn_id_cnt == 0 && in lpfc_disc_start()
5970 !test_bit(FC_RSCN_DISCOVERY, &vport->fc_flag)) { in lpfc_disc_start()
5971 clear_bit(FC_RSCN_MODE, &vport->fc_flag); in lpfc_disc_start()
5972 lpfc_can_disctmo(vport); in lpfc_disc_start()
5974 lpfc_els_handle_rscn(vport); in lpfc_disc_start()
6037 lpfc_disc_flush_list(struct lpfc_vport *vport) in lpfc_disc_flush_list() argument
6040 struct lpfc_hba *phba = vport->phba; in lpfc_disc_flush_list()
6042 if (atomic_read(&vport->fc_plogi_cnt) || in lpfc_disc_flush_list()
6043 atomic_read(&vport->fc_adisc_cnt)) { in lpfc_disc_flush_list()
6044 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, in lpfc_disc_flush_list()
6065 lpfc_notify_xport_npr(struct lpfc_vport *vport) in lpfc_notify_xport_npr() argument
6069 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, in lpfc_notify_xport_npr()
6071 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_notify_xport_npr()
6075 lpfc_cleanup_discovery_resources(struct lpfc_vport *vport) in lpfc_cleanup_discovery_resources() argument
6077 lpfc_els_flush_rscn(vport); in lpfc_cleanup_discovery_resources()
6078 lpfc_els_flush_cmd(vport); in lpfc_cleanup_discovery_resources()
6079 lpfc_disc_flush_list(vport); in lpfc_cleanup_discovery_resources()
6080 if (pci_channel_offline(vport->phba->pcidev)) in lpfc_cleanup_discovery_resources()
6081 lpfc_notify_xport_npr(vport); in lpfc_cleanup_discovery_resources()
6102 struct lpfc_vport *vport = from_timer(vport, t, fc_disctmo); in lpfc_disc_timeout() local
6103 struct lpfc_hba *phba = vport->phba; in lpfc_disc_timeout()
6110 spin_lock_irqsave(&vport->work_port_lock, flags); in lpfc_disc_timeout()
6111 tmo_posted = vport->work_port_events & WORKER_DISC_TMO; in lpfc_disc_timeout()
6113 vport->work_port_events |= WORKER_DISC_TMO; in lpfc_disc_timeout()
6114 spin_unlock_irqrestore(&vport->work_port_lock, flags); in lpfc_disc_timeout()
6122 lpfc_disc_timeout_handler(struct lpfc_vport *vport) in lpfc_disc_timeout_handler() argument
6124 struct lpfc_hba *phba = vport->phba; in lpfc_disc_timeout_handler()
6130 if (!test_and_clear_bit(FC_DISC_TMO, &vport->fc_flag)) in lpfc_disc_timeout_handler()
6133 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_disc_timeout_handler()
6135 vport->port_state, vport->fc_ns_retry, vport->fc_flag); in lpfc_disc_timeout_handler()
6137 switch (vport->port_state) { in lpfc_disc_timeout_handler()
6144 lpfc_printf_vlog(vport, KERN_WARNING, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
6148 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, in lpfc_disc_timeout_handler()
6154 lpfc_drop_node(vport, ndlp); in lpfc_disc_timeout_handler()
6160 lpfc_unreg_rpi(vport, ndlp); in lpfc_disc_timeout_handler()
6163 if (vport->port_state != LPFC_FLOGI) { in lpfc_disc_timeout_handler()
6165 lpfc_initial_flogi(vport); in lpfc_disc_timeout_handler()
6167 lpfc_issue_init_vfi(vport); in lpfc_disc_timeout_handler()
6176 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6179 vport->vpi ? "FDISC" : "FLOGI"); in lpfc_disc_timeout_handler()
6186 lpfc_disc_list_loopmap(vport); in lpfc_disc_timeout_handler()
6189 lpfc_disc_start(vport); in lpfc_disc_timeout_handler()
6195 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6200 ndlp = lpfc_findnode_did(vport, NameServer_DID); in lpfc_disc_timeout_handler()
6209 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6213 vport->fc_ns_retry, LPFC_MAX_NS_RETRY); in lpfc_disc_timeout_handler()
6215 if (vport->fc_ns_retry < LPFC_MAX_NS_RETRY) { in lpfc_disc_timeout_handler()
6217 vport->fc_ns_retry++; in lpfc_disc_timeout_handler()
6218 vport->gidft_inp = 0; in lpfc_disc_timeout_handler()
6219 rc = lpfc_issue_gidft(vport); in lpfc_disc_timeout_handler()
6223 vport->fc_ns_retry = 0; in lpfc_disc_timeout_handler()
6233 lpfc_issue_reg_vpi(phba, vport); in lpfc_disc_timeout_handler()
6235 lpfc_issue_clear_la(phba, vport); in lpfc_disc_timeout_handler()
6236 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_timeout_handler()
6243 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6255 initlinkmbox->vport = vport; in lpfc_disc_timeout_handler()
6266 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6269 lpfc_disc_flush_list(vport); in lpfc_disc_timeout_handler()
6277 lpfc_issue_reg_vpi(phba, vport); in lpfc_disc_timeout_handler()
6279 lpfc_issue_clear_la(phba, vport); in lpfc_disc_timeout_handler()
6280 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_timeout_handler()
6286 if (test_bit(FC_RSCN_MODE, &vport->fc_flag)) { in lpfc_disc_timeout_handler()
6287 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6291 vport->fc_ns_retry, LPFC_MAX_NS_RETRY, in lpfc_disc_timeout_handler()
6292 vport->port_state, vport->gidft_inp); in lpfc_disc_timeout_handler()
6295 lpfc_els_flush_cmd(vport); in lpfc_disc_timeout_handler()
6297 lpfc_els_flush_rscn(vport); in lpfc_disc_timeout_handler()
6298 lpfc_disc_flush_list(vport); in lpfc_disc_timeout_handler()
6303 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6306 "vport State x%x\n", vport->port_state); in lpfc_disc_timeout_handler()
6313 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6320 lpfc_issue_clear_la(phba, vport); in lpfc_disc_timeout_handler()
6328 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6340 lpfc_disc_flush_list(vport); in lpfc_disc_timeout_handler()
6347 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_timeout_handler()
6363 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_fdmi_reg_login() local
6371 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_mbx_cmpl_fdmi_reg_login()
6372 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE | LOG_DISCOVERY, in lpfc_mbx_cmpl_fdmi_reg_login()
6383 if (vport->port_type == LPFC_PHYSICAL_PORT) { in lpfc_mbx_cmpl_fdmi_reg_login()
6385 lpfc_fdmi_cmd(vport, ndlp, SLI_MGMT_DHBA, 0); in lpfc_mbx_cmpl_fdmi_reg_login()
6387 lpfc_fdmi_cmd(vport, ndlp, SLI_MGMT_DPRT, 0); in lpfc_mbx_cmpl_fdmi_reg_login()
6415 __lpfc_find_node(struct lpfc_vport *vport, node_filter filter, void *param) in __lpfc_find_node() argument
6419 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in __lpfc_find_node()
6421 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE_VERBOSE, in __lpfc_find_node()
6432 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in __lpfc_find_node()
6442 __lpfc_findnode_rpi(struct lpfc_vport *vport, uint16_t rpi) in __lpfc_findnode_rpi() argument
6444 return __lpfc_find_node(vport, lpfc_filter_by_rpi, &rpi); in __lpfc_findnode_rpi()
6452 lpfc_findnode_wwpn(struct lpfc_vport *vport, struct lpfc_name *wwpn) in lpfc_findnode_wwpn() argument
6454 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_findnode_wwpn()
6458 ndlp = __lpfc_find_node(vport, lpfc_filter_by_wwpn, wwpn); in lpfc_findnode_wwpn()
6469 lpfc_findnode_rpi(struct lpfc_vport *vport, uint16_t rpi) in lpfc_findnode_rpi() argument
6471 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_findnode_rpi()
6476 ndlp = __lpfc_findnode_rpi(vport, rpi); in lpfc_findnode_rpi()
6497 struct lpfc_vport *vport; in lpfc_find_vport_by_vpid() local
6521 list_for_each_entry(vport, &phba->port_list, listentry) { in lpfc_find_vport_by_vpid()
6522 if (vport->vpi == i) { in lpfc_find_vport_by_vpid()
6524 return vport; in lpfc_find_vport_by_vpid()
6532 lpfc_nlp_init(struct lpfc_vport *vport, uint32_t did) in lpfc_nlp_init() argument
6537 if (vport->phba->sli_rev == LPFC_SLI_REV4) { in lpfc_nlp_init()
6538 rpi = lpfc_sli4_alloc_rpi(vport->phba); in lpfc_nlp_init()
6543 ndlp = mempool_alloc(vport->phba->nlp_mem_pool, GFP_KERNEL); in lpfc_nlp_init()
6545 if (vport->phba->sli_rev == LPFC_SLI_REV4) in lpfc_nlp_init()
6546 lpfc_sli4_free_rpi(vport->phba, rpi); in lpfc_nlp_init()
6554 lpfc_initialize_node(vport, ndlp, did); in lpfc_nlp_init()
6556 if (vport->phba->sli_rev == LPFC_SLI_REV4) { in lpfc_nlp_init()
6558 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE | LOG_DISCOVERY, in lpfc_nlp_init()
6565 mempool_alloc(vport->phba->active_rrq_pool, in lpfc_nlp_init()
6574 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_init()
6589 struct lpfc_vport *vport = ndlp->vport; in lpfc_nlp_release() local
6591 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_release()
6595 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_nlp_release()
6601 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_nlp_release()
6602 lpfc_cleanup_node(vport, ndlp); in lpfc_nlp_release()
6614 lpfc_sli4_free_rpi(vport->phba, ndlp->nlp_rpi); in lpfc_nlp_release()
6622 ndlp->vport = NULL; in lpfc_nlp_release()
6644 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_get()
6656 lpfc_printf_vlog(ndlp->vport, KERN_WARNING, LOG_NODE, in lpfc_nlp_get()
6676 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_put()
6757 struct lpfc_vport *vport = mboxq->vport; in lpfc_unregister_vfi_cmpl() local
6763 mboxq->u.mb.mbxStatus, vport->port_state); in lpfc_unregister_vfi_cmpl()
6780 struct lpfc_vport *vport = mboxq->vport; in lpfc_unregister_fcfi_cmpl() local
6786 mboxq->u.mb.mbxStatus, vport->port_state); in lpfc_unregister_fcfi_cmpl()
6881 mbox->vport = phba->pport; in lpfc_sli4_unregister_fcf()
7249 lpfc_error_lost_link(struct lpfc_vport *vport, u32 ulp_status, u32 ulp_word4) in lpfc_error_lost_link() argument
7258 lpfc_printf_vlog(vport, KERN_WARNING, LOG_SLI | LOG_ELS, in lpfc_error_lost_link()