• Home
  • Raw
  • Download

Lines Matching +full:dma +full:- +full:drb

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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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 bsize = min(nbytes, (sizeof(mybuf) - 1)); in lpfc_debugfs_lockstat_write()
2169 return -EFAULT; in lpfc_debugfs_lockstat_write()
2174 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_debugfs_lockstat_write()
2175 qp = &phba->sli4_hba.hdwq[i]; in lpfc_debugfs_lockstat_write()
2176 qp->lock_conflict.alloc_xri_get = 0; in lpfc_debugfs_lockstat_write()
2177 qp->lock_conflict.alloc_xri_put = 0; in lpfc_debugfs_lockstat_write()
2178 qp->lock_conflict.free_xri = 0; in lpfc_debugfs_lockstat_write()
2179 qp->lock_conflict.wq_access = 0; in lpfc_debugfs_lockstat_write()
2180 qp->lock_conflict.alloc_pvt_pool = 0; in lpfc_debugfs_lockstat_write()
2181 qp->lock_conflict.mv_from_pvt_pool = 0; in lpfc_debugfs_lockstat_write()
2182 qp->lock_conflict.mv_to_pub_pool = 0; in lpfc_debugfs_lockstat_write()
2183 qp->lock_conflict.mv_to_pvt_pool = 0; in lpfc_debugfs_lockstat_write()
2184 qp->lock_conflict.free_pvt_pool = 0; in lpfc_debugfs_lockstat_write()
2185 qp->lock_conflict.free_pub_pool = 0; in lpfc_debugfs_lockstat_write()
2186 qp->lock_conflict.wq_access = 0; in lpfc_debugfs_lockstat_write()
2201 spin_lock_irq(&phba->hbalock); in lpfc_debugfs_ras_log_data()
2202 if (phba->ras_fwlog.state != ACTIVE) { in lpfc_debugfs_ras_log_data()
2203 spin_unlock_irq(&phba->hbalock); in lpfc_debugfs_ras_log_data()
2204 return -EINVAL; in lpfc_debugfs_ras_log_data()
2206 spin_unlock_irq(&phba->hbalock); in lpfc_debugfs_ras_log_data()
2209 &phba->ras_fwlog.fwlog_buff_list, list) { in lpfc_debugfs_ras_log_data()
2211 if ((copied + LPFC_RAS_MAX_ENTRY_SIZE) >= (size - 1)) { in lpfc_debugfs_ras_log_data()
2212 memcpy(buffer + copied, dmabuf->virt, in lpfc_debugfs_ras_log_data()
2213 size - copied - 1); in lpfc_debugfs_ras_log_data()
2214 copied += size - copied - 1; in lpfc_debugfs_ras_log_data()
2217 memcpy(buffer + copied, dmabuf->virt, LPFC_RAS_MAX_ENTRY_SIZE); in lpfc_debugfs_ras_log_data()
2226 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_ras_log_release()
2228 vfree(debug->buffer); in lpfc_debugfs_ras_log_release()
2235 * lpfc_debugfs_ras_log_open - Open the RAS log debugfs buffer
2242 * for the log, fills the buffer from the in-memory log for this vport, and then
2252 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_ras_log_open()
2255 int rc = -ENOMEM; in lpfc_debugfs_ras_log_open()
2257 spin_lock_irq(&phba->hbalock); in lpfc_debugfs_ras_log_open()
2258 if (phba->ras_fwlog.state != ACTIVE) { in lpfc_debugfs_ras_log_open()
2259 spin_unlock_irq(&phba->hbalock); in lpfc_debugfs_ras_log_open()
2260 rc = -EINVAL; in lpfc_debugfs_ras_log_open()
2263 spin_unlock_irq(&phba->hbalock); in lpfc_debugfs_ras_log_open()
2268 size = LPFC_RAS_MIN_BUFF_POST_SIZE * phba->cfg_ras_fwlog_buffsize; in lpfc_debugfs_ras_log_open()
2269 debug->buffer = vmalloc(size); in lpfc_debugfs_ras_log_open()
2270 if (!debug->buffer) in lpfc_debugfs_ras_log_open()
2273 debug->len = lpfc_debugfs_ras_log_data(phba, debug->buffer, size); in lpfc_debugfs_ras_log_open()
2274 if (debug->len < 0) { in lpfc_debugfs_ras_log_open()
2275 rc = -EINVAL; in lpfc_debugfs_ras_log_open()
2278 file->private_data = debug; in lpfc_debugfs_ras_log_open()
2283 vfree(debug->buffer); in lpfc_debugfs_ras_log_open()
2291 * lpfc_debugfs_dumpHBASlim_open - Open the Dump HBA SLIM debugfs buffer
2298 * for the log, fills the buffer from the in-memory log for this vport, and then
2308 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_dumpHBASlim_open()
2310 int rc = -ENOMEM; in lpfc_debugfs_dumpHBASlim_open()
2317 debug->buffer = kmalloc(LPFC_DUMPHBASLIM_SIZE, GFP_KERNEL); in lpfc_debugfs_dumpHBASlim_open()
2318 if (!debug->buffer) { in lpfc_debugfs_dumpHBASlim_open()
2323 debug->len = lpfc_debugfs_dumpHBASlim_data(phba, debug->buffer, in lpfc_debugfs_dumpHBASlim_open()
2325 file->private_data = debug; in lpfc_debugfs_dumpHBASlim_open()
2333 * lpfc_debugfs_dumpHostSlim_open - Open the Dump Host SLIM debugfs buffer
2340 * for the log, fills the buffer from the in-memory log for this vport, and then
2350 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_dumpHostSlim_open()
2352 int rc = -ENOMEM; in lpfc_debugfs_dumpHostSlim_open()
2359 debug->buffer = kmalloc(LPFC_DUMPHOSTSLIM_SIZE, GFP_KERNEL); in lpfc_debugfs_dumpHostSlim_open()
2360 if (!debug->buffer) { in lpfc_debugfs_dumpHostSlim_open()
2365 debug->len = lpfc_debugfs_dumpHostSlim_data(phba, debug->buffer, in lpfc_debugfs_dumpHostSlim_open()
2367 file->private_data = debug; in lpfc_debugfs_dumpHostSlim_open()
2378 struct dentry *dent = file->f_path.dentry; in lpfc_debugfs_dif_err_read()
2379 struct lpfc_hba *phba = file->private_data; in lpfc_debugfs_dif_err_read()
2384 if (dent == phba->debug_writeGuard) in lpfc_debugfs_dif_err_read()
2385 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_wgrd_cnt); in lpfc_debugfs_dif_err_read()
2386 else if (dent == phba->debug_writeApp) in lpfc_debugfs_dif_err_read()
2387 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_wapp_cnt); in lpfc_debugfs_dif_err_read()
2388 else if (dent == phba->debug_writeRef) in lpfc_debugfs_dif_err_read()
2389 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_wref_cnt); in lpfc_debugfs_dif_err_read()
2390 else if (dent == phba->debug_readGuard) in lpfc_debugfs_dif_err_read()
2391 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_rgrd_cnt); in lpfc_debugfs_dif_err_read()
2392 else if (dent == phba->debug_readApp) in lpfc_debugfs_dif_err_read()
2393 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_rapp_cnt); in lpfc_debugfs_dif_err_read()
2394 else if (dent == phba->debug_readRef) in lpfc_debugfs_dif_err_read()
2395 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_rref_cnt); in lpfc_debugfs_dif_err_read()
2396 else if (dent == phba->debug_InjErrNPortID) in lpfc_debugfs_dif_err_read()
2398 phba->lpfc_injerr_nportid); in lpfc_debugfs_dif_err_read()
2399 else if (dent == phba->debug_InjErrWWPN) { in lpfc_debugfs_dif_err_read()
2400 memcpy(&tmp, &phba->lpfc_injerr_wwpn, sizeof(struct lpfc_name)); in lpfc_debugfs_dif_err_read()
2403 } else if (dent == phba->debug_InjErrLBA) { in lpfc_debugfs_dif_err_read()
2404 if (phba->lpfc_injerr_lba == (sector_t)(-1)) in lpfc_debugfs_dif_err_read()
2408 (uint64_t) phba->lpfc_injerr_lba); in lpfc_debugfs_dif_err_read()
2420 struct dentry *dent = file->f_path.dentry; in lpfc_debugfs_dif_err_write()
2421 struct lpfc_hba *phba = file->private_data; in lpfc_debugfs_dif_err_write()
2429 return -EFAULT; in lpfc_debugfs_dif_err_write()
2431 if (dent == phba->debug_InjErrLBA) { in lpfc_debugfs_dif_err_write()
2434 tmp = (uint64_t)(-1); in lpfc_debugfs_dif_err_write()
2438 return -EINVAL; in lpfc_debugfs_dif_err_write()
2440 if (dent == phba->debug_writeGuard) in lpfc_debugfs_dif_err_write()
2441 phba->lpfc_injerr_wgrd_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2442 else if (dent == phba->debug_writeApp) in lpfc_debugfs_dif_err_write()
2443 phba->lpfc_injerr_wapp_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2444 else if (dent == phba->debug_writeRef) in lpfc_debugfs_dif_err_write()
2445 phba->lpfc_injerr_wref_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2446 else if (dent == phba->debug_readGuard) in lpfc_debugfs_dif_err_write()
2447 phba->lpfc_injerr_rgrd_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2448 else if (dent == phba->debug_readApp) in lpfc_debugfs_dif_err_write()
2449 phba->lpfc_injerr_rapp_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2450 else if (dent == phba->debug_readRef) in lpfc_debugfs_dif_err_write()
2451 phba->lpfc_injerr_rref_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2452 else if (dent == phba->debug_InjErrLBA) in lpfc_debugfs_dif_err_write()
2453 phba->lpfc_injerr_lba = (sector_t)tmp; in lpfc_debugfs_dif_err_write()
2454 else if (dent == phba->debug_InjErrNPortID) in lpfc_debugfs_dif_err_write()
2455 phba->lpfc_injerr_nportid = (uint32_t)(tmp & Mask_DID); in lpfc_debugfs_dif_err_write()
2456 else if (dent == phba->debug_InjErrWWPN) { in lpfc_debugfs_dif_err_write()
2458 memcpy(&phba->lpfc_injerr_wwpn, &tmp, sizeof(struct lpfc_name)); in lpfc_debugfs_dif_err_write()
2473 * lpfc_debugfs_nodelist_open - Open the nodelist debugfs file
2480 * for the log, fills the buffer from the in-memory log for this vport, and then
2490 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_nodelist_open()
2492 int rc = -ENOMEM; in lpfc_debugfs_nodelist_open()
2499 debug->buffer = kmalloc(LPFC_NODELIST_SIZE, GFP_KERNEL); in lpfc_debugfs_nodelist_open()
2500 if (!debug->buffer) { in lpfc_debugfs_nodelist_open()
2505 debug->len = lpfc_debugfs_nodelist_data(vport, debug->buffer, in lpfc_debugfs_nodelist_open()
2507 file->private_data = debug; in lpfc_debugfs_nodelist_open()
2515 * lpfc_debugfs_lseek - Seek through a debugfs file
2534 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_lseek()
2535 return fixed_size_llseek(file, off, whence, debug->len); in lpfc_debugfs_lseek()
2539 * lpfc_debugfs_read - Read a debugfs file
2558 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_read()
2560 return simple_read_from_buffer(buf, nbytes, ppos, debug->buffer, in lpfc_debugfs_read()
2561 debug->len); in lpfc_debugfs_read()
2565 * lpfc_debugfs_release - Release the buffer used to store debugfs file data
2579 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_release()
2581 kfree(debug->buffer); in lpfc_debugfs_release()
2588 * lpfc_debugfs_multixripools_write - Clear multi-XRI pools statistics
2595 * This routine clears multi-XRI pools statistics when buf contains "clear".
2606 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_multixripools_write()
2607 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_debugfs_multixripools_write()
2615 if (nbytes > sizeof(mybuf) - 1) in lpfc_debugfs_multixripools_write()
2616 nbytes = sizeof(mybuf) - 1; in lpfc_debugfs_multixripools_write()
2621 return -EFAULT; in lpfc_debugfs_multixripools_write()
2625 hwq_count = phba->cfg_hdw_queue; in lpfc_debugfs_multixripools_write()
2627 qp = &phba->sli4_hba.hdwq[i]; in lpfc_debugfs_multixripools_write()
2628 multixri_pool = qp->p_multixri_pool; in lpfc_debugfs_multixripools_write()
2632 qp->empty_io_bufs = 0; in lpfc_debugfs_multixripools_write()
2633 multixri_pool->pbl_empty_count = 0; in lpfc_debugfs_multixripools_write()
2635 multixri_pool->above_limit_count = 0; in lpfc_debugfs_multixripools_write()
2636 multixri_pool->below_limit_count = 0; in lpfc_debugfs_multixripools_write()
2637 multixri_pool->stat_max_hwm = 0; in lpfc_debugfs_multixripools_write()
2638 multixri_pool->local_pbl_hit_count = 0; in lpfc_debugfs_multixripools_write()
2639 multixri_pool->other_pbl_hit_count = 0; in lpfc_debugfs_multixripools_write()
2641 multixri_pool->stat_pbl_count = 0; in lpfc_debugfs_multixripools_write()
2642 multixri_pool->stat_pvt_count = 0; in lpfc_debugfs_multixripools_write()
2643 multixri_pool->stat_busy_count = 0; in lpfc_debugfs_multixripools_write()
2644 multixri_pool->stat_snapshot_taken = 0; in lpfc_debugfs_multixripools_write()
2650 return -EINVAL; in lpfc_debugfs_multixripools_write()
2656 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_nvmestat_open()
2658 int rc = -ENOMEM; in lpfc_debugfs_nvmestat_open()
2665 debug->buffer = kmalloc(LPFC_NVMESTAT_SIZE, GFP_KERNEL); in lpfc_debugfs_nvmestat_open()
2666 if (!debug->buffer) { in lpfc_debugfs_nvmestat_open()
2671 debug->len = lpfc_debugfs_nvmestat_data(vport, debug->buffer, in lpfc_debugfs_nvmestat_open()
2674 debug->i_private = inode->i_private; in lpfc_debugfs_nvmestat_open()
2675 file->private_data = debug; in lpfc_debugfs_nvmestat_open()
2686 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_nvmestat_write()
2687 struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; in lpfc_debugfs_nvmestat_write()
2688 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_nvmestat_write()
2693 if (!phba->targetport) in lpfc_debugfs_nvmestat_write()
2694 return -ENXIO; in lpfc_debugfs_nvmestat_write()
2696 if (nbytes > sizeof(mybuf) - 1) in lpfc_debugfs_nvmestat_write()
2697 nbytes = sizeof(mybuf) - 1; in lpfc_debugfs_nvmestat_write()
2702 return -EFAULT; in lpfc_debugfs_nvmestat_write()
2705 tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private; in lpfc_debugfs_nvmestat_write()
2708 atomic_set(&tgtp->rcv_ls_req_in, 0); in lpfc_debugfs_nvmestat_write()
2709 atomic_set(&tgtp->rcv_ls_req_out, 0); in lpfc_debugfs_nvmestat_write()
2710 atomic_set(&tgtp->rcv_ls_req_drop, 0); in lpfc_debugfs_nvmestat_write()
2711 atomic_set(&tgtp->xmt_ls_abort, 0); in lpfc_debugfs_nvmestat_write()
2712 atomic_set(&tgtp->xmt_ls_abort_cmpl, 0); in lpfc_debugfs_nvmestat_write()
2713 atomic_set(&tgtp->xmt_ls_rsp, 0); in lpfc_debugfs_nvmestat_write()
2714 atomic_set(&tgtp->xmt_ls_drop, 0); in lpfc_debugfs_nvmestat_write()
2715 atomic_set(&tgtp->xmt_ls_rsp_error, 0); in lpfc_debugfs_nvmestat_write()
2716 atomic_set(&tgtp->xmt_ls_rsp_cmpl, 0); in lpfc_debugfs_nvmestat_write()
2718 atomic_set(&tgtp->rcv_fcp_cmd_in, 0); in lpfc_debugfs_nvmestat_write()
2719 atomic_set(&tgtp->rcv_fcp_cmd_out, 0); in lpfc_debugfs_nvmestat_write()
2720 atomic_set(&tgtp->rcv_fcp_cmd_drop, 0); in lpfc_debugfs_nvmestat_write()
2721 atomic_set(&tgtp->xmt_fcp_drop, 0); in lpfc_debugfs_nvmestat_write()
2722 atomic_set(&tgtp->xmt_fcp_read_rsp, 0); in lpfc_debugfs_nvmestat_write()
2723 atomic_set(&tgtp->xmt_fcp_read, 0); in lpfc_debugfs_nvmestat_write()
2724 atomic_set(&tgtp->xmt_fcp_write, 0); in lpfc_debugfs_nvmestat_write()
2725 atomic_set(&tgtp->xmt_fcp_rsp, 0); in lpfc_debugfs_nvmestat_write()
2726 atomic_set(&tgtp->xmt_fcp_release, 0); in lpfc_debugfs_nvmestat_write()
2727 atomic_set(&tgtp->xmt_fcp_rsp_cmpl, 0); in lpfc_debugfs_nvmestat_write()
2728 atomic_set(&tgtp->xmt_fcp_rsp_error, 0); in lpfc_debugfs_nvmestat_write()
2729 atomic_set(&tgtp->xmt_fcp_rsp_drop, 0); in lpfc_debugfs_nvmestat_write()
2731 atomic_set(&tgtp->xmt_fcp_abort, 0); in lpfc_debugfs_nvmestat_write()
2732 atomic_set(&tgtp->xmt_fcp_abort_cmpl, 0); in lpfc_debugfs_nvmestat_write()
2733 atomic_set(&tgtp->xmt_abort_sol, 0); in lpfc_debugfs_nvmestat_write()
2734 atomic_set(&tgtp->xmt_abort_unsol, 0); in lpfc_debugfs_nvmestat_write()
2735 atomic_set(&tgtp->xmt_abort_rsp, 0); in lpfc_debugfs_nvmestat_write()
2736 atomic_set(&tgtp->xmt_abort_rsp_error, 0); in lpfc_debugfs_nvmestat_write()
2744 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_scsistat_open()
2746 int rc = -ENOMEM; in lpfc_debugfs_scsistat_open()
2753 debug->buffer = kzalloc(LPFC_SCSISTAT_SIZE, GFP_KERNEL); in lpfc_debugfs_scsistat_open()
2754 if (!debug->buffer) { in lpfc_debugfs_scsistat_open()
2759 debug->len = lpfc_debugfs_scsistat_data(vport, debug->buffer, in lpfc_debugfs_scsistat_open()
2762 debug->i_private = inode->i_private; in lpfc_debugfs_scsistat_open()
2763 file->private_data = debug; in lpfc_debugfs_scsistat_open()
2774 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_scsistat_write()
2775 struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; in lpfc_debugfs_scsistat_write()
2776 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_scsistat_write()
2781 (sizeof(mybuf) - 1) : nbytes)) in lpfc_debugfs_scsistat_write()
2782 return -EFAULT; in lpfc_debugfs_scsistat_write()
2786 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_debugfs_scsistat_write()
2787 memset(&phba->sli4_hba.hdwq[i].scsi_cstat, 0, in lpfc_debugfs_scsistat_write()
2788 sizeof(phba->sli4_hba.hdwq[i].scsi_cstat)); in lpfc_debugfs_scsistat_write()
2798 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_ioktime_open()
2800 int rc = -ENOMEM; in lpfc_debugfs_ioktime_open()
2807 debug->buffer = kmalloc(LPFC_IOKTIME_SIZE, GFP_KERNEL); in lpfc_debugfs_ioktime_open()
2808 if (!debug->buffer) { in lpfc_debugfs_ioktime_open()
2813 debug->len = lpfc_debugfs_ioktime_data(vport, debug->buffer, in lpfc_debugfs_ioktime_open()
2816 debug->i_private = inode->i_private; in lpfc_debugfs_ioktime_open()
2817 file->private_data = debug; in lpfc_debugfs_ioktime_open()
2828 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_ioktime_write()
2829 struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; in lpfc_debugfs_ioktime_write()
2830 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_ioktime_write()
2834 if (nbytes > sizeof(mybuf) - 1) in lpfc_debugfs_ioktime_write()
2835 nbytes = sizeof(mybuf) - 1; in lpfc_debugfs_ioktime_write()
2840 return -EFAULT; in lpfc_debugfs_ioktime_write()
2843 if ((strncmp(pbuf, "on", sizeof("on") - 1) == 0)) { in lpfc_debugfs_ioktime_write()
2844 phba->ktime_data_samples = 0; in lpfc_debugfs_ioktime_write()
2845 phba->ktime_status_samples = 0; in lpfc_debugfs_ioktime_write()
2846 phba->ktime_seg1_total = 0; in lpfc_debugfs_ioktime_write()
2847 phba->ktime_seg1_max = 0; in lpfc_debugfs_ioktime_write()
2848 phba->ktime_seg1_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2849 phba->ktime_seg2_total = 0; in lpfc_debugfs_ioktime_write()
2850 phba->ktime_seg2_max = 0; in lpfc_debugfs_ioktime_write()
2851 phba->ktime_seg2_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2852 phba->ktime_seg3_total = 0; in lpfc_debugfs_ioktime_write()
2853 phba->ktime_seg3_max = 0; in lpfc_debugfs_ioktime_write()
2854 phba->ktime_seg3_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2855 phba->ktime_seg4_total = 0; in lpfc_debugfs_ioktime_write()
2856 phba->ktime_seg4_max = 0; in lpfc_debugfs_ioktime_write()
2857 phba->ktime_seg4_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2858 phba->ktime_seg5_total = 0; in lpfc_debugfs_ioktime_write()
2859 phba->ktime_seg5_max = 0; in lpfc_debugfs_ioktime_write()
2860 phba->ktime_seg5_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2861 phba->ktime_seg6_total = 0; in lpfc_debugfs_ioktime_write()
2862 phba->ktime_seg6_max = 0; in lpfc_debugfs_ioktime_write()
2863 phba->ktime_seg6_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2864 phba->ktime_seg7_total = 0; in lpfc_debugfs_ioktime_write()
2865 phba->ktime_seg7_max = 0; in lpfc_debugfs_ioktime_write()
2866 phba->ktime_seg7_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2867 phba->ktime_seg8_total = 0; in lpfc_debugfs_ioktime_write()
2868 phba->ktime_seg8_max = 0; in lpfc_debugfs_ioktime_write()
2869 phba->ktime_seg8_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2870 phba->ktime_seg9_total = 0; in lpfc_debugfs_ioktime_write()
2871 phba->ktime_seg9_max = 0; in lpfc_debugfs_ioktime_write()
2872 phba->ktime_seg9_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2873 phba->ktime_seg10_total = 0; in lpfc_debugfs_ioktime_write()
2874 phba->ktime_seg10_max = 0; in lpfc_debugfs_ioktime_write()
2875 phba->ktime_seg10_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2877 phba->ktime_on = 1; in lpfc_debugfs_ioktime_write()
2880 sizeof("off") - 1) == 0)) { in lpfc_debugfs_ioktime_write()
2881 phba->ktime_on = 0; in lpfc_debugfs_ioktime_write()
2884 sizeof("zero") - 1) == 0)) { in lpfc_debugfs_ioktime_write()
2885 phba->ktime_data_samples = 0; in lpfc_debugfs_ioktime_write()
2886 phba->ktime_status_samples = 0; in lpfc_debugfs_ioktime_write()
2887 phba->ktime_seg1_total = 0; in lpfc_debugfs_ioktime_write()
2888 phba->ktime_seg1_max = 0; in lpfc_debugfs_ioktime_write()
2889 phba->ktime_seg1_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2890 phba->ktime_seg2_total = 0; in lpfc_debugfs_ioktime_write()
2891 phba->ktime_seg2_max = 0; in lpfc_debugfs_ioktime_write()
2892 phba->ktime_seg2_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2893 phba->ktime_seg3_total = 0; in lpfc_debugfs_ioktime_write()
2894 phba->ktime_seg3_max = 0; in lpfc_debugfs_ioktime_write()
2895 phba->ktime_seg3_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2896 phba->ktime_seg4_total = 0; in lpfc_debugfs_ioktime_write()
2897 phba->ktime_seg4_max = 0; in lpfc_debugfs_ioktime_write()
2898 phba->ktime_seg4_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2899 phba->ktime_seg5_total = 0; in lpfc_debugfs_ioktime_write()
2900 phba->ktime_seg5_max = 0; in lpfc_debugfs_ioktime_write()
2901 phba->ktime_seg5_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2902 phba->ktime_seg6_total = 0; in lpfc_debugfs_ioktime_write()
2903 phba->ktime_seg6_max = 0; in lpfc_debugfs_ioktime_write()
2904 phba->ktime_seg6_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2905 phba->ktime_seg7_total = 0; in lpfc_debugfs_ioktime_write()
2906 phba->ktime_seg7_max = 0; in lpfc_debugfs_ioktime_write()
2907 phba->ktime_seg7_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2908 phba->ktime_seg8_total = 0; in lpfc_debugfs_ioktime_write()
2909 phba->ktime_seg8_max = 0; in lpfc_debugfs_ioktime_write()
2910 phba->ktime_seg8_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2911 phba->ktime_seg9_total = 0; in lpfc_debugfs_ioktime_write()
2912 phba->ktime_seg9_max = 0; in lpfc_debugfs_ioktime_write()
2913 phba->ktime_seg9_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2914 phba->ktime_seg10_total = 0; in lpfc_debugfs_ioktime_write()
2915 phba->ktime_seg10_max = 0; in lpfc_debugfs_ioktime_write()
2916 phba->ktime_seg10_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2919 return -EINVAL; in lpfc_debugfs_ioktime_write()
2925 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_nvmeio_trc_open()
2927 int rc = -ENOMEM; in lpfc_debugfs_nvmeio_trc_open()
2934 debug->buffer = kmalloc(LPFC_NVMEIO_TRC_SIZE, GFP_KERNEL); in lpfc_debugfs_nvmeio_trc_open()
2935 if (!debug->buffer) { in lpfc_debugfs_nvmeio_trc_open()
2940 debug->len = lpfc_debugfs_nvmeio_trc_data(phba, debug->buffer, in lpfc_debugfs_nvmeio_trc_open()
2943 debug->i_private = inode->i_private; in lpfc_debugfs_nvmeio_trc_open()
2944 file->private_data = debug; in lpfc_debugfs_nvmeio_trc_open()
2955 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_nvmeio_trc_write()
2956 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_debugfs_nvmeio_trc_write()
2962 if (nbytes > sizeof(mybuf) - 1) in lpfc_debugfs_nvmeio_trc_write()
2963 nbytes = sizeof(mybuf) - 1; in lpfc_debugfs_nvmeio_trc_write()
2968 return -EFAULT; in lpfc_debugfs_nvmeio_trc_write()
2971 if ((strncmp(pbuf, "off", sizeof("off") - 1) == 0)) { in lpfc_debugfs_nvmeio_trc_write()
2974 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_nvmeio_trc_write()
2975 phba->nvmeio_trc_on = 0; in lpfc_debugfs_nvmeio_trc_write()
2977 } else if ((strncmp(pbuf, "on", sizeof("on") - 1) == 0)) { in lpfc_debugfs_nvmeio_trc_write()
2980 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_nvmeio_trc_write()
2981 phba->nvmeio_trc_on = 1; in lpfc_debugfs_nvmeio_trc_write()
2986 if (phba->nvmeio_trc_on != 0) in lpfc_debugfs_nvmeio_trc_write()
2987 return -EINVAL; in lpfc_debugfs_nvmeio_trc_write()
2992 return -EINVAL; in lpfc_debugfs_nvmeio_trc_write()
2993 phba->nvmeio_trc_size = (uint32_t)sz; in lpfc_debugfs_nvmeio_trc_write()
2995 /* It must be a power of 2 - round down */ in lpfc_debugfs_nvmeio_trc_write()
3002 if (phba->nvmeio_trc_size != sz) in lpfc_debugfs_nvmeio_trc_write()
3006 phba->nvmeio_trc_size = (uint32_t)sz; in lpfc_debugfs_nvmeio_trc_write()
3009 kfree(phba->nvmeio_trc); in lpfc_debugfs_nvmeio_trc_write()
3012 phba->nvmeio_trc = kzalloc((sizeof(struct lpfc_debugfs_nvmeio_trc) * in lpfc_debugfs_nvmeio_trc_write()
3014 if (!phba->nvmeio_trc) { in lpfc_debugfs_nvmeio_trc_write()
3018 return -ENOMEM; in lpfc_debugfs_nvmeio_trc_write()
3020 atomic_set(&phba->nvmeio_trc_cnt, 0); in lpfc_debugfs_nvmeio_trc_write()
3021 phba->nvmeio_trc_on = 0; in lpfc_debugfs_nvmeio_trc_write()
3022 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_nvmeio_trc_write()
3030 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_hdwqstat_open()
3032 int rc = -ENOMEM; in lpfc_debugfs_hdwqstat_open()
3039 debug->buffer = kcalloc(1, LPFC_SCSISTAT_SIZE, GFP_KERNEL); in lpfc_debugfs_hdwqstat_open()
3040 if (!debug->buffer) { in lpfc_debugfs_hdwqstat_open()
3045 debug->len = lpfc_debugfs_hdwqstat_data(vport, debug->buffer, in lpfc_debugfs_hdwqstat_open()
3048 debug->i_private = inode->i_private; in lpfc_debugfs_hdwqstat_open()
3049 file->private_data = debug; in lpfc_debugfs_hdwqstat_open()
3060 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_hdwqstat_write()
3061 struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; in lpfc_debugfs_hdwqstat_write()
3062 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_hdwqstat_write()
3068 if (nbytes > sizeof(mybuf) - 1) in lpfc_debugfs_hdwqstat_write()
3069 nbytes = sizeof(mybuf) - 1; in lpfc_debugfs_hdwqstat_write()
3074 return -EFAULT; in lpfc_debugfs_hdwqstat_write()
3077 if ((strncmp(pbuf, "on", sizeof("on") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3078 if (phba->nvmet_support) in lpfc_debugfs_hdwqstat_write()
3079 phba->hdwqstat_on |= LPFC_CHECK_NVMET_IO; in lpfc_debugfs_hdwqstat_write()
3081 phba->hdwqstat_on |= (LPFC_CHECK_NVME_IO | in lpfc_debugfs_hdwqstat_write()
3084 } else if ((strncmp(pbuf, "nvme_on", sizeof("nvme_on") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3085 if (phba->nvmet_support) in lpfc_debugfs_hdwqstat_write()
3086 phba->hdwqstat_on |= LPFC_CHECK_NVMET_IO; in lpfc_debugfs_hdwqstat_write()
3088 phba->hdwqstat_on |= LPFC_CHECK_NVME_IO; in lpfc_debugfs_hdwqstat_write()
3090 } else if ((strncmp(pbuf, "scsi_on", sizeof("scsi_on") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3091 if (!phba->nvmet_support) in lpfc_debugfs_hdwqstat_write()
3092 phba->hdwqstat_on |= LPFC_CHECK_SCSI_IO; in lpfc_debugfs_hdwqstat_write()
3094 } else if ((strncmp(pbuf, "nvme_off", sizeof("nvme_off") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3095 phba->hdwqstat_on &= ~(LPFC_CHECK_NVME_IO | in lpfc_debugfs_hdwqstat_write()
3098 } else if ((strncmp(pbuf, "scsi_off", sizeof("scsi_off") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3099 phba->hdwqstat_on &= ~LPFC_CHECK_SCSI_IO; in lpfc_debugfs_hdwqstat_write()
3102 sizeof("off") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3103 phba->hdwqstat_on = LPFC_CHECK_OFF; in lpfc_debugfs_hdwqstat_write()
3106 sizeof("zero") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3108 c_stat = per_cpu_ptr(phba->sli4_hba.c_stat, i); in lpfc_debugfs_hdwqstat_write()
3109 c_stat->xmt_io = 0; in lpfc_debugfs_hdwqstat_write()
3110 c_stat->cmpl_io = 0; in lpfc_debugfs_hdwqstat_write()
3111 c_stat->rcv_io = 0; in lpfc_debugfs_hdwqstat_write()
3115 return -EINVAL; in lpfc_debugfs_hdwqstat_write()
3119 * ---------------------------------
3121 * ---------------------------------
3130 * lpfc_idiag_cmd_get - Get and parse idiag debugfs comands from user space
3152 bsize = min(nbytes, (sizeof(mybuf)-1)); in lpfc_idiag_cmd_get()
3155 return -EFAULT; in lpfc_idiag_cmd_get()
3161 return -EINVAL; in lpfc_idiag_cmd_get()
3163 idiag_cmd->opcode = simple_strtol(step_str, NULL, 0); in lpfc_idiag_cmd_get()
3164 if (idiag_cmd->opcode == 0) in lpfc_idiag_cmd_get()
3165 return -EINVAL; in lpfc_idiag_cmd_get()
3171 idiag_cmd->data[i] = simple_strtol(step_str, NULL, 0); in lpfc_idiag_cmd_get()
3177 * lpfc_idiag_open - idiag open debugfs
3200 return -ENOMEM; in lpfc_idiag_open()
3202 debug->i_private = inode->i_private; in lpfc_idiag_open()
3203 debug->buffer = NULL; in lpfc_idiag_open()
3204 file->private_data = debug; in lpfc_idiag_open()
3210 * lpfc_idiag_release - Release idiag access file operation
3225 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_release()
3228 kfree(debug->buffer); in lpfc_idiag_release()
3235 * lpfc_idiag_cmd_release - Release idiag cmd access file operation
3250 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_cmd_release()
3252 if (debug->op == LPFC_IDIAG_OP_WR) { in lpfc_idiag_cmd_release()
3268 kfree(debug->buffer); in lpfc_idiag_cmd_release()
3275 * lpfc_idiag_pcicfg_read - idiag debugfs read pcicfg
3296 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_pcicfg_read()
3297 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_pcicfg_read()
3306 pdev = phba->pcidev; in lpfc_idiag_pcicfg_read()
3311 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_pcicfg_read()
3313 if (!debug->buffer) in lpfc_idiag_pcicfg_read()
3314 debug->buffer = kmalloc(LPFC_PCI_CFG_SIZE, GFP_KERNEL); in lpfc_idiag_pcicfg_read()
3315 if (!debug->buffer) in lpfc_idiag_pcicfg_read()
3317 pbuffer = debug->buffer; in lpfc_idiag_pcicfg_read()
3332 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3337 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3342 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3362 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3366 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3371 LPFC_PCI_CFG_SIZE-len, "\n"); in lpfc_idiag_pcicfg_read()
3374 index -= sizeof(uint32_t); in lpfc_idiag_pcicfg_read()
3376 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3380 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3397 * lpfc_idiag_pcicfg_write - Syntax check and set up idiag pcicfg commands
3418 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_pcicfg_write()
3419 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_pcicfg_write()
3427 pdev = phba->pcidev; in lpfc_idiag_pcicfg_write()
3429 return -EFAULT; in lpfc_idiag_pcicfg_write()
3432 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_pcicfg_write()
3455 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint8_t)) in lpfc_idiag_pcicfg_write()
3461 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint16_t)) in lpfc_idiag_pcicfg_write()
3467 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint32_t)) in lpfc_idiag_pcicfg_write()
3478 /* Write command to PCI config space, read-modify-write */ in lpfc_idiag_pcicfg_write()
3488 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint8_t)) in lpfc_idiag_pcicfg_write()
3513 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint16_t)) in lpfc_idiag_pcicfg_write()
3538 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint32_t)) in lpfc_idiag_pcicfg_write()
3570 return -EINVAL; in lpfc_idiag_pcicfg_write()
3574 * lpfc_idiag_baracc_read - idiag debugfs pci bar access read
3592 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_baracc_read()
3593 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_baracc_read()
3602 pdev = phba->pcidev; in lpfc_idiag_baracc_read()
3607 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_baracc_read()
3609 if (!debug->buffer) in lpfc_idiag_baracc_read()
3610 debug->buffer = kmalloc(LPFC_PCI_BAR_RD_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_baracc_read()
3611 if (!debug->buffer) in lpfc_idiag_baracc_read()
3613 pbuffer = debug->buffer; in lpfc_idiag_baracc_read()
3629 if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf); in lpfc_idiag_baracc_read()
3632 mem_mapped_bar = phba->sli4_hba.conf_regs_memmap_p; in lpfc_idiag_baracc_read()
3634 mem_mapped_bar = phba->sli4_hba.ctrl_regs_memmap_p; in lpfc_idiag_baracc_read()
3636 mem_mapped_bar = phba->sli4_hba.drbl_regs_memmap_p; in lpfc_idiag_baracc_read()
3641 mem_mapped_bar = phba->sli4_hba.conf_regs_memmap_p; in lpfc_idiag_baracc_read()
3651 len += scnprintf(pbuffer+len, LPFC_PCI_BAR_RD_BUF_SIZE-len, in lpfc_idiag_baracc_read()
3665 len += scnprintf(pbuffer+len, LPFC_PCI_BAR_RD_BUF_SIZE-len, in lpfc_idiag_baracc_read()
3670 len += scnprintf(pbuffer+len, LPFC_PCI_BAR_RD_BUF_SIZE-len, in lpfc_idiag_baracc_read()
3676 LPFC_PCI_BAR_RD_BUF_SIZE-len, "\n"); in lpfc_idiag_baracc_read()
3683 LPFC_PCI_BAR_RD_BUF_SIZE-len, "\n"); in lpfc_idiag_baracc_read()
3687 index -= sizeof(uint32_t); in lpfc_idiag_baracc_read()
3690 LPFC_PCI_BAR_RD_BUF_SIZE-len, "\n"); in lpfc_idiag_baracc_read()
3694 LPFC_PCI_BAR_RD_BUF_SIZE-len, in lpfc_idiag_baracc_read()
3721 * lpfc_idiag_baracc_write - Syntax check and set up idiag bar access commands
3743 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_baracc_write()
3744 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_baracc_write()
3752 pdev = phba->pcidev; in lpfc_idiag_baracc_write()
3754 return -EFAULT; in lpfc_idiag_baracc_write()
3757 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_baracc_write()
3763 if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf); in lpfc_idiag_baracc_write()
3781 mem_mapped_bar = phba->sli4_hba.conf_regs_memmap_p; in lpfc_idiag_baracc_write()
3785 mem_mapped_bar = phba->sli4_hba.ctrl_regs_memmap_p; in lpfc_idiag_baracc_write()
3789 mem_mapped_bar = phba->sli4_hba.drbl_regs_memmap_p; in lpfc_idiag_baracc_write()
3796 mem_mapped_bar = phba->sli4_hba.conf_regs_memmap_p; in lpfc_idiag_baracc_write()
3813 if (offset > bar_size - sizeof(uint32_t)) in lpfc_idiag_baracc_write()
3830 /* Write command to PCI bar space, read-modify-write */ in lpfc_idiag_baracc_write()
3856 return -EINVAL; in lpfc_idiag_baracc_write()
3866 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_wq()
3868 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_wq()
3869 "AssocCQID[%04d]: WQ-STAT[oflow:x%x posted:x%llx]\n", in __lpfc_idiag_print_wq()
3870 qp->assoc_qid, qp->q_cnt_1, in __lpfc_idiag_print_wq()
3871 (unsigned long long)qp->q_cnt_4); in __lpfc_idiag_print_wq()
3872 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_wq()
3873 "\t\tWQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_wq()
3874 "HST-IDX[%04d], PRT-IDX[%04d], NTFI[%03d]", in __lpfc_idiag_print_wq()
3875 qp->queue_id, qp->entry_count, in __lpfc_idiag_print_wq()
3876 qp->entry_size, qp->host_index, in __lpfc_idiag_print_wq()
3877 qp->hba_index, qp->notify_interval); in __lpfc_idiag_print_wq()
3879 LPFC_QUE_INFO_GET_BUF_SIZE - len, "\n"); in __lpfc_idiag_print_wq()
3890 for (qidx = 0; qidx < phba->cfg_hdw_queue; qidx++) { in lpfc_idiag_wqs_for_cq()
3891 qp = phba->sli4_hba.hdwq[qidx].io_wq; in lpfc_idiag_wqs_for_cq()
3892 if (qp->assoc_qid != cq_id) in lpfc_idiag_wqs_for_cq()
3908 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_cq()
3910 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_cq()
3913 qp->assoc_qid, qp->q_cnt_1, qp->q_cnt_2, in __lpfc_idiag_print_cq()
3914 qp->q_cnt_3, (unsigned long long)qp->q_cnt_4); in __lpfc_idiag_print_cq()
3915 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_cq()
3916 "\tCQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_cq()
3917 "HST-IDX[%04d], NTFI[%03d], PLMT[%03d]", in __lpfc_idiag_print_cq()
3918 qp->queue_id, qp->entry_count, in __lpfc_idiag_print_cq()
3919 qp->entry_size, qp->host_index, in __lpfc_idiag_print_cq()
3920 qp->notify_interval, qp->max_proc_limit); in __lpfc_idiag_print_cq()
3922 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_cq()
3935 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_rqpair()
3937 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_rqpair()
3938 "AssocCQID[%02d]: RQ-STAT[nopost:x%x nobuf:x%x " in __lpfc_idiag_print_rqpair()
3940 qp->assoc_qid, qp->q_cnt_1, qp->q_cnt_2, in __lpfc_idiag_print_rqpair()
3941 qp->q_cnt_3, (unsigned long long)qp->q_cnt_4); in __lpfc_idiag_print_rqpair()
3942 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_rqpair()
3943 "\t\tHQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_rqpair()
3944 "HST-IDX[%04d], PRT-IDX[%04d], NTFI[%03d]\n", in __lpfc_idiag_print_rqpair()
3945 qp->queue_id, qp->entry_count, qp->entry_size, in __lpfc_idiag_print_rqpair()
3946 qp->host_index, qp->hba_index, qp->notify_interval); in __lpfc_idiag_print_rqpair()
3947 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_rqpair()
3948 "\t\tDQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_rqpair()
3949 "HST-IDX[%04d], PRT-IDX[%04d], NTFI[%03d]\n", in __lpfc_idiag_print_rqpair()
3950 datqp->queue_id, datqp->entry_count, in __lpfc_idiag_print_rqpair()
3951 datqp->entry_size, datqp->host_index, in __lpfc_idiag_print_rqpair()
3952 datqp->hba_index, datqp->notify_interval); in __lpfc_idiag_print_rqpair()
3963 qp = phba->sli4_hba.hdwq[eqidx].io_cq; in lpfc_idiag_cqs_for_eq()
3968 qp->CQ_max_cqe = 0; in lpfc_idiag_cqs_for_eq()
3974 max_cnt, qp->queue_id); in lpfc_idiag_cqs_for_eq()
3978 if ((eqidx < phba->cfg_nvmet_mrq) && phba->nvmet_support) { in lpfc_idiag_cqs_for_eq()
3980 qp = phba->sli4_hba.nvmet_cqset[eqidx]; in lpfc_idiag_cqs_for_eq()
3984 qp->CQ_max_cqe = 0; in lpfc_idiag_cqs_for_eq()
3990 qp = phba->sli4_hba.nvmet_mrq_hdr[eqidx]; in lpfc_idiag_cqs_for_eq()
3992 phba->sli4_hba.nvmet_mrq_data[eqidx], in lpfc_idiag_cqs_for_eq()
4009 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_eq()
4010 "\n%s EQ info: EQ-STAT[max:x%x noE:x%x " in __lpfc_idiag_print_eq()
4012 eqtype, qp->q_cnt_1, qp->q_cnt_2, qp->q_cnt_3, in __lpfc_idiag_print_eq()
4013 (unsigned long long)qp->q_cnt_4, qp->q_mode); in __lpfc_idiag_print_eq()
4014 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_eq()
4015 "EQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_eq()
4016 "HST-IDX[%04d], NTFI[%03d], PLMT[%03d], AFFIN[%03d]", in __lpfc_idiag_print_eq()
4017 qp->queue_id, qp->entry_count, qp->entry_size, in __lpfc_idiag_print_eq()
4018 qp->host_index, qp->notify_interval, in __lpfc_idiag_print_eq()
4019 qp->max_proc_limit, qp->chann); in __lpfc_idiag_print_eq()
4020 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_eq()
4027 * lpfc_idiag_queinfo_read - idiag debugfs read queue information
4048 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_queinfo_read()
4049 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_queinfo_read()
4054 if (!debug->buffer) in lpfc_idiag_queinfo_read()
4055 debug->buffer = kmalloc(LPFC_QUE_INFO_GET_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_queinfo_read()
4056 if (!debug->buffer) in lpfc_idiag_queinfo_read()
4058 pbuffer = debug->buffer; in lpfc_idiag_queinfo_read()
4059 max_cnt = LPFC_QUE_INFO_GET_BUF_SIZE - 256; in lpfc_idiag_queinfo_read()
4064 spin_lock_irq(&phba->hbalock); in lpfc_idiag_queinfo_read()
4066 /* Fast-path event queue */ in lpfc_idiag_queinfo_read()
4067 if (phba->sli4_hba.hdwq && phba->cfg_hdw_queue) { in lpfc_idiag_queinfo_read()
4069 x = phba->lpfc_idiag_last_eq; in lpfc_idiag_queinfo_read()
4070 phba->lpfc_idiag_last_eq++; in lpfc_idiag_queinfo_read()
4071 if (phba->lpfc_idiag_last_eq >= phba->cfg_hdw_queue) in lpfc_idiag_queinfo_read()
4072 phba->lpfc_idiag_last_eq = 0; in lpfc_idiag_queinfo_read()
4075 LPFC_QUE_INFO_GET_BUF_SIZE - len, in lpfc_idiag_queinfo_read()
4077 x, phba->cfg_hdw_queue); in lpfc_idiag_queinfo_read()
4079 /* Fast-path EQ */ in lpfc_idiag_queinfo_read()
4080 qp = phba->sli4_hba.hdwq[x].hba_eq; in lpfc_idiag_queinfo_read()
4087 qp->EQ_max_eqe = 0; in lpfc_idiag_queinfo_read()
4094 max_cnt, x, qp->queue_id); in lpfc_idiag_queinfo_read()
4102 /* Slow-path mailbox CQ */ in lpfc_idiag_queinfo_read()
4103 qp = phba->sli4_hba.mbx_cq; in lpfc_idiag_queinfo_read()
4108 /* Slow-path MBOX MQ */ in lpfc_idiag_queinfo_read()
4109 qp = phba->sli4_hba.mbx_wq; in lpfc_idiag_queinfo_read()
4114 /* Slow-path ELS response CQ */ in lpfc_idiag_queinfo_read()
4115 qp = phba->sli4_hba.els_cq; in lpfc_idiag_queinfo_read()
4119 qp->CQ_max_cqe = 0; in lpfc_idiag_queinfo_read()
4123 /* Slow-path ELS WQ */ in lpfc_idiag_queinfo_read()
4124 qp = phba->sli4_hba.els_wq; in lpfc_idiag_queinfo_read()
4129 qp = phba->sli4_hba.hdr_rq; in lpfc_idiag_queinfo_read()
4130 len = __lpfc_idiag_print_rqpair(qp, phba->sli4_hba.dat_rq, in lpfc_idiag_queinfo_read()
4135 /* Slow-path NVME LS response CQ */ in lpfc_idiag_queinfo_read()
4136 qp = phba->sli4_hba.nvmels_cq; in lpfc_idiag_queinfo_read()
4141 qp->CQ_max_cqe = 0; in lpfc_idiag_queinfo_read()
4145 /* Slow-path NVME LS WQ */ in lpfc_idiag_queinfo_read()
4146 qp = phba->sli4_hba.nvmels_wq; in lpfc_idiag_queinfo_read()
4155 spin_unlock_irq(&phba->hbalock); in lpfc_idiag_queinfo_read()
4160 LPFC_QUE_INFO_GET_BUF_SIZE - len, "Truncated ...\n"); in lpfc_idiag_queinfo_read()
4162 spin_unlock_irq(&phba->hbalock); in lpfc_idiag_queinfo_read()
4167 * lpfc_idiag_que_param_check - queue access command parameter sanity check
4176 * This function returns -EINVAL when fails the sanity check, otherwise, it
4184 return -EINVAL; in lpfc_idiag_que_param_check()
4185 if (index > q->entry_count - 1) in lpfc_idiag_que_param_check()
4186 return -EINVAL; in lpfc_idiag_que_param_check()
4191 * lpfc_idiag_queacc_read_qe - read a single entry from the given queue index
4214 esize = pque->entry_size; in lpfc_idiag_queacc_read_qe()
4215 len += scnprintf(pbuffer+len, LPFC_QUE_ACC_BUF_SIZE-len, in lpfc_idiag_queacc_read_qe()
4216 "QE-INDEX[%04d]:\n", index); in lpfc_idiag_queacc_read_qe()
4221 len += scnprintf(pbuffer+len, LPFC_QUE_ACC_BUF_SIZE-len, in lpfc_idiag_queacc_read_qe()
4225 esize -= sizeof(uint32_t); in lpfc_idiag_queacc_read_qe()
4228 LPFC_QUE_ACC_BUF_SIZE-len, "\n"); in lpfc_idiag_queacc_read_qe()
4230 len += scnprintf(pbuffer+len, LPFC_QUE_ACC_BUF_SIZE-len, "\n"); in lpfc_idiag_queacc_read_qe()
4236 * lpfc_idiag_queacc_read - idiag debugfs read port queue
4256 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_queacc_read()
4263 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_queacc_read()
4265 if (!debug->buffer) in lpfc_idiag_queacc_read()
4266 debug->buffer = kmalloc(LPFC_QUE_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_queacc_read()
4267 if (!debug->buffer) in lpfc_idiag_queacc_read()
4269 pbuffer = debug->buffer; in lpfc_idiag_queacc_read()
4296 while (len < LPFC_QUE_ACC_SIZE - pque->entry_size) { in lpfc_idiag_queacc_read()
4299 if (index > pque->entry_count - 1) in lpfc_idiag_queacc_read()
4304 if (index > pque->entry_count - 1) in lpfc_idiag_queacc_read()
4312 * lpfc_idiag_queacc_write - Syntax check and set up idiag queacc commands
4333 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_queacc_write()
4334 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_queacc_write()
4341 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_queacc_write()
4372 if (phba->sli4_hba.hdwq) { in lpfc_idiag_queacc_write()
4373 for (qidx = 0; qidx < phba->cfg_hdw_queue; qidx++) { in lpfc_idiag_queacc_write()
4374 qp = phba->sli4_hba.hdwq[qidx].hba_eq; in lpfc_idiag_queacc_write()
4375 if (qp && qp->queue_id == queid) { in lpfc_idiag_queacc_write()
4390 if (phba->sli4_hba.mbx_cq && in lpfc_idiag_queacc_write()
4391 phba->sli4_hba.mbx_cq->queue_id == queid) { in lpfc_idiag_queacc_write()
4394 phba->sli4_hba.mbx_cq, index, count); in lpfc_idiag_queacc_write()
4397 idiag.ptr_private = phba->sli4_hba.mbx_cq; in lpfc_idiag_queacc_write()
4401 if (phba->sli4_hba.els_cq && in lpfc_idiag_queacc_write()
4402 phba->sli4_hba.els_cq->queue_id == queid) { in lpfc_idiag_queacc_write()
4405 phba->sli4_hba.els_cq, index, count); in lpfc_idiag_queacc_write()
4408 idiag.ptr_private = phba->sli4_hba.els_cq; in lpfc_idiag_queacc_write()
4412 if (phba->sli4_hba.nvmels_cq && in lpfc_idiag_queacc_write()
4413 phba->sli4_hba.nvmels_cq->queue_id == queid) { in lpfc_idiag_queacc_write()
4416 phba->sli4_hba.nvmels_cq, index, count); in lpfc_idiag_queacc_write()
4419 idiag.ptr_private = phba->sli4_hba.nvmels_cq; in lpfc_idiag_queacc_write()
4423 if (phba->sli4_hba.hdwq) { in lpfc_idiag_queacc_write()
4424 for (qidx = 0; qidx < phba->cfg_hdw_queue; in lpfc_idiag_queacc_write()
4426 qp = phba->sli4_hba.hdwq[qidx].io_cq; in lpfc_idiag_queacc_write()
4427 if (qp && qp->queue_id == queid) { in lpfc_idiag_queacc_write()
4442 if (phba->sli4_hba.mbx_wq && in lpfc_idiag_queacc_write()
4443 phba->sli4_hba.mbx_wq->queue_id == queid) { in lpfc_idiag_queacc_write()
4446 phba->sli4_hba.mbx_wq, index, count); in lpfc_idiag_queacc_write()
4449 idiag.ptr_private = phba->sli4_hba.mbx_wq; in lpfc_idiag_queacc_write()
4456 if (phba->sli4_hba.els_wq && in lpfc_idiag_queacc_write()
4457 phba->sli4_hba.els_wq->queue_id == queid) { in lpfc_idiag_queacc_write()
4460 phba->sli4_hba.els_wq, index, count); in lpfc_idiag_queacc_write()
4463 idiag.ptr_private = phba->sli4_hba.els_wq; in lpfc_idiag_queacc_write()
4467 if (phba->sli4_hba.nvmels_wq && in lpfc_idiag_queacc_write()
4468 phba->sli4_hba.nvmels_wq->queue_id == queid) { in lpfc_idiag_queacc_write()
4471 phba->sli4_hba.nvmels_wq, index, count); in lpfc_idiag_queacc_write()
4474 idiag.ptr_private = phba->sli4_hba.nvmels_wq; in lpfc_idiag_queacc_write()
4478 if (phba->sli4_hba.hdwq) { in lpfc_idiag_queacc_write()
4480 for (qidx = 0; qidx < phba->cfg_hdw_queue; qidx++) { in lpfc_idiag_queacc_write()
4481 qp = phba->sli4_hba.hdwq[qidx].io_wq; in lpfc_idiag_queacc_write()
4482 if (qp && qp->queue_id == queid) { in lpfc_idiag_queacc_write()
4498 if (phba->sli4_hba.hdr_rq && in lpfc_idiag_queacc_write()
4499 phba->sli4_hba.hdr_rq->queue_id == queid) { in lpfc_idiag_queacc_write()
4502 phba->sli4_hba.hdr_rq, index, count); in lpfc_idiag_queacc_write()
4505 idiag.ptr_private = phba->sli4_hba.hdr_rq; in lpfc_idiag_queacc_write()
4509 if (phba->sli4_hba.dat_rq && in lpfc_idiag_queacc_write()
4510 phba->sli4_hba.dat_rq->queue_id == queid) { in lpfc_idiag_queacc_write()
4513 phba->sli4_hba.dat_rq, index, count); in lpfc_idiag_queacc_write()
4516 idiag.ptr_private = phba->sli4_hba.dat_rq; in lpfc_idiag_queacc_write()
4538 if (offset > pque->entry_size/sizeof(uint32_t) - 1) in lpfc_idiag_queacc_write()
4554 return -EINVAL; in lpfc_idiag_queacc_write()
4558 * lpfc_idiag_drbacc_read_reg - idiag debugfs read a doorbell register
4581 len += scnprintf(pbuffer + len, LPFC_DRB_ACC_BUF_SIZE-len, in lpfc_idiag_drbacc_read_reg()
4582 "EQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4583 readl(phba->sli4_hba.EQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4586 len += scnprintf(pbuffer + len, LPFC_DRB_ACC_BUF_SIZE - len, in lpfc_idiag_drbacc_read_reg()
4587 "CQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4588 readl(phba->sli4_hba.CQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4591 len += scnprintf(pbuffer+len, LPFC_DRB_ACC_BUF_SIZE-len, in lpfc_idiag_drbacc_read_reg()
4592 "MQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4593 readl(phba->sli4_hba.MQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4596 len += scnprintf(pbuffer+len, LPFC_DRB_ACC_BUF_SIZE-len, in lpfc_idiag_drbacc_read_reg()
4597 "WQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4598 readl(phba->sli4_hba.WQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4601 len += scnprintf(pbuffer+len, LPFC_DRB_ACC_BUF_SIZE-len, in lpfc_idiag_drbacc_read_reg()
4602 "RQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4603 readl(phba->sli4_hba.RQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4613 * lpfc_idiag_drbacc_read - idiag debugfs read port doorbell
4633 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_drbacc_read()
4634 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_drbacc_read()
4640 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_drbacc_read()
4642 if (!debug->buffer) in lpfc_idiag_drbacc_read()
4643 debug->buffer = kmalloc(LPFC_DRB_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_drbacc_read()
4644 if (!debug->buffer) in lpfc_idiag_drbacc_read()
4646 pbuffer = debug->buffer; in lpfc_idiag_drbacc_read()
4668 * lpfc_idiag_drbacc_write - Syntax check and set up idiag drbacc commands
4689 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_drbacc_write()
4690 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_drbacc_write()
4696 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_drbacc_write()
4728 drb_reg = phba->sli4_hba.EQDBregaddr; in lpfc_idiag_drbacc_write()
4731 drb_reg = phba->sli4_hba.CQDBregaddr; in lpfc_idiag_drbacc_write()
4734 drb_reg = phba->sli4_hba.MQDBregaddr; in lpfc_idiag_drbacc_write()
4737 drb_reg = phba->sli4_hba.WQDBregaddr; in lpfc_idiag_drbacc_write()
4740 drb_reg = phba->sli4_hba.RQDBregaddr; in lpfc_idiag_drbacc_write()
4764 return -EINVAL; in lpfc_idiag_drbacc_write()
4768 * lpfc_idiag_ctlacc_read_reg - idiag debugfs read a control registers
4791 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4793 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4797 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4799 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4803 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4805 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4809 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4811 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4815 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4817 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4821 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4823 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4833 * lpfc_idiag_ctlacc_read - idiag debugfs read port and device control register
4851 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_ctlacc_read()
4852 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_ctlacc_read()
4858 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_ctlacc_read()
4860 if (!debug->buffer) in lpfc_idiag_ctlacc_read()
4861 debug->buffer = kmalloc(LPFC_CTL_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_ctlacc_read()
4862 if (!debug->buffer) in lpfc_idiag_ctlacc_read()
4864 pbuffer = debug->buffer; in lpfc_idiag_ctlacc_read()
4886 * lpfc_idiag_ctlacc_write - Syntax check and set up idiag ctlacc commands
4904 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_ctlacc_write()
4905 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_ctlacc_write()
4911 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_ctlacc_write()
4943 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4947 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4951 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4955 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4959 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4963 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4988 return -EINVAL; in lpfc_idiag_ctlacc_write()
4992 * lpfc_idiag_mbxacc_get_setup - idiag debugfs get mailbox access setup
5014 len += scnprintf(pbuffer+len, LPFC_MBX_ACC_BUF_SIZE-len, in lpfc_idiag_mbxacc_get_setup()
5016 len += scnprintf(pbuffer+len, LPFC_MBX_ACC_BUF_SIZE-len, in lpfc_idiag_mbxacc_get_setup()
5018 len += scnprintf(pbuffer+len, LPFC_MBX_ACC_BUF_SIZE-len, in lpfc_idiag_mbxacc_get_setup()
5020 len += scnprintf(pbuffer+len, LPFC_MBX_ACC_BUF_SIZE-len, in lpfc_idiag_mbxacc_get_setup()
5027 * lpfc_idiag_mbxacc_read - idiag debugfs read on mailbox access
5045 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_mbxacc_read()
5046 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_mbxacc_read()
5051 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_mbxacc_read()
5053 if (!debug->buffer) in lpfc_idiag_mbxacc_read()
5054 debug->buffer = kmalloc(LPFC_MBX_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_mbxacc_read()
5055 if (!debug->buffer) in lpfc_idiag_mbxacc_read()
5057 pbuffer = debug->buffer; in lpfc_idiag_mbxacc_read()
5072 * lpfc_idiag_mbxacc_write - Syntax check and set up idiag mbxacc commands
5090 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_mbxacc_write()
5095 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_mbxacc_write()
5149 return -EINVAL; in lpfc_idiag_mbxacc_write()
5153 * lpfc_idiag_extacc_avail_get - get the available extents information
5169 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5172 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()
5179 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()
5186 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()
5193 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5197 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5204 * lpfc_idiag_extacc_alloc_get - get the allocated extents information
5221 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5224 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5229 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5231 phba->brd_no, ext_cnt, ext_size); in lpfc_idiag_extacc_alloc_get()
5233 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5236 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5241 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5243 phba->brd_no, ext_cnt, ext_size); in lpfc_idiag_extacc_alloc_get()
5245 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5248 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5253 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5255 phba->brd_no, ext_cnt, ext_size); in lpfc_idiag_extacc_alloc_get()
5257 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5260 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5265 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5267 phba->brd_no, ext_cnt, ext_size); in lpfc_idiag_extacc_alloc_get()
5269 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5276 * lpfc_idiag_extacc_drivr_get - get driver extent information
5293 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5296 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5299 list_for_each_entry(rsrc_blks, &phba->lpfc_vpi_blk_list, list) { in lpfc_idiag_extacc_drivr_get()
5300 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5302 index, rsrc_blks->rsrc_start, in lpfc_idiag_extacc_drivr_get()
5303 rsrc_blks->rsrc_size); in lpfc_idiag_extacc_drivr_get()
5306 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5309 list_for_each_entry(rsrc_blks, &phba->sli4_hba.lpfc_vfi_blk_list, in lpfc_idiag_extacc_drivr_get()
5311 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5313 index, rsrc_blks->rsrc_start, in lpfc_idiag_extacc_drivr_get()
5314 rsrc_blks->rsrc_size); in lpfc_idiag_extacc_drivr_get()
5318 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5321 list_for_each_entry(rsrc_blks, &phba->sli4_hba.lpfc_rpi_blk_list, in lpfc_idiag_extacc_drivr_get()
5323 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5325 index, rsrc_blks->rsrc_start, in lpfc_idiag_extacc_drivr_get()
5326 rsrc_blks->rsrc_size); in lpfc_idiag_extacc_drivr_get()
5330 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5333 list_for_each_entry(rsrc_blks, &phba->sli4_hba.lpfc_xri_blk_list, in lpfc_idiag_extacc_drivr_get()
5335 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5337 index, rsrc_blks->rsrc_start, in lpfc_idiag_extacc_drivr_get()
5338 rsrc_blks->rsrc_size); in lpfc_idiag_extacc_drivr_get()
5346 * lpfc_idiag_extacc_write - Syntax check and set up idiag extacc commands
5364 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_extacc_write()
5369 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_extacc_write()
5388 return -EINVAL; in lpfc_idiag_extacc_write()
5392 * lpfc_idiag_extacc_read - idiag debugfs read access to extent information
5410 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_extacc_read()
5411 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_extacc_read()
5417 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_extacc_read()
5419 if (!debug->buffer) in lpfc_idiag_extacc_read()
5420 debug->buffer = kmalloc(LPFC_EXT_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_extacc_read()
5421 if (!debug->buffer) in lpfc_idiag_extacc_read()
5423 pbuffer = debug->buffer; in lpfc_idiag_extacc_read()
5670 /* lpfc_idiag_mbxacc_dump_bsg_mbox - idiag debugfs dump bsg mailbox command
5672 * @dmabuf: Pointer to a DMA buffer descriptor.
5675 * This routine dump a bsg pass-through non-embedded mailbox command with
5743 pword = (uint32_t *)dmabuf->virt; in lpfc_idiag_mbxacc_dump_bsg_mbox()
5750 LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_bsg_mbox()
5753 len += scnprintf(line_buf+len, LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_bsg_mbox()
5757 if ((i - 1) % 8) in lpfc_idiag_mbxacc_dump_bsg_mbox()
5759 (*mbx_dump_cnt)--; in lpfc_idiag_mbxacc_dump_bsg_mbox()
5769 /* lpfc_idiag_mbxacc_dump_issue_mbox - idiag debugfs dump issue mailbox command
5771 * @dmabuf: Pointer to a DMA buffer descriptor.
5774 * This routine dump a pass-through non-embedded mailbox command from issue
5802 (*mbx_mbox_cmd != pmbox->mbxCommand)) in lpfc_idiag_mbxacc_dump_issue_mbox()
5808 pmbox->mbxCommand); in lpfc_idiag_mbxacc_dump_issue_mbox()
5817 LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_issue_mbox()
5820 len += scnprintf(line_buf+len, LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_issue_mbox()
5825 if ((i - 1) % 8) in lpfc_idiag_mbxacc_dump_issue_mbox()
5831 pmbox->mbxCommand); in lpfc_idiag_mbxacc_dump_issue_mbox()
5840 LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_issue_mbox()
5845 LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_issue_mbox()
5851 LPFC_MBX_ACC_LBUF_SZ-len, " "); in lpfc_idiag_mbxacc_dump_issue_mbox()
5853 if ((i - 1) % 8) in lpfc_idiag_mbxacc_dump_issue_mbox()
5857 (*mbx_dump_cnt)--; in lpfc_idiag_mbxacc_dump_issue_mbox()
5867 * lpfc_debugfs_initialize - Initialize debugfs for a vport
5880 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_initialize()
5897 snprintf(name, sizeof(name), "fn%d", phba->brd_no); in lpfc_debugfs_initialize()
5898 if (!phba->hba_debugfs_root) { in lpfc_debugfs_initialize()
5900 phba->hba_debugfs_root = in lpfc_debugfs_initialize()
5903 atomic_set(&phba->debugfs_vport_count, 0); in lpfc_debugfs_initialize()
5905 /* Multi-XRI pools */ in lpfc_debugfs_initialize()
5907 phba->debug_multixri_pools = in lpfc_debugfs_initialize()
5909 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5912 if (IS_ERR(phba->debug_multixri_pools)) { in lpfc_debugfs_initialize()
5920 phba->debug_ras_log = in lpfc_debugfs_initialize()
5922 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5924 if (IS_ERR(phba->debug_ras_log)) { in lpfc_debugfs_initialize()
5933 phba->debug_hbqinfo = in lpfc_debugfs_initialize()
5935 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5941 phba->debug_lockstat = in lpfc_debugfs_initialize()
5943 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5945 if (IS_ERR(phba->debug_lockstat)) { in lpfc_debugfs_initialize()
5953 if (phba->sli_rev < LPFC_SLI_REV4) { in lpfc_debugfs_initialize()
5955 phba->debug_dumpHBASlim = in lpfc_debugfs_initialize()
5958 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5961 phba->debug_dumpHBASlim = NULL; in lpfc_debugfs_initialize()
5964 if (phba->sli_rev < LPFC_SLI_REV4) { in lpfc_debugfs_initialize()
5966 phba->debug_dumpHostSlim = in lpfc_debugfs_initialize()
5969 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5972 phba->debug_dumpHostSlim = NULL; in lpfc_debugfs_initialize()
5976 phba->debug_InjErrLBA = in lpfc_debugfs_initialize()
5978 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5980 phba->lpfc_injerr_lba = LPFC_INJERR_LBA_OFF; in lpfc_debugfs_initialize()
5983 phba->debug_InjErrNPortID = in lpfc_debugfs_initialize()
5985 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5989 phba->debug_InjErrWWPN = in lpfc_debugfs_initialize()
5991 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
5995 phba->debug_writeGuard = in lpfc_debugfs_initialize()
5997 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6001 phba->debug_writeApp = in lpfc_debugfs_initialize()
6003 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6007 phba->debug_writeRef = in lpfc_debugfs_initialize()
6009 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6013 phba->debug_readGuard = in lpfc_debugfs_initialize()
6015 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6019 phba->debug_readApp = in lpfc_debugfs_initialize()
6021 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6025 phba->debug_readRef = in lpfc_debugfs_initialize()
6027 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6032 num = lpfc_debugfs_max_slow_ring_trc - 1; in lpfc_debugfs_initialize()
6048 phba->debug_slow_ring_trc = in lpfc_debugfs_initialize()
6050 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6052 if (!phba->slow_ring_trc) { in lpfc_debugfs_initialize()
6053 phba->slow_ring_trc = kmalloc( in lpfc_debugfs_initialize()
6057 if (!phba->slow_ring_trc) { in lpfc_debugfs_initialize()
6063 atomic_set(&phba->slow_ring_trc_cnt, 0); in lpfc_debugfs_initialize()
6064 memset(phba->slow_ring_trc, 0, in lpfc_debugfs_initialize()
6070 phba->debug_nvmeio_trc = in lpfc_debugfs_initialize()
6072 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6075 atomic_set(&phba->nvmeio_trc_cnt, 0); in lpfc_debugfs_initialize()
6077 num = lpfc_debugfs_max_nvmeio_trc - 1; in lpfc_debugfs_initialize()
6092 phba->nvmeio_trc_size = lpfc_debugfs_max_nvmeio_trc; in lpfc_debugfs_initialize()
6095 phba->nvmeio_trc = kzalloc( in lpfc_debugfs_initialize()
6097 phba->nvmeio_trc_size), GFP_KERNEL); in lpfc_debugfs_initialize()
6099 if (!phba->nvmeio_trc) { in lpfc_debugfs_initialize()
6105 phba->nvmeio_trc_on = 1; in lpfc_debugfs_initialize()
6106 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_initialize()
6107 phba->nvmeio_trc = NULL; in lpfc_debugfs_initialize()
6110 phba->nvmeio_trc_size = 0; in lpfc_debugfs_initialize()
6111 phba->nvmeio_trc_on = 0; in lpfc_debugfs_initialize()
6112 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_initialize()
6113 phba->nvmeio_trc = NULL; in lpfc_debugfs_initialize()
6117 snprintf(name, sizeof(name), "vport%d", vport->vpi); in lpfc_debugfs_initialize()
6118 if (!vport->vport_debugfs_root) { in lpfc_debugfs_initialize()
6119 vport->vport_debugfs_root = in lpfc_debugfs_initialize()
6120 debugfs_create_dir(name, phba->hba_debugfs_root); in lpfc_debugfs_initialize()
6121 atomic_inc(&phba->debugfs_vport_count); in lpfc_debugfs_initialize()
6125 num = lpfc_debugfs_max_disc_trc - 1; in lpfc_debugfs_initialize()
6140 vport->disc_trc = kzalloc( in lpfc_debugfs_initialize()
6144 if (!vport->disc_trc) { in lpfc_debugfs_initialize()
6150 atomic_set(&vport->disc_trc_cnt, 0); in lpfc_debugfs_initialize()
6153 vport->debug_disc_trc = in lpfc_debugfs_initialize()
6155 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6158 vport->debug_nodelist = in lpfc_debugfs_initialize()
6160 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6164 vport->debug_nvmestat = in lpfc_debugfs_initialize()
6166 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6170 vport->debug_scsistat = in lpfc_debugfs_initialize()
6172 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6174 if (IS_ERR(vport->debug_scsistat)) { in lpfc_debugfs_initialize()
6181 vport->debug_ioktime = in lpfc_debugfs_initialize()
6183 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6185 if (IS_ERR(vport->debug_ioktime)) { in lpfc_debugfs_initialize()
6192 vport->debug_hdwqstat = in lpfc_debugfs_initialize()
6194 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6208 if (phba->sli_rev < LPFC_SLI_REV4) in lpfc_debugfs_initialize()
6212 if (!phba->idiag_root) { in lpfc_debugfs_initialize()
6213 phba->idiag_root = in lpfc_debugfs_initialize()
6214 debugfs_create_dir(name, phba->hba_debugfs_root); in lpfc_debugfs_initialize()
6221 if (!phba->idiag_pci_cfg) { in lpfc_debugfs_initialize()
6222 phba->idiag_pci_cfg = in lpfc_debugfs_initialize()
6224 phba->idiag_root, phba, &lpfc_idiag_op_pciCfg); in lpfc_debugfs_initialize()
6230 if (!phba->idiag_bar_acc) { in lpfc_debugfs_initialize()
6231 phba->idiag_bar_acc = in lpfc_debugfs_initialize()
6233 phba->idiag_root, phba, &lpfc_idiag_op_barAcc); in lpfc_debugfs_initialize()
6239 if (!phba->idiag_que_info) { in lpfc_debugfs_initialize()
6240 phba->idiag_que_info = in lpfc_debugfs_initialize()
6242 phba->idiag_root, phba, &lpfc_idiag_op_queInfo); in lpfc_debugfs_initialize()
6247 if (!phba->idiag_que_acc) { in lpfc_debugfs_initialize()
6248 phba->idiag_que_acc = in lpfc_debugfs_initialize()
6250 phba->idiag_root, phba, &lpfc_idiag_op_queAcc); in lpfc_debugfs_initialize()
6255 if (!phba->idiag_drb_acc) { in lpfc_debugfs_initialize()
6256 phba->idiag_drb_acc = in lpfc_debugfs_initialize()
6258 phba->idiag_root, phba, &lpfc_idiag_op_drbAcc); in lpfc_debugfs_initialize()
6263 if (!phba->idiag_ctl_acc) { in lpfc_debugfs_initialize()
6264 phba->idiag_ctl_acc = in lpfc_debugfs_initialize()
6266 phba->idiag_root, phba, &lpfc_idiag_op_ctlAcc); in lpfc_debugfs_initialize()
6271 if (!phba->idiag_mbx_acc) { in lpfc_debugfs_initialize()
6272 phba->idiag_mbx_acc = in lpfc_debugfs_initialize()
6274 phba->idiag_root, phba, &lpfc_idiag_op_mbxAcc); in lpfc_debugfs_initialize()
6278 if (phba->sli4_hba.extents_in_use) { in lpfc_debugfs_initialize()
6280 if (!phba->idiag_ext_acc) { in lpfc_debugfs_initialize()
6281 phba->idiag_ext_acc = in lpfc_debugfs_initialize()
6284 phba->idiag_root, phba, in lpfc_debugfs_initialize()
6295 * lpfc_debugfs_terminate - Tear down debugfs infrastructure for this vport
6309 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_terminate()
6311 kfree(vport->disc_trc); in lpfc_debugfs_terminate()
6312 vport->disc_trc = NULL; in lpfc_debugfs_terminate()
6314 debugfs_remove(vport->debug_disc_trc); /* discovery_trace */ in lpfc_debugfs_terminate()
6315 vport->debug_disc_trc = NULL; in lpfc_debugfs_terminate()
6317 debugfs_remove(vport->debug_nodelist); /* nodelist */ in lpfc_debugfs_terminate()
6318 vport->debug_nodelist = NULL; in lpfc_debugfs_terminate()
6320 debugfs_remove(vport->debug_nvmestat); /* nvmestat */ in lpfc_debugfs_terminate()
6321 vport->debug_nvmestat = NULL; in lpfc_debugfs_terminate()
6323 debugfs_remove(vport->debug_scsistat); /* scsistat */ in lpfc_debugfs_terminate()
6324 vport->debug_scsistat = NULL; in lpfc_debugfs_terminate()
6326 debugfs_remove(vport->debug_ioktime); /* ioktime */ in lpfc_debugfs_terminate()
6327 vport->debug_ioktime = NULL; in lpfc_debugfs_terminate()
6329 debugfs_remove(vport->debug_hdwqstat); /* hdwqstat */ in lpfc_debugfs_terminate()
6330 vport->debug_hdwqstat = NULL; in lpfc_debugfs_terminate()
6332 if (vport->vport_debugfs_root) { in lpfc_debugfs_terminate()
6333 debugfs_remove(vport->vport_debugfs_root); /* vportX */ in lpfc_debugfs_terminate()
6334 vport->vport_debugfs_root = NULL; in lpfc_debugfs_terminate()
6335 atomic_dec(&phba->debugfs_vport_count); in lpfc_debugfs_terminate()
6338 if (atomic_read(&phba->debugfs_vport_count) == 0) { in lpfc_debugfs_terminate()
6340 debugfs_remove(phba->debug_multixri_pools); /* multixripools*/ in lpfc_debugfs_terminate()
6341 phba->debug_multixri_pools = NULL; in lpfc_debugfs_terminate()
6343 debugfs_remove(phba->debug_hbqinfo); /* hbqinfo */ in lpfc_debugfs_terminate()
6344 phba->debug_hbqinfo = NULL; in lpfc_debugfs_terminate()
6346 debugfs_remove(phba->debug_ras_log); in lpfc_debugfs_terminate()
6347 phba->debug_ras_log = NULL; in lpfc_debugfs_terminate()
6350 debugfs_remove(phba->debug_lockstat); /* lockstat */ in lpfc_debugfs_terminate()
6351 phba->debug_lockstat = NULL; in lpfc_debugfs_terminate()
6353 debugfs_remove(phba->debug_dumpHBASlim); /* HBASlim */ in lpfc_debugfs_terminate()
6354 phba->debug_dumpHBASlim = NULL; in lpfc_debugfs_terminate()
6356 debugfs_remove(phba->debug_dumpHostSlim); /* HostSlim */ in lpfc_debugfs_terminate()
6357 phba->debug_dumpHostSlim = NULL; in lpfc_debugfs_terminate()
6359 debugfs_remove(phba->debug_InjErrLBA); /* InjErrLBA */ in lpfc_debugfs_terminate()
6360 phba->debug_InjErrLBA = NULL; in lpfc_debugfs_terminate()
6362 debugfs_remove(phba->debug_InjErrNPortID); in lpfc_debugfs_terminate()
6363 phba->debug_InjErrNPortID = NULL; in lpfc_debugfs_terminate()
6365 debugfs_remove(phba->debug_InjErrWWPN); /* InjErrWWPN */ in lpfc_debugfs_terminate()
6366 phba->debug_InjErrWWPN = NULL; in lpfc_debugfs_terminate()
6368 debugfs_remove(phba->debug_writeGuard); /* writeGuard */ in lpfc_debugfs_terminate()
6369 phba->debug_writeGuard = NULL; in lpfc_debugfs_terminate()
6371 debugfs_remove(phba->debug_writeApp); /* writeApp */ in lpfc_debugfs_terminate()
6372 phba->debug_writeApp = NULL; in lpfc_debugfs_terminate()
6374 debugfs_remove(phba->debug_writeRef); /* writeRef */ in lpfc_debugfs_terminate()
6375 phba->debug_writeRef = NULL; in lpfc_debugfs_terminate()
6377 debugfs_remove(phba->debug_readGuard); /* readGuard */ in lpfc_debugfs_terminate()
6378 phba->debug_readGuard = NULL; in lpfc_debugfs_terminate()
6380 debugfs_remove(phba->debug_readApp); /* readApp */ in lpfc_debugfs_terminate()
6381 phba->debug_readApp = NULL; in lpfc_debugfs_terminate()
6383 debugfs_remove(phba->debug_readRef); /* readRef */ in lpfc_debugfs_terminate()
6384 phba->debug_readRef = NULL; in lpfc_debugfs_terminate()
6386 kfree(phba->slow_ring_trc); in lpfc_debugfs_terminate()
6387 phba->slow_ring_trc = NULL; in lpfc_debugfs_terminate()
6390 debugfs_remove(phba->debug_slow_ring_trc); in lpfc_debugfs_terminate()
6391 phba->debug_slow_ring_trc = NULL; in lpfc_debugfs_terminate()
6393 debugfs_remove(phba->debug_nvmeio_trc); in lpfc_debugfs_terminate()
6394 phba->debug_nvmeio_trc = NULL; in lpfc_debugfs_terminate()
6396 kfree(phba->nvmeio_trc); in lpfc_debugfs_terminate()
6397 phba->nvmeio_trc = NULL; in lpfc_debugfs_terminate()
6402 if (phba->sli_rev == LPFC_SLI_REV4) { in lpfc_debugfs_terminate()
6404 debugfs_remove(phba->idiag_ext_acc); in lpfc_debugfs_terminate()
6405 phba->idiag_ext_acc = NULL; in lpfc_debugfs_terminate()
6408 debugfs_remove(phba->idiag_mbx_acc); in lpfc_debugfs_terminate()
6409 phba->idiag_mbx_acc = NULL; in lpfc_debugfs_terminate()
6412 debugfs_remove(phba->idiag_ctl_acc); in lpfc_debugfs_terminate()
6413 phba->idiag_ctl_acc = NULL; in lpfc_debugfs_terminate()
6416 debugfs_remove(phba->idiag_drb_acc); in lpfc_debugfs_terminate()
6417 phba->idiag_drb_acc = NULL; in lpfc_debugfs_terminate()
6420 debugfs_remove(phba->idiag_que_acc); in lpfc_debugfs_terminate()
6421 phba->idiag_que_acc = NULL; in lpfc_debugfs_terminate()
6424 debugfs_remove(phba->idiag_que_info); in lpfc_debugfs_terminate()
6425 phba->idiag_que_info = NULL; in lpfc_debugfs_terminate()
6428 debugfs_remove(phba->idiag_bar_acc); in lpfc_debugfs_terminate()
6429 phba->idiag_bar_acc = NULL; in lpfc_debugfs_terminate()
6432 debugfs_remove(phba->idiag_pci_cfg); in lpfc_debugfs_terminate()
6433 phba->idiag_pci_cfg = NULL; in lpfc_debugfs_terminate()
6436 debugfs_remove(phba->idiag_root); in lpfc_debugfs_terminate()
6437 phba->idiag_root = NULL; in lpfc_debugfs_terminate()
6440 if (phba->hba_debugfs_root) { in lpfc_debugfs_terminate()
6441 debugfs_remove(phba->hba_debugfs_root); /* fnX */ in lpfc_debugfs_terminate()
6442 phba->hba_debugfs_root = NULL; in lpfc_debugfs_terminate()
6462 * lpfc_debug_dump_all_queues - dump all the queues with a hba
6479 for (idx = 0; idx < phba->cfg_hdw_queue; idx++) in lpfc_debug_dump_all_queues()
6491 for (idx = 0; idx < phba->cfg_hdw_queue; idx++) in lpfc_debug_dump_all_queues()
6497 for (idx = 0; idx < phba->cfg_hdw_queue; idx++) in lpfc_debug_dump_all_queues()