Lines Matching full:vport
71 static void lpfc_disc_flush_list(struct lpfc_vport *vport);
123 if (!ndlp->vport) { in lpfc_rport_invalid()
124 pr_err("**** %s: Null vport on ndlp x%px, DID x%x rport x%px " in lpfc_rport_invalid()
137 struct lpfc_vport *vport; in lpfc_terminate_rport_io() local
144 vport = ndlp->vport; in lpfc_terminate_rport_io()
145 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_terminate_rport_io()
150 lpfc_sli_abort_iocb(vport, ndlp->nlp_sid, 0, LPFC_CTX_TGT); in lpfc_terminate_rport_io()
160 struct lpfc_vport *vport; in lpfc_dev_loss_tmo_callbk() local
170 vport = ndlp->vport; in lpfc_dev_loss_tmo_callbk()
171 phba = vport->phba; in lpfc_dev_loss_tmo_callbk()
173 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_dev_loss_tmo_callbk()
177 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_dev_loss_tmo_callbk()
181 vport->load_flag, kref_read(&ndlp->kref), in lpfc_dev_loss_tmo_callbk()
184 /* Don't schedule a worker thread event if the vport is going down. */ in lpfc_dev_loss_tmo_callbk()
185 if (test_bit(FC_UNLOADING, &vport->load_flag) || in lpfc_dev_loss_tmo_callbk()
237 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_dev_loss_tmo_callbk()
245 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_dev_loss_tmo_callbk()
285 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_dev_loss_tmo_callbk()
290 vport->load_flag, kref_read(&ndlp->kref)); in lpfc_dev_loss_tmo_callbk()
294 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_dev_loss_tmo_callbk()
301 * lpfc_check_inactive_vmid_one - VMID inactivity checker for a vport
302 * @vport: Pointer to vport context object.
304 * This function checks for idle VMID entries related to a particular vport. If
307 static void lpfc_check_inactive_vmid_one(struct lpfc_vport *vport) in lpfc_check_inactive_vmid_one() argument
315 write_lock(&vport->vmid_lock); in lpfc_check_inactive_vmid_one()
317 if (!vport->cur_vmid_cnt) in lpfc_check_inactive_vmid_one()
321 hash_for_each(vport->hash_table, bucket, vmp, hnode) { in lpfc_check_inactive_vmid_one()
332 if ((vport->vmid_inactivity_timeout * in lpfc_check_inactive_vmid_one()
344 write_unlock(&vport->vmid_lock); in lpfc_check_inactive_vmid_one()
345 if (vport->vmid_priority_tagging) in lpfc_check_inactive_vmid_one()
346 r = lpfc_vmid_uvem(vport, vmp, false); in lpfc_check_inactive_vmid_one()
348 r = lpfc_vmid_cmd(vport, in lpfc_check_inactive_vmid_one()
354 write_lock(&vport->vmid_lock); in lpfc_check_inactive_vmid_one()
358 vport->cur_vmid_cnt--; in lpfc_check_inactive_vmid_one()
368 write_unlock(&vport->vmid_lock); in lpfc_check_inactive_vmid_one()
383 struct lpfc_vport *vport; in lpfc_check_inactive_vmid() local
393 vport = phba->pport; in lpfc_check_inactive_vmid()
395 vport = vports[i]; in lpfc_check_inactive_vmid()
396 if (!vport) in lpfc_check_inactive_vmid()
399 lpfc_check_inactive_vmid_one(vport); in lpfc_check_inactive_vmid()
406 * @vport: Pointer to vport object.
414 lpfc_check_nlp_post_devloss(struct lpfc_vport *vport, in lpfc_check_nlp_post_devloss() argument
419 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY | LOG_NODE, in lpfc_check_nlp_post_devloss()
424 ndlp->nlp_flag, vport->port_state); in lpfc_check_nlp_post_devloss()
441 struct lpfc_vport *vport; in lpfc_dev_loss_tmo_handler() local
450 vport = ndlp->vport; in lpfc_dev_loss_tmo_handler()
452 phba = vport->phba; in lpfc_dev_loss_tmo_handler()
457 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_dev_loss_tmo_handler()
461 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_dev_loss_tmo_handler()
468 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_dev_loss_tmo_handler()
490 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()
549 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_dev_loss_tmo_handler()
556 vport->port_state); in lpfc_dev_loss_tmo_handler()
566 lpfc_sli_abort_iocb(vport, ndlp->nlp_sid, 0, LPFC_CTX_TGT); in lpfc_dev_loss_tmo_handler()
570 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_dev_loss_tmo_handler()
580 lpfc_printf_vlog(vport, KERN_INFO, LOG_TRACE_EVENT, in lpfc_dev_loss_tmo_handler()
600 lpfc_disc_state_machine(vport, ndlp, NULL, NLP_EVT_DEVICE_RM); in lpfc_dev_loss_tmo_handler()
607 struct lpfc_vport *vport; in lpfc_check_vmid_qfpa_issue() local
617 vport = phba->pport; in lpfc_check_vmid_qfpa_issue()
619 vport = vports[i]; in lpfc_check_vmid_qfpa_issue()
620 if (!vport) in lpfc_check_vmid_qfpa_issue()
623 if (vport->vmid_flag & LPFC_VMID_ISSUE_QFPA) { in lpfc_check_vmid_qfpa_issue()
624 if (!lpfc_issue_els_qfpa(vport)) in lpfc_check_vmid_qfpa_issue()
625 vport->vmid_flag &= ~LPFC_VMID_ISSUE_QFPA; in lpfc_check_vmid_qfpa_issue()
769 shost = lpfc_shost_from_vport(fast_evt_data->vport); in lpfc_send_fastpath_evt()
866 lpfc_sli_abts_recover_port(ndlp->vport, ndlp); in lpfc_work_list_done()
936 struct lpfc_vport *vport; in lpfc_work_done() local
1007 vport = phba->pport; in lpfc_work_done()
1009 vport = vports[i]; in lpfc_work_done()
1010 if (vport == NULL) in lpfc_work_done()
1012 spin_lock_irq(&vport->work_port_lock); in lpfc_work_done()
1013 work_port_events = vport->work_port_events; in lpfc_work_done()
1014 vport->work_port_events &= ~work_port_events; in lpfc_work_done()
1015 spin_unlock_irq(&vport->work_port_lock); in lpfc_work_done()
1019 lpfc_disc_timeout_handler(vport); in lpfc_work_done()
1021 lpfc_els_timeout_handler(vport); in lpfc_work_done()
1031 lpfc_delayed_disc_timeout_handler(vport); in lpfc_work_done()
1151 lpfc_cleanup_rpis(struct lpfc_vport *vport, int remove) in lpfc_cleanup_rpis() argument
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()
1183 set_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag); in lpfc_cleanup_rpis()
1188 lpfc_port_link_failure(struct lpfc_vport *vport) in lpfc_port_link_failure() argument
1190 lpfc_vport_set_state(vport, FC_VPORT_LINKDOWN); in lpfc_port_link_failure()
1193 lpfc_cleanup_rcv_buffers(vport); in lpfc_port_link_failure()
1196 lpfc_els_flush_rscn(vport); in lpfc_port_link_failure()
1199 lpfc_els_flush_cmd(vport); in lpfc_port_link_failure()
1201 lpfc_cleanup_rpis(vport, 0); in lpfc_port_link_failure()
1204 lpfc_can_disctmo(vport); in lpfc_port_link_failure()
1208 lpfc_linkdown_port(struct lpfc_vport *vport) in lpfc_linkdown_port() argument
1210 struct lpfc_hba *phba = vport->phba; in lpfc_linkdown_port()
1211 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_linkdown_port()
1213 if (vport->cfg_enable_fc4_type != LPFC_ENABLE_NVME) in lpfc_linkdown_port()
1217 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_linkdown_port()
1219 vport->port_state, vport->fc_ns_retry, vport->fc_flag); in lpfc_linkdown_port()
1221 lpfc_port_link_failure(vport); in lpfc_linkdown_port()
1224 clear_bit(FC_DISC_DELAYED, &vport->fc_flag); in lpfc_linkdown_port()
1225 del_timer_sync(&vport->delayed_disc_tmo); in lpfc_linkdown_port()
1228 vport->port_type == LPFC_PHYSICAL_PORT && in lpfc_linkdown_port()
1238 struct lpfc_vport *vport = phba->pport; in lpfc_linkdown() local
1239 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_linkdown()
1289 if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || in lpfc_linkdown()
1290 (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { in lpfc_linkdown()
1307 mb->vport = vport; in lpfc_linkdown()
1322 mb->vport = vport; in lpfc_linkdown()
1338 lpfc_linkup_cleanup_nodes(struct lpfc_vport *vport) in lpfc_linkup_cleanup_nodes() argument
1342 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_linkup_cleanup_nodes()
1352 lpfc_unreg_rpi(vport, ndlp); in lpfc_linkup_cleanup_nodes()
1353 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_linkup_cleanup_nodes()
1358 lpfc_unreg_rpi(vport, ndlp); in lpfc_linkup_cleanup_nodes()
1364 lpfc_linkup_port(struct lpfc_vport *vport) in lpfc_linkup_port() argument
1366 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_linkup_port()
1367 struct lpfc_hba *phba = vport->phba; in lpfc_linkup_port()
1369 if (test_bit(FC_UNLOADING, &vport->load_flag)) in lpfc_linkup_port()
1372 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_linkup_port()
1378 (vport != phba->pport)) in lpfc_linkup_port()
1382 clear_bit(FC_ABORT_DISCOVERY, &vport->fc_flag); in lpfc_linkup_port()
1383 clear_bit(FC_RSCN_MODE, &vport->fc_flag); in lpfc_linkup_port()
1384 clear_bit(FC_NLP_MORE, &vport->fc_flag); in lpfc_linkup_port()
1385 clear_bit(FC_RSCN_DISCOVERY, &vport->fc_flag); in lpfc_linkup_port()
1387 clear_bit(FC_PT2PT, &vport->fc_flag); in lpfc_linkup_port()
1388 clear_bit(FC_PT2PT_PLOGI, &vport->fc_flag); in lpfc_linkup_port()
1389 clear_bit(FC_ABORT_DISCOVERY, &vport->fc_flag); in lpfc_linkup_port()
1390 clear_bit(FC_RSCN_MODE, &vport->fc_flag); in lpfc_linkup_port()
1391 clear_bit(FC_NLP_MORE, &vport->fc_flag); in lpfc_linkup_port()
1392 clear_bit(FC_RSCN_DISCOVERY, &vport->fc_flag); in lpfc_linkup_port()
1394 set_bit(FC_NDISC_ACTIVE, &vport->fc_flag); in lpfc_linkup_port()
1397 vport->fc_ns_retry = 0; in lpfc_linkup_port()
1399 lpfc_setup_fdmi_mask(vport); in lpfc_linkup_port()
1401 lpfc_linkup_cleanup_nodes(vport); in lpfc_linkup_port()
1447 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_clear_la() local
1459 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_clear_la()
1462 mb->mbxStatus, vport->port_state); in lpfc_mbx_cmpl_clear_la()
1467 if (vport->port_type == LPFC_PHYSICAL_PORT) in lpfc_mbx_cmpl_clear_la()
1482 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_mbx_cmpl_clear_la()
1486 clear_bit(FC_ABORT_DISCOVERY, &vport->fc_flag); in lpfc_mbx_cmpl_clear_la()
1488 lpfc_can_disctmo(vport); in lpfc_mbx_cmpl_clear_la()
1506 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_local_config_link() local
1523 test_bit(FC_PUBLIC_LOOP, &vport->fc_flag) && in lpfc_mbx_cmpl_local_config_link()
1524 !test_bit(FC_LBIT, &vport->fc_flag)) { in lpfc_mbx_cmpl_local_config_link()
1529 lpfc_set_disctmo(vport); in lpfc_mbx_cmpl_local_config_link()
1536 if (vport->port_state != LPFC_FLOGI) { in lpfc_mbx_cmpl_local_config_link()
1552 sparam_mb->vport = vport; in lpfc_mbx_cmpl_local_config_link()
1563 lpfc_initial_flogi(vport); in lpfc_mbx_cmpl_local_config_link()
1566 if (test_bit(FC_PT2PT, &vport->fc_flag)) in lpfc_mbx_cmpl_local_config_link()
1567 lpfc_disc_start(vport); in lpfc_mbx_cmpl_local_config_link()
1572 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_local_config_link()
1574 status, vport->port_state); in lpfc_mbx_cmpl_local_config_link()
1579 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_local_config_link()
1581 vport->port_state); in lpfc_mbx_cmpl_local_config_link()
1583 lpfc_issue_clear_la(phba, vport); in lpfc_mbx_cmpl_local_config_link()
1612 struct lpfc_vport *vport = mboxq->vport; in lpfc_mbx_cmpl_reg_fcfi() local
1615 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_reg_fcfi()
1618 vport->port_state); in lpfc_mbx_cmpl_reg_fcfi()
1639 if (vport->port_state != LPFC_FLOGI) { in lpfc_mbx_cmpl_reg_fcfi()
1641 lpfc_issue_init_vfi(vport); in lpfc_mbx_cmpl_reg_fcfi()
1905 fcf_mbxq->vport = phba->pport; in lpfc_register_fcf()
2373 * @vport: Pointer to vport object.
2382 int lpfc_sli4_fcf_rr_next_proc(struct lpfc_vport *vport, uint16_t fcf_index) in lpfc_sli4_fcf_rr_next_proc() argument
2384 struct lpfc_hba *phba = vport->phba; in lpfc_sli4_fcf_rr_next_proc()
2445 lpfc_can_disctmo(vport); in lpfc_sli4_fcf_rr_next_proc()
3149 struct lpfc_vport *vport = mboxq->vport; in lpfc_init_vfi_cmpl() local
3159 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_init_vfi_cmpl()
3163 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_init_vfi_cmpl()
3167 lpfc_initial_flogi(vport); in lpfc_init_vfi_cmpl()
3174 * @vport: pointer to lpfc_vport data structure.
3180 lpfc_issue_init_vfi(struct lpfc_vport *vport) in lpfc_issue_init_vfi() argument
3184 struct lpfc_hba *phba = vport->phba; in lpfc_issue_init_vfi()
3188 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_init_vfi()
3193 lpfc_init_vfi(mboxq, vport); in lpfc_issue_init_vfi()
3197 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_issue_init_vfi()
3199 mempool_free(mboxq, vport->phba->mbox_mem_pool); in lpfc_issue_init_vfi()
3213 struct lpfc_vport *vport = mboxq->vport; in lpfc_init_vpi_cmpl() local
3217 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_init_vpi_cmpl()
3221 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_init_vpi_cmpl()
3224 clear_bit(FC_VPORT_NEEDS_INIT_VPI, &vport->fc_flag); in lpfc_init_vpi_cmpl()
3227 if ((phba->pport == vport) || (vport->port_state == LPFC_FDISC)) { in lpfc_init_vpi_cmpl()
3228 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_init_vpi_cmpl()
3230 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_init_vpi_cmpl()
3235 lpfc_register_new_vport(phba, vport, ndlp); in lpfc_init_vpi_cmpl()
3241 lpfc_initial_fdisc(vport); in lpfc_init_vpi_cmpl()
3243 lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP); in lpfc_init_vpi_cmpl()
3244 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_init_vpi_cmpl()
3253 * @vport: pointer to lpfc_vport data structure.
3256 * VPI for the vport.
3259 lpfc_issue_init_vpi(struct lpfc_vport *vport) in lpfc_issue_init_vpi() argument
3264 if ((vport->port_type != LPFC_PHYSICAL_PORT) && (!vport->vpi)) { in lpfc_issue_init_vpi()
3265 vpi = lpfc_alloc_vpi(vport->phba); in lpfc_issue_init_vpi()
3267 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_issue_init_vpi()
3268 "3303 Failed to obtain vport vpi\n"); in lpfc_issue_init_vpi()
3269 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_issue_init_vpi()
3272 vport->vpi = vpi; in lpfc_issue_init_vpi()
3275 mboxq = mempool_alloc(vport->phba->mbox_mem_pool, GFP_KERNEL); in lpfc_issue_init_vpi()
3277 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_init_vpi()
3282 lpfc_init_vpi(vport->phba, mboxq, vport->vpi); in lpfc_issue_init_vpi()
3283 mboxq->vport = vport; in lpfc_issue_init_vpi()
3285 rc = lpfc_sli_issue_mbox(vport->phba, mboxq, MBX_NOWAIT); in lpfc_issue_init_vpi()
3287 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_issue_init_vpi()
3289 mempool_free(mboxq, vport->phba->mbox_mem_pool); in lpfc_issue_init_vpi()
3311 /* There are no vpi for this vport */ in lpfc_start_fdiscs()
3345 struct lpfc_vport *vport = mboxq->vport; in lpfc_mbx_cmpl_reg_vfi() local
3346 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_reg_vfi()
3356 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_reg_vfi()
3359 mboxq->u.mb.mbxStatus, vport->port_state); in lpfc_mbx_cmpl_reg_vfi()
3362 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_reg_vfi()
3364 lpfc_disc_start(vport); in lpfc_mbx_cmpl_reg_vfi()
3367 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_reg_vfi()
3375 if (test_bit(FC_VFI_REGISTERED, &vport->fc_flag)) in lpfc_mbx_cmpl_reg_vfi()
3377 test_bit(FC_PT2PT, &vport->fc_flag))) in lpfc_mbx_cmpl_reg_vfi()
3381 set_bit(FC_VFI_REGISTERED, &vport->fc_flag); in lpfc_mbx_cmpl_reg_vfi()
3382 clear_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag); in lpfc_mbx_cmpl_reg_vfi()
3383 clear_bit(FC_VPORT_NEEDS_INIT_VPI, &vport->fc_flag); in lpfc_mbx_cmpl_reg_vfi()
3385 vport->vpi_state |= LPFC_VPI_REGISTERED; in lpfc_mbx_cmpl_reg_vfi()
3395 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, in lpfc_mbx_cmpl_reg_vfi()
3398 vport->port_state, vport->fc_flag, vport->fc_myDID, in lpfc_mbx_cmpl_reg_vfi()
3399 vport->phba->alpa_map[0], in lpfc_mbx_cmpl_reg_vfi()
3402 if (vport->port_state == LPFC_FABRIC_CFG_LINK) { in lpfc_mbx_cmpl_reg_vfi()
3407 if (test_bit(FC_PT2PT, &vport->fc_flag) || in lpfc_mbx_cmpl_reg_vfi()
3409 !test_bit(FC_PUBLIC_LOOP, &vport->fc_flag))) { in lpfc_mbx_cmpl_reg_vfi()
3412 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_reg_vfi()
3414 if (test_bit(FC_PT2PT, &vport->fc_flag)) in lpfc_mbx_cmpl_reg_vfi()
3415 vport->port_state = LPFC_VPORT_READY; in lpfc_mbx_cmpl_reg_vfi()
3417 lpfc_disc_start(vport); in lpfc_mbx_cmpl_reg_vfi()
3420 lpfc_do_scr_ns_plogi(phba, vport); in lpfc_mbx_cmpl_reg_vfi()
3433 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_read_sparam() local
3434 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_read_sparam()
3435 struct serv_parm *sp = &vport->fc_sparam; in lpfc_mbx_cmpl_read_sparam()
3441 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_read_sparam()
3444 mb->mbxStatus, vport->port_state); in lpfc_mbx_cmpl_read_sparam()
3449 memcpy((uint8_t *) &vport->fc_sparam, (uint8_t *) mp->virt, in lpfc_mbx_cmpl_read_sparam()
3463 lpfc_update_vport_wwn(vport); in lpfc_mbx_cmpl_read_sparam()
3464 fc_host_port_name(shost) = wwn_to_u64(vport->fc_portname.u.wwn); in lpfc_mbx_cmpl_read_sparam()
3465 if (vport->port_type == LPFC_PHYSICAL_PORT) { in lpfc_mbx_cmpl_read_sparam()
3466 memcpy(&phba->wwnn, &vport->fc_nodename, sizeof(phba->wwnn)); in lpfc_mbx_cmpl_read_sparam()
3467 memcpy(&phba->wwpn, &vport->fc_portname, sizeof(phba->wwnn)); in lpfc_mbx_cmpl_read_sparam()
3476 lpfc_initial_flogi(vport); in lpfc_mbx_cmpl_read_sparam()
3483 lpfc_issue_clear_la(phba, vport); in lpfc_mbx_cmpl_read_sparam()
3489 struct lpfc_vport *vport = phba->pport; in lpfc_mbx_process_link_up() local
3542 set_bit(FC_LBIT, &vport->fc_flag); in lpfc_mbx_process_link_up()
3544 vport->fc_myDID = bf_get(lpfc_mbx_read_top_alpa_granted, la); in lpfc_mbx_process_link_up()
3550 if (vport->cfg_log_verbose & LOG_LINK_EVENT) { in lpfc_mbx_process_link_up()
3590 vport->fc_myDID = phba->fc_pref_DID; in lpfc_mbx_process_link_up()
3591 set_bit(FC_LBIT, &vport->fc_flag); in lpfc_mbx_process_link_up()
3607 sparam_mbox->vport = vport; in lpfc_mbx_process_link_up()
3619 vport->port_state = LPFC_LOCAL_CFG_LINK; in lpfc_mbx_process_link_up()
3621 cfglink_mbox->vport = vport; in lpfc_mbx_process_link_up()
3629 vport->port_state = LPFC_VPORT_UNKNOWN; in lpfc_mbx_process_link_up()
3691 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_process_link_up()
3692 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_process_link_up()
3694 vport->port_state, sparam_mbox, cfglink_mbox); in lpfc_mbx_process_link_up()
3695 lpfc_issue_clear_la(phba, vport); in lpfc_mbx_process_link_up()
3734 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_read_topology() local
3750 mb->mbxStatus, vport->port_state); in lpfc_mbx_cmpl_read_topology()
3762 set_bit(FC_BYPASSED_MODE, &vport->fc_flag); in lpfc_mbx_cmpl_read_topology()
3764 clear_bit(FC_BYPASSED_MODE, &vport->fc_flag); in lpfc_mbx_cmpl_read_topology()
3814 phba->pport->port_state, vport->fc_flag); in lpfc_mbx_cmpl_read_topology()
3820 phba->pport->port_state, vport->fc_flag, in lpfc_mbx_cmpl_read_topology()
3827 phba->pport->port_state, vport->fc_flag, in lpfc_mbx_cmpl_read_topology()
3851 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_reg_login() local
3862 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI | LOG_NODE | LOG_DISCOVERY, in lpfc_mbx_cmpl_reg_login()
3887 lpfc_unreg_rpi(vport, ndlp); in lpfc_mbx_cmpl_reg_login()
3891 lpfc_disc_state_machine(vport, ndlp, pmb, NLP_EVT_CMPL_REG_LOGIN); in lpfc_mbx_cmpl_reg_login()
3907 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_unreg_vpi() local
3908 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_unreg_vpi()
3913 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_mbx_cmpl_unreg_vpi()
3919 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_unreg_vpi()
3921 vport->vpi, mb->mbxStatus); in lpfc_mbx_cmpl_unreg_vpi()
3927 set_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag); in lpfc_mbx_cmpl_unreg_vpi()
3929 vport->vpi_state &= ~LPFC_VPI_REGISTERED; in lpfc_mbx_cmpl_unreg_vpi()
3932 lpfc_cleanup_vports_rrqs(vport, NULL); in lpfc_mbx_cmpl_unreg_vpi()
3937 if (test_bit(FC_UNLOADING, &vport->load_flag) && vport != phba->pport) in lpfc_mbx_cmpl_unreg_vpi()
3942 lpfc_mbx_unreg_vpi(struct lpfc_vport *vport) in lpfc_mbx_unreg_vpi() argument
3944 struct lpfc_hba *phba = vport->phba; in lpfc_mbx_unreg_vpi()
3952 lpfc_unreg_vpi(phba, vport->vpi, mbox); in lpfc_mbx_unreg_vpi()
3953 mbox->vport = vport; in lpfc_mbx_unreg_vpi()
3957 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_unreg_vpi()
3968 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_reg_vpi() local
3969 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_reg_vpi()
3976 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_mbx_cmpl_reg_vpi()
3979 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_reg_vpi()
3980 clear_bit(FC_FABRIC, &vport->fc_flag); in lpfc_mbx_cmpl_reg_vpi()
3981 clear_bit(FC_PUBLIC_LOOP, &vport->fc_flag); in lpfc_mbx_cmpl_reg_vpi()
3982 vport->fc_myDID = 0; in lpfc_mbx_cmpl_reg_vpi()
3984 if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || in lpfc_mbx_cmpl_reg_vpi()
3985 (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { in lpfc_mbx_cmpl_reg_vpi()
3989 lpfc_nvme_update_localport(vport); in lpfc_mbx_cmpl_reg_vpi()
3994 clear_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag); in lpfc_mbx_cmpl_reg_vpi()
3996 vport->vpi_state |= LPFC_VPI_REGISTERED; in lpfc_mbx_cmpl_reg_vpi()
3998 vport->num_disc_nodes = 0; in lpfc_mbx_cmpl_reg_vpi()
4000 if (atomic_read(&vport->fc_npr_cnt)) in lpfc_mbx_cmpl_reg_vpi()
4001 lpfc_els_disc_plogi(vport); in lpfc_mbx_cmpl_reg_vpi()
4003 if (!vport->num_disc_nodes) { in lpfc_mbx_cmpl_reg_vpi()
4004 clear_bit(FC_NDISC_ACTIVE, &vport->fc_flag); in lpfc_mbx_cmpl_reg_vpi()
4005 lpfc_can_disctmo(vport); in lpfc_mbx_cmpl_reg_vpi()
4007 vport->port_state = LPFC_VPORT_READY; in lpfc_mbx_cmpl_reg_vpi()
4032 struct lpfc_vport *vport; in lpfc_create_static_vport() local
4072 pmb->vport = phba->pport; in lpfc_create_static_vport()
4142 " create vport\n"); in lpfc_create_static_vport()
4146 vport = *(struct lpfc_vport **)new_fc_vport->dd_data; in lpfc_create_static_vport()
4147 vport->vport_flag |= STATIC_VPORT; in lpfc_create_static_vport()
4165 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_fabric_reg_login() local
4172 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_fabric_reg_login()
4178 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_fabric_reg_login()
4181 lpfc_disc_start(vport); in lpfc_mbx_cmpl_fabric_reg_login()
4189 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_fabric_reg_login()
4201 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_mbx_cmpl_fabric_reg_login()
4203 if (vport->port_state == LPFC_FABRIC_CFG_LINK) { in lpfc_mbx_cmpl_fabric_reg_login()
4205 * vport discovery */ in lpfc_mbx_cmpl_fabric_reg_login()
4206 if (!test_and_clear_bit(FC_LOGO_RCVD_DID_CHNG, &vport->fc_flag)) in lpfc_mbx_cmpl_fabric_reg_login()
4208 lpfc_do_scr_ns_plogi(phba, vport); in lpfc_mbx_cmpl_fabric_reg_login()
4225 lpfc_issue_gidft(struct lpfc_vport *vport) in lpfc_issue_gidft() argument
4228 if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || in lpfc_issue_gidft()
4229 (vport->cfg_enable_fc4_type == LPFC_ENABLE_FCP)) { in lpfc_issue_gidft()
4230 if (lpfc_ns_cmd(vport, SLI_CTNS_GID_FT, 0, SLI_CTPT_FCP)) { in lpfc_issue_gidft()
4234 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_gidft()
4242 vport->gidft_inp++; in lpfc_issue_gidft()
4245 if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || in lpfc_issue_gidft()
4246 (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { in lpfc_issue_gidft()
4247 if (lpfc_ns_cmd(vport, SLI_CTNS_GID_FT, 0, SLI_CTPT_NVME)) { in lpfc_issue_gidft()
4251 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_gidft()
4257 vport->gidft_inp); in lpfc_issue_gidft()
4258 if (vport->gidft_inp == 0) in lpfc_issue_gidft()
4261 vport->gidft_inp++; in lpfc_issue_gidft()
4263 return vport->gidft_inp; in lpfc_issue_gidft()
4268 * @vport: The virtual port for which this call is being executed.
4277 lpfc_issue_gidpt(struct lpfc_vport *vport) in lpfc_issue_gidpt() argument
4280 if (lpfc_ns_cmd(vport, SLI_CTNS_GID_PT, 0, GID_PT_N_PORT)) { in lpfc_issue_gidpt()
4284 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_issue_gidpt()
4291 vport->gidft_inp++; in lpfc_issue_gidpt()
4306 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_ns_reg_login() local
4310 vport->gidft_inp = 0; in lpfc_mbx_cmpl_ns_reg_login()
4313 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_ns_reg_login()
4339 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_ns_reg_login()
4342 lpfc_disc_start(vport); in lpfc_mbx_cmpl_ns_reg_login()
4345 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_ns_reg_login()
4353 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_mbx_cmpl_ns_reg_login()
4354 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE | LOG_DISCOVERY, in lpfc_mbx_cmpl_ns_reg_login()
4360 if (vport->port_state < LPFC_VPORT_READY) { in lpfc_mbx_cmpl_ns_reg_login()
4362 lpfc_ns_cmd(vport, SLI_CTNS_RNN_ID, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
4363 lpfc_ns_cmd(vport, SLI_CTNS_RSNN_NN, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
4364 lpfc_ns_cmd(vport, SLI_CTNS_RSPN_ID, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
4365 lpfc_ns_cmd(vport, SLI_CTNS_RFT_ID, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
4367 if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || in lpfc_mbx_cmpl_ns_reg_login()
4368 (vport->cfg_enable_fc4_type == LPFC_ENABLE_FCP)) in lpfc_mbx_cmpl_ns_reg_login()
4369 lpfc_ns_cmd(vport, SLI_CTNS_RFF_ID, 0, FC_TYPE_FCP); in lpfc_mbx_cmpl_ns_reg_login()
4371 if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || in lpfc_mbx_cmpl_ns_reg_login()
4372 (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) in lpfc_mbx_cmpl_ns_reg_login()
4373 lpfc_ns_cmd(vport, SLI_CTNS_RFF_ID, 0, in lpfc_mbx_cmpl_ns_reg_login()
4377 lpfc_issue_els_scr(vport, 0); in lpfc_mbx_cmpl_ns_reg_login()
4388 rc = lpfc_issue_els_edc(vport, 0); in lpfc_mbx_cmpl_ns_reg_login()
4395 lpfc_issue_els_edc(vport, 0); in lpfc_mbx_cmpl_ns_reg_login()
4397 lpfc_issue_els_rdf(vport, 0); in lpfc_mbx_cmpl_ns_reg_login()
4401 vport->fc_ns_retry = 0; in lpfc_mbx_cmpl_ns_reg_login()
4402 if (lpfc_issue_gidft(vport) == 0) in lpfc_mbx_cmpl_ns_reg_login()
4425 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_fc_reg_login() local
4431 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_mbx_cmpl_fc_reg_login()
4437 lpfc_check_nlp_post_devloss(vport, ndlp); in lpfc_mbx_cmpl_fc_reg_login()
4442 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_mbx_cmpl_fc_reg_login()
4450 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_mbx_cmpl_fc_reg_login()
4462 lpfc_register_remote_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_register_remote_port() argument
4464 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_register_remote_port()
4468 struct lpfc_hba *phba = vport->phba; in lpfc_register_remote_port()
4471 if (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME) in lpfc_register_remote_port()
4481 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_register_remote_port()
4486 if (test_bit(FC_UNLOADING, &vport->load_flag)) in lpfc_register_remote_port()
4527 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_register_remote_port()
4544 struct lpfc_vport *vport = ndlp->vport; in lpfc_unregister_remote_port() local
4546 if (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME) in lpfc_unregister_remote_port()
4549 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_unregister_remote_port()
4553 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_unregister_remote_port()
4564 lpfc_nlp_counters(struct lpfc_vport *vport, int state, int count) in lpfc_nlp_counters() argument
4568 atomic_add(count, &vport->fc_unused_cnt); in lpfc_nlp_counters()
4571 atomic_add(count, &vport->fc_plogi_cnt); in lpfc_nlp_counters()
4574 atomic_add(count, &vport->fc_adisc_cnt); in lpfc_nlp_counters()
4577 atomic_add(count, &vport->fc_reglogin_cnt); in lpfc_nlp_counters()
4580 atomic_add(count, &vport->fc_prli_cnt); in lpfc_nlp_counters()
4583 atomic_add(count, &vport->fc_unmap_cnt); in lpfc_nlp_counters()
4586 atomic_add(count, &vport->fc_map_cnt); in lpfc_nlp_counters()
4589 if (!atomic_read(&vport->fc_npr_cnt) && count == -1) in lpfc_nlp_counters()
4590 atomic_set(&vport->fc_npr_cnt, 0); in lpfc_nlp_counters()
4592 atomic_add(count, &vport->fc_npr_cnt); in lpfc_nlp_counters()
4599 lpfc_nlp_reg_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_nlp_reg_node() argument
4603 lpfc_check_nlp_post_devloss(vport, ndlp); in lpfc_nlp_reg_node()
4612 lpfc_nvme_rescan_port(vport, ndlp); in lpfc_nlp_reg_node()
4621 vport->phba->nport_event_cnt++; in lpfc_nlp_reg_node()
4626 lpfc_register_remote_port(vport, ndlp); in lpfc_nlp_reg_node()
4634 if (vport->phba->sli_rev >= LPFC_SLI_REV4 && in lpfc_nlp_reg_node()
4636 if (vport->phba->nvmet_support == 0) { in lpfc_nlp_reg_node()
4642 vport->phba->nport_event_cnt++; in lpfc_nlp_reg_node()
4643 lpfc_nvme_register_port(vport, ndlp); in lpfc_nlp_reg_node()
4656 lpfc_nlp_unreg_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_nlp_unreg_node() argument
4663 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_nlp_unreg_node()
4677 vport->phba->nport_event_cnt++; in lpfc_nlp_unreg_node()
4680 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_nlp_unreg_node()
4690 vport->phba->nport_event_cnt++; in lpfc_nlp_unreg_node()
4691 if (vport->phba->nvmet_support == 0) { in lpfc_nlp_unreg_node()
4694 lpfc_nvme_unregister_port(vport, ndlp); in lpfc_nlp_unreg_node()
4707 lpfc_handle_adisc_state(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_handle_adisc_state() argument
4728 lpfc_nlp_reg_node(vport, ndlp); in lpfc_handle_adisc_state()
4741 lpfc_nlp_unreg_node(vport, ndlp); in lpfc_handle_adisc_state()
4748 lpfc_nlp_state_cleanup(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_nlp_state_cleanup() argument
4754 lpfc_handle_adisc_state(vport, ndlp, new_state); in lpfc_nlp_state_cleanup()
4774 !lpfc_is_link_up(vport->phba)) in lpfc_nlp_state_cleanup()
4775 lpfc_nlp_unreg_node(vport, ndlp); in lpfc_nlp_state_cleanup()
4780 lpfc_nlp_reg_node(vport, ndlp); in lpfc_nlp_state_cleanup()
4794 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_nlp_state_cleanup()
4821 lpfc_nlp_set_state(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_nlp_set_state() argument
4829 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_nlp_set_state()
4835 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_set_state()
4847 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_nlp_set_state()
4854 spin_lock_irqsave(&vport->fc_nodes_list_lock, iflags); in lpfc_nlp_set_state()
4855 list_add_tail(&ndlp->nlp_listp, &vport->fc_nodes); in lpfc_nlp_set_state()
4856 spin_unlock_irqrestore(&vport->fc_nodes_list_lock, iflags); in lpfc_nlp_set_state()
4858 lpfc_nlp_counters(vport, old_state, -1); in lpfc_nlp_set_state()
4861 lpfc_nlp_counters(vport, state, 1); in lpfc_nlp_set_state()
4862 lpfc_nlp_state_cleanup(vport, ndlp, old_state, state); in lpfc_nlp_set_state()
4866 lpfc_enqueue_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_enqueue_node() argument
4871 spin_lock_irqsave(&vport->fc_nodes_list_lock, iflags); in lpfc_enqueue_node()
4872 list_add_tail(&ndlp->nlp_listp, &vport->fc_nodes); in lpfc_enqueue_node()
4873 spin_unlock_irqrestore(&vport->fc_nodes_list_lock, iflags); in lpfc_enqueue_node()
4878 lpfc_dequeue_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_dequeue_node() argument
4882 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_dequeue_node()
4884 lpfc_nlp_counters(vport, ndlp->nlp_state, -1); in lpfc_dequeue_node()
4885 spin_lock_irqsave(&vport->fc_nodes_list_lock, iflags); in lpfc_dequeue_node()
4887 spin_unlock_irqrestore(&vport->fc_nodes_list_lock, iflags); in lpfc_dequeue_node()
4888 lpfc_nlp_state_cleanup(vport, ndlp, ndlp->nlp_state, in lpfc_dequeue_node()
4894 * @vport: Pointer to Virtual Port object.
4901 * @vport, a direct reference to phba is taken here by @ndlp. This is due
4902 * to the life-span of the @ndlp might go beyond the existence of @vport as
4907 lpfc_initialize_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_initialize_node() argument
4916 ndlp->vport = vport; in lpfc_initialize_node()
4917 ndlp->phba = vport->phba; in lpfc_initialize_node()
4922 ndlp->cmd_qdepth = vport->cfg_tgt_queue_depth; in lpfc_initialize_node()
4927 lpfc_drop_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_drop_node() argument
4932 * release the ndlp from the vport when conditions are correct. in lpfc_drop_node()
4936 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNUSED_NODE); in lpfc_drop_node()
4937 if (vport->phba->sli_rev == LPFC_SLI_REV4) { in lpfc_drop_node()
4938 lpfc_cleanup_vports_rrqs(vport, ndlp); in lpfc_drop_node()
4939 lpfc_unreg_rpi(vport, ndlp); in lpfc_drop_node()
4954 lpfc_set_disctmo(struct lpfc_vport *vport) in lpfc_set_disctmo() argument
4956 struct lpfc_hba *phba = vport->phba; in lpfc_set_disctmo()
4959 if (vport->port_state == LPFC_LOCAL_CFG_LINK) { in lpfc_set_disctmo()
4970 if (!timer_pending(&vport->fc_disctmo)) { in lpfc_set_disctmo()
4971 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_set_disctmo()
4973 tmo, vport->port_state, vport->fc_flag); in lpfc_set_disctmo()
4976 mod_timer(&vport->fc_disctmo, jiffies + msecs_to_jiffies(1000 * tmo)); in lpfc_set_disctmo()
4977 set_bit(FC_DISC_TMO, &vport->fc_flag); in lpfc_set_disctmo()
4980 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_set_disctmo()
4983 vport->port_state, tmo, in lpfc_set_disctmo()
4984 (unsigned long)&vport->fc_disctmo, in lpfc_set_disctmo()
4985 atomic_read(&vport->fc_plogi_cnt), in lpfc_set_disctmo()
4986 atomic_read(&vport->fc_adisc_cnt)); in lpfc_set_disctmo()
4995 lpfc_can_disctmo(struct lpfc_vport *vport) in lpfc_can_disctmo() argument
4999 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_can_disctmo()
5001 vport->port_state, vport->fc_ns_retry, vport->fc_flag); in lpfc_can_disctmo()
5004 if (test_bit(FC_DISC_TMO, &vport->fc_flag) || in lpfc_can_disctmo()
5005 timer_pending(&vport->fc_disctmo)) { in lpfc_can_disctmo()
5006 clear_bit(FC_DISC_TMO, &vport->fc_flag); in lpfc_can_disctmo()
5007 del_timer_sync(&vport->fc_disctmo); in lpfc_can_disctmo()
5008 spin_lock_irqsave(&vport->work_port_lock, iflags); in lpfc_can_disctmo()
5009 vport->work_port_events &= ~WORKER_DISC_TMO; in lpfc_can_disctmo()
5010 spin_unlock_irqrestore(&vport->work_port_lock, iflags); in lpfc_can_disctmo()
5014 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_can_disctmo()
5017 vport->port_state, vport->fc_flag, in lpfc_can_disctmo()
5018 atomic_read(&vport->fc_plogi_cnt), in lpfc_can_disctmo()
5019 atomic_read(&vport->fc_adisc_cnt)); in lpfc_can_disctmo()
5033 struct lpfc_vport *vport = ndlp->vport; in lpfc_check_sli_ndlp() local
5038 if (iocb->vport != vport) in lpfc_check_sli_ndlp()
5159 struct lpfc_vport *vport = pmb->vport; in lpfc_nlp_logo_unreg() local
5165 lpfc_issue_els_logo(vport, ndlp, 0); in lpfc_nlp_logo_unreg()
5170 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_nlp_logo_unreg()
5178 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); in lpfc_nlp_logo_unreg()
5197 lpfc_set_unreg_login_mbx_cmpl(struct lpfc_hba *phba, struct lpfc_vport *vport, in lpfc_set_unreg_login_mbx_cmpl() argument
5210 !test_bit(FC_UNLOADING, &vport->load_flag) && in lpfc_set_unreg_login_mbx_cmpl()
5230 lpfc_unreg_rpi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_unreg_rpi() argument
5232 struct lpfc_hba *phba = vport->phba; in lpfc_unreg_rpi()
5240 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_unreg_rpi()
5252 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_unreg_rpi()
5270 lpfc_unreg_login(phba, vport->vpi, rpi, mbox); in lpfc_unreg_rpi()
5271 mbox->vport = vport; in lpfc_unreg_rpi()
5272 lpfc_set_unreg_login_mbx_cmpl(phba, vport, ndlp, mbox); in lpfc_unreg_rpi()
5282 if (!test_bit(FC_OFFLINE_MODE, &vport->fc_flag)) in lpfc_unreg_rpi()
5285 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_unreg_rpi()
5301 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_unreg_rpi()
5314 if (!test_bit(FC_UNLOADING, &vport->load_flag)) { in lpfc_unreg_rpi()
5316 lpfc_issue_els_logo(vport, ndlp, 0); in lpfc_unreg_rpi()
5318 lpfc_nlp_set_state(vport, ndlp, in lpfc_unreg_rpi()
5356 "2884 Vport array allocation failed \n"); in lpfc_unreg_hba_rpis()
5377 lpfc_unreg_all_rpis(struct lpfc_vport *vport) in lpfc_unreg_all_rpis() argument
5379 struct lpfc_hba *phba = vport->phba; in lpfc_unreg_all_rpis()
5384 lpfc_sli4_unreg_all_rpis(vport); in lpfc_unreg_all_rpis()
5390 lpfc_unreg_login(phba, vport->vpi, LPFC_UNREG_ALL_RPIS_VPORT, in lpfc_unreg_all_rpis()
5392 mbox->vport = vport; in lpfc_unreg_all_rpis()
5400 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_unreg_all_rpis()
5408 lpfc_unreg_default_rpis(struct lpfc_vport *vport) in lpfc_unreg_default_rpis() argument
5410 struct lpfc_hba *phba = vport->phba; in lpfc_unreg_default_rpis()
5420 lpfc_unreg_did(phba, vport->vpi, LPFC_UNREG_ALL_DFLT_RPIS, in lpfc_unreg_default_rpis()
5422 mbox->vport = vport; in lpfc_unreg_default_rpis()
5430 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_unreg_default_rpis()
5442 lpfc_cleanup_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_cleanup_node() argument
5444 struct lpfc_hba *phba = vport->phba; in lpfc_cleanup_node()
5448 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_cleanup_node()
5453 lpfc_dequeue_node(vport, ndlp); in lpfc_cleanup_node()
5503 lpfc_cleanup_vports_rrqs(vport, ndlp); in lpfc_cleanup_node()
5508 lpfc_matchdid(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_matchdid() argument
5521 mydid.un.word = vport->fc_myDID; in lpfc_matchdid()
5542 vport->phba->fc_topology == in lpfc_matchdid()
5564 __lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did) in __lpfc_findnode_did() argument
5569 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in __lpfc_findnode_did()
5570 if (lpfc_matchdid(vport, ndlp, did)) { in __lpfc_findnode_did()
5575 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE_VERBOSE, in __lpfc_findnode_did()
5586 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in __lpfc_findnode_did()
5592 lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did) in lpfc_findnode_did() argument
5594 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_findnode_did()
5599 ndlp = __lpfc_findnode_did(vport, did); in lpfc_findnode_did()
5605 lpfc_findnode_mapped(struct lpfc_vport *vport) in lpfc_findnode_mapped() argument
5611 spin_lock_irqsave(&vport->fc_nodes_list_lock, iflags); in lpfc_findnode_mapped()
5613 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_findnode_mapped()
5620 spin_unlock_irqrestore(&vport->fc_nodes_list_lock, in lpfc_findnode_mapped()
5622 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE_VERBOSE, in lpfc_findnode_mapped()
5631 spin_unlock_irqrestore(&vport->fc_nodes_list_lock, iflags); in lpfc_findnode_mapped()
5634 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_findnode_mapped()
5640 lpfc_setup_disc_node(struct lpfc_vport *vport, uint32_t did) in lpfc_setup_disc_node() argument
5644 ndlp = lpfc_findnode_did(vport, did); in lpfc_setup_disc_node()
5646 if (vport->phba->nvmet_support) in lpfc_setup_disc_node()
5648 if (test_bit(FC_RSCN_MODE, &vport->fc_flag) && in lpfc_setup_disc_node()
5649 lpfc_rscn_payload_check(vport, did) == 0) in lpfc_setup_disc_node()
5651 ndlp = lpfc_nlp_init(vport, did); in lpfc_setup_disc_node()
5654 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_setup_disc_node()
5656 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_setup_disc_node()
5660 ndlp->nlp_state, vport->fc_flag); in lpfc_setup_disc_node()
5670 if (test_bit(FC_RSCN_MODE, &vport->fc_flag) && in lpfc_setup_disc_node()
5671 !test_bit(FC_NDISC_ACTIVE, &vport->fc_flag)) { in lpfc_setup_disc_node()
5672 if (lpfc_rscn_payload_check(vport, did)) { in lpfc_setup_disc_node()
5677 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_setup_disc_node()
5679 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_setup_disc_node()
5683 ndlp->nlp_state, vport->fc_flag); in lpfc_setup_disc_node()
5690 if (vport->phba->nvmet_support) in lpfc_setup_disc_node()
5695 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_setup_disc_node()
5701 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_setup_disc_node()
5705 ndlp->nlp_state, vport->fc_flag); in lpfc_setup_disc_node()
5709 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_setup_disc_node()
5713 ndlp->nlp_state, vport->fc_flag); in lpfc_setup_disc_node()
5721 (!vport->phba->nvmet_support && in lpfc_setup_disc_node()
5725 if (vport->phba->nvmet_support) in lpfc_setup_disc_node()
5731 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_setup_disc_node()
5739 lpfc_disc_list_loopmap(struct lpfc_vport *vport) in lpfc_disc_list_loopmap() argument
5741 struct lpfc_hba *phba = vport->phba; in lpfc_disc_list_loopmap()
5755 if (((vport->fc_myDID & 0xff) == alpa) || (alpa == 0)) in lpfc_disc_list_loopmap()
5757 lpfc_setup_disc_node(vport, alpa); in lpfc_disc_list_loopmap()
5765 if (vport->cfg_scan_down) in lpfc_disc_list_loopmap()
5770 if ((vport->fc_myDID & 0xff) == alpa) in lpfc_disc_list_loopmap()
5772 lpfc_setup_disc_node(vport, alpa); in lpfc_disc_list_loopmap()
5780 lpfc_issue_clear_la(struct lpfc_hba *phba, struct lpfc_vport *vport) in lpfc_issue_clear_la() argument
5793 (vport->port_type != LPFC_PHYSICAL_PORT) || in lpfc_issue_clear_la()
5802 mbox->vport = vport; in lpfc_issue_clear_la()
5806 lpfc_disc_flush_list(vport); in lpfc_issue_clear_la()
5816 lpfc_issue_reg_vpi(struct lpfc_hba *phba, struct lpfc_vport *vport) in lpfc_issue_reg_vpi() argument
5822 lpfc_reg_vpi(vport, regvpimbox); in lpfc_issue_reg_vpi()
5824 regvpimbox->vport = vport; in lpfc_issue_reg_vpi()
5834 lpfc_disc_start(struct lpfc_vport *vport) in lpfc_disc_start() argument
5836 struct lpfc_hba *phba = vport->phba; in lpfc_disc_start()
5841 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, in lpfc_disc_start()
5852 if (vport->port_state < LPFC_VPORT_READY) in lpfc_disc_start()
5853 vport->port_state = LPFC_DISC_AUTH; in lpfc_disc_start()
5855 lpfc_set_disctmo(vport); in lpfc_disc_start()
5857 vport->fc_prevDID = vport->fc_myDID; in lpfc_disc_start()
5858 vport->num_disc_nodes = 0; in lpfc_disc_start()
5861 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_disc_start()
5864 vport->port_state, vport->fc_flag, in lpfc_disc_start()
5865 atomic_read(&vport->fc_plogi_cnt), in lpfc_disc_start()
5866 atomic_read(&vport->fc_adisc_cnt), in lpfc_disc_start()
5867 atomic_read(&vport->fc_npr_cnt)); in lpfc_disc_start()
5870 num_sent = lpfc_els_disc_adisc(vport); in lpfc_disc_start()
5877 !test_bit(FC_PT2PT, &vport->fc_flag) && in lpfc_disc_start()
5878 !test_bit(FC_RSCN_MODE, &vport->fc_flag) && in lpfc_disc_start()
5880 lpfc_issue_clear_la(phba, vport); in lpfc_disc_start()
5881 lpfc_issue_reg_vpi(phba, vport); in lpfc_disc_start()
5889 if (vport->port_state < LPFC_VPORT_READY && !clear_la_pending) { in lpfc_disc_start()
5891 lpfc_issue_clear_la(phba, vport); in lpfc_disc_start()
5893 if (!test_bit(FC_ABORT_DISCOVERY, &vport->fc_flag)) { in lpfc_disc_start()
5894 vport->num_disc_nodes = 0; in lpfc_disc_start()
5896 if (atomic_read(&vport->fc_npr_cnt)) in lpfc_disc_start()
5897 lpfc_els_disc_plogi(vport); in lpfc_disc_start()
5899 if (!vport->num_disc_nodes) { in lpfc_disc_start()
5900 clear_bit(FC_NDISC_ACTIVE, &vport->fc_flag); in lpfc_disc_start()
5901 lpfc_can_disctmo(vport); in lpfc_disc_start()
5904 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_start()
5907 num_sent = lpfc_els_disc_plogi(vport); in lpfc_disc_start()
5912 if (test_bit(FC_RSCN_MODE, &vport->fc_flag)) { in lpfc_disc_start()
5916 if (vport->fc_rscn_id_cnt == 0 && in lpfc_disc_start()
5917 !test_bit(FC_RSCN_DISCOVERY, &vport->fc_flag)) { in lpfc_disc_start()
5918 clear_bit(FC_RSCN_MODE, &vport->fc_flag); in lpfc_disc_start()
5919 lpfc_can_disctmo(vport); in lpfc_disc_start()
5921 lpfc_els_handle_rscn(vport); in lpfc_disc_start()
5984 lpfc_disc_flush_list(struct lpfc_vport *vport) in lpfc_disc_flush_list() argument
5987 struct lpfc_hba *phba = vport->phba; in lpfc_disc_flush_list()
5989 if (atomic_read(&vport->fc_plogi_cnt) || in lpfc_disc_flush_list()
5990 atomic_read(&vport->fc_adisc_cnt)) { in lpfc_disc_flush_list()
5991 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, in lpfc_disc_flush_list()
6003 * @vport: Pointer to Virtual Port object.
6012 lpfc_notify_xport_npr(struct lpfc_vport *vport) in lpfc_notify_xport_npr() argument
6016 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, in lpfc_notify_xport_npr()
6018 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_notify_xport_npr()
6022 lpfc_cleanup_discovery_resources(struct lpfc_vport *vport) in lpfc_cleanup_discovery_resources() argument
6024 lpfc_els_flush_rscn(vport); in lpfc_cleanup_discovery_resources()
6025 lpfc_els_flush_cmd(vport); in lpfc_cleanup_discovery_resources()
6026 lpfc_disc_flush_list(vport); in lpfc_cleanup_discovery_resources()
6027 if (pci_channel_offline(vport->phba->pcidev)) in lpfc_cleanup_discovery_resources()
6028 lpfc_notify_xport_npr(vport); in lpfc_cleanup_discovery_resources()
6049 struct lpfc_vport *vport = from_timer(vport, t, fc_disctmo); in lpfc_disc_timeout() local
6050 struct lpfc_hba *phba = vport->phba; in lpfc_disc_timeout()
6057 spin_lock_irqsave(&vport->work_port_lock, flags); in lpfc_disc_timeout()
6058 tmo_posted = vport->work_port_events & WORKER_DISC_TMO; in lpfc_disc_timeout()
6060 vport->work_port_events |= WORKER_DISC_TMO; in lpfc_disc_timeout()
6061 spin_unlock_irqrestore(&vport->work_port_lock, flags); in lpfc_disc_timeout()
6069 lpfc_disc_timeout_handler(struct lpfc_vport *vport) in lpfc_disc_timeout_handler() argument
6071 struct lpfc_hba *phba = vport->phba; in lpfc_disc_timeout_handler()
6077 if (!test_and_clear_bit(FC_DISC_TMO, &vport->fc_flag)) in lpfc_disc_timeout_handler()
6080 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_disc_timeout_handler()
6082 vport->port_state, vport->fc_ns_retry, vport->fc_flag); in lpfc_disc_timeout_handler()
6084 switch (vport->port_state) { in lpfc_disc_timeout_handler()
6091 lpfc_printf_vlog(vport, KERN_WARNING, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
6095 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, in lpfc_disc_timeout_handler()
6101 lpfc_drop_node(vport, ndlp); in lpfc_disc_timeout_handler()
6107 lpfc_unreg_rpi(vport, ndlp); in lpfc_disc_timeout_handler()
6110 if (vport->port_state != LPFC_FLOGI) { in lpfc_disc_timeout_handler()
6112 lpfc_initial_flogi(vport); in lpfc_disc_timeout_handler()
6114 lpfc_issue_init_vfi(vport); in lpfc_disc_timeout_handler()
6123 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6126 vport->vpi ? "FDISC" : "FLOGI"); in lpfc_disc_timeout_handler()
6133 lpfc_disc_list_loopmap(vport); in lpfc_disc_timeout_handler()
6136 lpfc_disc_start(vport); in lpfc_disc_timeout_handler()
6142 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6147 ndlp = lpfc_findnode_did(vport, NameServer_DID); in lpfc_disc_timeout_handler()
6156 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6160 vport->fc_ns_retry, LPFC_MAX_NS_RETRY); in lpfc_disc_timeout_handler()
6162 if (vport->fc_ns_retry < LPFC_MAX_NS_RETRY) { in lpfc_disc_timeout_handler()
6164 vport->fc_ns_retry++; in lpfc_disc_timeout_handler()
6165 vport->gidft_inp = 0; in lpfc_disc_timeout_handler()
6166 rc = lpfc_issue_gidft(vport); in lpfc_disc_timeout_handler()
6170 vport->fc_ns_retry = 0; in lpfc_disc_timeout_handler()
6180 lpfc_issue_reg_vpi(phba, vport); in lpfc_disc_timeout_handler()
6182 lpfc_issue_clear_la(phba, vport); in lpfc_disc_timeout_handler()
6183 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_timeout_handler()
6190 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6202 initlinkmbox->vport = vport; in lpfc_disc_timeout_handler()
6213 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6216 lpfc_disc_flush_list(vport); in lpfc_disc_timeout_handler()
6224 lpfc_issue_reg_vpi(phba, vport); in lpfc_disc_timeout_handler()
6226 lpfc_issue_clear_la(phba, vport); in lpfc_disc_timeout_handler()
6227 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_timeout_handler()
6233 if (test_bit(FC_RSCN_MODE, &vport->fc_flag)) { in lpfc_disc_timeout_handler()
6234 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6238 vport->fc_ns_retry, LPFC_MAX_NS_RETRY, in lpfc_disc_timeout_handler()
6239 vport->port_state, vport->gidft_inp); in lpfc_disc_timeout_handler()
6242 lpfc_els_flush_cmd(vport); in lpfc_disc_timeout_handler()
6244 lpfc_els_flush_rscn(vport); in lpfc_disc_timeout_handler()
6245 lpfc_disc_flush_list(vport); in lpfc_disc_timeout_handler()
6250 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6253 "vport State x%x\n", vport->port_state); in lpfc_disc_timeout_handler()
6260 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6267 lpfc_issue_clear_la(phba, vport); in lpfc_disc_timeout_handler()
6275 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_disc_timeout_handler()
6287 lpfc_disc_flush_list(vport); in lpfc_disc_timeout_handler()
6294 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_timeout_handler()
6310 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_fdmi_reg_login() local
6318 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_mbx_cmpl_fdmi_reg_login()
6319 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE | LOG_DISCOVERY, in lpfc_mbx_cmpl_fdmi_reg_login()
6330 if (vport->port_type == LPFC_PHYSICAL_PORT) { in lpfc_mbx_cmpl_fdmi_reg_login()
6332 lpfc_fdmi_cmd(vport, ndlp, SLI_MGMT_DHBA, 0); in lpfc_mbx_cmpl_fdmi_reg_login()
6334 lpfc_fdmi_cmd(vport, ndlp, SLI_MGMT_DPRT, 0); in lpfc_mbx_cmpl_fdmi_reg_login()
6362 __lpfc_find_node(struct lpfc_vport *vport, node_filter filter, void *param) in __lpfc_find_node() argument
6366 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in __lpfc_find_node()
6368 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE_VERBOSE, in __lpfc_find_node()
6379 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in __lpfc_find_node()
6389 __lpfc_findnode_rpi(struct lpfc_vport *vport, uint16_t rpi) in __lpfc_findnode_rpi() argument
6391 return __lpfc_find_node(vport, lpfc_filter_by_rpi, &rpi); in __lpfc_findnode_rpi()
6399 lpfc_findnode_wwpn(struct lpfc_vport *vport, struct lpfc_name *wwpn) in lpfc_findnode_wwpn() argument
6401 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_findnode_wwpn()
6405 ndlp = __lpfc_find_node(vport, lpfc_filter_by_wwpn, wwpn); in lpfc_findnode_wwpn()
6416 lpfc_findnode_rpi(struct lpfc_vport *vport, uint16_t rpi) in lpfc_findnode_rpi() argument
6418 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_findnode_rpi()
6423 ndlp = __lpfc_findnode_rpi(vport, rpi); in lpfc_findnode_rpi()
6429 * lpfc_find_vport_by_vpid - Find a vport on a HBA through vport identifier
6433 * This routine finds a vport on a HBA (referred by @phba) through a
6434 * @vpi. The function walks the HBA's vport list and returns the address
6435 * of the vport with the matching @vpi.
6438 * NULL - No vport with the matching @vpi found
6439 * Otherwise - Address to the vport with the matching @vpi.
6444 struct lpfc_vport *vport; in lpfc_find_vport_by_vpid() local
6452 * vport stores the logical vpi. in lpfc_find_vport_by_vpid()
6461 "2936 Could not find Vport mapped " in lpfc_find_vport_by_vpid()
6468 list_for_each_entry(vport, &phba->port_list, listentry) { in lpfc_find_vport_by_vpid()
6469 if (vport->vpi == i) { in lpfc_find_vport_by_vpid()
6471 return vport; in lpfc_find_vport_by_vpid()
6479 lpfc_nlp_init(struct lpfc_vport *vport, uint32_t did) in lpfc_nlp_init() argument
6484 if (vport->phba->sli_rev == LPFC_SLI_REV4) { in lpfc_nlp_init()
6485 rpi = lpfc_sli4_alloc_rpi(vport->phba); in lpfc_nlp_init()
6490 ndlp = mempool_alloc(vport->phba->nlp_mem_pool, GFP_KERNEL); in lpfc_nlp_init()
6492 if (vport->phba->sli_rev == LPFC_SLI_REV4) in lpfc_nlp_init()
6493 lpfc_sli4_free_rpi(vport->phba, rpi); in lpfc_nlp_init()
6501 lpfc_initialize_node(vport, ndlp, did); in lpfc_nlp_init()
6503 if (vport->phba->sli_rev == LPFC_SLI_REV4) { in lpfc_nlp_init()
6505 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_nlp_init()
6513 mempool_alloc(vport->phba->active_rrq_pool, in lpfc_nlp_init()
6522 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_init()
6537 struct lpfc_vport *vport = ndlp->vport; in lpfc_nlp_release() local
6539 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_release()
6543 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_nlp_release()
6549 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_nlp_release()
6550 lpfc_cleanup_node(vport, ndlp); in lpfc_nlp_release()
6555 if (vport->phba->sli_rev == LPFC_SLI_REV4) { in lpfc_nlp_release()
6556 lpfc_sli4_free_rpi(vport->phba, ndlp->nlp_rpi); in lpfc_nlp_release()
6563 ndlp->vport = NULL; in lpfc_nlp_release()
6585 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_get()
6597 lpfc_printf_vlog(ndlp->vport, KERN_WARNING, LOG_NODE, in lpfc_nlp_get()
6617 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_put()
6699 struct lpfc_vport *vport = mboxq->vport; in lpfc_unregister_vfi_cmpl() local
6705 mboxq->u.mb.mbxStatus, vport->port_state); in lpfc_unregister_vfi_cmpl()
6722 struct lpfc_vport *vport = mboxq->vport; in lpfc_unregister_fcfi_cmpl() local
6728 mboxq->u.mb.mbxStatus, vport->port_state); in lpfc_unregister_fcfi_cmpl()
6823 mbox->vport = phba->pport; in lpfc_sli4_unregister_fcf()
7177 * @vport: Pointer to lpfc_vport data structure.
7191 lpfc_error_lost_link(struct lpfc_vport *vport, u32 ulp_status, u32 ulp_word4) in lpfc_error_lost_link() argument
7200 lpfc_printf_vlog(vport, KERN_WARNING, LOG_SLI | LOG_ELS, in lpfc_error_lost_link()