Lines Matching +full:avg +full:- +full:samples

4  * Copyright (C) 2017-2019 Broadcom. All Rights Reserved. The term *
6 * Copyright (C) 2007-2015 Emulex. All rights reserved. *
16 * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE *
26 #include <linux/dma-mapping.h>
64 * # mount -t debugfs none /sys/kernel/debug
127 * lpfc_debugfs_disc_trc_data - Dump discovery logging to a buffer
161 index = (atomic_read(&vport->disc_trc_cnt) + 1) & in lpfc_debugfs_disc_trc_data()
162 (lpfc_debugfs_max_disc_trc - 1); in lpfc_debugfs_disc_trc_data()
164 dtp = vport->disc_trc + i; in lpfc_debugfs_disc_trc_data()
165 if (!dtp->fmt) in lpfc_debugfs_disc_trc_data()
167 ms = jiffies_to_msecs(dtp->jif - lpfc_debugfs_start_time); in lpfc_debugfs_disc_trc_data()
170 dtp->seq_cnt, ms, dtp->fmt); in lpfc_debugfs_disc_trc_data()
171 len += scnprintf(buf+len, size-len, buffer, in lpfc_debugfs_disc_trc_data()
172 dtp->data1, dtp->data2, dtp->data3); in lpfc_debugfs_disc_trc_data()
175 dtp = vport->disc_trc + i; in lpfc_debugfs_disc_trc_data()
176 if (!dtp->fmt) in lpfc_debugfs_disc_trc_data()
178 ms = jiffies_to_msecs(dtp->jif - lpfc_debugfs_start_time); in lpfc_debugfs_disc_trc_data()
181 dtp->seq_cnt, ms, dtp->fmt); in lpfc_debugfs_disc_trc_data()
182 len += scnprintf(buf+len, size-len, buffer, in lpfc_debugfs_disc_trc_data()
183 dtp->data1, dtp->data2, dtp->data3); in lpfc_debugfs_disc_trc_data()
193 * lpfc_debugfs_slow_ring_trc_data - Dump slow ring logging to a buffer
227 index = (atomic_read(&phba->slow_ring_trc_cnt) + 1) & in lpfc_debugfs_slow_ring_trc_data()
228 (lpfc_debugfs_max_slow_ring_trc - 1); in lpfc_debugfs_slow_ring_trc_data()
230 dtp = phba->slow_ring_trc + i; in lpfc_debugfs_slow_ring_trc_data()
231 if (!dtp->fmt) in lpfc_debugfs_slow_ring_trc_data()
233 ms = jiffies_to_msecs(dtp->jif - lpfc_debugfs_start_time); in lpfc_debugfs_slow_ring_trc_data()
236 dtp->seq_cnt, ms, dtp->fmt); in lpfc_debugfs_slow_ring_trc_data()
237 len += scnprintf(buf+len, size-len, buffer, in lpfc_debugfs_slow_ring_trc_data()
238 dtp->data1, dtp->data2, dtp->data3); in lpfc_debugfs_slow_ring_trc_data()
241 dtp = phba->slow_ring_trc + i; in lpfc_debugfs_slow_ring_trc_data()
242 if (!dtp->fmt) in lpfc_debugfs_slow_ring_trc_data()
244 ms = jiffies_to_msecs(dtp->jif - lpfc_debugfs_start_time); in lpfc_debugfs_slow_ring_trc_data()
247 dtp->seq_cnt, ms, dtp->fmt); in lpfc_debugfs_slow_ring_trc_data()
248 len += scnprintf(buf+len, size-len, buffer, in lpfc_debugfs_slow_ring_trc_data()
249 dtp->data1, dtp->data2, dtp->data3); in lpfc_debugfs_slow_ring_trc_data()
258 static int lpfc_debugfs_last_hbq = -1;
261 * lpfc_debugfs_hbqinfo_data - Dump host buffer queue info to a buffer
291 if (phba->sli_rev != 3) in lpfc_debugfs_hbqinfo_data()
294 spin_lock_irq(&phba->hbalock); in lpfc_debugfs_hbqinfo_data()
308 len += scnprintf(buf+len, size-len, "HBQ %d Info\n", i); in lpfc_debugfs_hbqinfo_data()
310 hbqs = &phba->hbqs[i]; in lpfc_debugfs_hbqinfo_data()
312 list_for_each_entry(d_buf, &hbqs->hbq_buffer_list, list) in lpfc_debugfs_hbqinfo_data()
316 len += scnprintf(buf+len, size-len, in lpfc_debugfs_hbqinfo_data()
318 hip->hbq_index, hip->profile, hip->rn, in lpfc_debugfs_hbqinfo_data()
319 hip->buffer_count, hip->init_count, hip->add_count, posted); in lpfc_debugfs_hbqinfo_data()
321 raw_index = phba->hbq_get[i]; in lpfc_debugfs_hbqinfo_data()
323 len += scnprintf(buf+len, size-len, in lpfc_debugfs_hbqinfo_data()
325 hbqs->entry_count, hbqs->buffer_count, hbqs->hbqPutIdx, in lpfc_debugfs_hbqinfo_data()
326 hbqs->next_hbqPutIdx, hbqs->local_hbqGetIdx, getidx); in lpfc_debugfs_hbqinfo_data()
328 hbqe = (struct lpfc_hbq_entry *) phba->hbqs[i].hbq_virt; in lpfc_debugfs_hbqinfo_data()
329 for (j=0; j<hbqs->entry_count; j++) { in lpfc_debugfs_hbqinfo_data()
330 len += scnprintf(buf+len, size-len, in lpfc_debugfs_hbqinfo_data()
332 le32_to_cpu(hbqe->bde.addrLow), in lpfc_debugfs_hbqinfo_data()
333 le32_to_cpu(hbqe->bde.tus.w), in lpfc_debugfs_hbqinfo_data()
334 le32_to_cpu(hbqe->buffer_tag)); in lpfc_debugfs_hbqinfo_data()
339 low = hbqs->hbqPutIdx - posted; in lpfc_debugfs_hbqinfo_data()
341 if ((j >= hbqs->hbqPutIdx) || (j < low)) { in lpfc_debugfs_hbqinfo_data()
342 len += scnprintf(buf + len, size - len, in lpfc_debugfs_hbqinfo_data()
348 if ((j >= hbqs->hbqPutIdx) && in lpfc_debugfs_hbqinfo_data()
349 (j < (hbqs->entry_count+low))) { in lpfc_debugfs_hbqinfo_data()
350 len += scnprintf(buf + len, size - len, in lpfc_debugfs_hbqinfo_data()
357 list_for_each_entry(d_buf, &hbqs->hbq_buffer_list, list) { in lpfc_debugfs_hbqinfo_data()
359 phys = ((uint64_t)hbq_buf->dbuf.phys & 0xffffffff); in lpfc_debugfs_hbqinfo_data()
360 if (phys == le32_to_cpu(hbqe->bde.addrLow)) { in lpfc_debugfs_hbqinfo_data()
361 len += scnprintf(buf+len, size-len, in lpfc_debugfs_hbqinfo_data()
363 hbq_buf->dbuf.virt, hbq_buf->tag); in lpfc_debugfs_hbqinfo_data()
370 len += scnprintf(buf+len, size-len, "No DMAinfo?\n"); in lpfc_debugfs_hbqinfo_data()
374 if (len > LPFC_HBQINFO_SIZE - 54) in lpfc_debugfs_hbqinfo_data()
377 spin_unlock_irq(&phba->hbalock); in lpfc_debugfs_hbqinfo_data()
384 * lpfc_debugfs_common_xri_data - Dump Hardware Queue info to a buffer
411 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_debugfs_commonxripools_data()
412 if (len > (LPFC_DUMP_MULTIXRIPOOL_SIZE - 80)) in lpfc_debugfs_commonxripools_data()
414 qp = &phba->sli4_hba.hdwq[lpfc_debugfs_last_xripool]; in lpfc_debugfs_commonxripools_data()
416 len += scnprintf(buf + len, size - len, "HdwQ %d Info ", i); in lpfc_debugfs_commonxripools_data()
417 spin_lock_irqsave(&qp->abts_io_buf_list_lock, iflag); in lpfc_debugfs_commonxripools_data()
418 spin_lock(&qp->io_buf_list_get_lock); in lpfc_debugfs_commonxripools_data()
419 spin_lock(&qp->io_buf_list_put_lock); in lpfc_debugfs_commonxripools_data()
420 out = qp->total_io_bufs - (qp->get_io_bufs + qp->put_io_bufs + in lpfc_debugfs_commonxripools_data()
421 qp->abts_scsi_io_bufs + qp->abts_nvme_io_bufs); in lpfc_debugfs_commonxripools_data()
422 len += scnprintf(buf + len, size - len, in lpfc_debugfs_commonxripools_data()
425 qp->total_io_bufs, qp->get_io_bufs, qp->put_io_bufs, in lpfc_debugfs_commonxripools_data()
426 qp->empty_io_bufs, qp->abts_scsi_io_bufs, in lpfc_debugfs_commonxripools_data()
427 qp->abts_nvme_io_bufs, out); in lpfc_debugfs_commonxripools_data()
428 spin_unlock(&qp->io_buf_list_put_lock); in lpfc_debugfs_commonxripools_data()
429 spin_unlock(&qp->io_buf_list_get_lock); in lpfc_debugfs_commonxripools_data()
430 spin_unlock_irqrestore(&qp->abts_io_buf_list_lock, iflag); in lpfc_debugfs_commonxripools_data()
433 if (lpfc_debugfs_last_xripool >= phba->cfg_hdw_queue) in lpfc_debugfs_commonxripools_data()
441 * lpfc_debugfs_multixripools_data - Display multi-XRI pools information
447 * This routine displays current multi-XRI pools information including XRI
467 if (phba->sli_rev != LPFC_SLI_REV4) in lpfc_debugfs_multixripools_data()
470 if (!phba->sli4_hba.hdwq) in lpfc_debugfs_multixripools_data()
473 if (!phba->cfg_xri_rebalancing) { in lpfc_debugfs_multixripools_data()
524 hwq_count = phba->cfg_hdw_queue; in lpfc_debugfs_multixripools_data()
526 qp = &phba->sli4_hba.hdwq[i]; in lpfc_debugfs_multixripools_data()
527 multixri_pool = qp->p_multixri_pool; in lpfc_debugfs_multixripools_data()
530 pbl_pool = &multixri_pool->pbl_pool; in lpfc_debugfs_multixripools_data()
531 pvt_pool = &multixri_pool->pvt_pool; in lpfc_debugfs_multixripools_data()
532 txcmplq_cnt = qp->io_wq->pring->txcmplq_cnt; in lpfc_debugfs_multixripools_data()
536 i, pbl_pool->count, pvt_pool->count, in lpfc_debugfs_multixripools_data()
537 txcmplq_cnt, pvt_pool->high_watermark, in lpfc_debugfs_multixripools_data()
538 qp->empty_io_bufs, multixri_pool->pbl_empty_count); in lpfc_debugfs_multixripools_data()
545 multixri_pool->stat_max_hwm, in lpfc_debugfs_multixripools_data()
546 multixri_pool->above_limit_count, in lpfc_debugfs_multixripools_data()
547 multixri_pool->below_limit_count, in lpfc_debugfs_multixripools_data()
548 multixri_pool->local_pbl_hit_count, in lpfc_debugfs_multixripools_data()
549 multixri_pool->other_pbl_hit_count); in lpfc_debugfs_multixripools_data()
555 multixri_pool->stat_pbl_count, in lpfc_debugfs_multixripools_data()
556 multixri_pool->stat_pvt_count, in lpfc_debugfs_multixripools_data()
557 multixri_pool->stat_busy_count); in lpfc_debugfs_multixripools_data()
574 * lpfc_debugfs_lockstat_data - Dump Hardware Queue info to a buffer
600 if (phba->sli_rev != LPFC_SLI_REV4) in lpfc_debugfs_lockstat_data()
603 if (!phba->sli4_hba.hdwq) in lpfc_debugfs_lockstat_data()
606 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_debugfs_lockstat_data()
607 if (len > (LPFC_HDWQINFO_SIZE - 100)) in lpfc_debugfs_lockstat_data()
609 qp = &phba->sli4_hba.hdwq[lpfc_debugfs_last_lock]; in lpfc_debugfs_lockstat_data()
611 len += scnprintf(buf + len, size - len, "HdwQ %03d Lock ", i); in lpfc_debugfs_lockstat_data()
612 if (phba->cfg_xri_rebalancing) { in lpfc_debugfs_lockstat_data()
613 len += scnprintf(buf + len, size - len, in lpfc_debugfs_lockstat_data()
617 qp->lock_conflict.alloc_pvt_pool, in lpfc_debugfs_lockstat_data()
618 qp->lock_conflict.mv_from_pvt_pool, in lpfc_debugfs_lockstat_data()
619 qp->lock_conflict.mv_to_pub_pool, in lpfc_debugfs_lockstat_data()
620 qp->lock_conflict.mv_to_pvt_pool, in lpfc_debugfs_lockstat_data()
621 qp->lock_conflict.free_pvt_pool, in lpfc_debugfs_lockstat_data()
622 qp->lock_conflict.free_pub_pool, in lpfc_debugfs_lockstat_data()
623 qp->lock_conflict.wq_access); in lpfc_debugfs_lockstat_data()
625 len += scnprintf(buf + len, size - len, in lpfc_debugfs_lockstat_data()
627 qp->lock_conflict.alloc_xri_get, in lpfc_debugfs_lockstat_data()
628 qp->lock_conflict.alloc_xri_put, in lpfc_debugfs_lockstat_data()
629 qp->lock_conflict.free_xri, in lpfc_debugfs_lockstat_data()
630 qp->lock_conflict.wq_access); in lpfc_debugfs_lockstat_data()
634 if (lpfc_debugfs_last_lock >= phba->cfg_hdw_queue) in lpfc_debugfs_lockstat_data()
645 * lpfc_debugfs_dumpHBASlim_data - Dump HBA SLIM info to a buffer
675 spin_lock_irq(&phba->hbalock); in lpfc_debugfs_dumpHBASlim_data()
677 len += scnprintf(buf+len, size-len, "HBA SLIM\n"); in lpfc_debugfs_dumpHBASlim_data()
679 phba->MBslimaddr + lpfc_debugfs_last_hba_slim_off, 1024); in lpfc_debugfs_dumpHBASlim_data()
691 len += scnprintf(buf+len, size-len, in lpfc_debugfs_dumpHBASlim_data()
696 i -= (8 * sizeof(uint32_t)); in lpfc_debugfs_dumpHBASlim_data()
700 spin_unlock_irq(&phba->hbalock); in lpfc_debugfs_dumpHBASlim_data()
707 * lpfc_debugfs_dumpHostSlim_data - Dump host SLIM info to a buffer
729 struct lpfc_sli *psli = &phba->sli; in lpfc_debugfs_dumpHostSlim_data()
733 spin_lock_irq(&phba->hbalock); in lpfc_debugfs_dumpHostSlim_data()
735 len += scnprintf(buf+len, size-len, "SLIM Mailbox\n"); in lpfc_debugfs_dumpHostSlim_data()
736 ptr = (uint32_t *)phba->slim2p.virt; in lpfc_debugfs_dumpHostSlim_data()
739 len += scnprintf(buf+len, size-len, in lpfc_debugfs_dumpHostSlim_data()
744 i -= (8 * sizeof(uint32_t)); in lpfc_debugfs_dumpHostSlim_data()
748 len += scnprintf(buf+len, size-len, "SLIM PCB\n"); in lpfc_debugfs_dumpHostSlim_data()
749 ptr = (uint32_t *)phba->pcb; in lpfc_debugfs_dumpHostSlim_data()
752 len += scnprintf(buf+len, size-len, in lpfc_debugfs_dumpHostSlim_data()
757 i -= (8 * sizeof(uint32_t)); in lpfc_debugfs_dumpHostSlim_data()
761 if (phba->sli_rev <= LPFC_SLI_REV3) { in lpfc_debugfs_dumpHostSlim_data()
763 pgpp = &phba->port_gp[i]; in lpfc_debugfs_dumpHostSlim_data()
764 pring = &psli->sli3_ring[i]; in lpfc_debugfs_dumpHostSlim_data()
765 len += scnprintf(buf+len, size-len, in lpfc_debugfs_dumpHostSlim_data()
770 i, pgpp->cmdGetInx, in lpfc_debugfs_dumpHostSlim_data()
771 pring->sli.sli3.numCiocb, in lpfc_debugfs_dumpHostSlim_data()
772 pring->sli.sli3.next_cmdidx, in lpfc_debugfs_dumpHostSlim_data()
773 pring->sli.sli3.local_getidx, in lpfc_debugfs_dumpHostSlim_data()
774 pring->flag, pgpp->rspPutInx, in lpfc_debugfs_dumpHostSlim_data()
775 pring->sli.sli3.numRiocb); in lpfc_debugfs_dumpHostSlim_data()
778 word0 = readl(phba->HAregaddr); in lpfc_debugfs_dumpHostSlim_data()
779 word1 = readl(phba->CAregaddr); in lpfc_debugfs_dumpHostSlim_data()
780 word2 = readl(phba->HSregaddr); in lpfc_debugfs_dumpHostSlim_data()
781 word3 = readl(phba->HCregaddr); in lpfc_debugfs_dumpHostSlim_data()
782 len += scnprintf(buf+len, size-len, "HA:%08x CA:%08x HS:%08x " in lpfc_debugfs_dumpHostSlim_data()
785 spin_unlock_irq(&phba->hbalock); in lpfc_debugfs_dumpHostSlim_data()
790 * lpfc_debugfs_nodelist_data - Dump target node list to a buffer
810 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_nodelist_data()
820 len += scnprintf(buf+len, size-len, "\nFCP Nodelist Entries ...\n"); in lpfc_debugfs_nodelist_data()
821 spin_lock_irq(shost->host_lock); in lpfc_debugfs_nodelist_data()
822 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_debugfs_nodelist_data()
825 len += scnprintf(buf+len, size-len, in lpfc_debugfs_nodelist_data()
829 cnt--; in lpfc_debugfs_nodelist_data()
830 switch (ndlp->nlp_state) { in lpfc_debugfs_nodelist_data()
863 len += scnprintf(buf+len, size-len, "%s DID:x%06x ", in lpfc_debugfs_nodelist_data()
864 statep, ndlp->nlp_DID); in lpfc_debugfs_nodelist_data()
865 len += scnprintf(buf+len, size-len, in lpfc_debugfs_nodelist_data()
867 wwn_to_u64(ndlp->nlp_portname.u.wwn)); in lpfc_debugfs_nodelist_data()
868 len += scnprintf(buf+len, size-len, in lpfc_debugfs_nodelist_data()
870 wwn_to_u64(ndlp->nlp_nodename.u.wwn)); in lpfc_debugfs_nodelist_data()
871 if (ndlp->nlp_flag & NLP_RPI_REGISTERED) in lpfc_debugfs_nodelist_data()
872 len += scnprintf(buf+len, size-len, "RPI:%03d ", in lpfc_debugfs_nodelist_data()
873 ndlp->nlp_rpi); in lpfc_debugfs_nodelist_data()
875 len += scnprintf(buf+len, size-len, "RPI:none "); in lpfc_debugfs_nodelist_data()
876 len += scnprintf(buf+len, size-len, "flag:x%08x ", in lpfc_debugfs_nodelist_data()
877 ndlp->nlp_flag); in lpfc_debugfs_nodelist_data()
878 if (!ndlp->nlp_type) in lpfc_debugfs_nodelist_data()
879 len += scnprintf(buf+len, size-len, "UNKNOWN_TYPE "); in lpfc_debugfs_nodelist_data()
880 if (ndlp->nlp_type & NLP_FC_NODE) in lpfc_debugfs_nodelist_data()
881 len += scnprintf(buf+len, size-len, "FC_NODE "); in lpfc_debugfs_nodelist_data()
882 if (ndlp->nlp_type & NLP_FABRIC) { in lpfc_debugfs_nodelist_data()
883 len += scnprintf(buf+len, size-len, "FABRIC "); in lpfc_debugfs_nodelist_data()
886 if (ndlp->nlp_type & NLP_FCP_TARGET) in lpfc_debugfs_nodelist_data()
887 len += scnprintf(buf+len, size-len, "FCP_TGT sid:%d ", in lpfc_debugfs_nodelist_data()
888 ndlp->nlp_sid); in lpfc_debugfs_nodelist_data()
889 if (ndlp->nlp_type & NLP_FCP_INITIATOR) in lpfc_debugfs_nodelist_data()
890 len += scnprintf(buf+len, size-len, "FCP_INITIATOR "); in lpfc_debugfs_nodelist_data()
891 if (ndlp->nlp_type & NLP_NVME_TARGET) in lpfc_debugfs_nodelist_data()
893 size - len, "NVME_TGT sid:%d ", in lpfc_debugfs_nodelist_data()
895 if (ndlp->nlp_type & NLP_NVME_INITIATOR) in lpfc_debugfs_nodelist_data()
897 size - len, "NVME_INITIATOR "); in lpfc_debugfs_nodelist_data()
898 len += scnprintf(buf+len, size-len, "usgmap:%x ", in lpfc_debugfs_nodelist_data()
899 ndlp->nlp_usg_map); in lpfc_debugfs_nodelist_data()
900 len += scnprintf(buf+len, size-len, "refcnt:%x", in lpfc_debugfs_nodelist_data()
901 kref_read(&ndlp->kref)); in lpfc_debugfs_nodelist_data()
903 i = atomic_read(&ndlp->cmd_pending); in lpfc_debugfs_nodelist_data()
904 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
906 i, ndlp->cmd_qdepth); in lpfc_debugfs_nodelist_data()
909 len += scnprintf(buf + len, size - len, "defer:%x ", in lpfc_debugfs_nodelist_data()
910 ndlp->nlp_defer_did); in lpfc_debugfs_nodelist_data()
911 len += scnprintf(buf+len, size-len, "\n"); in lpfc_debugfs_nodelist_data()
913 spin_unlock_irq(shost->host_lock); in lpfc_debugfs_nodelist_data()
915 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
918 if (phba->nvmet_support && phba->targetport && (vport == phba->pport)) { in lpfc_debugfs_nodelist_data()
919 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
923 if (phba->targetport->port_id) in lpfc_debugfs_nodelist_data()
927 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
929 wwn_to_u64(vport->fc_nodename.u.wwn), in lpfc_debugfs_nodelist_data()
930 wwn_to_u64(vport->fc_portname.u.wwn), in lpfc_debugfs_nodelist_data()
932 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
934 phba->targetport->port_id); in lpfc_debugfs_nodelist_data()
938 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
941 localport = vport->localport; in lpfc_debugfs_nodelist_data()
945 spin_lock_irq(shost->host_lock); in lpfc_debugfs_nodelist_data()
948 if (localport->port_id) in lpfc_debugfs_nodelist_data()
953 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
955 localport->port_id, statep); in lpfc_debugfs_nodelist_data()
957 len += scnprintf(buf + len, size - len, "\tRport List:\n"); in lpfc_debugfs_nodelist_data()
958 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_debugfs_nodelist_data()
959 /* local short-hand pointer. */ in lpfc_debugfs_nodelist_data()
960 spin_lock(&phba->hbalock); in lpfc_debugfs_nodelist_data()
963 nrport = rport->remoteport; in lpfc_debugfs_nodelist_data()
966 spin_unlock(&phba->hbalock); in lpfc_debugfs_nodelist_data()
971 switch (nrport->port_state) { in lpfc_debugfs_nodelist_data()
984 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
986 statep, nrport->port_id); in lpfc_debugfs_nodelist_data()
987 len += scnprintf(buf + len, size - len, "WWPN x%llx ", in lpfc_debugfs_nodelist_data()
988 nrport->port_name); in lpfc_debugfs_nodelist_data()
989 len += scnprintf(buf + len, size - len, "WWNN x%llx ", in lpfc_debugfs_nodelist_data()
990 nrport->node_name); in lpfc_debugfs_nodelist_data()
993 if (nrport->port_role & FC_PORT_ROLE_NVME_INITIATOR) in lpfc_debugfs_nodelist_data()
994 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
996 if (nrport->port_role & FC_PORT_ROLE_NVME_TARGET) in lpfc_debugfs_nodelist_data()
997 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
999 if (nrport->port_role & FC_PORT_ROLE_NVME_DISCOVERY) in lpfc_debugfs_nodelist_data()
1000 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
1002 if (nrport->port_role & ~(FC_PORT_ROLE_NVME_INITIATOR | in lpfc_debugfs_nodelist_data()
1005 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
1007 nrport->port_role); in lpfc_debugfs_nodelist_data()
1009 len += scnprintf(buf + len, size - len, "\n"); in lpfc_debugfs_nodelist_data()
1012 spin_unlock_irq(shost->host_lock); in lpfc_debugfs_nodelist_data()
1018 * lpfc_debugfs_nvmestat_data - Dump target node list to a buffer
1033 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_nvmestat_data()
1044 if (phba->nvmet_support) { in lpfc_debugfs_nvmestat_data()
1045 if (!phba->targetport) in lpfc_debugfs_nvmestat_data()
1047 tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private; in lpfc_debugfs_nvmestat_data()
1048 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1051 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1053 atomic_read(&tgtp->rcv_ls_req_in), in lpfc_debugfs_nvmestat_data()
1054 atomic_read(&tgtp->rcv_ls_req_drop), in lpfc_debugfs_nvmestat_data()
1055 atomic_read(&tgtp->xmt_ls_abort)); in lpfc_debugfs_nvmestat_data()
1056 if (atomic_read(&tgtp->rcv_ls_req_in) != in lpfc_debugfs_nvmestat_data()
1057 atomic_read(&tgtp->rcv_ls_req_out)) { in lpfc_debugfs_nvmestat_data()
1058 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1060 atomic_read(&tgtp->rcv_ls_req_in), in lpfc_debugfs_nvmestat_data()
1061 atomic_read(&tgtp->rcv_ls_req_out)); in lpfc_debugfs_nvmestat_data()
1064 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1066 atomic_read(&tgtp->xmt_ls_rsp), in lpfc_debugfs_nvmestat_data()
1067 atomic_read(&tgtp->xmt_ls_drop), in lpfc_debugfs_nvmestat_data()
1068 atomic_read(&tgtp->xmt_ls_rsp_cmpl)); in lpfc_debugfs_nvmestat_data()
1070 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1072 atomic_read(&tgtp->xmt_ls_rsp_aborted), in lpfc_debugfs_nvmestat_data()
1073 atomic_read(&tgtp->xmt_ls_rsp_xb_set), in lpfc_debugfs_nvmestat_data()
1074 atomic_read(&tgtp->xmt_ls_rsp_error)); in lpfc_debugfs_nvmestat_data()
1076 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1079 atomic_read(&tgtp->rcv_fcp_cmd_in), in lpfc_debugfs_nvmestat_data()
1080 atomic_read(&tgtp->rcv_fcp_cmd_defer), in lpfc_debugfs_nvmestat_data()
1081 atomic_read(&tgtp->xmt_fcp_release), in lpfc_debugfs_nvmestat_data()
1082 atomic_read(&tgtp->rcv_fcp_cmd_drop)); in lpfc_debugfs_nvmestat_data()
1084 if (atomic_read(&tgtp->rcv_fcp_cmd_in) != in lpfc_debugfs_nvmestat_data()
1085 atomic_read(&tgtp->rcv_fcp_cmd_out)) { in lpfc_debugfs_nvmestat_data()
1086 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1088 atomic_read(&tgtp->rcv_fcp_cmd_in), in lpfc_debugfs_nvmestat_data()
1089 atomic_read(&tgtp->rcv_fcp_cmd_out)); in lpfc_debugfs_nvmestat_data()
1092 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1095 atomic_read(&tgtp->xmt_fcp_read), in lpfc_debugfs_nvmestat_data()
1096 atomic_read(&tgtp->xmt_fcp_read_rsp), in lpfc_debugfs_nvmestat_data()
1097 atomic_read(&tgtp->xmt_fcp_write), in lpfc_debugfs_nvmestat_data()
1098 atomic_read(&tgtp->xmt_fcp_rsp)); in lpfc_debugfs_nvmestat_data()
1100 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1102 atomic_read(&tgtp->xmt_fcp_rsp_cmpl), in lpfc_debugfs_nvmestat_data()
1103 atomic_read(&tgtp->xmt_fcp_rsp_error), in lpfc_debugfs_nvmestat_data()
1104 atomic_read(&tgtp->xmt_fcp_rsp_drop)); in lpfc_debugfs_nvmestat_data()
1106 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1108 atomic_read(&tgtp->xmt_fcp_rsp_aborted), in lpfc_debugfs_nvmestat_data()
1109 atomic_read(&tgtp->xmt_fcp_rsp_xb_set), in lpfc_debugfs_nvmestat_data()
1110 atomic_read(&tgtp->xmt_fcp_xri_abort_cqe)); in lpfc_debugfs_nvmestat_data()
1112 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1114 atomic_read(&tgtp->xmt_fcp_abort), in lpfc_debugfs_nvmestat_data()
1115 atomic_read(&tgtp->xmt_fcp_abort_cmpl)); in lpfc_debugfs_nvmestat_data()
1117 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1119 atomic_read(&tgtp->xmt_abort_sol), in lpfc_debugfs_nvmestat_data()
1120 atomic_read(&tgtp->xmt_abort_unsol), in lpfc_debugfs_nvmestat_data()
1121 atomic_read(&tgtp->xmt_abort_rsp), in lpfc_debugfs_nvmestat_data()
1122 atomic_read(&tgtp->xmt_abort_rsp_error)); in lpfc_debugfs_nvmestat_data()
1124 len += scnprintf(buf + len, size - len, "\n"); in lpfc_debugfs_nvmestat_data()
1127 spin_lock(&phba->sli4_hba.abts_nvmet_buf_list_lock); in lpfc_debugfs_nvmestat_data()
1129 &phba->sli4_hba.lpfc_abts_nvmet_ctx_list, in lpfc_debugfs_nvmestat_data()
1133 spin_unlock(&phba->sli4_hba.abts_nvmet_buf_list_lock); in lpfc_debugfs_nvmestat_data()
1135 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1137 spin_lock(&phba->sli4_hba.abts_nvmet_buf_list_lock); in lpfc_debugfs_nvmestat_data()
1139 &phba->sli4_hba.lpfc_abts_nvmet_ctx_list, in lpfc_debugfs_nvmestat_data()
1141 if (len >= (size - LPFC_DEBUG_OUT_LINE_SZ)) in lpfc_debugfs_nvmestat_data()
1143 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1146 ctxp->oxid, ctxp->state, in lpfc_debugfs_nvmestat_data()
1147 ctxp->flag); in lpfc_debugfs_nvmestat_data()
1149 spin_unlock(&phba->sli4_hba.abts_nvmet_buf_list_lock); in lpfc_debugfs_nvmestat_data()
1153 tot = atomic_read(&tgtp->rcv_fcp_cmd_drop); in lpfc_debugfs_nvmestat_data()
1154 tot += atomic_read(&tgtp->xmt_fcp_release); in lpfc_debugfs_nvmestat_data()
1155 tot = atomic_read(&tgtp->rcv_fcp_cmd_in) - tot; in lpfc_debugfs_nvmestat_data()
1157 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1160 phba->sli4_hba.nvmet_xri_cnt, in lpfc_debugfs_nvmestat_data()
1161 phba->sli4_hba.nvmet_io_wait_cnt, in lpfc_debugfs_nvmestat_data()
1162 phba->sli4_hba.nvmet_io_wait_total, in lpfc_debugfs_nvmestat_data()
1165 if (!(vport->cfg_enable_fc4_type & LPFC_ENABLE_NVME)) in lpfc_debugfs_nvmestat_data()
1168 localport = vport->localport; in lpfc_debugfs_nvmestat_data()
1171 lport = (struct lpfc_nvme_lport *)localport->private; in lpfc_debugfs_nvmestat_data()
1175 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1178 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1180 atomic_read(&lport->fc4NvmeLsRequests), in lpfc_debugfs_nvmestat_data()
1181 atomic_read(&lport->fc4NvmeLsCmpls)); in lpfc_debugfs_nvmestat_data()
1185 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_debugfs_nvmestat_data()
1186 cstat = &phba->sli4_hba.hdwq[i].nvme_cstat; in lpfc_debugfs_nvmestat_data()
1187 tot = cstat->io_cmpls; in lpfc_debugfs_nvmestat_data()
1189 data1 = cstat->input_requests; in lpfc_debugfs_nvmestat_data()
1190 data2 = cstat->output_requests; in lpfc_debugfs_nvmestat_data()
1191 data3 = cstat->control_requests; in lpfc_debugfs_nvmestat_data()
1198 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_debugfs_nvmestat_data()
1202 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_debugfs_nvmestat_data()
1204 tot, ((data1 + data2 + data3) - tot)); in lpfc_debugfs_nvmestat_data()
1206 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_debugfs_nvmestat_data()
1209 totin, totout, totout - totin); in lpfc_debugfs_nvmestat_data()
1211 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1214 atomic_read(&lport->xmt_ls_abort), in lpfc_debugfs_nvmestat_data()
1215 atomic_read(&lport->xmt_ls_err), in lpfc_debugfs_nvmestat_data()
1216 atomic_read(&lport->cmpl_ls_xb), in lpfc_debugfs_nvmestat_data()
1217 atomic_read(&lport->cmpl_ls_err)); in lpfc_debugfs_nvmestat_data()
1219 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1222 atomic_read(&lport->xmt_fcp_noxri), in lpfc_debugfs_nvmestat_data()
1223 atomic_read(&lport->xmt_fcp_bad_ndlp), in lpfc_debugfs_nvmestat_data()
1224 atomic_read(&lport->xmt_fcp_qdepth), in lpfc_debugfs_nvmestat_data()
1225 atomic_read(&lport->xmt_fcp_wqerr), in lpfc_debugfs_nvmestat_data()
1226 atomic_read(&lport->xmt_fcp_err), in lpfc_debugfs_nvmestat_data()
1227 atomic_read(&lport->xmt_fcp_abort)); in lpfc_debugfs_nvmestat_data()
1229 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1231 atomic_read(&lport->cmpl_fcp_xb), in lpfc_debugfs_nvmestat_data()
1232 atomic_read(&lport->cmpl_fcp_err)); in lpfc_debugfs_nvmestat_data()
1240 * lpfc_debugfs_scsistat_data - Dump target node list to a buffer
1256 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_scsistat_data()
1263 if (!(vport->cfg_enable_fc4_type & LPFC_ENABLE_FCP) || in lpfc_debugfs_scsistat_data()
1264 (phba->sli_rev != LPFC_SLI_REV4)) in lpfc_debugfs_scsistat_data()
1271 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_debugfs_scsistat_data()
1272 cstat = &phba->sli4_hba.hdwq[i].scsi_cstat; in lpfc_debugfs_scsistat_data()
1273 tot = cstat->io_cmpls; in lpfc_debugfs_scsistat_data()
1275 data1 = cstat->input_requests; in lpfc_debugfs_scsistat_data()
1276 data2 = cstat->output_requests; in lpfc_debugfs_scsistat_data()
1277 data3 = cstat->control_requests; in lpfc_debugfs_scsistat_data()
1286 tot, ((data1 + data2 + data3) - tot)); in lpfc_debugfs_scsistat_data()
1291 "OutIO %016llx\n", totin, totout, totout - totin); in lpfc_debugfs_scsistat_data()
1306 if (!lpfc_cmd->ts_last_cmd || in lpfc_io_ktime()
1307 !lpfc_cmd->ts_cmd_start || in lpfc_io_ktime()
1308 !lpfc_cmd->ts_cmd_wqput || in lpfc_io_ktime()
1309 !lpfc_cmd->ts_isr_cmpl || in lpfc_io_ktime()
1310 !lpfc_cmd->ts_data_io) in lpfc_io_ktime()
1313 if (lpfc_cmd->ts_data_io < lpfc_cmd->ts_cmd_start) in lpfc_io_ktime()
1315 if (lpfc_cmd->ts_cmd_start < lpfc_cmd->ts_last_cmd) in lpfc_io_ktime()
1317 if (lpfc_cmd->ts_cmd_wqput < lpfc_cmd->ts_cmd_start) in lpfc_io_ktime()
1319 if (lpfc_cmd->ts_isr_cmpl < lpfc_cmd->ts_cmd_wqput) in lpfc_io_ktime()
1321 if (lpfc_cmd->ts_data_io < lpfc_cmd->ts_isr_cmpl) in lpfc_io_ktime()
1324 * Segment 1 - Time from Last FCP command cmpl is handed in lpfc_io_ktime()
1326 * Segment 2 - Time from Driver receives a IO cmd start in lpfc_io_ktime()
1328 * Segment 3 - Time from Driver WQ put is done on IO cmd in lpfc_io_ktime()
1329 * to MSI-X ISR for IO cmpl. in lpfc_io_ktime()
1330 * Segment 4 - Time from MSI-X ISR for IO cmpl to when in lpfc_io_ktime()
1333 seg1 = lpfc_cmd->ts_cmd_start - lpfc_cmd->ts_last_cmd; in lpfc_io_ktime()
1334 if (seg1 > 5000000) /* 5 ms - for sequential IOs only */ in lpfc_io_ktime()
1338 seg2 = (lpfc_cmd->ts_cmd_wqput - lpfc_cmd->ts_cmd_start); in lpfc_io_ktime()
1340 seg3 = lpfc_cmd->ts_isr_cmpl - lpfc_cmd->ts_cmd_start; in lpfc_io_ktime()
1343 seg3 -= segsum; in lpfc_io_ktime()
1346 seg4 = lpfc_cmd->ts_data_io - lpfc_cmd->ts_cmd_start; in lpfc_io_ktime()
1349 seg4 -= segsum; in lpfc_io_ktime()
1351 phba->ktime_data_samples++; in lpfc_io_ktime()
1352 phba->ktime_seg1_total += seg1; in lpfc_io_ktime()
1353 if (seg1 < phba->ktime_seg1_min) in lpfc_io_ktime()
1354 phba->ktime_seg1_min = seg1; in lpfc_io_ktime()
1355 else if (seg1 > phba->ktime_seg1_max) in lpfc_io_ktime()
1356 phba->ktime_seg1_max = seg1; in lpfc_io_ktime()
1357 phba->ktime_seg2_total += seg2; in lpfc_io_ktime()
1358 if (seg2 < phba->ktime_seg2_min) in lpfc_io_ktime()
1359 phba->ktime_seg2_min = seg2; in lpfc_io_ktime()
1360 else if (seg2 > phba->ktime_seg2_max) in lpfc_io_ktime()
1361 phba->ktime_seg2_max = seg2; in lpfc_io_ktime()
1362 phba->ktime_seg3_total += seg3; in lpfc_io_ktime()
1363 if (seg3 < phba->ktime_seg3_min) in lpfc_io_ktime()
1364 phba->ktime_seg3_min = seg3; in lpfc_io_ktime()
1365 else if (seg3 > phba->ktime_seg3_max) in lpfc_io_ktime()
1366 phba->ktime_seg3_max = seg3; in lpfc_io_ktime()
1367 phba->ktime_seg4_total += seg4; in lpfc_io_ktime()
1368 if (seg4 < phba->ktime_seg4_min) in lpfc_io_ktime()
1369 phba->ktime_seg4_min = seg4; in lpfc_io_ktime()
1370 else if (seg4 > phba->ktime_seg4_max) in lpfc_io_ktime()
1371 phba->ktime_seg4_max = seg4; in lpfc_io_ktime()
1373 lpfc_cmd->ts_last_cmd = 0; in lpfc_io_ktime()
1374 lpfc_cmd->ts_cmd_start = 0; in lpfc_io_ktime()
1375 lpfc_cmd->ts_cmd_wqput = 0; in lpfc_io_ktime()
1376 lpfc_cmd->ts_isr_cmpl = 0; in lpfc_io_ktime()
1377 lpfc_cmd->ts_data_io = 0; in lpfc_io_ktime()
1381 * lpfc_debugfs_ioktime_data - Dump target node list to a buffer
1396 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_ioktime_data()
1399 if (phba->nvmet_support == 0) { in lpfc_debugfs_ioktime_data()
1401 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1402 "ktime %s: Total Samples: %lld\n", in lpfc_debugfs_ioktime_data()
1403 (phba->ktime_on ? "Enabled" : "Disabled"), in lpfc_debugfs_ioktime_data()
1404 phba->ktime_data_samples); in lpfc_debugfs_ioktime_data()
1405 if (phba->ktime_data_samples == 0) in lpfc_debugfs_ioktime_data()
1409 buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1411 "done -to- Start of next Cmd (in driver)\n"); in lpfc_debugfs_ioktime_data()
1413 buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1414 "avg:%08lld min:%08lld max %08lld\n", in lpfc_debugfs_ioktime_data()
1415 div_u64(phba->ktime_seg1_total, in lpfc_debugfs_ioktime_data()
1416 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1417 phba->ktime_seg1_min, in lpfc_debugfs_ioktime_data()
1418 phba->ktime_seg1_max); in lpfc_debugfs_ioktime_data()
1420 buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1422 "-to- Firmware WQ doorbell\n"); in lpfc_debugfs_ioktime_data()
1424 buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1425 "avg:%08lld min:%08lld max %08lld\n", in lpfc_debugfs_ioktime_data()
1426 div_u64(phba->ktime_seg2_total, in lpfc_debugfs_ioktime_data()
1427 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1428 phba->ktime_seg2_min, in lpfc_debugfs_ioktime_data()
1429 phba->ktime_seg2_max); in lpfc_debugfs_ioktime_data()
1431 buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1432 "Segment 3: Firmware WQ doorbell -to- " in lpfc_debugfs_ioktime_data()
1433 "MSI-X ISR cmpl\n"); in lpfc_debugfs_ioktime_data()
1435 buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1436 "avg:%08lld min:%08lld max %08lld\n", in lpfc_debugfs_ioktime_data()
1437 div_u64(phba->ktime_seg3_total, in lpfc_debugfs_ioktime_data()
1438 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1439 phba->ktime_seg3_min, in lpfc_debugfs_ioktime_data()
1440 phba->ktime_seg3_max); in lpfc_debugfs_ioktime_data()
1442 buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1443 "Segment 4: MSI-X ISR cmpl -to- " in lpfc_debugfs_ioktime_data()
1446 buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1447 "avg:%08lld min:%08lld max %08lld\n", in lpfc_debugfs_ioktime_data()
1448 div_u64(phba->ktime_seg4_total, in lpfc_debugfs_ioktime_data()
1449 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1450 phba->ktime_seg4_min, in lpfc_debugfs_ioktime_data()
1451 phba->ktime_seg4_max); in lpfc_debugfs_ioktime_data()
1453 buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1454 "Total IO avg time: %08lld\n", in lpfc_debugfs_ioktime_data()
1455 div_u64(phba->ktime_seg1_total + in lpfc_debugfs_ioktime_data()
1456 phba->ktime_seg2_total + in lpfc_debugfs_ioktime_data()
1457 phba->ktime_seg3_total + in lpfc_debugfs_ioktime_data()
1458 phba->ktime_seg4_total, in lpfc_debugfs_ioktime_data()
1459 phba->ktime_data_samples)); in lpfc_debugfs_ioktime_data()
1464 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1465 "ktime %s: Total Samples: %lld %lld\n", in lpfc_debugfs_ioktime_data()
1466 (phba->ktime_on ? "Enabled" : "Disabled"), in lpfc_debugfs_ioktime_data()
1467 phba->ktime_data_samples, in lpfc_debugfs_ioktime_data()
1468 phba->ktime_status_samples); in lpfc_debugfs_ioktime_data()
1469 if (phba->ktime_data_samples == 0) in lpfc_debugfs_ioktime_data()
1472 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1473 "Segment 1: MSI-X ISR Rcv cmd -to- " in lpfc_debugfs_ioktime_data()
1475 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1476 "avg:%08lld min:%08lld max %08lld\n", in lpfc_debugfs_ioktime_data()
1477 div_u64(phba->ktime_seg1_total, in lpfc_debugfs_ioktime_data()
1478 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1479 phba->ktime_seg1_min, in lpfc_debugfs_ioktime_data()
1480 phba->ktime_seg1_max); in lpfc_debugfs_ioktime_data()
1481 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1482 "Segment 2: cmd pass to NVME Layer- " in lpfc_debugfs_ioktime_data()
1483 "-to- Driver rcv cmd OP (action)\n"); in lpfc_debugfs_ioktime_data()
1484 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1485 "avg:%08lld min:%08lld max %08lld\n", in lpfc_debugfs_ioktime_data()
1486 div_u64(phba->ktime_seg2_total, in lpfc_debugfs_ioktime_data()
1487 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1488 phba->ktime_seg2_min, in lpfc_debugfs_ioktime_data()
1489 phba->ktime_seg2_max); in lpfc_debugfs_ioktime_data()
1490 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1491 "Segment 3: Driver rcv cmd OP -to- " in lpfc_debugfs_ioktime_data()
1493 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1494 "avg:%08lld min:%08lld max %08lld\n", in lpfc_debugfs_ioktime_data()
1495 div_u64(phba->ktime_seg3_total, in lpfc_debugfs_ioktime_data()
1496 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1497 phba->ktime_seg3_min, in lpfc_debugfs_ioktime_data()
1498 phba->ktime_seg3_max); in lpfc_debugfs_ioktime_data()
1499 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1501 "-to- MSI-X ISR for cmd cmpl\n"); in lpfc_debugfs_ioktime_data()
1502 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1503 "avg:%08lld min:%08lld max %08lld\n", in lpfc_debugfs_ioktime_data()
1504 div_u64(phba->ktime_seg4_total, in lpfc_debugfs_ioktime_data()
1505 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1506 phba->ktime_seg4_min, in lpfc_debugfs_ioktime_data()
1507 phba->ktime_seg4_max); in lpfc_debugfs_ioktime_data()
1508 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1509 "Segment 5: MSI-X ISR for cmd cmpl " in lpfc_debugfs_ioktime_data()
1510 "-to- NVME layer passed cmd done\n"); in lpfc_debugfs_ioktime_data()
1511 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1512 "avg:%08lld min:%08lld max %08lld\n", in lpfc_debugfs_ioktime_data()
1513 div_u64(phba->ktime_seg5_total, in lpfc_debugfs_ioktime_data()
1514 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1515 phba->ktime_seg5_min, in lpfc_debugfs_ioktime_data()
1516 phba->ktime_seg5_max); in lpfc_debugfs_ioktime_data()
1518 if (phba->ktime_status_samples == 0) { in lpfc_debugfs_ioktime_data()
1519 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1520 "Total: cmd received by MSI-X ISR " in lpfc_debugfs_ioktime_data()
1521 "-to- cmd completed on wire\n"); in lpfc_debugfs_ioktime_data()
1522 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1523 "avg:%08lld min:%08lld " in lpfc_debugfs_ioktime_data()
1525 div_u64(phba->ktime_seg10_total, in lpfc_debugfs_ioktime_data()
1526 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1527 phba->ktime_seg10_min, in lpfc_debugfs_ioktime_data()
1528 phba->ktime_seg10_max); in lpfc_debugfs_ioktime_data()
1532 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1534 "-to- Driver rcv rsp status OP\n"); in lpfc_debugfs_ioktime_data()
1535 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1536 "avg:%08lld min:%08lld max %08lld\n", in lpfc_debugfs_ioktime_data()
1537 div_u64(phba->ktime_seg6_total, in lpfc_debugfs_ioktime_data()
1538 phba->ktime_status_samples), in lpfc_debugfs_ioktime_data()
1539 phba->ktime_seg6_min, in lpfc_debugfs_ioktime_data()
1540 phba->ktime_seg6_max); in lpfc_debugfs_ioktime_data()
1541 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1543 "-to- Firmware WQ doorbell: status\n"); in lpfc_debugfs_ioktime_data()
1544 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1545 "avg:%08lld min:%08lld max %08lld\n", in lpfc_debugfs_ioktime_data()
1546 div_u64(phba->ktime_seg7_total, in lpfc_debugfs_ioktime_data()
1547 phba->ktime_status_samples), in lpfc_debugfs_ioktime_data()
1548 phba->ktime_seg7_min, in lpfc_debugfs_ioktime_data()
1549 phba->ktime_seg7_max); in lpfc_debugfs_ioktime_data()
1550 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1552 " -to- MSI-X ISR for status cmpl\n"); in lpfc_debugfs_ioktime_data()
1553 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1554 "avg:%08lld min:%08lld max %08lld\n", in lpfc_debugfs_ioktime_data()
1555 div_u64(phba->ktime_seg8_total, in lpfc_debugfs_ioktime_data()
1556 phba->ktime_status_samples), in lpfc_debugfs_ioktime_data()
1557 phba->ktime_seg8_min, in lpfc_debugfs_ioktime_data()
1558 phba->ktime_seg8_max); in lpfc_debugfs_ioktime_data()
1559 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1560 "Segment 9: MSI-X ISR for status cmpl " in lpfc_debugfs_ioktime_data()
1561 "-to- NVME layer passed status done\n"); in lpfc_debugfs_ioktime_data()
1562 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1563 "avg:%08lld min:%08lld max %08lld\n", in lpfc_debugfs_ioktime_data()
1564 div_u64(phba->ktime_seg9_total, in lpfc_debugfs_ioktime_data()
1565 phba->ktime_status_samples), in lpfc_debugfs_ioktime_data()
1566 phba->ktime_seg9_min, in lpfc_debugfs_ioktime_data()
1567 phba->ktime_seg9_max); in lpfc_debugfs_ioktime_data()
1568 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1569 "Total: cmd received by MSI-X ISR -to- " in lpfc_debugfs_ioktime_data()
1571 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1572 "avg:%08lld min:%08lld max %08lld\n", in lpfc_debugfs_ioktime_data()
1573 div_u64(phba->ktime_seg10_total, in lpfc_debugfs_ioktime_data()
1574 phba->ktime_status_samples), in lpfc_debugfs_ioktime_data()
1575 phba->ktime_seg10_min, in lpfc_debugfs_ioktime_data()
1576 phba->ktime_seg10_max); in lpfc_debugfs_ioktime_data()
1581 * lpfc_debugfs_nvmeio_trc_data - Dump NVME IO trace list to a buffer
1600 state = phba->nvmeio_trc_on; in lpfc_debugfs_nvmeio_trc_data()
1602 index = (atomic_read(&phba->nvmeio_trc_cnt) + 1) & in lpfc_debugfs_nvmeio_trc_data()
1603 (phba->nvmeio_trc_size - 1); in lpfc_debugfs_nvmeio_trc_data()
1604 skip = phba->nvmeio_trc_output_idx; in lpfc_debugfs_nvmeio_trc_data()
1606 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmeio_trc_data()
1608 (phba->nvmet_support ? "NVME" : "NVMET"), in lpfc_debugfs_nvmeio_trc_data()
1610 index, skip, phba->nvmeio_trc_size); in lpfc_debugfs_nvmeio_trc_data()
1612 if (!phba->nvmeio_trc || state) in lpfc_debugfs_nvmeio_trc_data()
1617 for (i = index; i < phba->nvmeio_trc_size; i++) { in lpfc_debugfs_nvmeio_trc_data()
1619 skip--; in lpfc_debugfs_nvmeio_trc_data()
1622 dtp = phba->nvmeio_trc + i; in lpfc_debugfs_nvmeio_trc_data()
1623 phba->nvmeio_trc_output_idx++; in lpfc_debugfs_nvmeio_trc_data()
1625 if (!dtp->fmt) in lpfc_debugfs_nvmeio_trc_data()
1628 len += scnprintf(buf + len, size - len, dtp->fmt, in lpfc_debugfs_nvmeio_trc_data()
1629 dtp->data1, dtp->data2, dtp->data3); in lpfc_debugfs_nvmeio_trc_data()
1631 if (phba->nvmeio_trc_output_idx >= phba->nvmeio_trc_size) { in lpfc_debugfs_nvmeio_trc_data()
1632 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_nvmeio_trc_data()
1633 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmeio_trc_data()
1638 if (len >= (size - LPFC_DEBUG_OUT_LINE_SZ)) { in lpfc_debugfs_nvmeio_trc_data()
1639 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmeio_trc_data()
1641 phba->nvmeio_trc_output_idx, in lpfc_debugfs_nvmeio_trc_data()
1642 phba->nvmeio_trc_size); in lpfc_debugfs_nvmeio_trc_data()
1648 skip--; in lpfc_debugfs_nvmeio_trc_data()
1651 dtp = phba->nvmeio_trc + i; in lpfc_debugfs_nvmeio_trc_data()
1652 phba->nvmeio_trc_output_idx++; in lpfc_debugfs_nvmeio_trc_data()
1654 if (!dtp->fmt) in lpfc_debugfs_nvmeio_trc_data()
1657 len += scnprintf(buf + len, size - len, dtp->fmt, in lpfc_debugfs_nvmeio_trc_data()
1658 dtp->data1, dtp->data2, dtp->data3); in lpfc_debugfs_nvmeio_trc_data()
1660 if (phba->nvmeio_trc_output_idx >= phba->nvmeio_trc_size) { in lpfc_debugfs_nvmeio_trc_data()
1661 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_nvmeio_trc_data()
1662 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmeio_trc_data()
1667 if (len >= (size - LPFC_DEBUG_OUT_LINE_SZ)) { in lpfc_debugfs_nvmeio_trc_data()
1668 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmeio_trc_data()
1670 phba->nvmeio_trc_output_idx, in lpfc_debugfs_nvmeio_trc_data()
1671 phba->nvmeio_trc_size); in lpfc_debugfs_nvmeio_trc_data()
1676 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmeio_trc_data()
1683 * lpfc_debugfs_hdwqstat_data - Dump I/O stats to a buffer
1698 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_hdwqstat_data()
1711 (phba->hdwqstat_on & in lpfc_debugfs_hdwqstat_data()
1718 (phba->hdwqstat_on & LPFC_CHECK_SCSI_IO ? in lpfc_debugfs_hdwqstat_data()
1727 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_debugfs_hdwqstat_data()
1733 c_stat = per_cpu_ptr(phba->sli4_hba.c_stat, j); in lpfc_debugfs_hdwqstat_data()
1736 if (i != c_stat->hdwq_no) in lpfc_debugfs_hdwqstat_data()
1739 /* Only display non-zero counters */ in lpfc_debugfs_hdwqstat_data()
1740 if (!c_stat->xmt_io && !c_stat->cmpl_io && in lpfc_debugfs_hdwqstat_data()
1741 !c_stat->rcv_io) in lpfc_debugfs_hdwqstat_data()
1751 tot_xmt += c_stat->xmt_io; in lpfc_debugfs_hdwqstat_data()
1752 tot_cmpl += c_stat->cmpl_io; in lpfc_debugfs_hdwqstat_data()
1753 if (phba->nvmet_support) in lpfc_debugfs_hdwqstat_data()
1754 tot_rcv += c_stat->rcv_io; in lpfc_debugfs_hdwqstat_data()
1760 if (phba->nvmet_support) { in lpfc_debugfs_hdwqstat_data()
1763 c_stat->xmt_io, c_stat->cmpl_io, in lpfc_debugfs_hdwqstat_data()
1764 c_stat->rcv_io); in lpfc_debugfs_hdwqstat_data()
1770 c_stat->xmt_io, c_stat->cmpl_io); in lpfc_debugfs_hdwqstat_data()
1780 scnprintf(tmp, sizeof(tmp), "\t->\t[HDWQ Total: "); in lpfc_debugfs_hdwqstat_data()
1784 if (phba->nvmet_support) { in lpfc_debugfs_hdwqstat_data()
1807 * lpfc_debugfs_disc_trc - Store discovery trace log
1834 !vport || !vport->disc_trc) in lpfc_debugfs_disc_trc()
1837 index = atomic_inc_return(&vport->disc_trc_cnt) & in lpfc_debugfs_disc_trc()
1838 (lpfc_debugfs_max_disc_trc - 1); in lpfc_debugfs_disc_trc()
1839 dtp = vport->disc_trc + index; in lpfc_debugfs_disc_trc()
1840 dtp->fmt = fmt; in lpfc_debugfs_disc_trc()
1841 dtp->data1 = data1; in lpfc_debugfs_disc_trc()
1842 dtp->data2 = data2; in lpfc_debugfs_disc_trc()
1843 dtp->data3 = data3; in lpfc_debugfs_disc_trc()
1844 dtp->seq_cnt = atomic_inc_return(&lpfc_debugfs_seq_trc_cnt); in lpfc_debugfs_disc_trc()
1845 dtp->jif = jiffies; in lpfc_debugfs_disc_trc()
1851 * lpfc_debugfs_slow_ring_trc - Store slow ring trace log
1872 !phba || !phba->slow_ring_trc) in lpfc_debugfs_slow_ring_trc()
1875 index = atomic_inc_return(&phba->slow_ring_trc_cnt) & in lpfc_debugfs_slow_ring_trc()
1876 (lpfc_debugfs_max_slow_ring_trc - 1); in lpfc_debugfs_slow_ring_trc()
1877 dtp = phba->slow_ring_trc + index; in lpfc_debugfs_slow_ring_trc()
1878 dtp->fmt = fmt; in lpfc_debugfs_slow_ring_trc()
1879 dtp->data1 = data1; in lpfc_debugfs_slow_ring_trc()
1880 dtp->data2 = data2; in lpfc_debugfs_slow_ring_trc()
1881 dtp->data3 = data3; in lpfc_debugfs_slow_ring_trc()
1882 dtp->seq_cnt = atomic_inc_return(&lpfc_debugfs_seq_trc_cnt); in lpfc_debugfs_slow_ring_trc()
1883 dtp->jif = jiffies; in lpfc_debugfs_slow_ring_trc()
1889 * lpfc_debugfs_nvme_trc - Store NVME/NVMET trace log
1909 if (!phba->nvmeio_trc_on || !phba->nvmeio_trc) in lpfc_debugfs_nvme_trc()
1912 index = atomic_inc_return(&phba->nvmeio_trc_cnt) & in lpfc_debugfs_nvme_trc()
1913 (phba->nvmeio_trc_size - 1); in lpfc_debugfs_nvme_trc()
1914 dtp = phba->nvmeio_trc + index; in lpfc_debugfs_nvme_trc()
1915 dtp->fmt = fmt; in lpfc_debugfs_nvme_trc()
1916 dtp->data1 = data1; in lpfc_debugfs_nvme_trc()
1917 dtp->data2 = data2; in lpfc_debugfs_nvme_trc()
1918 dtp->data3 = data3; in lpfc_debugfs_nvme_trc()
1924 * lpfc_debugfs_disc_trc_open - Open the discovery trace log
1931 * for the log, fills the buffer from the in-memory log for this vport, and then
1941 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_disc_trc_open()
1944 int rc = -ENOMEM; in lpfc_debugfs_disc_trc_open()
1947 rc = -ENOSPC; in lpfc_debugfs_disc_trc_open()
1959 debug->buffer = kmalloc(size, GFP_KERNEL); in lpfc_debugfs_disc_trc_open()
1960 if (!debug->buffer) { in lpfc_debugfs_disc_trc_open()
1965 debug->len = lpfc_debugfs_disc_trc_data(vport, debug->buffer, size); in lpfc_debugfs_disc_trc_open()
1966 file->private_data = debug; in lpfc_debugfs_disc_trc_open()
1974 * lpfc_debugfs_slow_ring_trc_open - Open the Slow Ring trace log
1981 * for the log, fills the buffer from the in-memory log for this vport, and then
1991 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_slow_ring_trc_open()
1994 int rc = -ENOMEM; in lpfc_debugfs_slow_ring_trc_open()
1997 rc = -ENOSPC; in lpfc_debugfs_slow_ring_trc_open()
2009 debug->buffer = kmalloc(size, GFP_KERNEL); in lpfc_debugfs_slow_ring_trc_open()
2010 if (!debug->buffer) { in lpfc_debugfs_slow_ring_trc_open()
2015 debug->len = lpfc_debugfs_slow_ring_trc_data(phba, debug->buffer, size); in lpfc_debugfs_slow_ring_trc_open()
2016 file->private_data = debug; in lpfc_debugfs_slow_ring_trc_open()
2024 * lpfc_debugfs_hbqinfo_open - Open the hbqinfo debugfs buffer
2031 * for the log, fills the buffer from the in-memory log for this vport, and then
2041 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_hbqinfo_open()
2043 int rc = -ENOMEM; in lpfc_debugfs_hbqinfo_open()
2050 debug->buffer = kmalloc(LPFC_HBQINFO_SIZE, GFP_KERNEL); in lpfc_debugfs_hbqinfo_open()
2051 if (!debug->buffer) { in lpfc_debugfs_hbqinfo_open()
2056 debug->len = lpfc_debugfs_hbqinfo_data(phba, debug->buffer, in lpfc_debugfs_hbqinfo_open()
2058 file->private_data = debug; in lpfc_debugfs_hbqinfo_open()
2066 * lpfc_debugfs_multixripools_open - Open the multixripool debugfs buffer
2073 * for the log, fills the buffer from the in-memory log for this hba, and then
2083 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_multixripools_open()
2085 int rc = -ENOMEM; in lpfc_debugfs_multixripools_open()
2092 debug->buffer = kzalloc(LPFC_DUMP_MULTIXRIPOOL_SIZE, GFP_KERNEL); in lpfc_debugfs_multixripools_open()
2093 if (!debug->buffer) { in lpfc_debugfs_multixripools_open()
2098 debug->len = lpfc_debugfs_multixripools_data( in lpfc_debugfs_multixripools_open()
2099 phba, debug->buffer, LPFC_DUMP_MULTIXRIPOOL_SIZE); in lpfc_debugfs_multixripools_open()
2101 debug->i_private = inode->i_private; in lpfc_debugfs_multixripools_open()
2102 file->private_data = debug; in lpfc_debugfs_multixripools_open()
2111 * lpfc_debugfs_lockstat_open - Open the lockstat debugfs buffer
2118 * for the log, fills the buffer from the in-memory log for this vport, and then
2128 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_lockstat_open()
2130 int rc = -ENOMEM; in lpfc_debugfs_lockstat_open()
2137 debug->buffer = kmalloc(LPFC_HDWQINFO_SIZE, GFP_KERNEL); in lpfc_debugfs_lockstat_open()
2138 if (!debug->buffer) { in lpfc_debugfs_lockstat_open()
2143 debug->len = lpfc_debugfs_lockstat_data(phba, debug->buffer, in lpfc_debugfs_lockstat_open()
2145 file->private_data = debug; in lpfc_debugfs_lockstat_open()
2156 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_lockstat_write()
2157 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_debugfs_lockstat_write()
2166 return -EFAULT; in lpfc_debugfs_lockstat_write()
2171 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_debugfs_lockstat_write()
2172 qp = &phba->sli4_hba.hdwq[i]; in lpfc_debugfs_lockstat_write()
2173 qp->lock_conflict.alloc_xri_get = 0; in lpfc_debugfs_lockstat_write()
2174 qp->lock_conflict.alloc_xri_put = 0; in lpfc_debugfs_lockstat_write()
2175 qp->lock_conflict.free_xri = 0; in lpfc_debugfs_lockstat_write()
2176 qp->lock_conflict.wq_access = 0; in lpfc_debugfs_lockstat_write()
2177 qp->lock_conflict.alloc_pvt_pool = 0; in lpfc_debugfs_lockstat_write()
2178 qp->lock_conflict.mv_from_pvt_pool = 0; in lpfc_debugfs_lockstat_write()
2179 qp->lock_conflict.mv_to_pub_pool = 0; in lpfc_debugfs_lockstat_write()
2180 qp->lock_conflict.mv_to_pvt_pool = 0; in lpfc_debugfs_lockstat_write()
2181 qp->lock_conflict.free_pvt_pool = 0; in lpfc_debugfs_lockstat_write()
2182 qp->lock_conflict.free_pub_pool = 0; in lpfc_debugfs_lockstat_write()
2183 qp->lock_conflict.wq_access = 0; in lpfc_debugfs_lockstat_write()
2198 spin_lock_irq(&phba->hbalock); in lpfc_debugfs_ras_log_data()
2199 if (phba->ras_fwlog.state != ACTIVE) { in lpfc_debugfs_ras_log_data()
2200 spin_unlock_irq(&phba->hbalock); in lpfc_debugfs_ras_log_data()
2201 return -EINVAL; in lpfc_debugfs_ras_log_data()
2203 spin_unlock_irq(&phba->hbalock); in lpfc_debugfs_ras_log_data()
2206 &phba->ras_fwlog.fwlog_buff_list, list) { in lpfc_debugfs_ras_log_data()
2208 if ((copied + LPFC_RAS_MAX_ENTRY_SIZE) >= (size - 1)) { in lpfc_debugfs_ras_log_data()
2209 memcpy(buffer + copied, dmabuf->virt, in lpfc_debugfs_ras_log_data()
2210 size - copied - 1); in lpfc_debugfs_ras_log_data()
2211 copied += size - copied - 1; in lpfc_debugfs_ras_log_data()
2214 memcpy(buffer + copied, dmabuf->virt, LPFC_RAS_MAX_ENTRY_SIZE); in lpfc_debugfs_ras_log_data()
2223 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_ras_log_release()
2225 vfree(debug->buffer); in lpfc_debugfs_ras_log_release()
2232 * lpfc_debugfs_ras_log_open - Open the RAS log debugfs buffer
2239 * for the log, fills the buffer from the in-memory log for this vport, and then
2249 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_ras_log_open()
2252 int rc = -ENOMEM; in lpfc_debugfs_ras_log_open()
2254 spin_lock_irq(&phba->hbalock); in lpfc_debugfs_ras_log_open()
2255 if (phba->ras_fwlog.state != ACTIVE) { in lpfc_debugfs_ras_log_open()
2256 spin_unlock_irq(&phba->hbalock); in lpfc_debugfs_ras_log_open()
2257 rc = -EINVAL; in lpfc_debugfs_ras_log_open()
2260 spin_unlock_irq(&phba->hbalock); in lpfc_debugfs_ras_log_open()
2265 size = LPFC_RAS_MIN_BUFF_POST_SIZE * phba->cfg_ras_fwlog_buffsize; in lpfc_debugfs_ras_log_open()
2266 debug->buffer = vmalloc(size); in lpfc_debugfs_ras_log_open()
2267 if (!debug->buffer) in lpfc_debugfs_ras_log_open()
2270 debug->len = lpfc_debugfs_ras_log_data(phba, debug->buffer, size); in lpfc_debugfs_ras_log_open()
2271 if (debug->len < 0) { in lpfc_debugfs_ras_log_open()
2272 rc = -EINVAL; in lpfc_debugfs_ras_log_open()
2275 file->private_data = debug; in lpfc_debugfs_ras_log_open()
2280 vfree(debug->buffer); in lpfc_debugfs_ras_log_open()
2288 * lpfc_debugfs_dumpHBASlim_open - Open the Dump HBA SLIM debugfs buffer
2295 * for the log, fills the buffer from the in-memory log for this vport, and then
2305 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_dumpHBASlim_open()
2307 int rc = -ENOMEM; in lpfc_debugfs_dumpHBASlim_open()
2314 debug->buffer = kmalloc(LPFC_DUMPHBASLIM_SIZE, GFP_KERNEL); in lpfc_debugfs_dumpHBASlim_open()
2315 if (!debug->buffer) { in lpfc_debugfs_dumpHBASlim_open()
2320 debug->len = lpfc_debugfs_dumpHBASlim_data(phba, debug->buffer, in lpfc_debugfs_dumpHBASlim_open()
2322 file->private_data = debug; in lpfc_debugfs_dumpHBASlim_open()
2330 * lpfc_debugfs_dumpHostSlim_open - Open the Dump Host SLIM debugfs buffer
2337 * for the log, fills the buffer from the in-memory log for this vport, and then
2347 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_dumpHostSlim_open()
2349 int rc = -ENOMEM; in lpfc_debugfs_dumpHostSlim_open()
2356 debug->buffer = kmalloc(LPFC_DUMPHOSTSLIM_SIZE, GFP_KERNEL); in lpfc_debugfs_dumpHostSlim_open()
2357 if (!debug->buffer) { in lpfc_debugfs_dumpHostSlim_open()
2362 debug->len = lpfc_debugfs_dumpHostSlim_data(phba, debug->buffer, in lpfc_debugfs_dumpHostSlim_open()
2364 file->private_data = debug; in lpfc_debugfs_dumpHostSlim_open()
2375 struct dentry *dent = file->f_path.dentry; in lpfc_debugfs_dif_err_read()
2376 struct lpfc_hba *phba = file->private_data; in lpfc_debugfs_dif_err_read()
2381 if (dent == phba->debug_writeGuard) in lpfc_debugfs_dif_err_read()
2382 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_wgrd_cnt); in lpfc_debugfs_dif_err_read()
2383 else if (dent == phba->debug_writeApp) in lpfc_debugfs_dif_err_read()
2384 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_wapp_cnt); in lpfc_debugfs_dif_err_read()
2385 else if (dent == phba->debug_writeRef) in lpfc_debugfs_dif_err_read()
2386 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_wref_cnt); in lpfc_debugfs_dif_err_read()
2387 else if (dent == phba->debug_readGuard) in lpfc_debugfs_dif_err_read()
2388 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_rgrd_cnt); in lpfc_debugfs_dif_err_read()
2389 else if (dent == phba->debug_readApp) in lpfc_debugfs_dif_err_read()
2390 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_rapp_cnt); in lpfc_debugfs_dif_err_read()
2391 else if (dent == phba->debug_readRef) in lpfc_debugfs_dif_err_read()
2392 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_rref_cnt); in lpfc_debugfs_dif_err_read()
2393 else if (dent == phba->debug_InjErrNPortID) in lpfc_debugfs_dif_err_read()
2395 phba->lpfc_injerr_nportid); in lpfc_debugfs_dif_err_read()
2396 else if (dent == phba->debug_InjErrWWPN) { in lpfc_debugfs_dif_err_read()
2397 memcpy(&tmp, &phba->lpfc_injerr_wwpn, sizeof(struct lpfc_name)); in lpfc_debugfs_dif_err_read()
2400 } else if (dent == phba->debug_InjErrLBA) { in lpfc_debugfs_dif_err_read()
2401 if (phba->lpfc_injerr_lba == (sector_t)(-1)) in lpfc_debugfs_dif_err_read()
2405 (uint64_t) phba->lpfc_injerr_lba); in lpfc_debugfs_dif_err_read()
2417 struct dentry *dent = file->f_path.dentry; in lpfc_debugfs_dif_err_write()
2418 struct lpfc_hba *phba = file->private_data; in lpfc_debugfs_dif_err_write()
2428 if (dent == phba->debug_InjErrLBA) { in lpfc_debugfs_dif_err_write()
2431 tmp = (uint64_t)(-1); in lpfc_debugfs_dif_err_write()
2437 if (dent == phba->debug_writeGuard) in lpfc_debugfs_dif_err_write()
2438 phba->lpfc_injerr_wgrd_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2439 else if (dent == phba->debug_writeApp) in lpfc_debugfs_dif_err_write()
2440 phba->lpfc_injerr_wapp_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2441 else if (dent == phba->debug_writeRef) in lpfc_debugfs_dif_err_write()
2442 phba->lpfc_injerr_wref_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2443 else if (dent == phba->debug_readGuard) in lpfc_debugfs_dif_err_write()
2444 phba->lpfc_injerr_rgrd_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2445 else if (dent == phba->debug_readApp) in lpfc_debugfs_dif_err_write()
2446 phba->lpfc_injerr_rapp_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2447 else if (dent == phba->debug_readRef) in lpfc_debugfs_dif_err_write()
2448 phba->lpfc_injerr_rref_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2449 else if (dent == phba->debug_InjErrLBA) in lpfc_debugfs_dif_err_write()
2450 phba->lpfc_injerr_lba = (sector_t)tmp; in lpfc_debugfs_dif_err_write()
2451 else if (dent == phba->debug_InjErrNPortID) in lpfc_debugfs_dif_err_write()
2452 phba->lpfc_injerr_nportid = (uint32_t)(tmp & Mask_DID); in lpfc_debugfs_dif_err_write()
2453 else if (dent == phba->debug_InjErrWWPN) { in lpfc_debugfs_dif_err_write()
2455 memcpy(&phba->lpfc_injerr_wwpn, &tmp, sizeof(struct lpfc_name)); in lpfc_debugfs_dif_err_write()
2470 * lpfc_debugfs_nodelist_open - Open the nodelist debugfs file
2477 * for the log, fills the buffer from the in-memory log for this vport, and then
2487 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_nodelist_open()
2489 int rc = -ENOMEM; in lpfc_debugfs_nodelist_open()
2496 debug->buffer = kmalloc(LPFC_NODELIST_SIZE, GFP_KERNEL); in lpfc_debugfs_nodelist_open()
2497 if (!debug->buffer) { in lpfc_debugfs_nodelist_open()
2502 debug->len = lpfc_debugfs_nodelist_data(vport, debug->buffer, in lpfc_debugfs_nodelist_open()
2504 file->private_data = debug; in lpfc_debugfs_nodelist_open()
2512 * lpfc_debugfs_lseek - Seek through a debugfs file
2531 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_lseek()
2532 return fixed_size_llseek(file, off, whence, debug->len); in lpfc_debugfs_lseek()
2536 * lpfc_debugfs_read - Read a debugfs file
2555 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_read()
2557 return simple_read_from_buffer(buf, nbytes, ppos, debug->buffer, in lpfc_debugfs_read()
2558 debug->len); in lpfc_debugfs_read()
2562 * lpfc_debugfs_release - Release the buffer used to store debugfs file data
2576 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_release()
2578 kfree(debug->buffer); in lpfc_debugfs_release()
2585 * lpfc_debugfs_multixripools_write - Clear multi-XRI pools statistics
2592 * This routine clears multi-XRI pools statistics when buf contains "clear".
2603 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_multixripools_write()
2604 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_debugfs_multixripools_write()
2618 return -EFAULT; in lpfc_debugfs_multixripools_write()
2622 hwq_count = phba->cfg_hdw_queue; in lpfc_debugfs_multixripools_write()
2624 qp = &phba->sli4_hba.hdwq[i]; in lpfc_debugfs_multixripools_write()
2625 multixri_pool = qp->p_multixri_pool; in lpfc_debugfs_multixripools_write()
2629 qp->empty_io_bufs = 0; in lpfc_debugfs_multixripools_write()
2630 multixri_pool->pbl_empty_count = 0; in lpfc_debugfs_multixripools_write()
2632 multixri_pool->above_limit_count = 0; in lpfc_debugfs_multixripools_write()
2633 multixri_pool->below_limit_count = 0; in lpfc_debugfs_multixripools_write()
2634 multixri_pool->stat_max_hwm = 0; in lpfc_debugfs_multixripools_write()
2635 multixri_pool->local_pbl_hit_count = 0; in lpfc_debugfs_multixripools_write()
2636 multixri_pool->other_pbl_hit_count = 0; in lpfc_debugfs_multixripools_write()
2638 multixri_pool->stat_pbl_count = 0; in lpfc_debugfs_multixripools_write()
2639 multixri_pool->stat_pvt_count = 0; in lpfc_debugfs_multixripools_write()
2640 multixri_pool->stat_busy_count = 0; in lpfc_debugfs_multixripools_write()
2641 multixri_pool->stat_snapshot_taken = 0; in lpfc_debugfs_multixripools_write()
2647 return -EINVAL; in lpfc_debugfs_multixripools_write()
2653 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_nvmestat_open()
2655 int rc = -ENOMEM; in lpfc_debugfs_nvmestat_open()
2662 debug->buffer = kmalloc(LPFC_NVMESTAT_SIZE, GFP_KERNEL); in lpfc_debugfs_nvmestat_open()
2663 if (!debug->buffer) { in lpfc_debugfs_nvmestat_open()
2668 debug->len = lpfc_debugfs_nvmestat_data(vport, debug->buffer, in lpfc_debugfs_nvmestat_open()
2671 debug->i_private = inode->i_private; in lpfc_debugfs_nvmestat_open()
2672 file->private_data = debug; in lpfc_debugfs_nvmestat_open()
2683 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_nvmestat_write()
2684 struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; in lpfc_debugfs_nvmestat_write()
2685 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_nvmestat_write()
2690 if (!phba->targetport) in lpfc_debugfs_nvmestat_write()
2691 return -ENXIO; in lpfc_debugfs_nvmestat_write()
2699 return -EFAULT; in lpfc_debugfs_nvmestat_write()
2702 tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private; in lpfc_debugfs_nvmestat_write()
2705 atomic_set(&tgtp->rcv_ls_req_in, 0); in lpfc_debugfs_nvmestat_write()
2706 atomic_set(&tgtp->rcv_ls_req_out, 0); in lpfc_debugfs_nvmestat_write()
2707 atomic_set(&tgtp->rcv_ls_req_drop, 0); in lpfc_debugfs_nvmestat_write()
2708 atomic_set(&tgtp->xmt_ls_abort, 0); in lpfc_debugfs_nvmestat_write()
2709 atomic_set(&tgtp->xmt_ls_abort_cmpl, 0); in lpfc_debugfs_nvmestat_write()
2710 atomic_set(&tgtp->xmt_ls_rsp, 0); in lpfc_debugfs_nvmestat_write()
2711 atomic_set(&tgtp->xmt_ls_drop, 0); in lpfc_debugfs_nvmestat_write()
2712 atomic_set(&tgtp->xmt_ls_rsp_error, 0); in lpfc_debugfs_nvmestat_write()
2713 atomic_set(&tgtp->xmt_ls_rsp_cmpl, 0); in lpfc_debugfs_nvmestat_write()
2715 atomic_set(&tgtp->rcv_fcp_cmd_in, 0); in lpfc_debugfs_nvmestat_write()
2716 atomic_set(&tgtp->rcv_fcp_cmd_out, 0); in lpfc_debugfs_nvmestat_write()
2717 atomic_set(&tgtp->rcv_fcp_cmd_drop, 0); in lpfc_debugfs_nvmestat_write()
2718 atomic_set(&tgtp->xmt_fcp_drop, 0); in lpfc_debugfs_nvmestat_write()
2719 atomic_set(&tgtp->xmt_fcp_read_rsp, 0); in lpfc_debugfs_nvmestat_write()
2720 atomic_set(&tgtp->xmt_fcp_read, 0); in lpfc_debugfs_nvmestat_write()
2721 atomic_set(&tgtp->xmt_fcp_write, 0); in lpfc_debugfs_nvmestat_write()
2722 atomic_set(&tgtp->xmt_fcp_rsp, 0); in lpfc_debugfs_nvmestat_write()
2723 atomic_set(&tgtp->xmt_fcp_release, 0); in lpfc_debugfs_nvmestat_write()
2724 atomic_set(&tgtp->xmt_fcp_rsp_cmpl, 0); in lpfc_debugfs_nvmestat_write()
2725 atomic_set(&tgtp->xmt_fcp_rsp_error, 0); in lpfc_debugfs_nvmestat_write()
2726 atomic_set(&tgtp->xmt_fcp_rsp_drop, 0); in lpfc_debugfs_nvmestat_write()
2728 atomic_set(&tgtp->xmt_fcp_abort, 0); in lpfc_debugfs_nvmestat_write()
2729 atomic_set(&tgtp->xmt_fcp_abort_cmpl, 0); in lpfc_debugfs_nvmestat_write()
2730 atomic_set(&tgtp->xmt_abort_sol, 0); in lpfc_debugfs_nvmestat_write()
2731 atomic_set(&tgtp->xmt_abort_unsol, 0); in lpfc_debugfs_nvmestat_write()
2732 atomic_set(&tgtp->xmt_abort_rsp, 0); in lpfc_debugfs_nvmestat_write()
2733 atomic_set(&tgtp->xmt_abort_rsp_error, 0); in lpfc_debugfs_nvmestat_write()
2741 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_scsistat_open()
2743 int rc = -ENOMEM; in lpfc_debugfs_scsistat_open()
2750 debug->buffer = kzalloc(LPFC_SCSISTAT_SIZE, GFP_KERNEL); in lpfc_debugfs_scsistat_open()
2751 if (!debug->buffer) { in lpfc_debugfs_scsistat_open()
2756 debug->len = lpfc_debugfs_scsistat_data(vport, debug->buffer, in lpfc_debugfs_scsistat_open()
2759 debug->i_private = inode->i_private; in lpfc_debugfs_scsistat_open()
2760 file->private_data = debug; in lpfc_debugfs_scsistat_open()
2771 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_scsistat_write()
2772 struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; in lpfc_debugfs_scsistat_write()
2773 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_scsistat_write()
2778 (sizeof(mybuf) - 1) : nbytes)) in lpfc_debugfs_scsistat_write()
2779 return -EFAULT; in lpfc_debugfs_scsistat_write()
2783 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_debugfs_scsistat_write()
2784 memset(&phba->sli4_hba.hdwq[i].scsi_cstat, 0, in lpfc_debugfs_scsistat_write()
2785 sizeof(phba->sli4_hba.hdwq[i].scsi_cstat)); in lpfc_debugfs_scsistat_write()
2795 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_ioktime_open()
2797 int rc = -ENOMEM; in lpfc_debugfs_ioktime_open()
2804 debug->buffer = kmalloc(LPFC_IOKTIME_SIZE, GFP_KERNEL); in lpfc_debugfs_ioktime_open()
2805 if (!debug->buffer) { in lpfc_debugfs_ioktime_open()
2810 debug->len = lpfc_debugfs_ioktime_data(vport, debug->buffer, in lpfc_debugfs_ioktime_open()
2813 debug->i_private = inode->i_private; in lpfc_debugfs_ioktime_open()
2814 file->private_data = debug; in lpfc_debugfs_ioktime_open()
2825 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_ioktime_write()
2826 struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; in lpfc_debugfs_ioktime_write()
2827 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_ioktime_write()
2837 return -EFAULT; in lpfc_debugfs_ioktime_write()
2840 if ((strncmp(pbuf, "on", sizeof("on") - 1) == 0)) { in lpfc_debugfs_ioktime_write()
2841 phba->ktime_data_samples = 0; in lpfc_debugfs_ioktime_write()
2842 phba->ktime_status_samples = 0; in lpfc_debugfs_ioktime_write()
2843 phba->ktime_seg1_total = 0; in lpfc_debugfs_ioktime_write()
2844 phba->ktime_seg1_max = 0; in lpfc_debugfs_ioktime_write()
2845 phba->ktime_seg1_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2846 phba->ktime_seg2_total = 0; in lpfc_debugfs_ioktime_write()
2847 phba->ktime_seg2_max = 0; in lpfc_debugfs_ioktime_write()
2848 phba->ktime_seg2_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2849 phba->ktime_seg3_total = 0; in lpfc_debugfs_ioktime_write()
2850 phba->ktime_seg3_max = 0; in lpfc_debugfs_ioktime_write()
2851 phba->ktime_seg3_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2852 phba->ktime_seg4_total = 0; in lpfc_debugfs_ioktime_write()
2853 phba->ktime_seg4_max = 0; in lpfc_debugfs_ioktime_write()
2854 phba->ktime_seg4_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2855 phba->ktime_seg5_total = 0; in lpfc_debugfs_ioktime_write()
2856 phba->ktime_seg5_max = 0; in lpfc_debugfs_ioktime_write()
2857 phba->ktime_seg5_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2858 phba->ktime_seg6_total = 0; in lpfc_debugfs_ioktime_write()
2859 phba->ktime_seg6_max = 0; in lpfc_debugfs_ioktime_write()
2860 phba->ktime_seg6_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2861 phba->ktime_seg7_total = 0; in lpfc_debugfs_ioktime_write()
2862 phba->ktime_seg7_max = 0; in lpfc_debugfs_ioktime_write()
2863 phba->ktime_seg7_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2864 phba->ktime_seg8_total = 0; in lpfc_debugfs_ioktime_write()
2865 phba->ktime_seg8_max = 0; in lpfc_debugfs_ioktime_write()
2866 phba->ktime_seg8_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2867 phba->ktime_seg9_total = 0; in lpfc_debugfs_ioktime_write()
2868 phba->ktime_seg9_max = 0; in lpfc_debugfs_ioktime_write()
2869 phba->ktime_seg9_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2870 phba->ktime_seg10_total = 0; in lpfc_debugfs_ioktime_write()
2871 phba->ktime_seg10_max = 0; in lpfc_debugfs_ioktime_write()
2872 phba->ktime_seg10_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2874 phba->ktime_on = 1; in lpfc_debugfs_ioktime_write()
2877 sizeof("off") - 1) == 0)) { in lpfc_debugfs_ioktime_write()
2878 phba->ktime_on = 0; in lpfc_debugfs_ioktime_write()
2881 sizeof("zero") - 1) == 0)) { in lpfc_debugfs_ioktime_write()
2882 phba->ktime_data_samples = 0; in lpfc_debugfs_ioktime_write()
2883 phba->ktime_status_samples = 0; in lpfc_debugfs_ioktime_write()
2884 phba->ktime_seg1_total = 0; in lpfc_debugfs_ioktime_write()
2885 phba->ktime_seg1_max = 0; in lpfc_debugfs_ioktime_write()
2886 phba->ktime_seg1_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2887 phba->ktime_seg2_total = 0; in lpfc_debugfs_ioktime_write()
2888 phba->ktime_seg2_max = 0; in lpfc_debugfs_ioktime_write()
2889 phba->ktime_seg2_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2890 phba->ktime_seg3_total = 0; in lpfc_debugfs_ioktime_write()
2891 phba->ktime_seg3_max = 0; in lpfc_debugfs_ioktime_write()
2892 phba->ktime_seg3_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2893 phba->ktime_seg4_total = 0; in lpfc_debugfs_ioktime_write()
2894 phba->ktime_seg4_max = 0; in lpfc_debugfs_ioktime_write()
2895 phba->ktime_seg4_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2896 phba->ktime_seg5_total = 0; in lpfc_debugfs_ioktime_write()
2897 phba->ktime_seg5_max = 0; in lpfc_debugfs_ioktime_write()
2898 phba->ktime_seg5_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2899 phba->ktime_seg6_total = 0; in lpfc_debugfs_ioktime_write()
2900 phba->ktime_seg6_max = 0; in lpfc_debugfs_ioktime_write()
2901 phba->ktime_seg6_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2902 phba->ktime_seg7_total = 0; in lpfc_debugfs_ioktime_write()
2903 phba->ktime_seg7_max = 0; in lpfc_debugfs_ioktime_write()
2904 phba->ktime_seg7_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2905 phba->ktime_seg8_total = 0; in lpfc_debugfs_ioktime_write()
2906 phba->ktime_seg8_max = 0; in lpfc_debugfs_ioktime_write()
2907 phba->ktime_seg8_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2908 phba->ktime_seg9_total = 0; in lpfc_debugfs_ioktime_write()
2909 phba->ktime_seg9_max = 0; in lpfc_debugfs_ioktime_write()
2910 phba->ktime_seg9_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2911 phba->ktime_seg10_total = 0; in lpfc_debugfs_ioktime_write()
2912 phba->ktime_seg10_max = 0; in lpfc_debugfs_ioktime_write()
2913 phba->ktime_seg10_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2916 return -EINVAL; in lpfc_debugfs_ioktime_write()
2922 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_nvmeio_trc_open()
2924 int rc = -ENOMEM; in lpfc_debugfs_nvmeio_trc_open()
2931 debug->buffer = kmalloc(LPFC_NVMEIO_TRC_SIZE, GFP_KERNEL); in lpfc_debugfs_nvmeio_trc_open()
2932 if (!debug->buffer) { in lpfc_debugfs_nvmeio_trc_open()
2937 debug->len = lpfc_debugfs_nvmeio_trc_data(phba, debug->buffer, in lpfc_debugfs_nvmeio_trc_open()
2940 debug->i_private = inode->i_private; in lpfc_debugfs_nvmeio_trc_open()
2941 file->private_data = debug; in lpfc_debugfs_nvmeio_trc_open()
2952 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_nvmeio_trc_write()
2953 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_debugfs_nvmeio_trc_write()
2965 return -EFAULT; in lpfc_debugfs_nvmeio_trc_write()
2968 if ((strncmp(pbuf, "off", sizeof("off") - 1) == 0)) { in lpfc_debugfs_nvmeio_trc_write()
2971 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_nvmeio_trc_write()
2972 phba->nvmeio_trc_on = 0; in lpfc_debugfs_nvmeio_trc_write()
2974 } else if ((strncmp(pbuf, "on", sizeof("on") - 1) == 0)) { in lpfc_debugfs_nvmeio_trc_write()
2977 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_nvmeio_trc_write()
2978 phba->nvmeio_trc_on = 1; in lpfc_debugfs_nvmeio_trc_write()
2983 if (phba->nvmeio_trc_on != 0) in lpfc_debugfs_nvmeio_trc_write()
2984 return -EINVAL; in lpfc_debugfs_nvmeio_trc_write()
2989 return -EINVAL; in lpfc_debugfs_nvmeio_trc_write()
2990 phba->nvmeio_trc_size = (uint32_t)sz; in lpfc_debugfs_nvmeio_trc_write()
2992 /* It must be a power of 2 - round down */ in lpfc_debugfs_nvmeio_trc_write()
2999 if (phba->nvmeio_trc_size != sz) in lpfc_debugfs_nvmeio_trc_write()
3003 phba->nvmeio_trc_size = (uint32_t)sz; in lpfc_debugfs_nvmeio_trc_write()
3006 kfree(phba->nvmeio_trc); in lpfc_debugfs_nvmeio_trc_write()
3009 phba->nvmeio_trc = kzalloc((sizeof(struct lpfc_debugfs_nvmeio_trc) * in lpfc_debugfs_nvmeio_trc_write()
3011 if (!phba->nvmeio_trc) { in lpfc_debugfs_nvmeio_trc_write()
3015 return -ENOMEM; in lpfc_debugfs_nvmeio_trc_write()
3017 atomic_set(&phba->nvmeio_trc_cnt, 0); in lpfc_debugfs_nvmeio_trc_write()
3018 phba->nvmeio_trc_on = 0; in lpfc_debugfs_nvmeio_trc_write()
3019 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_nvmeio_trc_write()
3027 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_hdwqstat_open()
3029 int rc = -ENOMEM; in lpfc_debugfs_hdwqstat_open()
3036 debug->buffer = kcalloc(1, LPFC_SCSISTAT_SIZE, GFP_KERNEL); in lpfc_debugfs_hdwqstat_open()
3037 if (!debug->buffer) { in lpfc_debugfs_hdwqstat_open()
3042 debug->len = lpfc_debugfs_hdwqstat_data(vport, debug->buffer, in lpfc_debugfs_hdwqstat_open()
3045 debug->i_private = inode->i_private; in lpfc_debugfs_hdwqstat_open()
3046 file->private_data = debug; in lpfc_debugfs_hdwqstat_open()
3057 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_hdwqstat_write()
3058 struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; in lpfc_debugfs_hdwqstat_write()
3059 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_hdwqstat_write()
3071 return -EFAULT; in lpfc_debugfs_hdwqstat_write()
3074 if ((strncmp(pbuf, "on", sizeof("on") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3075 if (phba->nvmet_support) in lpfc_debugfs_hdwqstat_write()
3076 phba->hdwqstat_on |= LPFC_CHECK_NVMET_IO; in lpfc_debugfs_hdwqstat_write()
3078 phba->hdwqstat_on |= (LPFC_CHECK_NVME_IO | in lpfc_debugfs_hdwqstat_write()
3081 } else if ((strncmp(pbuf, "nvme_on", sizeof("nvme_on") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3082 if (phba->nvmet_support) in lpfc_debugfs_hdwqstat_write()
3083 phba->hdwqstat_on |= LPFC_CHECK_NVMET_IO; in lpfc_debugfs_hdwqstat_write()
3085 phba->hdwqstat_on |= LPFC_CHECK_NVME_IO; in lpfc_debugfs_hdwqstat_write()
3087 } else if ((strncmp(pbuf, "scsi_on", sizeof("scsi_on") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3088 if (!phba->nvmet_support) in lpfc_debugfs_hdwqstat_write()
3089 phba->hdwqstat_on |= LPFC_CHECK_SCSI_IO; in lpfc_debugfs_hdwqstat_write()
3091 } else if ((strncmp(pbuf, "nvme_off", sizeof("nvme_off") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3092 phba->hdwqstat_on &= ~(LPFC_CHECK_NVME_IO | in lpfc_debugfs_hdwqstat_write()
3095 } else if ((strncmp(pbuf, "scsi_off", sizeof("scsi_off") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3096 phba->hdwqstat_on &= ~LPFC_CHECK_SCSI_IO; in lpfc_debugfs_hdwqstat_write()
3099 sizeof("off") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3100 phba->hdwqstat_on = LPFC_CHECK_OFF; in lpfc_debugfs_hdwqstat_write()
3103 sizeof("zero") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3105 c_stat = per_cpu_ptr(phba->sli4_hba.c_stat, i); in lpfc_debugfs_hdwqstat_write()
3106 c_stat->xmt_io = 0; in lpfc_debugfs_hdwqstat_write()
3107 c_stat->cmpl_io = 0; in lpfc_debugfs_hdwqstat_write()
3108 c_stat->rcv_io = 0; in lpfc_debugfs_hdwqstat_write()
3112 return -EINVAL; in lpfc_debugfs_hdwqstat_write()
3116 * ---------------------------------
3118 * ---------------------------------
3127 * lpfc_idiag_cmd_get - Get and parse idiag debugfs comands from user space
3149 bsize = min(nbytes, (sizeof(mybuf)-1)); in lpfc_idiag_cmd_get()
3152 return -EFAULT; in lpfc_idiag_cmd_get()
3158 return -EINVAL; in lpfc_idiag_cmd_get()
3160 idiag_cmd->opcode = simple_strtol(step_str, NULL, 0); in lpfc_idiag_cmd_get()
3161 if (idiag_cmd->opcode == 0) in lpfc_idiag_cmd_get()
3162 return -EINVAL; in lpfc_idiag_cmd_get()
3168 idiag_cmd->data[i] = simple_strtol(step_str, NULL, 0); in lpfc_idiag_cmd_get()
3174 * lpfc_idiag_open - idiag open debugfs
3197 return -ENOMEM; in lpfc_idiag_open()
3199 debug->i_private = inode->i_private; in lpfc_idiag_open()
3200 debug->buffer = NULL; in lpfc_idiag_open()
3201 file->private_data = debug; in lpfc_idiag_open()
3207 * lpfc_idiag_release - Release idiag access file operation
3222 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_release()
3225 kfree(debug->buffer); in lpfc_idiag_release()
3232 * lpfc_idiag_cmd_release - Release idiag cmd access file operation
3247 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_cmd_release()
3249 if (debug->op == LPFC_IDIAG_OP_WR) { in lpfc_idiag_cmd_release()
3265 kfree(debug->buffer); in lpfc_idiag_cmd_release()
3272 * lpfc_idiag_pcicfg_read - idiag debugfs read pcicfg
3293 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_pcicfg_read()
3294 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_pcicfg_read()
3303 pdev = phba->pcidev; in lpfc_idiag_pcicfg_read()
3308 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_pcicfg_read()
3310 if (!debug->buffer) in lpfc_idiag_pcicfg_read()
3311 debug->buffer = kmalloc(LPFC_PCI_CFG_SIZE, GFP_KERNEL); in lpfc_idiag_pcicfg_read()
3312 if (!debug->buffer) in lpfc_idiag_pcicfg_read()
3314 pbuffer = debug->buffer; in lpfc_idiag_pcicfg_read()
3329 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3334 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3339 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3359 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3363 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3368 LPFC_PCI_CFG_SIZE-len, "\n"); in lpfc_idiag_pcicfg_read()
3371 index -= sizeof(uint32_t); in lpfc_idiag_pcicfg_read()
3373 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3377 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3394 * lpfc_idiag_pcicfg_write - Syntax check and set up idiag pcicfg commands
3415 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_pcicfg_write()
3416 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_pcicfg_write()
3424 pdev = phba->pcidev; in lpfc_idiag_pcicfg_write()
3426 return -EFAULT; in lpfc_idiag_pcicfg_write()
3429 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_pcicfg_write()
3452 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint8_t)) in lpfc_idiag_pcicfg_write()
3458 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint16_t)) in lpfc_idiag_pcicfg_write()
3464 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint32_t)) in lpfc_idiag_pcicfg_write()
3475 /* Write command to PCI config space, read-modify-write */ in lpfc_idiag_pcicfg_write()
3485 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint8_t)) in lpfc_idiag_pcicfg_write()
3510 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint16_t)) in lpfc_idiag_pcicfg_write()
3535 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint32_t)) in lpfc_idiag_pcicfg_write()
3567 return -EINVAL; in lpfc_idiag_pcicfg_write()
3571 * lpfc_idiag_baracc_read - idiag debugfs pci bar access read
3589 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_baracc_read()
3590 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_baracc_read()
3599 pdev = phba->pcidev; in lpfc_idiag_baracc_read()
3604 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_baracc_read()
3606 if (!debug->buffer) in lpfc_idiag_baracc_read()
3607 debug->buffer = kmalloc(LPFC_PCI_BAR_RD_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_baracc_read()
3608 if (!debug->buffer) in lpfc_idiag_baracc_read()
3610 pbuffer = debug->buffer; in lpfc_idiag_baracc_read()
3626 if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf); in lpfc_idiag_baracc_read()
3629 mem_mapped_bar = phba->sli4_hba.conf_regs_memmap_p; in lpfc_idiag_baracc_read()
3631 mem_mapped_bar = phba->sli4_hba.ctrl_regs_memmap_p; in lpfc_idiag_baracc_read()
3633 mem_mapped_bar = phba->sli4_hba.drbl_regs_memmap_p; in lpfc_idiag_baracc_read()
3638 mem_mapped_bar = phba->sli4_hba.conf_regs_memmap_p; in lpfc_idiag_baracc_read()
3648 len += scnprintf(pbuffer+len, LPFC_PCI_BAR_RD_BUF_SIZE-len, in lpfc_idiag_baracc_read()
3662 len += scnprintf(pbuffer+len, LPFC_PCI_BAR_RD_BUF_SIZE-len, in lpfc_idiag_baracc_read()
3667 len += scnprintf(pbuffer+len, LPFC_PCI_BAR_RD_BUF_SIZE-len, in lpfc_idiag_baracc_read()
3673 LPFC_PCI_BAR_RD_BUF_SIZE-len, "\n"); in lpfc_idiag_baracc_read()
3680 LPFC_PCI_BAR_RD_BUF_SIZE-len, "\n"); in lpfc_idiag_baracc_read()
3684 index -= sizeof(uint32_t); in lpfc_idiag_baracc_read()
3687 LPFC_PCI_BAR_RD_BUF_SIZE-len, "\n"); in lpfc_idiag_baracc_read()
3691 LPFC_PCI_BAR_RD_BUF_SIZE-len, in lpfc_idiag_baracc_read()
3718 * lpfc_idiag_baracc_write - Syntax check and set up idiag bar access commands
3740 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_baracc_write()
3741 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_baracc_write()
3749 pdev = phba->pcidev; in lpfc_idiag_baracc_write()
3751 return -EFAULT; in lpfc_idiag_baracc_write()
3754 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_baracc_write()
3760 if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf); in lpfc_idiag_baracc_write()
3778 mem_mapped_bar = phba->sli4_hba.conf_regs_memmap_p; in lpfc_idiag_baracc_write()
3782 mem_mapped_bar = phba->sli4_hba.ctrl_regs_memmap_p; in lpfc_idiag_baracc_write()
3786 mem_mapped_bar = phba->sli4_hba.drbl_regs_memmap_p; in lpfc_idiag_baracc_write()
3793 mem_mapped_bar = phba->sli4_hba.conf_regs_memmap_p; in lpfc_idiag_baracc_write()
3810 if (offset > bar_size - sizeof(uint32_t)) in lpfc_idiag_baracc_write()
3827 /* Write command to PCI bar space, read-modify-write */ in lpfc_idiag_baracc_write()
3853 return -EINVAL; in lpfc_idiag_baracc_write()
3863 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_wq()
3865 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_wq()
3866 "AssocCQID[%04d]: WQ-STAT[oflow:x%x posted:x%llx]\n", in __lpfc_idiag_print_wq()
3867 qp->assoc_qid, qp->q_cnt_1, in __lpfc_idiag_print_wq()
3868 (unsigned long long)qp->q_cnt_4); in __lpfc_idiag_print_wq()
3869 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_wq()
3870 "\t\tWQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_wq()
3871 "HST-IDX[%04d], PRT-IDX[%04d], NTFI[%03d]", in __lpfc_idiag_print_wq()
3872 qp->queue_id, qp->entry_count, in __lpfc_idiag_print_wq()
3873 qp->entry_size, qp->host_index, in __lpfc_idiag_print_wq()
3874 qp->hba_index, qp->notify_interval); in __lpfc_idiag_print_wq()
3876 LPFC_QUE_INFO_GET_BUF_SIZE - len, "\n"); in __lpfc_idiag_print_wq()
3887 for (qidx = 0; qidx < phba->cfg_hdw_queue; qidx++) { in lpfc_idiag_wqs_for_cq()
3888 qp = phba->sli4_hba.hdwq[qidx].io_wq; in lpfc_idiag_wqs_for_cq()
3889 if (qp->assoc_qid != cq_id) in lpfc_idiag_wqs_for_cq()
3905 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_cq()
3907 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_cq()
3910 qp->assoc_qid, qp->q_cnt_1, qp->q_cnt_2, in __lpfc_idiag_print_cq()
3911 qp->q_cnt_3, (unsigned long long)qp->q_cnt_4); in __lpfc_idiag_print_cq()
3912 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_cq()
3913 "\tCQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_cq()
3914 "HST-IDX[%04d], NTFI[%03d], PLMT[%03d]", in __lpfc_idiag_print_cq()
3915 qp->queue_id, qp->entry_count, in __lpfc_idiag_print_cq()
3916 qp->entry_size, qp->host_index, in __lpfc_idiag_print_cq()
3917 qp->notify_interval, qp->max_proc_limit); in __lpfc_idiag_print_cq()
3919 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_cq()
3932 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_rqpair()
3934 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_rqpair()
3935 "AssocCQID[%02d]: RQ-STAT[nopost:x%x nobuf:x%x " in __lpfc_idiag_print_rqpair()
3937 qp->assoc_qid, qp->q_cnt_1, qp->q_cnt_2, in __lpfc_idiag_print_rqpair()
3938 qp->q_cnt_3, (unsigned long long)qp->q_cnt_4); in __lpfc_idiag_print_rqpair()
3939 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_rqpair()
3940 "\t\tHQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_rqpair()
3941 "HST-IDX[%04d], PRT-IDX[%04d], NTFI[%03d]\n", in __lpfc_idiag_print_rqpair()
3942 qp->queue_id, qp->entry_count, qp->entry_size, in __lpfc_idiag_print_rqpair()
3943 qp->host_index, qp->hba_index, qp->notify_interval); in __lpfc_idiag_print_rqpair()
3944 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_rqpair()
3945 "\t\tDQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_rqpair()
3946 "HST-IDX[%04d], PRT-IDX[%04d], NTFI[%03d]\n", in __lpfc_idiag_print_rqpair()
3947 datqp->queue_id, datqp->entry_count, in __lpfc_idiag_print_rqpair()
3948 datqp->entry_size, datqp->host_index, in __lpfc_idiag_print_rqpair()
3949 datqp->hba_index, datqp->notify_interval); in __lpfc_idiag_print_rqpair()
3960 qp = phba->sli4_hba.hdwq[eqidx].io_cq; in lpfc_idiag_cqs_for_eq()
3965 qp->CQ_max_cqe = 0; in lpfc_idiag_cqs_for_eq()
3971 max_cnt, qp->queue_id); in lpfc_idiag_cqs_for_eq()
3975 if ((eqidx < phba->cfg_nvmet_mrq) && phba->nvmet_support) { in lpfc_idiag_cqs_for_eq()
3977 qp = phba->sli4_hba.nvmet_cqset[eqidx]; in lpfc_idiag_cqs_for_eq()
3981 qp->CQ_max_cqe = 0; in lpfc_idiag_cqs_for_eq()
3987 qp = phba->sli4_hba.nvmet_mrq_hdr[eqidx]; in lpfc_idiag_cqs_for_eq()
3989 phba->sli4_hba.nvmet_mrq_data[eqidx], in lpfc_idiag_cqs_for_eq()
4006 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_eq()
4007 "\n%s EQ info: EQ-STAT[max:x%x noE:x%x " in __lpfc_idiag_print_eq()
4009 eqtype, qp->q_cnt_1, qp->q_cnt_2, qp->q_cnt_3, in __lpfc_idiag_print_eq()
4010 (unsigned long long)qp->q_cnt_4, qp->q_mode); in __lpfc_idiag_print_eq()
4011 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_eq()
4012 "EQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_eq()
4013 "HST-IDX[%04d], NTFI[%03d], PLMT[%03d], AFFIN[%03d]", in __lpfc_idiag_print_eq()
4014 qp->queue_id, qp->entry_count, qp->entry_size, in __lpfc_idiag_print_eq()
4015 qp->host_index, qp->notify_interval, in __lpfc_idiag_print_eq()
4016 qp->max_proc_limit, qp->chann); in __lpfc_idiag_print_eq()
4017 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_eq()
4024 * lpfc_idiag_queinfo_read - idiag debugfs read queue information
4045 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_queinfo_read()
4046 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_queinfo_read()
4051 if (!debug->buffer) in lpfc_idiag_queinfo_read()
4052 debug->buffer = kmalloc(LPFC_QUE_INFO_GET_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_queinfo_read()
4053 if (!debug->buffer) in lpfc_idiag_queinfo_read()
4055 pbuffer = debug->buffer; in lpfc_idiag_queinfo_read()
4056 max_cnt = LPFC_QUE_INFO_GET_BUF_SIZE - 256; in lpfc_idiag_queinfo_read()
4061 spin_lock_irq(&phba->hbalock); in lpfc_idiag_queinfo_read()
4063 /* Fast-path event queue */ in lpfc_idiag_queinfo_read()
4064 if (phba->sli4_hba.hdwq && phba->cfg_hdw_queue) { in lpfc_idiag_queinfo_read()
4066 x = phba->lpfc_idiag_last_eq; in lpfc_idiag_queinfo_read()
4067 phba->lpfc_idiag_last_eq++; in lpfc_idiag_queinfo_read()
4068 if (phba->lpfc_idiag_last_eq >= phba->cfg_hdw_queue) in lpfc_idiag_queinfo_read()
4069 phba->lpfc_idiag_last_eq = 0; in lpfc_idiag_queinfo_read()
4072 LPFC_QUE_INFO_GET_BUF_SIZE - len, in lpfc_idiag_queinfo_read()
4074 x, phba->cfg_hdw_queue); in lpfc_idiag_queinfo_read()
4076 /* Fast-path EQ */ in lpfc_idiag_queinfo_read()
4077 qp = phba->sli4_hba.hdwq[x].hba_eq; in lpfc_idiag_queinfo_read()
4084 qp->EQ_max_eqe = 0; in lpfc_idiag_queinfo_read()
4091 max_cnt, x, qp->queue_id); in lpfc_idiag_queinfo_read()
4099 /* Slow-path mailbox CQ */ in lpfc_idiag_queinfo_read()
4100 qp = phba->sli4_hba.mbx_cq; in lpfc_idiag_queinfo_read()
4105 /* Slow-path MBOX MQ */ in lpfc_idiag_queinfo_read()
4106 qp = phba->sli4_hba.mbx_wq; in lpfc_idiag_queinfo_read()
4111 /* Slow-path ELS response CQ */ in lpfc_idiag_queinfo_read()
4112 qp = phba->sli4_hba.els_cq; in lpfc_idiag_queinfo_read()
4116 qp->CQ_max_cqe = 0; in lpfc_idiag_queinfo_read()
4120 /* Slow-path ELS WQ */ in lpfc_idiag_queinfo_read()
4121 qp = phba->sli4_hba.els_wq; in lpfc_idiag_queinfo_read()
4126 qp = phba->sli4_hba.hdr_rq; in lpfc_idiag_queinfo_read()
4127 len = __lpfc_idiag_print_rqpair(qp, phba->sli4_hba.dat_rq, in lpfc_idiag_queinfo_read()
4132 /* Slow-path NVME LS response CQ */ in lpfc_idiag_queinfo_read()
4133 qp = phba->sli4_hba.nvmels_cq; in lpfc_idiag_queinfo_read()
4138 qp->CQ_max_cqe = 0; in lpfc_idiag_queinfo_read()
4142 /* Slow-path NVME LS WQ */ in lpfc_idiag_queinfo_read()
4143 qp = phba->sli4_hba.nvmels_wq; in lpfc_idiag_queinfo_read()
4152 spin_unlock_irq(&phba->hbalock); in lpfc_idiag_queinfo_read()
4157 LPFC_QUE_INFO_GET_BUF_SIZE - len, "Truncated ...\n"); in lpfc_idiag_queinfo_read()
4159 spin_unlock_irq(&phba->hbalock); in lpfc_idiag_queinfo_read()
4164 * lpfc_idiag_que_param_check - queue access command parameter sanity check
4173 * This function returns -EINVAL when fails the sanity check, otherwise, it
4181 return -EINVAL; in lpfc_idiag_que_param_check()
4182 if (index > q->entry_count - 1) in lpfc_idiag_que_param_check()
4183 return -EINVAL; in lpfc_idiag_que_param_check()
4188 * lpfc_idiag_queacc_read_qe - read a single entry from the given queue index
4211 esize = pque->entry_size; in lpfc_idiag_queacc_read_qe()
4212 len += scnprintf(pbuffer+len, LPFC_QUE_ACC_BUF_SIZE-len, in lpfc_idiag_queacc_read_qe()
4213 "QE-INDEX[%04d]:\n", index); in lpfc_idiag_queacc_read_qe()
4218 len += scnprintf(pbuffer+len, LPFC_QUE_ACC_BUF_SIZE-len, in lpfc_idiag_queacc_read_qe()
4222 esize -= sizeof(uint32_t); in lpfc_idiag_queacc_read_qe()
4225 LPFC_QUE_ACC_BUF_SIZE-len, "\n"); in lpfc_idiag_queacc_read_qe()
4227 len += scnprintf(pbuffer+len, LPFC_QUE_ACC_BUF_SIZE-len, "\n"); in lpfc_idiag_queacc_read_qe()
4233 * lpfc_idiag_queacc_read - idiag debugfs read port queue
4253 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_queacc_read()
4260 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_queacc_read()
4262 if (!debug->buffer) in lpfc_idiag_queacc_read()
4263 debug->buffer = kmalloc(LPFC_QUE_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_queacc_read()
4264 if (!debug->buffer) in lpfc_idiag_queacc_read()
4266 pbuffer = debug->buffer; in lpfc_idiag_queacc_read()
4293 while (len < LPFC_QUE_ACC_SIZE - pque->entry_size) { in lpfc_idiag_queacc_read()
4296 if (index > pque->entry_count - 1) in lpfc_idiag_queacc_read()
4301 if (index > pque->entry_count - 1) in lpfc_idiag_queacc_read()
4309 * lpfc_idiag_queacc_write - Syntax check and set up idiag queacc commands
4330 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_queacc_write()
4331 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_queacc_write()
4338 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_queacc_write()
4369 if (phba->sli4_hba.hdwq) { in lpfc_idiag_queacc_write()
4370 for (qidx = 0; qidx < phba->cfg_hdw_queue; qidx++) { in lpfc_idiag_queacc_write()
4371 qp = phba->sli4_hba.hdwq[qidx].hba_eq; in lpfc_idiag_queacc_write()
4372 if (qp && qp->queue_id == queid) { in lpfc_idiag_queacc_write()
4387 if (phba->sli4_hba.mbx_cq && in lpfc_idiag_queacc_write()
4388 phba->sli4_hba.mbx_cq->queue_id == queid) { in lpfc_idiag_queacc_write()
4391 phba->sli4_hba.mbx_cq, index, count); in lpfc_idiag_queacc_write()
4394 idiag.ptr_private = phba->sli4_hba.mbx_cq; in lpfc_idiag_queacc_write()
4398 if (phba->sli4_hba.els_cq && in lpfc_idiag_queacc_write()
4399 phba->sli4_hba.els_cq->queue_id == queid) { in lpfc_idiag_queacc_write()
4402 phba->sli4_hba.els_cq, index, count); in lpfc_idiag_queacc_write()
4405 idiag.ptr_private = phba->sli4_hba.els_cq; in lpfc_idiag_queacc_write()
4409 if (phba->sli4_hba.nvmels_cq && in lpfc_idiag_queacc_write()
4410 phba->sli4_hba.nvmels_cq->queue_id == queid) { in lpfc_idiag_queacc_write()
4413 phba->sli4_hba.nvmels_cq, index, count); in lpfc_idiag_queacc_write()
4416 idiag.ptr_private = phba->sli4_hba.nvmels_cq; in lpfc_idiag_queacc_write()
4420 if (phba->sli4_hba.hdwq) { in lpfc_idiag_queacc_write()
4421 for (qidx = 0; qidx < phba->cfg_hdw_queue; in lpfc_idiag_queacc_write()
4423 qp = phba->sli4_hba.hdwq[qidx].io_cq; in lpfc_idiag_queacc_write()
4424 if (qp && qp->queue_id == queid) { in lpfc_idiag_queacc_write()
4439 if (phba->sli4_hba.mbx_wq && in lpfc_idiag_queacc_write()
4440 phba->sli4_hba.mbx_wq->queue_id == queid) { in lpfc_idiag_queacc_write()
4443 phba->sli4_hba.mbx_wq, index, count); in lpfc_idiag_queacc_write()
4446 idiag.ptr_private = phba->sli4_hba.mbx_wq; in lpfc_idiag_queacc_write()
4453 if (phba->sli4_hba.els_wq && in lpfc_idiag_queacc_write()
4454 phba->sli4_hba.els_wq->queue_id == queid) { in lpfc_idiag_queacc_write()
4457 phba->sli4_hba.els_wq, index, count); in lpfc_idiag_queacc_write()
4460 idiag.ptr_private = phba->sli4_hba.els_wq; in lpfc_idiag_queacc_write()
4464 if (phba->sli4_hba.nvmels_wq && in lpfc_idiag_queacc_write()
4465 phba->sli4_hba.nvmels_wq->queue_id == queid) { in lpfc_idiag_queacc_write()
4468 phba->sli4_hba.nvmels_wq, index, count); in lpfc_idiag_queacc_write()
4471 idiag.ptr_private = phba->sli4_hba.nvmels_wq; in lpfc_idiag_queacc_write()
4475 if (phba->sli4_hba.hdwq) { in lpfc_idiag_queacc_write()
4477 for (qidx = 0; qidx < phba->cfg_hdw_queue; qidx++) { in lpfc_idiag_queacc_write()
4478 qp = phba->sli4_hba.hdwq[qidx].io_wq; in lpfc_idiag_queacc_write()
4479 if (qp && qp->queue_id == queid) { in lpfc_idiag_queacc_write()
4495 if (phba->sli4_hba.hdr_rq && in lpfc_idiag_queacc_write()
4496 phba->sli4_hba.hdr_rq->queue_id == queid) { in lpfc_idiag_queacc_write()
4499 phba->sli4_hba.hdr_rq, index, count); in lpfc_idiag_queacc_write()
4502 idiag.ptr_private = phba->sli4_hba.hdr_rq; in lpfc_idiag_queacc_write()
4506 if (phba->sli4_hba.dat_rq && in lpfc_idiag_queacc_write()
4507 phba->sli4_hba.dat_rq->queue_id == queid) { in lpfc_idiag_queacc_write()
4510 phba->sli4_hba.dat_rq, index, count); in lpfc_idiag_queacc_write()
4513 idiag.ptr_private = phba->sli4_hba.dat_rq; in lpfc_idiag_queacc_write()
4535 if (offset > pque->entry_size/sizeof(uint32_t) - 1) in lpfc_idiag_queacc_write()
4551 return -EINVAL; in lpfc_idiag_queacc_write()
4555 * lpfc_idiag_drbacc_read_reg - idiag debugfs read a doorbell register
4578 len += scnprintf(pbuffer + len, LPFC_DRB_ACC_BUF_SIZE-len, in lpfc_idiag_drbacc_read_reg()
4579 "EQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4580 readl(phba->sli4_hba.EQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4583 len += scnprintf(pbuffer + len, LPFC_DRB_ACC_BUF_SIZE - len, in lpfc_idiag_drbacc_read_reg()
4584 "CQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4585 readl(phba->sli4_hba.CQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4588 len += scnprintf(pbuffer+len, LPFC_DRB_ACC_BUF_SIZE-len, in lpfc_idiag_drbacc_read_reg()
4589 "MQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4590 readl(phba->sli4_hba.MQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4593 len += scnprintf(pbuffer+len, LPFC_DRB_ACC_BUF_SIZE-len, in lpfc_idiag_drbacc_read_reg()
4594 "WQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4595 readl(phba->sli4_hba.WQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4598 len += scnprintf(pbuffer+len, LPFC_DRB_ACC_BUF_SIZE-len, in lpfc_idiag_drbacc_read_reg()
4599 "RQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4600 readl(phba->sli4_hba.RQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4610 * lpfc_idiag_drbacc_read - idiag debugfs read port doorbell
4630 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_drbacc_read()
4631 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_drbacc_read()
4637 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_drbacc_read()
4639 if (!debug->buffer) in lpfc_idiag_drbacc_read()
4640 debug->buffer = kmalloc(LPFC_DRB_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_drbacc_read()
4641 if (!debug->buffer) in lpfc_idiag_drbacc_read()
4643 pbuffer = debug->buffer; in lpfc_idiag_drbacc_read()
4665 * lpfc_idiag_drbacc_write - Syntax check and set up idiag drbacc commands
4686 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_drbacc_write()
4687 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_drbacc_write()
4693 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_drbacc_write()
4725 drb_reg = phba->sli4_hba.EQDBregaddr; in lpfc_idiag_drbacc_write()
4728 drb_reg = phba->sli4_hba.CQDBregaddr; in lpfc_idiag_drbacc_write()
4731 drb_reg = phba->sli4_hba.MQDBregaddr; in lpfc_idiag_drbacc_write()
4734 drb_reg = phba->sli4_hba.WQDBregaddr; in lpfc_idiag_drbacc_write()
4737 drb_reg = phba->sli4_hba.RQDBregaddr; in lpfc_idiag_drbacc_write()
4761 return -EINVAL; in lpfc_idiag_drbacc_write()
4765 * lpfc_idiag_ctlacc_read_reg - idiag debugfs read a control registers
4788 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4790 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4794 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4796 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4800 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4802 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4806 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4808 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4812 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4814 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4818 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4820 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4830 * lpfc_idiag_ctlacc_read - idiag debugfs read port and device control register
4848 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_ctlacc_read()
4849 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_ctlacc_read()
4855 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_ctlacc_read()
4857 if (!debug->buffer) in lpfc_idiag_ctlacc_read()
4858 debug->buffer = kmalloc(LPFC_CTL_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_ctlacc_read()
4859 if (!debug->buffer) in lpfc_idiag_ctlacc_read()
4861 pbuffer = debug->buffer; in lpfc_idiag_ctlacc_read()
4883 * lpfc_idiag_ctlacc_write - Syntax check and set up idiag ctlacc commands
4901 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_ctlacc_write()
4902 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_ctlacc_write()
4908 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_ctlacc_write()
4940 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4944 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4948 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4952 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4956 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4960 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4985 return -EINVAL; in lpfc_idiag_ctlacc_write()
4989 * lpfc_idiag_mbxacc_get_setup - idiag debugfs get mailbox access setup
5011 len += scnprintf(pbuffer+len, LPFC_MBX_ACC_BUF_SIZE-len, in lpfc_idiag_mbxacc_get_setup()
5013 len += scnprintf(pbuffer+len, LPFC_MBX_ACC_BUF_SIZE-len, in lpfc_idiag_mbxacc_get_setup()
5015 len += scnprintf(pbuffer+len, LPFC_MBX_ACC_BUF_SIZE-len, in lpfc_idiag_mbxacc_get_setup()
5017 len += scnprintf(pbuffer+len, LPFC_MBX_ACC_BUF_SIZE-len, in lpfc_idiag_mbxacc_get_setup()
5024 * lpfc_idiag_mbxacc_read - idiag debugfs read on mailbox access
5042 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_mbxacc_read()
5043 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_mbxacc_read()
5048 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_mbxacc_read()
5050 if (!debug->buffer) in lpfc_idiag_mbxacc_read()
5051 debug->buffer = kmalloc(LPFC_MBX_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_mbxacc_read()
5052 if (!debug->buffer) in lpfc_idiag_mbxacc_read()
5054 pbuffer = debug->buffer; in lpfc_idiag_mbxacc_read()
5069 * lpfc_idiag_mbxacc_write - Syntax check and set up idiag mbxacc commands
5087 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_mbxacc_write()
5092 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_mbxacc_write()
5146 return -EINVAL; in lpfc_idiag_mbxacc_write()
5150 * lpfc_idiag_extacc_avail_get - get the available extents information
5166 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5169 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5173 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5176 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5180 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5183 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5187 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5190 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5194 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5201 * lpfc_idiag_extacc_alloc_get - get the allocated extents information
5218 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5221 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5226 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5228 phba->brd_no, ext_cnt, ext_size); in lpfc_idiag_extacc_alloc_get()
5230 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5233 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5238 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5240 phba->brd_no, ext_cnt, ext_size); in lpfc_idiag_extacc_alloc_get()
5242 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5245 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5250 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5252 phba->brd_no, ext_cnt, ext_size); in lpfc_idiag_extacc_alloc_get()
5254 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5257 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5262 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5264 phba->brd_no, ext_cnt, ext_size); in lpfc_idiag_extacc_alloc_get()
5266 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5273 * lpfc_idiag_extacc_drivr_get - get driver extent information
5290 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5293 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5296 list_for_each_entry(rsrc_blks, &phba->lpfc_vpi_blk_list, list) { in lpfc_idiag_extacc_drivr_get()
5297 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5299 index, rsrc_blks->rsrc_start, in lpfc_idiag_extacc_drivr_get()
5300 rsrc_blks->rsrc_size); in lpfc_idiag_extacc_drivr_get()
5303 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5306 list_for_each_entry(rsrc_blks, &phba->sli4_hba.lpfc_vfi_blk_list, in lpfc_idiag_extacc_drivr_get()
5308 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5310 index, rsrc_blks->rsrc_start, in lpfc_idiag_extacc_drivr_get()
5311 rsrc_blks->rsrc_size); in lpfc_idiag_extacc_drivr_get()
5315 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5318 list_for_each_entry(rsrc_blks, &phba->sli4_hba.lpfc_rpi_blk_list, in lpfc_idiag_extacc_drivr_get()
5320 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5322 index, rsrc_blks->rsrc_start, in lpfc_idiag_extacc_drivr_get()
5323 rsrc_blks->rsrc_size); in lpfc_idiag_extacc_drivr_get()
5327 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5330 list_for_each_entry(rsrc_blks, &phba->sli4_hba.lpfc_xri_blk_list, in lpfc_idiag_extacc_drivr_get()
5332 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5334 index, rsrc_blks->rsrc_start, in lpfc_idiag_extacc_drivr_get()
5335 rsrc_blks->rsrc_size); in lpfc_idiag_extacc_drivr_get()
5343 * lpfc_idiag_extacc_write - Syntax check and set up idiag extacc commands
5361 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_extacc_write()
5366 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_extacc_write()
5385 return -EINVAL; in lpfc_idiag_extacc_write()
5389 * lpfc_idiag_extacc_read - idiag debugfs read access to extent information
5407 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_extacc_read()
5408 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_extacc_read()
5414 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_extacc_read()
5416 if (!debug->buffer) in lpfc_idiag_extacc_read()
5417 debug->buffer = kmalloc(LPFC_EXT_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_extacc_read()
5418 if (!debug->buffer) in lpfc_idiag_extacc_read()
5420 pbuffer = debug->buffer; in lpfc_idiag_extacc_read()
5667 /* lpfc_idiag_mbxacc_dump_bsg_mbox - idiag debugfs dump bsg mailbox command
5672 * This routine dump a bsg pass-through non-embedded mailbox command with
5740 pword = (uint32_t *)dmabuf->virt; in lpfc_idiag_mbxacc_dump_bsg_mbox()
5747 LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_bsg_mbox()
5750 len += scnprintf(line_buf+len, LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_bsg_mbox()
5754 if ((i - 1) % 8) in lpfc_idiag_mbxacc_dump_bsg_mbox()
5756 (*mbx_dump_cnt)--; in lpfc_idiag_mbxacc_dump_bsg_mbox()
5766 /* lpfc_idiag_mbxacc_dump_issue_mbox - idiag debugfs dump issue mailbox command
5771 * This routine dump a pass-through non-embedded mailbox command from issue
5799 (*mbx_mbox_cmd != pmbox->mbxCommand)) in lpfc_idiag_mbxacc_dump_issue_mbox()
5805 pmbox->mbxCommand); in lpfc_idiag_mbxacc_dump_issue_mbox()
5814 LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_issue_mbox()
5817 len += scnprintf(line_buf+len, LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_issue_mbox()
5822 if ((i - 1) % 8) in lpfc_idiag_mbxacc_dump_issue_mbox()
5828 pmbox->mbxCommand); in lpfc_idiag_mbxacc_dump_issue_mbox()
5837 LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_issue_mbox()
5842 LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_issue_mbox()
5848 LPFC_MBX_ACC_LBUF_SZ-len, " "); in lpfc_idiag_mbxacc_dump_issue_mbox()
5850 if ((i - 1) % 8) in lpfc_idiag_mbxacc_dump_issue_mbox()
5854 (*mbx_dump_cnt)--; in lpfc_idiag_mbxacc_dump_issue_mbox()
5864 * lpfc_debugfs_initialize - Initialize debugfs for a vport
5877 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_initialize()
5894 snprintf(name, sizeof(name), "fn%d", phba->brd_no); in lpfc_debugfs_initialize()
5895 if (!phba->hba_debugfs_root) { in lpfc_debugfs_initialize()
5897 phba->hba_debugfs_root = in lpfc_debugfs_initialize()
5900 atomic_set(&phba->debugfs_vport_count, 0); in lpfc_debugfs_initialize()
5902 /* Multi-XRI pools */ in lpfc_debugfs_initialize()
5904 phba->debug_multixri_pools = in lpfc_debugfs_initialize()
5906 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5909 if (!phba->debug_multixri_pools) { in lpfc_debugfs_initialize()
5917 phba->debug_ras_log = in lpfc_debugfs_initialize()
5919 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5921 if (!phba->debug_ras_log) { in lpfc_debugfs_initialize()
5930 phba->debug_hbqinfo = in lpfc_debugfs_initialize()
5932 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5938 phba->debug_lockstat = in lpfc_debugfs_initialize()
5940 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5942 if (!phba->debug_lockstat) { in lpfc_debugfs_initialize()
5950 if (phba->sli_rev < LPFC_SLI_REV4) { in lpfc_debugfs_initialize()
5952 phba->debug_dumpHBASlim = in lpfc_debugfs_initialize()
5955 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5958 phba->debug_dumpHBASlim = NULL; in lpfc_debugfs_initialize()
5961 if (phba->sli_rev < LPFC_SLI_REV4) { in lpfc_debugfs_initialize()
5963 phba->debug_dumpHostSlim = in lpfc_debugfs_initialize()
5966 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5969 phba->debug_dumpHostSlim = NULL; in lpfc_debugfs_initialize()
5973 phba->debug_InjErrLBA = in lpfc_debugfs_initialize()
5975 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5977 phba->lpfc_injerr_lba = LPFC_INJERR_LBA_OFF; in lpfc_debugfs_initialize()
5980 phba->debug_InjErrNPortID = in lpfc_debugfs_initialize()
5982 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5986 phba->debug_InjErrWWPN = in lpfc_debugfs_initialize()
5988 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5992 phba->debug_writeGuard = in lpfc_debugfs_initialize()
5994 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5998 phba->debug_writeApp = in lpfc_debugfs_initialize()
6000 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6004 phba->debug_writeRef = in lpfc_debugfs_initialize()
6006 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6010 phba->debug_readGuard = in lpfc_debugfs_initialize()
6012 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6016 phba->debug_readApp = in lpfc_debugfs_initialize()
6018 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6022 phba->debug_readRef = in lpfc_debugfs_initialize()
6024 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6029 num = lpfc_debugfs_max_slow_ring_trc - 1; in lpfc_debugfs_initialize()
6045 phba->debug_slow_ring_trc = in lpfc_debugfs_initialize()
6047 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6049 if (!phba->slow_ring_trc) { in lpfc_debugfs_initialize()
6050 phba->slow_ring_trc = kmalloc( in lpfc_debugfs_initialize()
6054 if (!phba->slow_ring_trc) { in lpfc_debugfs_initialize()
6060 atomic_set(&phba->slow_ring_trc_cnt, 0); in lpfc_debugfs_initialize()
6061 memset(phba->slow_ring_trc, 0, in lpfc_debugfs_initialize()
6067 phba->debug_nvmeio_trc = in lpfc_debugfs_initialize()
6069 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6072 atomic_set(&phba->nvmeio_trc_cnt, 0); in lpfc_debugfs_initialize()
6074 num = lpfc_debugfs_max_nvmeio_trc - 1; in lpfc_debugfs_initialize()
6089 phba->nvmeio_trc_size = lpfc_debugfs_max_nvmeio_trc; in lpfc_debugfs_initialize()
6092 phba->nvmeio_trc = kzalloc( in lpfc_debugfs_initialize()
6094 phba->nvmeio_trc_size), GFP_KERNEL); in lpfc_debugfs_initialize()
6096 if (!phba->nvmeio_trc) { in lpfc_debugfs_initialize()
6102 phba->nvmeio_trc_on = 1; in lpfc_debugfs_initialize()
6103 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_initialize()
6104 phba->nvmeio_trc = NULL; in lpfc_debugfs_initialize()
6107 phba->nvmeio_trc_size = 0; in lpfc_debugfs_initialize()
6108 phba->nvmeio_trc_on = 0; in lpfc_debugfs_initialize()
6109 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_initialize()
6110 phba->nvmeio_trc = NULL; in lpfc_debugfs_initialize()
6114 snprintf(name, sizeof(name), "vport%d", vport->vpi); in lpfc_debugfs_initialize()
6115 if (!vport->vport_debugfs_root) { in lpfc_debugfs_initialize()
6116 vport->vport_debugfs_root = in lpfc_debugfs_initialize()
6117 debugfs_create_dir(name, phba->hba_debugfs_root); in lpfc_debugfs_initialize()
6118 atomic_inc(&phba->debugfs_vport_count); in lpfc_debugfs_initialize()
6122 num = lpfc_debugfs_max_disc_trc - 1; in lpfc_debugfs_initialize()
6137 vport->disc_trc = kzalloc( in lpfc_debugfs_initialize()
6141 if (!vport->disc_trc) { in lpfc_debugfs_initialize()
6147 atomic_set(&vport->disc_trc_cnt, 0); in lpfc_debugfs_initialize()
6150 vport->debug_disc_trc = in lpfc_debugfs_initialize()
6152 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6155 vport->debug_nodelist = in lpfc_debugfs_initialize()
6157 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6161 vport->debug_nvmestat = in lpfc_debugfs_initialize()
6163 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6167 vport->debug_scsistat = in lpfc_debugfs_initialize()
6169 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6171 if (!vport->debug_scsistat) { in lpfc_debugfs_initialize()
6178 vport->debug_ioktime = in lpfc_debugfs_initialize()
6180 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6182 if (!vport->debug_ioktime) { in lpfc_debugfs_initialize()
6189 vport->debug_hdwqstat = in lpfc_debugfs_initialize()
6191 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6205 if (phba->sli_rev < LPFC_SLI_REV4) in lpfc_debugfs_initialize()
6209 if (!phba->idiag_root) { in lpfc_debugfs_initialize()
6210 phba->idiag_root = in lpfc_debugfs_initialize()
6211 debugfs_create_dir(name, phba->hba_debugfs_root); in lpfc_debugfs_initialize()
6218 if (!phba->idiag_pci_cfg) { in lpfc_debugfs_initialize()
6219 phba->idiag_pci_cfg = in lpfc_debugfs_initialize()
6221 phba->idiag_root, phba, &lpfc_idiag_op_pciCfg); in lpfc_debugfs_initialize()
6227 if (!phba->idiag_bar_acc) { in lpfc_debugfs_initialize()
6228 phba->idiag_bar_acc = in lpfc_debugfs_initialize()
6230 phba->idiag_root, phba, &lpfc_idiag_op_barAcc); in lpfc_debugfs_initialize()
6236 if (!phba->idiag_que_info) { in lpfc_debugfs_initialize()
6237 phba->idiag_que_info = in lpfc_debugfs_initialize()
6239 phba->idiag_root, phba, &lpfc_idiag_op_queInfo); in lpfc_debugfs_initialize()
6244 if (!phba->idiag_que_acc) { in lpfc_debugfs_initialize()
6245 phba->idiag_que_acc = in lpfc_debugfs_initialize()
6247 phba->idiag_root, phba, &lpfc_idiag_op_queAcc); in lpfc_debugfs_initialize()
6252 if (!phba->idiag_drb_acc) { in lpfc_debugfs_initialize()
6253 phba->idiag_drb_acc = in lpfc_debugfs_initialize()
6255 phba->idiag_root, phba, &lpfc_idiag_op_drbAcc); in lpfc_debugfs_initialize()
6260 if (!phba->idiag_ctl_acc) { in lpfc_debugfs_initialize()
6261 phba->idiag_ctl_acc = in lpfc_debugfs_initialize()
6263 phba->idiag_root, phba, &lpfc_idiag_op_ctlAcc); in lpfc_debugfs_initialize()
6268 if (!phba->idiag_mbx_acc) { in lpfc_debugfs_initialize()
6269 phba->idiag_mbx_acc = in lpfc_debugfs_initialize()
6271 phba->idiag_root, phba, &lpfc_idiag_op_mbxAcc); in lpfc_debugfs_initialize()
6275 if (phba->sli4_hba.extents_in_use) { in lpfc_debugfs_initialize()
6277 if (!phba->idiag_ext_acc) { in lpfc_debugfs_initialize()
6278 phba->idiag_ext_acc = in lpfc_debugfs_initialize()
6281 phba->idiag_root, phba, in lpfc_debugfs_initialize()
6292 * lpfc_debugfs_terminate - Tear down debugfs infrastructure for this vport
6306 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_terminate()
6308 kfree(vport->disc_trc); in lpfc_debugfs_terminate()
6309 vport->disc_trc = NULL; in lpfc_debugfs_terminate()
6311 debugfs_remove(vport->debug_disc_trc); /* discovery_trace */ in lpfc_debugfs_terminate()
6312 vport->debug_disc_trc = NULL; in lpfc_debugfs_terminate()
6314 debugfs_remove(vport->debug_nodelist); /* nodelist */ in lpfc_debugfs_terminate()
6315 vport->debug_nodelist = NULL; in lpfc_debugfs_terminate()
6317 debugfs_remove(vport->debug_nvmestat); /* nvmestat */ in lpfc_debugfs_terminate()
6318 vport->debug_nvmestat = NULL; in lpfc_debugfs_terminate()
6320 debugfs_remove(vport->debug_scsistat); /* scsistat */ in lpfc_debugfs_terminate()
6321 vport->debug_scsistat = NULL; in lpfc_debugfs_terminate()
6323 debugfs_remove(vport->debug_ioktime); /* ioktime */ in lpfc_debugfs_terminate()
6324 vport->debug_ioktime = NULL; in lpfc_debugfs_terminate()
6326 debugfs_remove(vport->debug_hdwqstat); /* hdwqstat */ in lpfc_debugfs_terminate()
6327 vport->debug_hdwqstat = NULL; in lpfc_debugfs_terminate()
6329 if (vport->vport_debugfs_root) { in lpfc_debugfs_terminate()
6330 debugfs_remove(vport->vport_debugfs_root); /* vportX */ in lpfc_debugfs_terminate()
6331 vport->vport_debugfs_root = NULL; in lpfc_debugfs_terminate()
6332 atomic_dec(&phba->debugfs_vport_count); in lpfc_debugfs_terminate()
6335 if (atomic_read(&phba->debugfs_vport_count) == 0) { in lpfc_debugfs_terminate()
6337 debugfs_remove(phba->debug_multixri_pools); /* multixripools*/ in lpfc_debugfs_terminate()
6338 phba->debug_multixri_pools = NULL; in lpfc_debugfs_terminate()
6340 debugfs_remove(phba->debug_hbqinfo); /* hbqinfo */ in lpfc_debugfs_terminate()
6341 phba->debug_hbqinfo = NULL; in lpfc_debugfs_terminate()
6343 debugfs_remove(phba->debug_ras_log); in lpfc_debugfs_terminate()
6344 phba->debug_ras_log = NULL; in lpfc_debugfs_terminate()
6347 debugfs_remove(phba->debug_lockstat); /* lockstat */ in lpfc_debugfs_terminate()
6348 phba->debug_lockstat = NULL; in lpfc_debugfs_terminate()
6350 debugfs_remove(phba->debug_dumpHBASlim); /* HBASlim */ in lpfc_debugfs_terminate()
6351 phba->debug_dumpHBASlim = NULL; in lpfc_debugfs_terminate()
6353 debugfs_remove(phba->debug_dumpHostSlim); /* HostSlim */ in lpfc_debugfs_terminate()
6354 phba->debug_dumpHostSlim = NULL; in lpfc_debugfs_terminate()
6356 debugfs_remove(phba->debug_InjErrLBA); /* InjErrLBA */ in lpfc_debugfs_terminate()
6357 phba->debug_InjErrLBA = NULL; in lpfc_debugfs_terminate()
6359 debugfs_remove(phba->debug_InjErrNPortID); in lpfc_debugfs_terminate()
6360 phba->debug_InjErrNPortID = NULL; in lpfc_debugfs_terminate()
6362 debugfs_remove(phba->debug_InjErrWWPN); /* InjErrWWPN */ in lpfc_debugfs_terminate()
6363 phba->debug_InjErrWWPN = NULL; in lpfc_debugfs_terminate()
6365 debugfs_remove(phba->debug_writeGuard); /* writeGuard */ in lpfc_debugfs_terminate()
6366 phba->debug_writeGuard = NULL; in lpfc_debugfs_terminate()
6368 debugfs_remove(phba->debug_writeApp); /* writeApp */ in lpfc_debugfs_terminate()
6369 phba->debug_writeApp = NULL; in lpfc_debugfs_terminate()
6371 debugfs_remove(phba->debug_writeRef); /* writeRef */ in lpfc_debugfs_terminate()
6372 phba->debug_writeRef = NULL; in lpfc_debugfs_terminate()
6374 debugfs_remove(phba->debug_readGuard); /* readGuard */ in lpfc_debugfs_terminate()
6375 phba->debug_readGuard = NULL; in lpfc_debugfs_terminate()
6377 debugfs_remove(phba->debug_readApp); /* readApp */ in lpfc_debugfs_terminate()
6378 phba->debug_readApp = NULL; in lpfc_debugfs_terminate()
6380 debugfs_remove(phba->debug_readRef); /* readRef */ in lpfc_debugfs_terminate()
6381 phba->debug_readRef = NULL; in lpfc_debugfs_terminate()
6383 kfree(phba->slow_ring_trc); in lpfc_debugfs_terminate()
6384 phba->slow_ring_trc = NULL; in lpfc_debugfs_terminate()
6387 debugfs_remove(phba->debug_slow_ring_trc); in lpfc_debugfs_terminate()
6388 phba->debug_slow_ring_trc = NULL; in lpfc_debugfs_terminate()
6390 debugfs_remove(phba->debug_nvmeio_trc); in lpfc_debugfs_terminate()
6391 phba->debug_nvmeio_trc = NULL; in lpfc_debugfs_terminate()
6393 kfree(phba->nvmeio_trc); in lpfc_debugfs_terminate()
6394 phba->nvmeio_trc = NULL; in lpfc_debugfs_terminate()
6399 if (phba->sli_rev == LPFC_SLI_REV4) { in lpfc_debugfs_terminate()
6401 debugfs_remove(phba->idiag_ext_acc); in lpfc_debugfs_terminate()
6402 phba->idiag_ext_acc = NULL; in lpfc_debugfs_terminate()
6405 debugfs_remove(phba->idiag_mbx_acc); in lpfc_debugfs_terminate()
6406 phba->idiag_mbx_acc = NULL; in lpfc_debugfs_terminate()
6409 debugfs_remove(phba->idiag_ctl_acc); in lpfc_debugfs_terminate()
6410 phba->idiag_ctl_acc = NULL; in lpfc_debugfs_terminate()
6413 debugfs_remove(phba->idiag_drb_acc); in lpfc_debugfs_terminate()
6414 phba->idiag_drb_acc = NULL; in lpfc_debugfs_terminate()
6417 debugfs_remove(phba->idiag_que_acc); in lpfc_debugfs_terminate()
6418 phba->idiag_que_acc = NULL; in lpfc_debugfs_terminate()
6421 debugfs_remove(phba->idiag_que_info); in lpfc_debugfs_terminate()
6422 phba->idiag_que_info = NULL; in lpfc_debugfs_terminate()
6425 debugfs_remove(phba->idiag_bar_acc); in lpfc_debugfs_terminate()
6426 phba->idiag_bar_acc = NULL; in lpfc_debugfs_terminate()
6429 debugfs_remove(phba->idiag_pci_cfg); in lpfc_debugfs_terminate()
6430 phba->idiag_pci_cfg = NULL; in lpfc_debugfs_terminate()
6433 debugfs_remove(phba->idiag_root); in lpfc_debugfs_terminate()
6434 phba->idiag_root = NULL; in lpfc_debugfs_terminate()
6437 if (phba->hba_debugfs_root) { in lpfc_debugfs_terminate()
6438 debugfs_remove(phba->hba_debugfs_root); /* fnX */ in lpfc_debugfs_terminate()
6439 phba->hba_debugfs_root = NULL; in lpfc_debugfs_terminate()
6459 * lpfc_debug_dump_all_queues - dump all the queues with a hba
6476 for (idx = 0; idx < phba->cfg_hdw_queue; idx++) in lpfc_debug_dump_all_queues()
6488 for (idx = 0; idx < phba->cfg_hdw_queue; idx++) in lpfc_debug_dump_all_queues()
6494 for (idx = 0; idx < phba->cfg_hdw_queue; idx++) in lpfc_debug_dump_all_queues()