Lines Matching +full:mbox +full:- +full:num +full:- +full:users
4 * Copyright (C) 2017-2021 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_commonxripools_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 len += scnprintf(buf+len, size-len, "RPI:x%04x ", in lpfc_debugfs_nodelist_data()
872 ndlp->nlp_rpi); in lpfc_debugfs_nodelist_data()
873 len += scnprintf(buf+len, size-len, "flag:x%08x ", in lpfc_debugfs_nodelist_data()
874 ndlp->nlp_flag); in lpfc_debugfs_nodelist_data()
875 if (!ndlp->nlp_type) in lpfc_debugfs_nodelist_data()
876 len += scnprintf(buf+len, size-len, "UNKNOWN_TYPE "); in lpfc_debugfs_nodelist_data()
877 if (ndlp->nlp_type & NLP_FC_NODE) in lpfc_debugfs_nodelist_data()
878 len += scnprintf(buf+len, size-len, "FC_NODE "); in lpfc_debugfs_nodelist_data()
879 if (ndlp->nlp_type & NLP_FABRIC) { in lpfc_debugfs_nodelist_data()
880 len += scnprintf(buf+len, size-len, "FABRIC "); in lpfc_debugfs_nodelist_data()
883 if (ndlp->nlp_type & NLP_FCP_TARGET) in lpfc_debugfs_nodelist_data()
884 len += scnprintf(buf+len, size-len, "FCP_TGT sid:%d ", in lpfc_debugfs_nodelist_data()
885 ndlp->nlp_sid); in lpfc_debugfs_nodelist_data()
886 if (ndlp->nlp_type & NLP_FCP_INITIATOR) in lpfc_debugfs_nodelist_data()
887 len += scnprintf(buf+len, size-len, "FCP_INITIATOR "); in lpfc_debugfs_nodelist_data()
888 if (ndlp->nlp_type & NLP_NVME_TARGET) in lpfc_debugfs_nodelist_data()
890 size - len, "NVME_TGT sid:%d ", in lpfc_debugfs_nodelist_data()
892 if (ndlp->nlp_type & NLP_NVME_INITIATOR) in lpfc_debugfs_nodelist_data()
894 size - len, "NVME_INITIATOR "); in lpfc_debugfs_nodelist_data()
895 len += scnprintf(buf+len, size-len, "refcnt:%d", in lpfc_debugfs_nodelist_data()
896 kref_read(&ndlp->kref)); in lpfc_debugfs_nodelist_data()
898 i = atomic_read(&ndlp->cmd_pending); in lpfc_debugfs_nodelist_data()
899 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
901 i, ndlp->cmd_qdepth); in lpfc_debugfs_nodelist_data()
904 len += scnprintf(buf+len, size-len, " xpt:x%x", in lpfc_debugfs_nodelist_data()
905 ndlp->fc4_xpt_flags); in lpfc_debugfs_nodelist_data()
906 if (ndlp->nlp_defer_did != NLP_EVT_NOTHING_PENDING) in lpfc_debugfs_nodelist_data()
907 len += scnprintf(buf+len, size-len, " defer:%x", in lpfc_debugfs_nodelist_data()
908 ndlp->nlp_defer_did); in lpfc_debugfs_nodelist_data()
909 len += scnprintf(buf+len, size-len, "\n"); in lpfc_debugfs_nodelist_data()
911 spin_unlock_irq(shost->host_lock); in lpfc_debugfs_nodelist_data()
913 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
916 if (phba->nvmet_support && phba->targetport && (vport == phba->pport)) { in lpfc_debugfs_nodelist_data()
917 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
921 if (phba->targetport->port_id) in lpfc_debugfs_nodelist_data()
925 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
927 wwn_to_u64(vport->fc_nodename.u.wwn), in lpfc_debugfs_nodelist_data()
928 wwn_to_u64(vport->fc_portname.u.wwn), in lpfc_debugfs_nodelist_data()
930 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
932 phba->targetport->port_id); in lpfc_debugfs_nodelist_data()
936 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
939 localport = vport->localport; in lpfc_debugfs_nodelist_data()
943 spin_lock_irq(shost->host_lock); in lpfc_debugfs_nodelist_data()
946 if (localport->port_id) in lpfc_debugfs_nodelist_data()
951 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
953 localport->port_id, statep); in lpfc_debugfs_nodelist_data()
955 len += scnprintf(buf + len, size - len, "\tRport List:\n"); in lpfc_debugfs_nodelist_data()
956 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_debugfs_nodelist_data()
957 /* local short-hand pointer. */ in lpfc_debugfs_nodelist_data()
958 spin_lock(&ndlp->lock); in lpfc_debugfs_nodelist_data()
961 nrport = rport->remoteport; in lpfc_debugfs_nodelist_data()
964 spin_unlock(&ndlp->lock); in lpfc_debugfs_nodelist_data()
969 switch (nrport->port_state) { in lpfc_debugfs_nodelist_data()
982 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
984 statep, nrport->port_id); in lpfc_debugfs_nodelist_data()
985 len += scnprintf(buf + len, size - len, "WWPN x%llx ", in lpfc_debugfs_nodelist_data()
986 nrport->port_name); in lpfc_debugfs_nodelist_data()
987 len += scnprintf(buf + len, size - len, "WWNN x%llx ", in lpfc_debugfs_nodelist_data()
988 nrport->node_name); in lpfc_debugfs_nodelist_data()
991 if (nrport->port_role & FC_PORT_ROLE_NVME_INITIATOR) in lpfc_debugfs_nodelist_data()
992 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
994 if (nrport->port_role & FC_PORT_ROLE_NVME_TARGET) in lpfc_debugfs_nodelist_data()
995 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
997 if (nrport->port_role & FC_PORT_ROLE_NVME_DISCOVERY) in lpfc_debugfs_nodelist_data()
998 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
1000 if (nrport->port_role & ~(FC_PORT_ROLE_NVME_INITIATOR | in lpfc_debugfs_nodelist_data()
1003 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nodelist_data()
1005 nrport->port_role); in lpfc_debugfs_nodelist_data()
1007 len += scnprintf(buf + len, size - len, "\n"); in lpfc_debugfs_nodelist_data()
1010 spin_unlock_irq(shost->host_lock); in lpfc_debugfs_nodelist_data()
1016 * lpfc_debugfs_nvmestat_data - Dump target node list to a buffer
1031 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_nvmestat_data()
1042 if (phba->nvmet_support) { in lpfc_debugfs_nvmestat_data()
1043 if (!phba->targetport) in lpfc_debugfs_nvmestat_data()
1045 tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private; in lpfc_debugfs_nvmestat_data()
1046 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1049 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1051 atomic_read(&tgtp->rcv_ls_req_in), in lpfc_debugfs_nvmestat_data()
1052 atomic_read(&tgtp->rcv_ls_req_drop), in lpfc_debugfs_nvmestat_data()
1053 atomic_read(&tgtp->xmt_ls_abort)); in lpfc_debugfs_nvmestat_data()
1054 if (atomic_read(&tgtp->rcv_ls_req_in) != in lpfc_debugfs_nvmestat_data()
1055 atomic_read(&tgtp->rcv_ls_req_out)) { in lpfc_debugfs_nvmestat_data()
1056 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1058 atomic_read(&tgtp->rcv_ls_req_in), in lpfc_debugfs_nvmestat_data()
1059 atomic_read(&tgtp->rcv_ls_req_out)); in lpfc_debugfs_nvmestat_data()
1062 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1064 atomic_read(&tgtp->xmt_ls_rsp), in lpfc_debugfs_nvmestat_data()
1065 atomic_read(&tgtp->xmt_ls_drop), in lpfc_debugfs_nvmestat_data()
1066 atomic_read(&tgtp->xmt_ls_rsp_cmpl)); in lpfc_debugfs_nvmestat_data()
1068 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1070 atomic_read(&tgtp->xmt_ls_rsp_aborted), in lpfc_debugfs_nvmestat_data()
1071 atomic_read(&tgtp->xmt_ls_rsp_xb_set), in lpfc_debugfs_nvmestat_data()
1072 atomic_read(&tgtp->xmt_ls_rsp_error)); in lpfc_debugfs_nvmestat_data()
1074 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1077 atomic_read(&tgtp->rcv_fcp_cmd_in), in lpfc_debugfs_nvmestat_data()
1078 atomic_read(&tgtp->rcv_fcp_cmd_defer), in lpfc_debugfs_nvmestat_data()
1079 atomic_read(&tgtp->xmt_fcp_release), in lpfc_debugfs_nvmestat_data()
1080 atomic_read(&tgtp->rcv_fcp_cmd_drop)); in lpfc_debugfs_nvmestat_data()
1082 if (atomic_read(&tgtp->rcv_fcp_cmd_in) != in lpfc_debugfs_nvmestat_data()
1083 atomic_read(&tgtp->rcv_fcp_cmd_out)) { in lpfc_debugfs_nvmestat_data()
1084 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1086 atomic_read(&tgtp->rcv_fcp_cmd_in), in lpfc_debugfs_nvmestat_data()
1087 atomic_read(&tgtp->rcv_fcp_cmd_out)); in lpfc_debugfs_nvmestat_data()
1090 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1093 atomic_read(&tgtp->xmt_fcp_read), in lpfc_debugfs_nvmestat_data()
1094 atomic_read(&tgtp->xmt_fcp_read_rsp), in lpfc_debugfs_nvmestat_data()
1095 atomic_read(&tgtp->xmt_fcp_write), in lpfc_debugfs_nvmestat_data()
1096 atomic_read(&tgtp->xmt_fcp_rsp)); in lpfc_debugfs_nvmestat_data()
1098 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1100 atomic_read(&tgtp->xmt_fcp_rsp_cmpl), in lpfc_debugfs_nvmestat_data()
1101 atomic_read(&tgtp->xmt_fcp_rsp_error), in lpfc_debugfs_nvmestat_data()
1102 atomic_read(&tgtp->xmt_fcp_rsp_drop)); in lpfc_debugfs_nvmestat_data()
1104 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1106 atomic_read(&tgtp->xmt_fcp_rsp_aborted), in lpfc_debugfs_nvmestat_data()
1107 atomic_read(&tgtp->xmt_fcp_rsp_xb_set), in lpfc_debugfs_nvmestat_data()
1108 atomic_read(&tgtp->xmt_fcp_xri_abort_cqe)); in lpfc_debugfs_nvmestat_data()
1110 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1112 atomic_read(&tgtp->xmt_fcp_abort), in lpfc_debugfs_nvmestat_data()
1113 atomic_read(&tgtp->xmt_fcp_abort_cmpl)); in lpfc_debugfs_nvmestat_data()
1115 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1117 atomic_read(&tgtp->xmt_abort_sol), in lpfc_debugfs_nvmestat_data()
1118 atomic_read(&tgtp->xmt_abort_unsol), in lpfc_debugfs_nvmestat_data()
1119 atomic_read(&tgtp->xmt_abort_rsp), in lpfc_debugfs_nvmestat_data()
1120 atomic_read(&tgtp->xmt_abort_rsp_error)); in lpfc_debugfs_nvmestat_data()
1122 len += scnprintf(buf + len, size - len, "\n"); in lpfc_debugfs_nvmestat_data()
1125 spin_lock(&phba->sli4_hba.abts_nvmet_buf_list_lock); in lpfc_debugfs_nvmestat_data()
1127 &phba->sli4_hba.lpfc_abts_nvmet_ctx_list, in lpfc_debugfs_nvmestat_data()
1131 spin_unlock(&phba->sli4_hba.abts_nvmet_buf_list_lock); in lpfc_debugfs_nvmestat_data()
1133 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1135 spin_lock(&phba->sli4_hba.abts_nvmet_buf_list_lock); in lpfc_debugfs_nvmestat_data()
1137 &phba->sli4_hba.lpfc_abts_nvmet_ctx_list, in lpfc_debugfs_nvmestat_data()
1139 if (len >= (size - LPFC_DEBUG_OUT_LINE_SZ)) in lpfc_debugfs_nvmestat_data()
1141 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1144 ctxp->oxid, ctxp->state, in lpfc_debugfs_nvmestat_data()
1145 ctxp->flag); in lpfc_debugfs_nvmestat_data()
1147 spin_unlock(&phba->sli4_hba.abts_nvmet_buf_list_lock); in lpfc_debugfs_nvmestat_data()
1151 tot = atomic_read(&tgtp->rcv_fcp_cmd_drop); in lpfc_debugfs_nvmestat_data()
1152 tot += atomic_read(&tgtp->xmt_fcp_release); in lpfc_debugfs_nvmestat_data()
1153 tot = atomic_read(&tgtp->rcv_fcp_cmd_in) - tot; in lpfc_debugfs_nvmestat_data()
1155 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1158 phba->sli4_hba.nvmet_xri_cnt, in lpfc_debugfs_nvmestat_data()
1159 phba->sli4_hba.nvmet_io_wait_cnt, in lpfc_debugfs_nvmestat_data()
1160 phba->sli4_hba.nvmet_io_wait_total, in lpfc_debugfs_nvmestat_data()
1163 if (!(vport->cfg_enable_fc4_type & LPFC_ENABLE_NVME)) in lpfc_debugfs_nvmestat_data()
1166 localport = vport->localport; in lpfc_debugfs_nvmestat_data()
1169 lport = (struct lpfc_nvme_lport *)localport->private; in lpfc_debugfs_nvmestat_data()
1173 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1176 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1178 atomic_read(&lport->fc4NvmeLsRequests), in lpfc_debugfs_nvmestat_data()
1179 atomic_read(&lport->fc4NvmeLsCmpls)); in lpfc_debugfs_nvmestat_data()
1183 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_debugfs_nvmestat_data()
1184 cstat = &phba->sli4_hba.hdwq[i].nvme_cstat; in lpfc_debugfs_nvmestat_data()
1185 tot = cstat->io_cmpls; in lpfc_debugfs_nvmestat_data()
1187 data1 = cstat->input_requests; in lpfc_debugfs_nvmestat_data()
1188 data2 = cstat->output_requests; in lpfc_debugfs_nvmestat_data()
1189 data3 = cstat->control_requests; in lpfc_debugfs_nvmestat_data()
1196 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_debugfs_nvmestat_data()
1200 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_debugfs_nvmestat_data()
1202 tot, ((data1 + data2 + data3) - tot)); in lpfc_debugfs_nvmestat_data()
1204 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_debugfs_nvmestat_data()
1207 totin, totout, totout - totin); in lpfc_debugfs_nvmestat_data()
1209 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1212 atomic_read(&lport->xmt_ls_abort), in lpfc_debugfs_nvmestat_data()
1213 atomic_read(&lport->xmt_ls_err), in lpfc_debugfs_nvmestat_data()
1214 atomic_read(&lport->cmpl_ls_xb), in lpfc_debugfs_nvmestat_data()
1215 atomic_read(&lport->cmpl_ls_err)); in lpfc_debugfs_nvmestat_data()
1217 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1220 atomic_read(&lport->xmt_fcp_noxri), in lpfc_debugfs_nvmestat_data()
1221 atomic_read(&lport->xmt_fcp_bad_ndlp), in lpfc_debugfs_nvmestat_data()
1222 atomic_read(&lport->xmt_fcp_qdepth), in lpfc_debugfs_nvmestat_data()
1223 atomic_read(&lport->xmt_fcp_wqerr), in lpfc_debugfs_nvmestat_data()
1224 atomic_read(&lport->xmt_fcp_err), in lpfc_debugfs_nvmestat_data()
1225 atomic_read(&lport->xmt_fcp_abort)); in lpfc_debugfs_nvmestat_data()
1227 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmestat_data()
1229 atomic_read(&lport->cmpl_fcp_xb), in lpfc_debugfs_nvmestat_data()
1230 atomic_read(&lport->cmpl_fcp_err)); in lpfc_debugfs_nvmestat_data()
1238 * lpfc_debugfs_scsistat_data - Dump target node list to a buffer
1254 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_scsistat_data()
1261 if (!(vport->cfg_enable_fc4_type & LPFC_ENABLE_FCP) || in lpfc_debugfs_scsistat_data()
1262 (phba->sli_rev != LPFC_SLI_REV4)) in lpfc_debugfs_scsistat_data()
1269 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_debugfs_scsistat_data()
1270 cstat = &phba->sli4_hba.hdwq[i].scsi_cstat; in lpfc_debugfs_scsistat_data()
1271 tot = cstat->io_cmpls; in lpfc_debugfs_scsistat_data()
1273 data1 = cstat->input_requests; in lpfc_debugfs_scsistat_data()
1274 data2 = cstat->output_requests; in lpfc_debugfs_scsistat_data()
1275 data3 = cstat->control_requests; in lpfc_debugfs_scsistat_data()
1284 tot, ((data1 + data2 + data3) - tot)); in lpfc_debugfs_scsistat_data()
1289 "OutIO %016llx\n", totin, totout, totout - totin); in lpfc_debugfs_scsistat_data()
1304 if (!lpfc_cmd->ts_last_cmd || in lpfc_io_ktime()
1305 !lpfc_cmd->ts_cmd_start || in lpfc_io_ktime()
1306 !lpfc_cmd->ts_cmd_wqput || in lpfc_io_ktime()
1307 !lpfc_cmd->ts_isr_cmpl || in lpfc_io_ktime()
1308 !lpfc_cmd->ts_data_io) in lpfc_io_ktime()
1311 if (lpfc_cmd->ts_data_io < lpfc_cmd->ts_cmd_start) in lpfc_io_ktime()
1313 if (lpfc_cmd->ts_cmd_start < lpfc_cmd->ts_last_cmd) in lpfc_io_ktime()
1315 if (lpfc_cmd->ts_cmd_wqput < lpfc_cmd->ts_cmd_start) in lpfc_io_ktime()
1317 if (lpfc_cmd->ts_isr_cmpl < lpfc_cmd->ts_cmd_wqput) in lpfc_io_ktime()
1319 if (lpfc_cmd->ts_data_io < lpfc_cmd->ts_isr_cmpl) in lpfc_io_ktime()
1322 * Segment 1 - Time from Last FCP command cmpl is handed in lpfc_io_ktime()
1324 * Segment 2 - Time from Driver receives a IO cmd start in lpfc_io_ktime()
1326 * Segment 3 - Time from Driver WQ put is done on IO cmd in lpfc_io_ktime()
1327 * to MSI-X ISR for IO cmpl. in lpfc_io_ktime()
1328 * Segment 4 - Time from MSI-X ISR for IO cmpl to when in lpfc_io_ktime()
1331 seg1 = lpfc_cmd->ts_cmd_start - lpfc_cmd->ts_last_cmd; in lpfc_io_ktime()
1332 if (seg1 > 5000000) /* 5 ms - for sequential IOs only */ in lpfc_io_ktime()
1336 seg2 = (lpfc_cmd->ts_cmd_wqput - lpfc_cmd->ts_cmd_start); in lpfc_io_ktime()
1338 seg3 = lpfc_cmd->ts_isr_cmpl - lpfc_cmd->ts_cmd_start; in lpfc_io_ktime()
1341 seg3 -= segsum; in lpfc_io_ktime()
1344 seg4 = lpfc_cmd->ts_data_io - lpfc_cmd->ts_cmd_start; in lpfc_io_ktime()
1347 seg4 -= segsum; in lpfc_io_ktime()
1349 phba->ktime_data_samples++; in lpfc_io_ktime()
1350 phba->ktime_seg1_total += seg1; in lpfc_io_ktime()
1351 if (seg1 < phba->ktime_seg1_min) in lpfc_io_ktime()
1352 phba->ktime_seg1_min = seg1; in lpfc_io_ktime()
1353 else if (seg1 > phba->ktime_seg1_max) in lpfc_io_ktime()
1354 phba->ktime_seg1_max = seg1; in lpfc_io_ktime()
1355 phba->ktime_seg2_total += seg2; in lpfc_io_ktime()
1356 if (seg2 < phba->ktime_seg2_min) in lpfc_io_ktime()
1357 phba->ktime_seg2_min = seg2; in lpfc_io_ktime()
1358 else if (seg2 > phba->ktime_seg2_max) in lpfc_io_ktime()
1359 phba->ktime_seg2_max = seg2; in lpfc_io_ktime()
1360 phba->ktime_seg3_total += seg3; in lpfc_io_ktime()
1361 if (seg3 < phba->ktime_seg3_min) in lpfc_io_ktime()
1362 phba->ktime_seg3_min = seg3; in lpfc_io_ktime()
1363 else if (seg3 > phba->ktime_seg3_max) in lpfc_io_ktime()
1364 phba->ktime_seg3_max = seg3; in lpfc_io_ktime()
1365 phba->ktime_seg4_total += seg4; in lpfc_io_ktime()
1366 if (seg4 < phba->ktime_seg4_min) in lpfc_io_ktime()
1367 phba->ktime_seg4_min = seg4; in lpfc_io_ktime()
1368 else if (seg4 > phba->ktime_seg4_max) in lpfc_io_ktime()
1369 phba->ktime_seg4_max = seg4; in lpfc_io_ktime()
1371 lpfc_cmd->ts_last_cmd = 0; in lpfc_io_ktime()
1372 lpfc_cmd->ts_cmd_start = 0; in lpfc_io_ktime()
1373 lpfc_cmd->ts_cmd_wqput = 0; in lpfc_io_ktime()
1374 lpfc_cmd->ts_isr_cmpl = 0; in lpfc_io_ktime()
1375 lpfc_cmd->ts_data_io = 0; in lpfc_io_ktime()
1379 * lpfc_debugfs_ioktime_data - Dump target node list to a buffer
1394 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_ioktime_data()
1397 if (phba->nvmet_support == 0) { in lpfc_debugfs_ioktime_data()
1399 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1401 (phba->ktime_on ? "Enabled" : "Disabled"), in lpfc_debugfs_ioktime_data()
1402 phba->ktime_data_samples); in lpfc_debugfs_ioktime_data()
1403 if (phba->ktime_data_samples == 0) in lpfc_debugfs_ioktime_data()
1407 buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1409 "done -to- Start of next Cmd (in driver)\n"); in lpfc_debugfs_ioktime_data()
1411 buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1413 div_u64(phba->ktime_seg1_total, in lpfc_debugfs_ioktime_data()
1414 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1415 phba->ktime_seg1_min, in lpfc_debugfs_ioktime_data()
1416 phba->ktime_seg1_max); in lpfc_debugfs_ioktime_data()
1418 buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1420 "-to- Firmware WQ doorbell\n"); in lpfc_debugfs_ioktime_data()
1422 buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1424 div_u64(phba->ktime_seg2_total, in lpfc_debugfs_ioktime_data()
1425 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1426 phba->ktime_seg2_min, in lpfc_debugfs_ioktime_data()
1427 phba->ktime_seg2_max); in lpfc_debugfs_ioktime_data()
1429 buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1430 "Segment 3: Firmware WQ doorbell -to- " in lpfc_debugfs_ioktime_data()
1431 "MSI-X ISR cmpl\n"); in lpfc_debugfs_ioktime_data()
1433 buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1435 div_u64(phba->ktime_seg3_total, in lpfc_debugfs_ioktime_data()
1436 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1437 phba->ktime_seg3_min, in lpfc_debugfs_ioktime_data()
1438 phba->ktime_seg3_max); in lpfc_debugfs_ioktime_data()
1440 buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1441 "Segment 4: MSI-X ISR cmpl -to- " in lpfc_debugfs_ioktime_data()
1444 buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1446 div_u64(phba->ktime_seg4_total, in lpfc_debugfs_ioktime_data()
1447 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1448 phba->ktime_seg4_min, in lpfc_debugfs_ioktime_data()
1449 phba->ktime_seg4_max); in lpfc_debugfs_ioktime_data()
1451 buf + len, PAGE_SIZE - len, in lpfc_debugfs_ioktime_data()
1453 div_u64(phba->ktime_seg1_total + in lpfc_debugfs_ioktime_data()
1454 phba->ktime_seg2_total + in lpfc_debugfs_ioktime_data()
1455 phba->ktime_seg3_total + in lpfc_debugfs_ioktime_data()
1456 phba->ktime_seg4_total, in lpfc_debugfs_ioktime_data()
1457 phba->ktime_data_samples)); in lpfc_debugfs_ioktime_data()
1462 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1464 (phba->ktime_on ? "Enabled" : "Disabled"), in lpfc_debugfs_ioktime_data()
1465 phba->ktime_data_samples, in lpfc_debugfs_ioktime_data()
1466 phba->ktime_status_samples); in lpfc_debugfs_ioktime_data()
1467 if (phba->ktime_data_samples == 0) in lpfc_debugfs_ioktime_data()
1470 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1471 "Segment 1: MSI-X ISR Rcv cmd -to- " in lpfc_debugfs_ioktime_data()
1473 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1475 div_u64(phba->ktime_seg1_total, in lpfc_debugfs_ioktime_data()
1476 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1477 phba->ktime_seg1_min, in lpfc_debugfs_ioktime_data()
1478 phba->ktime_seg1_max); in lpfc_debugfs_ioktime_data()
1479 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1480 "Segment 2: cmd pass to NVME Layer- " in lpfc_debugfs_ioktime_data()
1481 "-to- Driver rcv cmd OP (action)\n"); in lpfc_debugfs_ioktime_data()
1482 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1484 div_u64(phba->ktime_seg2_total, in lpfc_debugfs_ioktime_data()
1485 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1486 phba->ktime_seg2_min, in lpfc_debugfs_ioktime_data()
1487 phba->ktime_seg2_max); in lpfc_debugfs_ioktime_data()
1488 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1489 "Segment 3: Driver rcv cmd OP -to- " in lpfc_debugfs_ioktime_data()
1491 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1493 div_u64(phba->ktime_seg3_total, in lpfc_debugfs_ioktime_data()
1494 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1495 phba->ktime_seg3_min, in lpfc_debugfs_ioktime_data()
1496 phba->ktime_seg3_max); in lpfc_debugfs_ioktime_data()
1497 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1499 "-to- MSI-X ISR for cmd cmpl\n"); in lpfc_debugfs_ioktime_data()
1500 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1502 div_u64(phba->ktime_seg4_total, in lpfc_debugfs_ioktime_data()
1503 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1504 phba->ktime_seg4_min, in lpfc_debugfs_ioktime_data()
1505 phba->ktime_seg4_max); in lpfc_debugfs_ioktime_data()
1506 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1507 "Segment 5: MSI-X ISR for cmd cmpl " in lpfc_debugfs_ioktime_data()
1508 "-to- NVME layer passed cmd done\n"); in lpfc_debugfs_ioktime_data()
1509 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1511 div_u64(phba->ktime_seg5_total, in lpfc_debugfs_ioktime_data()
1512 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1513 phba->ktime_seg5_min, in lpfc_debugfs_ioktime_data()
1514 phba->ktime_seg5_max); in lpfc_debugfs_ioktime_data()
1516 if (phba->ktime_status_samples == 0) { in lpfc_debugfs_ioktime_data()
1517 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1518 "Total: cmd received by MSI-X ISR " in lpfc_debugfs_ioktime_data()
1519 "-to- cmd completed on wire\n"); in lpfc_debugfs_ioktime_data()
1520 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1523 div_u64(phba->ktime_seg10_total, in lpfc_debugfs_ioktime_data()
1524 phba->ktime_data_samples), in lpfc_debugfs_ioktime_data()
1525 phba->ktime_seg10_min, in lpfc_debugfs_ioktime_data()
1526 phba->ktime_seg10_max); in lpfc_debugfs_ioktime_data()
1530 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1532 "-to- Driver rcv rsp status OP\n"); in lpfc_debugfs_ioktime_data()
1533 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1535 div_u64(phba->ktime_seg6_total, in lpfc_debugfs_ioktime_data()
1536 phba->ktime_status_samples), in lpfc_debugfs_ioktime_data()
1537 phba->ktime_seg6_min, in lpfc_debugfs_ioktime_data()
1538 phba->ktime_seg6_max); in lpfc_debugfs_ioktime_data()
1539 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1541 "-to- Firmware WQ doorbell: status\n"); in lpfc_debugfs_ioktime_data()
1542 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1544 div_u64(phba->ktime_seg7_total, in lpfc_debugfs_ioktime_data()
1545 phba->ktime_status_samples), in lpfc_debugfs_ioktime_data()
1546 phba->ktime_seg7_min, in lpfc_debugfs_ioktime_data()
1547 phba->ktime_seg7_max); in lpfc_debugfs_ioktime_data()
1548 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1550 " -to- MSI-X ISR for status cmpl\n"); in lpfc_debugfs_ioktime_data()
1551 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1553 div_u64(phba->ktime_seg8_total, in lpfc_debugfs_ioktime_data()
1554 phba->ktime_status_samples), in lpfc_debugfs_ioktime_data()
1555 phba->ktime_seg8_min, in lpfc_debugfs_ioktime_data()
1556 phba->ktime_seg8_max); in lpfc_debugfs_ioktime_data()
1557 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1558 "Segment 9: MSI-X ISR for status cmpl " in lpfc_debugfs_ioktime_data()
1559 "-to- NVME layer passed status done\n"); in lpfc_debugfs_ioktime_data()
1560 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1562 div_u64(phba->ktime_seg9_total, in lpfc_debugfs_ioktime_data()
1563 phba->ktime_status_samples), in lpfc_debugfs_ioktime_data()
1564 phba->ktime_seg9_min, in lpfc_debugfs_ioktime_data()
1565 phba->ktime_seg9_max); in lpfc_debugfs_ioktime_data()
1566 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1567 "Total: cmd received by MSI-X ISR -to- " in lpfc_debugfs_ioktime_data()
1569 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_debugfs_ioktime_data()
1571 div_u64(phba->ktime_seg10_total, in lpfc_debugfs_ioktime_data()
1572 phba->ktime_status_samples), in lpfc_debugfs_ioktime_data()
1573 phba->ktime_seg10_min, in lpfc_debugfs_ioktime_data()
1574 phba->ktime_seg10_max); in lpfc_debugfs_ioktime_data()
1579 * lpfc_debugfs_nvmeio_trc_data - Dump NVME IO trace list to a buffer
1598 state = phba->nvmeio_trc_on; in lpfc_debugfs_nvmeio_trc_data()
1600 index = (atomic_read(&phba->nvmeio_trc_cnt) + 1) & in lpfc_debugfs_nvmeio_trc_data()
1601 (phba->nvmeio_trc_size - 1); in lpfc_debugfs_nvmeio_trc_data()
1602 skip = phba->nvmeio_trc_output_idx; in lpfc_debugfs_nvmeio_trc_data()
1604 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmeio_trc_data()
1606 (phba->nvmet_support ? "NVME" : "NVMET"), in lpfc_debugfs_nvmeio_trc_data()
1608 index, skip, phba->nvmeio_trc_size); in lpfc_debugfs_nvmeio_trc_data()
1610 if (!phba->nvmeio_trc || state) in lpfc_debugfs_nvmeio_trc_data()
1615 for (i = index; i < phba->nvmeio_trc_size; i++) { in lpfc_debugfs_nvmeio_trc_data()
1617 skip--; in lpfc_debugfs_nvmeio_trc_data()
1620 dtp = phba->nvmeio_trc + i; in lpfc_debugfs_nvmeio_trc_data()
1621 phba->nvmeio_trc_output_idx++; in lpfc_debugfs_nvmeio_trc_data()
1623 if (!dtp->fmt) in lpfc_debugfs_nvmeio_trc_data()
1626 len += scnprintf(buf + len, size - len, dtp->fmt, in lpfc_debugfs_nvmeio_trc_data()
1627 dtp->data1, dtp->data2, dtp->data3); in lpfc_debugfs_nvmeio_trc_data()
1629 if (phba->nvmeio_trc_output_idx >= phba->nvmeio_trc_size) { in lpfc_debugfs_nvmeio_trc_data()
1630 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_nvmeio_trc_data()
1631 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmeio_trc_data()
1636 if (len >= (size - LPFC_DEBUG_OUT_LINE_SZ)) { in lpfc_debugfs_nvmeio_trc_data()
1637 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmeio_trc_data()
1639 phba->nvmeio_trc_output_idx, in lpfc_debugfs_nvmeio_trc_data()
1640 phba->nvmeio_trc_size); in lpfc_debugfs_nvmeio_trc_data()
1646 skip--; in lpfc_debugfs_nvmeio_trc_data()
1649 dtp = phba->nvmeio_trc + i; in lpfc_debugfs_nvmeio_trc_data()
1650 phba->nvmeio_trc_output_idx++; in lpfc_debugfs_nvmeio_trc_data()
1652 if (!dtp->fmt) in lpfc_debugfs_nvmeio_trc_data()
1655 len += scnprintf(buf + len, size - len, dtp->fmt, in lpfc_debugfs_nvmeio_trc_data()
1656 dtp->data1, dtp->data2, dtp->data3); in lpfc_debugfs_nvmeio_trc_data()
1658 if (phba->nvmeio_trc_output_idx >= phba->nvmeio_trc_size) { in lpfc_debugfs_nvmeio_trc_data()
1659 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_nvmeio_trc_data()
1660 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmeio_trc_data()
1665 if (len >= (size - LPFC_DEBUG_OUT_LINE_SZ)) { in lpfc_debugfs_nvmeio_trc_data()
1666 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmeio_trc_data()
1668 phba->nvmeio_trc_output_idx, in lpfc_debugfs_nvmeio_trc_data()
1669 phba->nvmeio_trc_size); in lpfc_debugfs_nvmeio_trc_data()
1674 len += scnprintf(buf + len, size - len, in lpfc_debugfs_nvmeio_trc_data()
1681 * lpfc_debugfs_hdwqstat_data - Dump I/O stats to a buffer
1696 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_hdwqstat_data()
1709 (phba->hdwqstat_on & in lpfc_debugfs_hdwqstat_data()
1716 (phba->hdwqstat_on & LPFC_CHECK_SCSI_IO ? in lpfc_debugfs_hdwqstat_data()
1725 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_debugfs_hdwqstat_data()
1731 c_stat = per_cpu_ptr(phba->sli4_hba.c_stat, j); in lpfc_debugfs_hdwqstat_data()
1734 if (i != c_stat->hdwq_no) in lpfc_debugfs_hdwqstat_data()
1737 /* Only display non-zero counters */ in lpfc_debugfs_hdwqstat_data()
1738 if (!c_stat->xmt_io && !c_stat->cmpl_io && in lpfc_debugfs_hdwqstat_data()
1739 !c_stat->rcv_io) in lpfc_debugfs_hdwqstat_data()
1749 tot_xmt += c_stat->xmt_io; in lpfc_debugfs_hdwqstat_data()
1750 tot_cmpl += c_stat->cmpl_io; in lpfc_debugfs_hdwqstat_data()
1751 if (phba->nvmet_support) in lpfc_debugfs_hdwqstat_data()
1752 tot_rcv += c_stat->rcv_io; in lpfc_debugfs_hdwqstat_data()
1758 if (phba->nvmet_support) { in lpfc_debugfs_hdwqstat_data()
1761 c_stat->xmt_io, c_stat->cmpl_io, in lpfc_debugfs_hdwqstat_data()
1762 c_stat->rcv_io); in lpfc_debugfs_hdwqstat_data()
1768 c_stat->xmt_io, c_stat->cmpl_io); in lpfc_debugfs_hdwqstat_data()
1778 scnprintf(tmp, sizeof(tmp), "\t->\t[HDWQ Total: "); in lpfc_debugfs_hdwqstat_data()
1782 if (phba->nvmet_support) { in lpfc_debugfs_hdwqstat_data()
1805 * lpfc_debugfs_disc_trc - Store discovery trace log
1832 !vport || !vport->disc_trc) in lpfc_debugfs_disc_trc()
1835 index = atomic_inc_return(&vport->disc_trc_cnt) & in lpfc_debugfs_disc_trc()
1836 (lpfc_debugfs_max_disc_trc - 1); in lpfc_debugfs_disc_trc()
1837 dtp = vport->disc_trc + index; in lpfc_debugfs_disc_trc()
1838 dtp->fmt = fmt; in lpfc_debugfs_disc_trc()
1839 dtp->data1 = data1; in lpfc_debugfs_disc_trc()
1840 dtp->data2 = data2; in lpfc_debugfs_disc_trc()
1841 dtp->data3 = data3; in lpfc_debugfs_disc_trc()
1842 dtp->seq_cnt = atomic_inc_return(&lpfc_debugfs_seq_trc_cnt); in lpfc_debugfs_disc_trc()
1843 dtp->jif = jiffies; in lpfc_debugfs_disc_trc()
1849 * lpfc_debugfs_slow_ring_trc - Store slow ring trace log
1870 !phba || !phba->slow_ring_trc) in lpfc_debugfs_slow_ring_trc()
1873 index = atomic_inc_return(&phba->slow_ring_trc_cnt) & in lpfc_debugfs_slow_ring_trc()
1874 (lpfc_debugfs_max_slow_ring_trc - 1); in lpfc_debugfs_slow_ring_trc()
1875 dtp = phba->slow_ring_trc + index; in lpfc_debugfs_slow_ring_trc()
1876 dtp->fmt = fmt; in lpfc_debugfs_slow_ring_trc()
1877 dtp->data1 = data1; in lpfc_debugfs_slow_ring_trc()
1878 dtp->data2 = data2; in lpfc_debugfs_slow_ring_trc()
1879 dtp->data3 = data3; in lpfc_debugfs_slow_ring_trc()
1880 dtp->seq_cnt = atomic_inc_return(&lpfc_debugfs_seq_trc_cnt); in lpfc_debugfs_slow_ring_trc()
1881 dtp->jif = jiffies; in lpfc_debugfs_slow_ring_trc()
1887 * lpfc_debugfs_nvme_trc - Store NVME/NVMET trace log
1907 if (!phba->nvmeio_trc_on || !phba->nvmeio_trc) in lpfc_debugfs_nvme_trc()
1910 index = atomic_inc_return(&phba->nvmeio_trc_cnt) & in lpfc_debugfs_nvme_trc()
1911 (phba->nvmeio_trc_size - 1); in lpfc_debugfs_nvme_trc()
1912 dtp = phba->nvmeio_trc + index; in lpfc_debugfs_nvme_trc()
1913 dtp->fmt = fmt; in lpfc_debugfs_nvme_trc()
1914 dtp->data1 = data1; in lpfc_debugfs_nvme_trc()
1915 dtp->data2 = data2; in lpfc_debugfs_nvme_trc()
1916 dtp->data3 = data3; in lpfc_debugfs_nvme_trc()
1922 * lpfc_debugfs_disc_trc_open - Open the discovery trace log
1929 * for the log, fills the buffer from the in-memory log for this vport, and then
1939 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_disc_trc_open()
1942 int rc = -ENOMEM; in lpfc_debugfs_disc_trc_open()
1945 rc = -ENOSPC; in lpfc_debugfs_disc_trc_open()
1957 debug->buffer = kmalloc(size, GFP_KERNEL); in lpfc_debugfs_disc_trc_open()
1958 if (!debug->buffer) { in lpfc_debugfs_disc_trc_open()
1963 debug->len = lpfc_debugfs_disc_trc_data(vport, debug->buffer, size); in lpfc_debugfs_disc_trc_open()
1964 file->private_data = debug; in lpfc_debugfs_disc_trc_open()
1972 * lpfc_debugfs_slow_ring_trc_open - Open the Slow Ring trace log
1979 * for the log, fills the buffer from the in-memory log for this vport, and then
1989 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_slow_ring_trc_open()
1992 int rc = -ENOMEM; in lpfc_debugfs_slow_ring_trc_open()
1995 rc = -ENOSPC; in lpfc_debugfs_slow_ring_trc_open()
2007 debug->buffer = kmalloc(size, GFP_KERNEL); in lpfc_debugfs_slow_ring_trc_open()
2008 if (!debug->buffer) { in lpfc_debugfs_slow_ring_trc_open()
2013 debug->len = lpfc_debugfs_slow_ring_trc_data(phba, debug->buffer, size); in lpfc_debugfs_slow_ring_trc_open()
2014 file->private_data = debug; in lpfc_debugfs_slow_ring_trc_open()
2022 * lpfc_debugfs_hbqinfo_open - Open the hbqinfo debugfs buffer
2029 * for the log, fills the buffer from the in-memory log for this vport, and then
2039 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_hbqinfo_open()
2041 int rc = -ENOMEM; in lpfc_debugfs_hbqinfo_open()
2048 debug->buffer = kmalloc(LPFC_HBQINFO_SIZE, GFP_KERNEL); in lpfc_debugfs_hbqinfo_open()
2049 if (!debug->buffer) { in lpfc_debugfs_hbqinfo_open()
2054 debug->len = lpfc_debugfs_hbqinfo_data(phba, debug->buffer, in lpfc_debugfs_hbqinfo_open()
2056 file->private_data = debug; in lpfc_debugfs_hbqinfo_open()
2064 * lpfc_debugfs_multixripools_open - Open the multixripool debugfs buffer
2071 * for the log, fills the buffer from the in-memory log for this hba, and then
2081 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_multixripools_open()
2083 int rc = -ENOMEM; in lpfc_debugfs_multixripools_open()
2090 debug->buffer = kzalloc(LPFC_DUMP_MULTIXRIPOOL_SIZE, GFP_KERNEL); in lpfc_debugfs_multixripools_open()
2091 if (!debug->buffer) { in lpfc_debugfs_multixripools_open()
2096 debug->len = lpfc_debugfs_multixripools_data( in lpfc_debugfs_multixripools_open()
2097 phba, debug->buffer, LPFC_DUMP_MULTIXRIPOOL_SIZE); in lpfc_debugfs_multixripools_open()
2099 debug->i_private = inode->i_private; in lpfc_debugfs_multixripools_open()
2100 file->private_data = debug; in lpfc_debugfs_multixripools_open()
2109 * lpfc_debugfs_lockstat_open - Open the lockstat debugfs buffer
2116 * for the log, fills the buffer from the in-memory log for this vport, and then
2126 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_lockstat_open()
2128 int rc = -ENOMEM; in lpfc_debugfs_lockstat_open()
2135 debug->buffer = kmalloc(LPFC_HDWQINFO_SIZE, GFP_KERNEL); in lpfc_debugfs_lockstat_open()
2136 if (!debug->buffer) { in lpfc_debugfs_lockstat_open()
2141 debug->len = lpfc_debugfs_lockstat_data(phba, debug->buffer, in lpfc_debugfs_lockstat_open()
2143 file->private_data = debug; in lpfc_debugfs_lockstat_open()
2154 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_lockstat_write()
2155 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_debugfs_lockstat_write()
2164 return -EFAULT; in lpfc_debugfs_lockstat_write()
2169 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_debugfs_lockstat_write()
2170 qp = &phba->sli4_hba.hdwq[i]; in lpfc_debugfs_lockstat_write()
2171 qp->lock_conflict.alloc_xri_get = 0; in lpfc_debugfs_lockstat_write()
2172 qp->lock_conflict.alloc_xri_put = 0; in lpfc_debugfs_lockstat_write()
2173 qp->lock_conflict.free_xri = 0; in lpfc_debugfs_lockstat_write()
2174 qp->lock_conflict.wq_access = 0; in lpfc_debugfs_lockstat_write()
2175 qp->lock_conflict.alloc_pvt_pool = 0; in lpfc_debugfs_lockstat_write()
2176 qp->lock_conflict.mv_from_pvt_pool = 0; in lpfc_debugfs_lockstat_write()
2177 qp->lock_conflict.mv_to_pub_pool = 0; in lpfc_debugfs_lockstat_write()
2178 qp->lock_conflict.mv_to_pvt_pool = 0; in lpfc_debugfs_lockstat_write()
2179 qp->lock_conflict.free_pvt_pool = 0; in lpfc_debugfs_lockstat_write()
2180 qp->lock_conflict.free_pub_pool = 0; in lpfc_debugfs_lockstat_write()
2181 qp->lock_conflict.wq_access = 0; in lpfc_debugfs_lockstat_write()
2196 spin_lock_irq(&phba->hbalock); in lpfc_debugfs_ras_log_data()
2197 if (phba->ras_fwlog.state != ACTIVE) { in lpfc_debugfs_ras_log_data()
2198 spin_unlock_irq(&phba->hbalock); in lpfc_debugfs_ras_log_data()
2199 return -EINVAL; in lpfc_debugfs_ras_log_data()
2201 spin_unlock_irq(&phba->hbalock); in lpfc_debugfs_ras_log_data()
2204 &phba->ras_fwlog.fwlog_buff_list, list) { in lpfc_debugfs_ras_log_data()
2206 if ((copied + LPFC_RAS_MAX_ENTRY_SIZE) >= (size - 1)) { in lpfc_debugfs_ras_log_data()
2207 memcpy(buffer + copied, dmabuf->virt, in lpfc_debugfs_ras_log_data()
2208 size - copied - 1); in lpfc_debugfs_ras_log_data()
2209 copied += size - copied - 1; in lpfc_debugfs_ras_log_data()
2212 memcpy(buffer + copied, dmabuf->virt, LPFC_RAS_MAX_ENTRY_SIZE); in lpfc_debugfs_ras_log_data()
2221 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_ras_log_release()
2223 vfree(debug->buffer); in lpfc_debugfs_ras_log_release()
2230 * lpfc_debugfs_ras_log_open - Open the RAS log debugfs buffer
2237 * for the log, fills the buffer from the in-memory log for this vport, and then
2247 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_ras_log_open()
2250 int rc = -ENOMEM; in lpfc_debugfs_ras_log_open()
2252 spin_lock_irq(&phba->hbalock); in lpfc_debugfs_ras_log_open()
2253 if (phba->ras_fwlog.state != ACTIVE) { in lpfc_debugfs_ras_log_open()
2254 spin_unlock_irq(&phba->hbalock); in lpfc_debugfs_ras_log_open()
2255 rc = -EINVAL; in lpfc_debugfs_ras_log_open()
2258 spin_unlock_irq(&phba->hbalock); in lpfc_debugfs_ras_log_open()
2263 size = LPFC_RAS_MIN_BUFF_POST_SIZE * phba->cfg_ras_fwlog_buffsize; in lpfc_debugfs_ras_log_open()
2264 debug->buffer = vmalloc(size); in lpfc_debugfs_ras_log_open()
2265 if (!debug->buffer) in lpfc_debugfs_ras_log_open()
2268 debug->len = lpfc_debugfs_ras_log_data(phba, debug->buffer, size); in lpfc_debugfs_ras_log_open()
2269 if (debug->len < 0) { in lpfc_debugfs_ras_log_open()
2270 rc = -EINVAL; in lpfc_debugfs_ras_log_open()
2273 file->private_data = debug; in lpfc_debugfs_ras_log_open()
2278 vfree(debug->buffer); in lpfc_debugfs_ras_log_open()
2286 * lpfc_debugfs_dumpHBASlim_open - Open the Dump HBA SLIM debugfs buffer
2293 * for the log, fills the buffer from the in-memory log for this vport, and then
2303 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_dumpHBASlim_open()
2305 int rc = -ENOMEM; in lpfc_debugfs_dumpHBASlim_open()
2312 debug->buffer = kmalloc(LPFC_DUMPHBASLIM_SIZE, GFP_KERNEL); in lpfc_debugfs_dumpHBASlim_open()
2313 if (!debug->buffer) { in lpfc_debugfs_dumpHBASlim_open()
2318 debug->len = lpfc_debugfs_dumpHBASlim_data(phba, debug->buffer, in lpfc_debugfs_dumpHBASlim_open()
2320 file->private_data = debug; in lpfc_debugfs_dumpHBASlim_open()
2328 * lpfc_debugfs_dumpHostSlim_open - Open the Dump Host SLIM debugfs buffer
2335 * for the log, fills the buffer from the in-memory log for this vport, and then
2345 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_dumpHostSlim_open()
2347 int rc = -ENOMEM; in lpfc_debugfs_dumpHostSlim_open()
2354 debug->buffer = kmalloc(LPFC_DUMPHOSTSLIM_SIZE, GFP_KERNEL); in lpfc_debugfs_dumpHostSlim_open()
2355 if (!debug->buffer) { in lpfc_debugfs_dumpHostSlim_open()
2360 debug->len = lpfc_debugfs_dumpHostSlim_data(phba, debug->buffer, in lpfc_debugfs_dumpHostSlim_open()
2362 file->private_data = debug; in lpfc_debugfs_dumpHostSlim_open()
2373 struct dentry *dent = file->f_path.dentry; in lpfc_debugfs_dif_err_read()
2374 struct lpfc_hba *phba = file->private_data; in lpfc_debugfs_dif_err_read()
2379 if (dent == phba->debug_writeGuard) in lpfc_debugfs_dif_err_read()
2380 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_wgrd_cnt); in lpfc_debugfs_dif_err_read()
2381 else if (dent == phba->debug_writeApp) in lpfc_debugfs_dif_err_read()
2382 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_wapp_cnt); in lpfc_debugfs_dif_err_read()
2383 else if (dent == phba->debug_writeRef) in lpfc_debugfs_dif_err_read()
2384 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_wref_cnt); in lpfc_debugfs_dif_err_read()
2385 else if (dent == phba->debug_readGuard) in lpfc_debugfs_dif_err_read()
2386 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_rgrd_cnt); in lpfc_debugfs_dif_err_read()
2387 else if (dent == phba->debug_readApp) in lpfc_debugfs_dif_err_read()
2388 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_rapp_cnt); in lpfc_debugfs_dif_err_read()
2389 else if (dent == phba->debug_readRef) in lpfc_debugfs_dif_err_read()
2390 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_rref_cnt); in lpfc_debugfs_dif_err_read()
2391 else if (dent == phba->debug_InjErrNPortID) in lpfc_debugfs_dif_err_read()
2393 phba->lpfc_injerr_nportid); in lpfc_debugfs_dif_err_read()
2394 else if (dent == phba->debug_InjErrWWPN) { in lpfc_debugfs_dif_err_read()
2395 memcpy(&tmp, &phba->lpfc_injerr_wwpn, sizeof(struct lpfc_name)); in lpfc_debugfs_dif_err_read()
2398 } else if (dent == phba->debug_InjErrLBA) { in lpfc_debugfs_dif_err_read()
2399 if (phba->lpfc_injerr_lba == (sector_t)(-1)) in lpfc_debugfs_dif_err_read()
2403 (uint64_t) phba->lpfc_injerr_lba); in lpfc_debugfs_dif_err_read()
2415 struct dentry *dent = file->f_path.dentry; in lpfc_debugfs_dif_err_write()
2416 struct lpfc_hba *phba = file->private_data; in lpfc_debugfs_dif_err_write()
2424 return -EFAULT; in lpfc_debugfs_dif_err_write()
2426 if (dent == phba->debug_InjErrLBA) { in lpfc_debugfs_dif_err_write()
2429 tmp = (uint64_t)(-1); in lpfc_debugfs_dif_err_write()
2433 return -EINVAL; in lpfc_debugfs_dif_err_write()
2435 if (dent == phba->debug_writeGuard) in lpfc_debugfs_dif_err_write()
2436 phba->lpfc_injerr_wgrd_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2437 else if (dent == phba->debug_writeApp) in lpfc_debugfs_dif_err_write()
2438 phba->lpfc_injerr_wapp_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2439 else if (dent == phba->debug_writeRef) in lpfc_debugfs_dif_err_write()
2440 phba->lpfc_injerr_wref_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2441 else if (dent == phba->debug_readGuard) in lpfc_debugfs_dif_err_write()
2442 phba->lpfc_injerr_rgrd_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2443 else if (dent == phba->debug_readApp) in lpfc_debugfs_dif_err_write()
2444 phba->lpfc_injerr_rapp_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2445 else if (dent == phba->debug_readRef) in lpfc_debugfs_dif_err_write()
2446 phba->lpfc_injerr_rref_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2447 else if (dent == phba->debug_InjErrLBA) in lpfc_debugfs_dif_err_write()
2448 phba->lpfc_injerr_lba = (sector_t)tmp; in lpfc_debugfs_dif_err_write()
2449 else if (dent == phba->debug_InjErrNPortID) in lpfc_debugfs_dif_err_write()
2450 phba->lpfc_injerr_nportid = (uint32_t)(tmp & Mask_DID); in lpfc_debugfs_dif_err_write()
2451 else if (dent == phba->debug_InjErrWWPN) { in lpfc_debugfs_dif_err_write()
2453 memcpy(&phba->lpfc_injerr_wwpn, &tmp, sizeof(struct lpfc_name)); in lpfc_debugfs_dif_err_write()
2468 * lpfc_debugfs_nodelist_open - Open the nodelist debugfs file
2475 * for the log, fills the buffer from the in-memory log for this vport, and then
2485 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_nodelist_open()
2487 int rc = -ENOMEM; in lpfc_debugfs_nodelist_open()
2494 debug->buffer = kmalloc(LPFC_NODELIST_SIZE, GFP_KERNEL); in lpfc_debugfs_nodelist_open()
2495 if (!debug->buffer) { in lpfc_debugfs_nodelist_open()
2500 debug->len = lpfc_debugfs_nodelist_data(vport, debug->buffer, in lpfc_debugfs_nodelist_open()
2502 file->private_data = debug; in lpfc_debugfs_nodelist_open()
2510 * lpfc_debugfs_lseek - Seek through a debugfs file
2529 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_lseek()
2530 return fixed_size_llseek(file, off, whence, debug->len); in lpfc_debugfs_lseek()
2534 * lpfc_debugfs_read - Read a debugfs file
2553 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_read()
2555 return simple_read_from_buffer(buf, nbytes, ppos, debug->buffer, in lpfc_debugfs_read()
2556 debug->len); in lpfc_debugfs_read()
2560 * lpfc_debugfs_release - Release the buffer used to store debugfs file data
2574 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_release()
2576 kfree(debug->buffer); in lpfc_debugfs_release()
2583 * lpfc_debugfs_multixripools_write - Clear multi-XRI pools statistics
2590 * This routine clears multi-XRI pools statistics when buf contains "clear".
2601 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_multixripools_write()
2602 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_debugfs_multixripools_write()
2616 return -EFAULT; in lpfc_debugfs_multixripools_write()
2620 hwq_count = phba->cfg_hdw_queue; in lpfc_debugfs_multixripools_write()
2622 qp = &phba->sli4_hba.hdwq[i]; in lpfc_debugfs_multixripools_write()
2623 multixri_pool = qp->p_multixri_pool; in lpfc_debugfs_multixripools_write()
2627 qp->empty_io_bufs = 0; in lpfc_debugfs_multixripools_write()
2628 multixri_pool->pbl_empty_count = 0; in lpfc_debugfs_multixripools_write()
2630 multixri_pool->above_limit_count = 0; in lpfc_debugfs_multixripools_write()
2631 multixri_pool->below_limit_count = 0; in lpfc_debugfs_multixripools_write()
2632 multixri_pool->stat_max_hwm = 0; in lpfc_debugfs_multixripools_write()
2633 multixri_pool->local_pbl_hit_count = 0; in lpfc_debugfs_multixripools_write()
2634 multixri_pool->other_pbl_hit_count = 0; in lpfc_debugfs_multixripools_write()
2636 multixri_pool->stat_pbl_count = 0; in lpfc_debugfs_multixripools_write()
2637 multixri_pool->stat_pvt_count = 0; in lpfc_debugfs_multixripools_write()
2638 multixri_pool->stat_busy_count = 0; in lpfc_debugfs_multixripools_write()
2639 multixri_pool->stat_snapshot_taken = 0; in lpfc_debugfs_multixripools_write()
2645 return -EINVAL; in lpfc_debugfs_multixripools_write()
2651 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_nvmestat_open()
2653 int rc = -ENOMEM; in lpfc_debugfs_nvmestat_open()
2660 debug->buffer = kmalloc(LPFC_NVMESTAT_SIZE, GFP_KERNEL); in lpfc_debugfs_nvmestat_open()
2661 if (!debug->buffer) { in lpfc_debugfs_nvmestat_open()
2666 debug->len = lpfc_debugfs_nvmestat_data(vport, debug->buffer, in lpfc_debugfs_nvmestat_open()
2669 debug->i_private = inode->i_private; in lpfc_debugfs_nvmestat_open()
2670 file->private_data = debug; in lpfc_debugfs_nvmestat_open()
2681 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_nvmestat_write()
2682 struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; in lpfc_debugfs_nvmestat_write()
2683 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_nvmestat_write()
2688 if (!phba->targetport) in lpfc_debugfs_nvmestat_write()
2689 return -ENXIO; in lpfc_debugfs_nvmestat_write()
2697 return -EFAULT; in lpfc_debugfs_nvmestat_write()
2700 tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private; in lpfc_debugfs_nvmestat_write()
2703 atomic_set(&tgtp->rcv_ls_req_in, 0); in lpfc_debugfs_nvmestat_write()
2704 atomic_set(&tgtp->rcv_ls_req_out, 0); in lpfc_debugfs_nvmestat_write()
2705 atomic_set(&tgtp->rcv_ls_req_drop, 0); in lpfc_debugfs_nvmestat_write()
2706 atomic_set(&tgtp->xmt_ls_abort, 0); in lpfc_debugfs_nvmestat_write()
2707 atomic_set(&tgtp->xmt_ls_abort_cmpl, 0); in lpfc_debugfs_nvmestat_write()
2708 atomic_set(&tgtp->xmt_ls_rsp, 0); in lpfc_debugfs_nvmestat_write()
2709 atomic_set(&tgtp->xmt_ls_drop, 0); in lpfc_debugfs_nvmestat_write()
2710 atomic_set(&tgtp->xmt_ls_rsp_error, 0); in lpfc_debugfs_nvmestat_write()
2711 atomic_set(&tgtp->xmt_ls_rsp_cmpl, 0); in lpfc_debugfs_nvmestat_write()
2713 atomic_set(&tgtp->rcv_fcp_cmd_in, 0); in lpfc_debugfs_nvmestat_write()
2714 atomic_set(&tgtp->rcv_fcp_cmd_out, 0); in lpfc_debugfs_nvmestat_write()
2715 atomic_set(&tgtp->rcv_fcp_cmd_drop, 0); in lpfc_debugfs_nvmestat_write()
2716 atomic_set(&tgtp->xmt_fcp_drop, 0); in lpfc_debugfs_nvmestat_write()
2717 atomic_set(&tgtp->xmt_fcp_read_rsp, 0); in lpfc_debugfs_nvmestat_write()
2718 atomic_set(&tgtp->xmt_fcp_read, 0); in lpfc_debugfs_nvmestat_write()
2719 atomic_set(&tgtp->xmt_fcp_write, 0); in lpfc_debugfs_nvmestat_write()
2720 atomic_set(&tgtp->xmt_fcp_rsp, 0); in lpfc_debugfs_nvmestat_write()
2721 atomic_set(&tgtp->xmt_fcp_release, 0); in lpfc_debugfs_nvmestat_write()
2722 atomic_set(&tgtp->xmt_fcp_rsp_cmpl, 0); in lpfc_debugfs_nvmestat_write()
2723 atomic_set(&tgtp->xmt_fcp_rsp_error, 0); in lpfc_debugfs_nvmestat_write()
2724 atomic_set(&tgtp->xmt_fcp_rsp_drop, 0); in lpfc_debugfs_nvmestat_write()
2726 atomic_set(&tgtp->xmt_fcp_abort, 0); in lpfc_debugfs_nvmestat_write()
2727 atomic_set(&tgtp->xmt_fcp_abort_cmpl, 0); in lpfc_debugfs_nvmestat_write()
2728 atomic_set(&tgtp->xmt_abort_sol, 0); in lpfc_debugfs_nvmestat_write()
2729 atomic_set(&tgtp->xmt_abort_unsol, 0); in lpfc_debugfs_nvmestat_write()
2730 atomic_set(&tgtp->xmt_abort_rsp, 0); in lpfc_debugfs_nvmestat_write()
2731 atomic_set(&tgtp->xmt_abort_rsp_error, 0); in lpfc_debugfs_nvmestat_write()
2739 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_scsistat_open()
2741 int rc = -ENOMEM; in lpfc_debugfs_scsistat_open()
2748 debug->buffer = kzalloc(LPFC_SCSISTAT_SIZE, GFP_KERNEL); in lpfc_debugfs_scsistat_open()
2749 if (!debug->buffer) { in lpfc_debugfs_scsistat_open()
2754 debug->len = lpfc_debugfs_scsistat_data(vport, debug->buffer, in lpfc_debugfs_scsistat_open()
2757 debug->i_private = inode->i_private; in lpfc_debugfs_scsistat_open()
2758 file->private_data = debug; in lpfc_debugfs_scsistat_open()
2769 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_scsistat_write()
2770 struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; in lpfc_debugfs_scsistat_write()
2771 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_scsistat_write()
2776 (sizeof(mybuf) - 1) : nbytes)) in lpfc_debugfs_scsistat_write()
2777 return -EFAULT; in lpfc_debugfs_scsistat_write()
2781 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_debugfs_scsistat_write()
2782 memset(&phba->sli4_hba.hdwq[i].scsi_cstat, 0, in lpfc_debugfs_scsistat_write()
2783 sizeof(phba->sli4_hba.hdwq[i].scsi_cstat)); in lpfc_debugfs_scsistat_write()
2793 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_ioktime_open()
2795 int rc = -ENOMEM; in lpfc_debugfs_ioktime_open()
2802 debug->buffer = kmalloc(LPFC_IOKTIME_SIZE, GFP_KERNEL); in lpfc_debugfs_ioktime_open()
2803 if (!debug->buffer) { in lpfc_debugfs_ioktime_open()
2808 debug->len = lpfc_debugfs_ioktime_data(vport, debug->buffer, in lpfc_debugfs_ioktime_open()
2811 debug->i_private = inode->i_private; in lpfc_debugfs_ioktime_open()
2812 file->private_data = debug; in lpfc_debugfs_ioktime_open()
2823 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_ioktime_write()
2824 struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; in lpfc_debugfs_ioktime_write()
2825 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_ioktime_write()
2835 return -EFAULT; in lpfc_debugfs_ioktime_write()
2838 if ((strncmp(pbuf, "on", sizeof("on") - 1) == 0)) { in lpfc_debugfs_ioktime_write()
2839 phba->ktime_data_samples = 0; in lpfc_debugfs_ioktime_write()
2840 phba->ktime_status_samples = 0; in lpfc_debugfs_ioktime_write()
2841 phba->ktime_seg1_total = 0; in lpfc_debugfs_ioktime_write()
2842 phba->ktime_seg1_max = 0; in lpfc_debugfs_ioktime_write()
2843 phba->ktime_seg1_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2844 phba->ktime_seg2_total = 0; in lpfc_debugfs_ioktime_write()
2845 phba->ktime_seg2_max = 0; in lpfc_debugfs_ioktime_write()
2846 phba->ktime_seg2_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2847 phba->ktime_seg3_total = 0; in lpfc_debugfs_ioktime_write()
2848 phba->ktime_seg3_max = 0; in lpfc_debugfs_ioktime_write()
2849 phba->ktime_seg3_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2850 phba->ktime_seg4_total = 0; in lpfc_debugfs_ioktime_write()
2851 phba->ktime_seg4_max = 0; in lpfc_debugfs_ioktime_write()
2852 phba->ktime_seg4_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2853 phba->ktime_seg5_total = 0; in lpfc_debugfs_ioktime_write()
2854 phba->ktime_seg5_max = 0; in lpfc_debugfs_ioktime_write()
2855 phba->ktime_seg5_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2856 phba->ktime_seg6_total = 0; in lpfc_debugfs_ioktime_write()
2857 phba->ktime_seg6_max = 0; in lpfc_debugfs_ioktime_write()
2858 phba->ktime_seg6_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2859 phba->ktime_seg7_total = 0; in lpfc_debugfs_ioktime_write()
2860 phba->ktime_seg7_max = 0; in lpfc_debugfs_ioktime_write()
2861 phba->ktime_seg7_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2862 phba->ktime_seg8_total = 0; in lpfc_debugfs_ioktime_write()
2863 phba->ktime_seg8_max = 0; in lpfc_debugfs_ioktime_write()
2864 phba->ktime_seg8_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2865 phba->ktime_seg9_total = 0; in lpfc_debugfs_ioktime_write()
2866 phba->ktime_seg9_max = 0; in lpfc_debugfs_ioktime_write()
2867 phba->ktime_seg9_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2868 phba->ktime_seg10_total = 0; in lpfc_debugfs_ioktime_write()
2869 phba->ktime_seg10_max = 0; in lpfc_debugfs_ioktime_write()
2870 phba->ktime_seg10_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2872 phba->ktime_on = 1; in lpfc_debugfs_ioktime_write()
2875 sizeof("off") - 1) == 0)) { in lpfc_debugfs_ioktime_write()
2876 phba->ktime_on = 0; in lpfc_debugfs_ioktime_write()
2879 sizeof("zero") - 1) == 0)) { in lpfc_debugfs_ioktime_write()
2880 phba->ktime_data_samples = 0; in lpfc_debugfs_ioktime_write()
2881 phba->ktime_status_samples = 0; in lpfc_debugfs_ioktime_write()
2882 phba->ktime_seg1_total = 0; in lpfc_debugfs_ioktime_write()
2883 phba->ktime_seg1_max = 0; in lpfc_debugfs_ioktime_write()
2884 phba->ktime_seg1_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2885 phba->ktime_seg2_total = 0; in lpfc_debugfs_ioktime_write()
2886 phba->ktime_seg2_max = 0; in lpfc_debugfs_ioktime_write()
2887 phba->ktime_seg2_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2888 phba->ktime_seg3_total = 0; in lpfc_debugfs_ioktime_write()
2889 phba->ktime_seg3_max = 0; in lpfc_debugfs_ioktime_write()
2890 phba->ktime_seg3_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2891 phba->ktime_seg4_total = 0; in lpfc_debugfs_ioktime_write()
2892 phba->ktime_seg4_max = 0; in lpfc_debugfs_ioktime_write()
2893 phba->ktime_seg4_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2894 phba->ktime_seg5_total = 0; in lpfc_debugfs_ioktime_write()
2895 phba->ktime_seg5_max = 0; in lpfc_debugfs_ioktime_write()
2896 phba->ktime_seg5_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2897 phba->ktime_seg6_total = 0; in lpfc_debugfs_ioktime_write()
2898 phba->ktime_seg6_max = 0; in lpfc_debugfs_ioktime_write()
2899 phba->ktime_seg6_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2900 phba->ktime_seg7_total = 0; in lpfc_debugfs_ioktime_write()
2901 phba->ktime_seg7_max = 0; in lpfc_debugfs_ioktime_write()
2902 phba->ktime_seg7_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2903 phba->ktime_seg8_total = 0; in lpfc_debugfs_ioktime_write()
2904 phba->ktime_seg8_max = 0; in lpfc_debugfs_ioktime_write()
2905 phba->ktime_seg8_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2906 phba->ktime_seg9_total = 0; in lpfc_debugfs_ioktime_write()
2907 phba->ktime_seg9_max = 0; in lpfc_debugfs_ioktime_write()
2908 phba->ktime_seg9_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2909 phba->ktime_seg10_total = 0; in lpfc_debugfs_ioktime_write()
2910 phba->ktime_seg10_max = 0; in lpfc_debugfs_ioktime_write()
2911 phba->ktime_seg10_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2914 return -EINVAL; in lpfc_debugfs_ioktime_write()
2920 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_nvmeio_trc_open()
2922 int rc = -ENOMEM; in lpfc_debugfs_nvmeio_trc_open()
2929 debug->buffer = kmalloc(LPFC_NVMEIO_TRC_SIZE, GFP_KERNEL); in lpfc_debugfs_nvmeio_trc_open()
2930 if (!debug->buffer) { in lpfc_debugfs_nvmeio_trc_open()
2935 debug->len = lpfc_debugfs_nvmeio_trc_data(phba, debug->buffer, in lpfc_debugfs_nvmeio_trc_open()
2938 debug->i_private = inode->i_private; in lpfc_debugfs_nvmeio_trc_open()
2939 file->private_data = debug; in lpfc_debugfs_nvmeio_trc_open()
2950 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_nvmeio_trc_write()
2951 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_debugfs_nvmeio_trc_write()
2963 return -EFAULT; in lpfc_debugfs_nvmeio_trc_write()
2966 if ((strncmp(pbuf, "off", sizeof("off") - 1) == 0)) { in lpfc_debugfs_nvmeio_trc_write()
2969 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_nvmeio_trc_write()
2970 phba->nvmeio_trc_on = 0; in lpfc_debugfs_nvmeio_trc_write()
2972 } else if ((strncmp(pbuf, "on", sizeof("on") - 1) == 0)) { in lpfc_debugfs_nvmeio_trc_write()
2975 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_nvmeio_trc_write()
2976 phba->nvmeio_trc_on = 1; in lpfc_debugfs_nvmeio_trc_write()
2981 if (phba->nvmeio_trc_on != 0) in lpfc_debugfs_nvmeio_trc_write()
2982 return -EINVAL; in lpfc_debugfs_nvmeio_trc_write()
2987 return -EINVAL; in lpfc_debugfs_nvmeio_trc_write()
2988 phba->nvmeio_trc_size = (uint32_t)sz; in lpfc_debugfs_nvmeio_trc_write()
2990 /* It must be a power of 2 - round down */ in lpfc_debugfs_nvmeio_trc_write()
2997 if (phba->nvmeio_trc_size != sz) in lpfc_debugfs_nvmeio_trc_write()
3001 phba->nvmeio_trc_size = (uint32_t)sz; in lpfc_debugfs_nvmeio_trc_write()
3004 kfree(phba->nvmeio_trc); in lpfc_debugfs_nvmeio_trc_write()
3007 phba->nvmeio_trc = kzalloc((sizeof(struct lpfc_debugfs_nvmeio_trc) * in lpfc_debugfs_nvmeio_trc_write()
3009 if (!phba->nvmeio_trc) { in lpfc_debugfs_nvmeio_trc_write()
3013 return -ENOMEM; in lpfc_debugfs_nvmeio_trc_write()
3015 atomic_set(&phba->nvmeio_trc_cnt, 0); in lpfc_debugfs_nvmeio_trc_write()
3016 phba->nvmeio_trc_on = 0; in lpfc_debugfs_nvmeio_trc_write()
3017 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_nvmeio_trc_write()
3025 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_hdwqstat_open()
3027 int rc = -ENOMEM; in lpfc_debugfs_hdwqstat_open()
3034 debug->buffer = kcalloc(1, LPFC_SCSISTAT_SIZE, GFP_KERNEL); in lpfc_debugfs_hdwqstat_open()
3035 if (!debug->buffer) { in lpfc_debugfs_hdwqstat_open()
3040 debug->len = lpfc_debugfs_hdwqstat_data(vport, debug->buffer, in lpfc_debugfs_hdwqstat_open()
3043 debug->i_private = inode->i_private; in lpfc_debugfs_hdwqstat_open()
3044 file->private_data = debug; in lpfc_debugfs_hdwqstat_open()
3055 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_hdwqstat_write()
3056 struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; in lpfc_debugfs_hdwqstat_write()
3057 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_hdwqstat_write()
3069 return -EFAULT; in lpfc_debugfs_hdwqstat_write()
3072 if ((strncmp(pbuf, "on", sizeof("on") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3073 if (phba->nvmet_support) in lpfc_debugfs_hdwqstat_write()
3074 phba->hdwqstat_on |= LPFC_CHECK_NVMET_IO; in lpfc_debugfs_hdwqstat_write()
3076 phba->hdwqstat_on |= (LPFC_CHECK_NVME_IO | in lpfc_debugfs_hdwqstat_write()
3079 } else if ((strncmp(pbuf, "nvme_on", sizeof("nvme_on") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3080 if (phba->nvmet_support) in lpfc_debugfs_hdwqstat_write()
3081 phba->hdwqstat_on |= LPFC_CHECK_NVMET_IO; in lpfc_debugfs_hdwqstat_write()
3083 phba->hdwqstat_on |= LPFC_CHECK_NVME_IO; in lpfc_debugfs_hdwqstat_write()
3085 } else if ((strncmp(pbuf, "scsi_on", sizeof("scsi_on") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3086 if (!phba->nvmet_support) in lpfc_debugfs_hdwqstat_write()
3087 phba->hdwqstat_on |= LPFC_CHECK_SCSI_IO; in lpfc_debugfs_hdwqstat_write()
3089 } else if ((strncmp(pbuf, "nvme_off", sizeof("nvme_off") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3090 phba->hdwqstat_on &= ~(LPFC_CHECK_NVME_IO | in lpfc_debugfs_hdwqstat_write()
3093 } else if ((strncmp(pbuf, "scsi_off", sizeof("scsi_off") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3094 phba->hdwqstat_on &= ~LPFC_CHECK_SCSI_IO; in lpfc_debugfs_hdwqstat_write()
3097 sizeof("off") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3098 phba->hdwqstat_on = LPFC_CHECK_OFF; in lpfc_debugfs_hdwqstat_write()
3101 sizeof("zero") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3103 c_stat = per_cpu_ptr(phba->sli4_hba.c_stat, i); in lpfc_debugfs_hdwqstat_write()
3104 c_stat->xmt_io = 0; in lpfc_debugfs_hdwqstat_write()
3105 c_stat->cmpl_io = 0; in lpfc_debugfs_hdwqstat_write()
3106 c_stat->rcv_io = 0; in lpfc_debugfs_hdwqstat_write()
3110 return -EINVAL; in lpfc_debugfs_hdwqstat_write()
3114 * ---------------------------------
3116 * ---------------------------------
3125 * lpfc_idiag_cmd_get - Get and parse idiag debugfs comands from user space
3147 bsize = min(nbytes, (sizeof(mybuf)-1)); in lpfc_idiag_cmd_get()
3150 return -EFAULT; in lpfc_idiag_cmd_get()
3156 return -EINVAL; in lpfc_idiag_cmd_get()
3158 idiag_cmd->opcode = simple_strtol(step_str, NULL, 0); in lpfc_idiag_cmd_get()
3159 if (idiag_cmd->opcode == 0) in lpfc_idiag_cmd_get()
3160 return -EINVAL; in lpfc_idiag_cmd_get()
3166 idiag_cmd->data[i] = simple_strtol(step_str, NULL, 0); in lpfc_idiag_cmd_get()
3172 * lpfc_idiag_open - idiag open debugfs
3195 return -ENOMEM; in lpfc_idiag_open()
3197 debug->i_private = inode->i_private; in lpfc_idiag_open()
3198 debug->buffer = NULL; in lpfc_idiag_open()
3199 file->private_data = debug; in lpfc_idiag_open()
3205 * lpfc_idiag_release - Release idiag access file operation
3220 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_release()
3223 kfree(debug->buffer); in lpfc_idiag_release()
3230 * lpfc_idiag_cmd_release - Release idiag cmd access file operation
3245 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_cmd_release()
3247 if (debug->op == LPFC_IDIAG_OP_WR) { in lpfc_idiag_cmd_release()
3263 kfree(debug->buffer); in lpfc_idiag_cmd_release()
3270 * lpfc_idiag_pcicfg_read - idiag debugfs read pcicfg
3291 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_pcicfg_read()
3292 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_pcicfg_read()
3301 pdev = phba->pcidev; in lpfc_idiag_pcicfg_read()
3306 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_pcicfg_read()
3308 if (!debug->buffer) in lpfc_idiag_pcicfg_read()
3309 debug->buffer = kmalloc(LPFC_PCI_CFG_SIZE, GFP_KERNEL); in lpfc_idiag_pcicfg_read()
3310 if (!debug->buffer) in lpfc_idiag_pcicfg_read()
3312 pbuffer = debug->buffer; in lpfc_idiag_pcicfg_read()
3327 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, 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()
3356 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3360 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3365 LPFC_PCI_CFG_SIZE-len, "\n"); in lpfc_idiag_pcicfg_read()
3368 index -= sizeof(uint32_t); in lpfc_idiag_pcicfg_read()
3370 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3374 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3391 * lpfc_idiag_pcicfg_write - Syntax check and set up idiag pcicfg commands
3412 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_pcicfg_write()
3413 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_pcicfg_write()
3421 pdev = phba->pcidev; in lpfc_idiag_pcicfg_write()
3423 return -EFAULT; in lpfc_idiag_pcicfg_write()
3426 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_pcicfg_write()
3449 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint8_t)) in lpfc_idiag_pcicfg_write()
3455 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint16_t)) in lpfc_idiag_pcicfg_write()
3461 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint32_t)) in lpfc_idiag_pcicfg_write()
3472 /* Write command to PCI config space, read-modify-write */ in lpfc_idiag_pcicfg_write()
3482 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint8_t)) in lpfc_idiag_pcicfg_write()
3507 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint16_t)) in lpfc_idiag_pcicfg_write()
3532 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint32_t)) in lpfc_idiag_pcicfg_write()
3564 return -EINVAL; in lpfc_idiag_pcicfg_write()
3568 * lpfc_idiag_baracc_read - idiag debugfs pci bar access read
3586 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_baracc_read()
3587 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_baracc_read()
3596 pdev = phba->pcidev; in lpfc_idiag_baracc_read()
3601 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_baracc_read()
3603 if (!debug->buffer) in lpfc_idiag_baracc_read()
3604 debug->buffer = kmalloc(LPFC_PCI_BAR_RD_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_baracc_read()
3605 if (!debug->buffer) in lpfc_idiag_baracc_read()
3607 pbuffer = debug->buffer; in lpfc_idiag_baracc_read()
3623 if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf); in lpfc_idiag_baracc_read()
3626 mem_mapped_bar = phba->sli4_hba.conf_regs_memmap_p; in lpfc_idiag_baracc_read()
3628 mem_mapped_bar = phba->sli4_hba.ctrl_regs_memmap_p; in lpfc_idiag_baracc_read()
3630 mem_mapped_bar = phba->sli4_hba.drbl_regs_memmap_p; in lpfc_idiag_baracc_read()
3635 mem_mapped_bar = phba->sli4_hba.conf_regs_memmap_p; in lpfc_idiag_baracc_read()
3645 len += scnprintf(pbuffer+len, LPFC_PCI_BAR_RD_BUF_SIZE-len, in lpfc_idiag_baracc_read()
3659 len += scnprintf(pbuffer+len, LPFC_PCI_BAR_RD_BUF_SIZE-len, in lpfc_idiag_baracc_read()
3664 len += scnprintf(pbuffer+len, LPFC_PCI_BAR_RD_BUF_SIZE-len, in lpfc_idiag_baracc_read()
3670 LPFC_PCI_BAR_RD_BUF_SIZE-len, "\n"); in lpfc_idiag_baracc_read()
3677 LPFC_PCI_BAR_RD_BUF_SIZE-len, "\n"); in lpfc_idiag_baracc_read()
3681 index -= sizeof(uint32_t); in lpfc_idiag_baracc_read()
3684 LPFC_PCI_BAR_RD_BUF_SIZE-len, "\n"); in lpfc_idiag_baracc_read()
3688 LPFC_PCI_BAR_RD_BUF_SIZE-len, in lpfc_idiag_baracc_read()
3715 * lpfc_idiag_baracc_write - Syntax check and set up idiag bar access commands
3737 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_baracc_write()
3738 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_baracc_write()
3746 pdev = phba->pcidev; in lpfc_idiag_baracc_write()
3748 return -EFAULT; in lpfc_idiag_baracc_write()
3751 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_baracc_write()
3757 if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf); in lpfc_idiag_baracc_write()
3775 mem_mapped_bar = phba->sli4_hba.conf_regs_memmap_p; in lpfc_idiag_baracc_write()
3779 mem_mapped_bar = phba->sli4_hba.ctrl_regs_memmap_p; in lpfc_idiag_baracc_write()
3783 mem_mapped_bar = phba->sli4_hba.drbl_regs_memmap_p; in lpfc_idiag_baracc_write()
3790 mem_mapped_bar = phba->sli4_hba.conf_regs_memmap_p; in lpfc_idiag_baracc_write()
3807 if (offset > bar_size - sizeof(uint32_t)) in lpfc_idiag_baracc_write()
3824 /* Write command to PCI bar space, read-modify-write */ in lpfc_idiag_baracc_write()
3850 return -EINVAL; in lpfc_idiag_baracc_write()
3860 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_wq()
3862 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_wq()
3863 "AssocCQID[%04d]: WQ-STAT[oflow:x%x posted:x%llx]\n", in __lpfc_idiag_print_wq()
3864 qp->assoc_qid, qp->q_cnt_1, in __lpfc_idiag_print_wq()
3865 (unsigned long long)qp->q_cnt_4); in __lpfc_idiag_print_wq()
3866 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_wq()
3867 "\t\tWQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_wq()
3868 "HST-IDX[%04d], PRT-IDX[%04d], NTFI[%03d]", in __lpfc_idiag_print_wq()
3869 qp->queue_id, qp->entry_count, in __lpfc_idiag_print_wq()
3870 qp->entry_size, qp->host_index, in __lpfc_idiag_print_wq()
3871 qp->hba_index, qp->notify_interval); in __lpfc_idiag_print_wq()
3873 LPFC_QUE_INFO_GET_BUF_SIZE - len, "\n"); in __lpfc_idiag_print_wq()
3884 for (qidx = 0; qidx < phba->cfg_hdw_queue; qidx++) { in lpfc_idiag_wqs_for_cq()
3885 qp = phba->sli4_hba.hdwq[qidx].io_wq; in lpfc_idiag_wqs_for_cq()
3886 if (qp->assoc_qid != cq_id) in lpfc_idiag_wqs_for_cq()
3902 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_cq()
3904 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_cq()
3907 qp->assoc_qid, qp->q_cnt_1, qp->q_cnt_2, in __lpfc_idiag_print_cq()
3908 qp->q_cnt_3, (unsigned long long)qp->q_cnt_4); in __lpfc_idiag_print_cq()
3909 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_cq()
3910 "\tCQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_cq()
3911 "HST-IDX[%04d], NTFI[%03d], PLMT[%03d]", in __lpfc_idiag_print_cq()
3912 qp->queue_id, qp->entry_count, in __lpfc_idiag_print_cq()
3913 qp->entry_size, qp->host_index, in __lpfc_idiag_print_cq()
3914 qp->notify_interval, qp->max_proc_limit); in __lpfc_idiag_print_cq()
3916 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_cq()
3929 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_rqpair()
3931 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_rqpair()
3932 "AssocCQID[%02d]: RQ-STAT[nopost:x%x nobuf:x%x " in __lpfc_idiag_print_rqpair()
3934 qp->assoc_qid, qp->q_cnt_1, qp->q_cnt_2, in __lpfc_idiag_print_rqpair()
3935 qp->q_cnt_3, (unsigned long long)qp->q_cnt_4); in __lpfc_idiag_print_rqpair()
3936 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_rqpair()
3937 "\t\tHQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_rqpair()
3938 "HST-IDX[%04d], PRT-IDX[%04d], NTFI[%03d]\n", in __lpfc_idiag_print_rqpair()
3939 qp->queue_id, qp->entry_count, qp->entry_size, in __lpfc_idiag_print_rqpair()
3940 qp->host_index, qp->hba_index, qp->notify_interval); in __lpfc_idiag_print_rqpair()
3941 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_rqpair()
3942 "\t\tDQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_rqpair()
3943 "HST-IDX[%04d], PRT-IDX[%04d], NTFI[%03d]\n", in __lpfc_idiag_print_rqpair()
3944 datqp->queue_id, datqp->entry_count, in __lpfc_idiag_print_rqpair()
3945 datqp->entry_size, datqp->host_index, in __lpfc_idiag_print_rqpair()
3946 datqp->hba_index, datqp->notify_interval); in __lpfc_idiag_print_rqpair()
3957 qp = phba->sli4_hba.hdwq[eqidx].io_cq; in lpfc_idiag_cqs_for_eq()
3962 qp->CQ_max_cqe = 0; in lpfc_idiag_cqs_for_eq()
3968 max_cnt, qp->queue_id); in lpfc_idiag_cqs_for_eq()
3972 if ((eqidx < phba->cfg_nvmet_mrq) && phba->nvmet_support) { in lpfc_idiag_cqs_for_eq()
3974 qp = phba->sli4_hba.nvmet_cqset[eqidx]; in lpfc_idiag_cqs_for_eq()
3978 qp->CQ_max_cqe = 0; in lpfc_idiag_cqs_for_eq()
3984 qp = phba->sli4_hba.nvmet_mrq_hdr[eqidx]; in lpfc_idiag_cqs_for_eq()
3986 phba->sli4_hba.nvmet_mrq_data[eqidx], in lpfc_idiag_cqs_for_eq()
4003 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_eq()
4004 "\n%s EQ info: EQ-STAT[max:x%x noE:x%x " in __lpfc_idiag_print_eq()
4006 eqtype, qp->q_cnt_1, qp->q_cnt_2, qp->q_cnt_3, in __lpfc_idiag_print_eq()
4007 (unsigned long long)qp->q_cnt_4, qp->q_mode); in __lpfc_idiag_print_eq()
4008 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_eq()
4009 "EQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_eq()
4010 "HST-IDX[%04d], NTFI[%03d], PLMT[%03d], AFFIN[%03d]", in __lpfc_idiag_print_eq()
4011 qp->queue_id, qp->entry_count, qp->entry_size, in __lpfc_idiag_print_eq()
4012 qp->host_index, qp->notify_interval, in __lpfc_idiag_print_eq()
4013 qp->max_proc_limit, qp->chann); in __lpfc_idiag_print_eq()
4014 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_eq()
4021 * lpfc_idiag_queinfo_read - idiag debugfs read queue information
4042 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_queinfo_read()
4043 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_queinfo_read()
4048 if (!debug->buffer) in lpfc_idiag_queinfo_read()
4049 debug->buffer = kmalloc(LPFC_QUE_INFO_GET_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_queinfo_read()
4050 if (!debug->buffer) in lpfc_idiag_queinfo_read()
4052 pbuffer = debug->buffer; in lpfc_idiag_queinfo_read()
4053 max_cnt = LPFC_QUE_INFO_GET_BUF_SIZE - 256; in lpfc_idiag_queinfo_read()
4058 spin_lock_irq(&phba->hbalock); in lpfc_idiag_queinfo_read()
4060 /* Fast-path event queue */ in lpfc_idiag_queinfo_read()
4061 if (phba->sli4_hba.hdwq && phba->cfg_hdw_queue) { in lpfc_idiag_queinfo_read()
4063 x = phba->lpfc_idiag_last_eq; in lpfc_idiag_queinfo_read()
4064 phba->lpfc_idiag_last_eq++; in lpfc_idiag_queinfo_read()
4065 if (phba->lpfc_idiag_last_eq >= phba->cfg_hdw_queue) in lpfc_idiag_queinfo_read()
4066 phba->lpfc_idiag_last_eq = 0; in lpfc_idiag_queinfo_read()
4069 LPFC_QUE_INFO_GET_BUF_SIZE - len, in lpfc_idiag_queinfo_read()
4071 x, phba->cfg_hdw_queue); in lpfc_idiag_queinfo_read()
4073 /* Fast-path EQ */ in lpfc_idiag_queinfo_read()
4074 qp = phba->sli4_hba.hdwq[x].hba_eq; in lpfc_idiag_queinfo_read()
4081 qp->EQ_max_eqe = 0; in lpfc_idiag_queinfo_read()
4088 max_cnt, x, qp->queue_id); in lpfc_idiag_queinfo_read()
4096 /* Slow-path mailbox CQ */ in lpfc_idiag_queinfo_read()
4097 qp = phba->sli4_hba.mbx_cq; in lpfc_idiag_queinfo_read()
4102 /* Slow-path MBOX MQ */ in lpfc_idiag_queinfo_read()
4103 qp = phba->sli4_hba.mbx_wq; in lpfc_idiag_queinfo_read()
4108 /* Slow-path ELS response CQ */ in lpfc_idiag_queinfo_read()
4109 qp = phba->sli4_hba.els_cq; in lpfc_idiag_queinfo_read()
4113 qp->CQ_max_cqe = 0; in lpfc_idiag_queinfo_read()
4117 /* Slow-path ELS WQ */ in lpfc_idiag_queinfo_read()
4118 qp = phba->sli4_hba.els_wq; in lpfc_idiag_queinfo_read()
4123 qp = phba->sli4_hba.hdr_rq; in lpfc_idiag_queinfo_read()
4124 len = __lpfc_idiag_print_rqpair(qp, phba->sli4_hba.dat_rq, in lpfc_idiag_queinfo_read()
4129 /* Slow-path NVME LS response CQ */ in lpfc_idiag_queinfo_read()
4130 qp = phba->sli4_hba.nvmels_cq; in lpfc_idiag_queinfo_read()
4135 qp->CQ_max_cqe = 0; in lpfc_idiag_queinfo_read()
4139 /* Slow-path NVME LS WQ */ in lpfc_idiag_queinfo_read()
4140 qp = phba->sli4_hba.nvmels_wq; in lpfc_idiag_queinfo_read()
4149 spin_unlock_irq(&phba->hbalock); in lpfc_idiag_queinfo_read()
4154 LPFC_QUE_INFO_GET_BUF_SIZE - len, "Truncated ...\n"); in lpfc_idiag_queinfo_read()
4156 spin_unlock_irq(&phba->hbalock); in lpfc_idiag_queinfo_read()
4161 * lpfc_idiag_que_param_check - queue access command parameter sanity check
4170 * This function returns -EINVAL when fails the sanity check, otherwise, it
4178 return -EINVAL; in lpfc_idiag_que_param_check()
4179 if (index > q->entry_count - 1) in lpfc_idiag_que_param_check()
4180 return -EINVAL; in lpfc_idiag_que_param_check()
4185 * lpfc_idiag_queacc_read_qe - read a single entry from the given queue index
4209 esize = pque->entry_size; in lpfc_idiag_queacc_read_qe()
4210 len += scnprintf(pbuffer+len, LPFC_QUE_ACC_BUF_SIZE-len, in lpfc_idiag_queacc_read_qe()
4211 "QE-INDEX[%04d]:\n", index); in lpfc_idiag_queacc_read_qe()
4216 len += scnprintf(pbuffer+len, LPFC_QUE_ACC_BUF_SIZE-len, in lpfc_idiag_queacc_read_qe()
4220 esize -= sizeof(uint32_t); in lpfc_idiag_queacc_read_qe()
4223 LPFC_QUE_ACC_BUF_SIZE-len, "\n"); in lpfc_idiag_queacc_read_qe()
4225 len += scnprintf(pbuffer+len, LPFC_QUE_ACC_BUF_SIZE-len, "\n"); in lpfc_idiag_queacc_read_qe()
4231 * lpfc_idiag_queacc_read - idiag debugfs read port queue
4251 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_queacc_read()
4258 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_queacc_read()
4260 if (!debug->buffer) in lpfc_idiag_queacc_read()
4261 debug->buffer = kmalloc(LPFC_QUE_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_queacc_read()
4262 if (!debug->buffer) in lpfc_idiag_queacc_read()
4264 pbuffer = debug->buffer; in lpfc_idiag_queacc_read()
4291 while (len < LPFC_QUE_ACC_SIZE - pque->entry_size) { in lpfc_idiag_queacc_read()
4294 if (index > pque->entry_count - 1) in lpfc_idiag_queacc_read()
4299 if (index > pque->entry_count - 1) in lpfc_idiag_queacc_read()
4307 * lpfc_idiag_queacc_write - Syntax check and set up idiag queacc commands
4328 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_queacc_write()
4329 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_queacc_write()
4336 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_queacc_write()
4367 if (phba->sli4_hba.hdwq) { in lpfc_idiag_queacc_write()
4368 for (qidx = 0; qidx < phba->cfg_hdw_queue; qidx++) { in lpfc_idiag_queacc_write()
4369 qp = phba->sli4_hba.hdwq[qidx].hba_eq; in lpfc_idiag_queacc_write()
4370 if (qp && qp->queue_id == queid) { in lpfc_idiag_queacc_write()
4385 if (phba->sli4_hba.mbx_cq && in lpfc_idiag_queacc_write()
4386 phba->sli4_hba.mbx_cq->queue_id == queid) { in lpfc_idiag_queacc_write()
4389 phba->sli4_hba.mbx_cq, index, count); in lpfc_idiag_queacc_write()
4392 idiag.ptr_private = phba->sli4_hba.mbx_cq; in lpfc_idiag_queacc_write()
4396 if (phba->sli4_hba.els_cq && in lpfc_idiag_queacc_write()
4397 phba->sli4_hba.els_cq->queue_id == queid) { in lpfc_idiag_queacc_write()
4400 phba->sli4_hba.els_cq, index, count); in lpfc_idiag_queacc_write()
4403 idiag.ptr_private = phba->sli4_hba.els_cq; in lpfc_idiag_queacc_write()
4407 if (phba->sli4_hba.nvmels_cq && in lpfc_idiag_queacc_write()
4408 phba->sli4_hba.nvmels_cq->queue_id == queid) { in lpfc_idiag_queacc_write()
4411 phba->sli4_hba.nvmels_cq, index, count); in lpfc_idiag_queacc_write()
4414 idiag.ptr_private = phba->sli4_hba.nvmels_cq; in lpfc_idiag_queacc_write()
4418 if (phba->sli4_hba.hdwq) { in lpfc_idiag_queacc_write()
4419 for (qidx = 0; qidx < phba->cfg_hdw_queue; in lpfc_idiag_queacc_write()
4421 qp = phba->sli4_hba.hdwq[qidx].io_cq; in lpfc_idiag_queacc_write()
4422 if (qp && qp->queue_id == queid) { in lpfc_idiag_queacc_write()
4437 if (phba->sli4_hba.mbx_wq && in lpfc_idiag_queacc_write()
4438 phba->sli4_hba.mbx_wq->queue_id == queid) { in lpfc_idiag_queacc_write()
4441 phba->sli4_hba.mbx_wq, index, count); in lpfc_idiag_queacc_write()
4444 idiag.ptr_private = phba->sli4_hba.mbx_wq; in lpfc_idiag_queacc_write()
4451 if (phba->sli4_hba.els_wq && in lpfc_idiag_queacc_write()
4452 phba->sli4_hba.els_wq->queue_id == queid) { in lpfc_idiag_queacc_write()
4455 phba->sli4_hba.els_wq, index, count); in lpfc_idiag_queacc_write()
4458 idiag.ptr_private = phba->sli4_hba.els_wq; in lpfc_idiag_queacc_write()
4462 if (phba->sli4_hba.nvmels_wq && in lpfc_idiag_queacc_write()
4463 phba->sli4_hba.nvmels_wq->queue_id == queid) { in lpfc_idiag_queacc_write()
4466 phba->sli4_hba.nvmels_wq, index, count); in lpfc_idiag_queacc_write()
4469 idiag.ptr_private = phba->sli4_hba.nvmels_wq; in lpfc_idiag_queacc_write()
4473 if (phba->sli4_hba.hdwq) { in lpfc_idiag_queacc_write()
4475 for (qidx = 0; qidx < phba->cfg_hdw_queue; qidx++) { in lpfc_idiag_queacc_write()
4476 qp = phba->sli4_hba.hdwq[qidx].io_wq; in lpfc_idiag_queacc_write()
4477 if (qp && qp->queue_id == queid) { in lpfc_idiag_queacc_write()
4492 if (phba->sli4_hba.hdr_rq && in lpfc_idiag_queacc_write()
4493 phba->sli4_hba.hdr_rq->queue_id == queid) { in lpfc_idiag_queacc_write()
4496 phba->sli4_hba.hdr_rq, index, count); in lpfc_idiag_queacc_write()
4499 idiag.ptr_private = phba->sli4_hba.hdr_rq; in lpfc_idiag_queacc_write()
4503 if (phba->sli4_hba.dat_rq && in lpfc_idiag_queacc_write()
4504 phba->sli4_hba.dat_rq->queue_id == queid) { in lpfc_idiag_queacc_write()
4507 phba->sli4_hba.dat_rq, index, count); in lpfc_idiag_queacc_write()
4510 idiag.ptr_private = phba->sli4_hba.dat_rq; in lpfc_idiag_queacc_write()
4530 if (offset > pque->entry_size/sizeof(uint32_t) - 1) in lpfc_idiag_queacc_write()
4546 return -EINVAL; in lpfc_idiag_queacc_write()
4550 * lpfc_idiag_drbacc_read_reg - idiag debugfs read a doorbell register
4573 len += scnprintf(pbuffer + len, LPFC_DRB_ACC_BUF_SIZE-len, in lpfc_idiag_drbacc_read_reg()
4574 "EQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4575 readl(phba->sli4_hba.EQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4578 len += scnprintf(pbuffer + len, LPFC_DRB_ACC_BUF_SIZE - len, in lpfc_idiag_drbacc_read_reg()
4579 "CQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4580 readl(phba->sli4_hba.CQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4583 len += scnprintf(pbuffer+len, LPFC_DRB_ACC_BUF_SIZE-len, in lpfc_idiag_drbacc_read_reg()
4584 "MQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4585 readl(phba->sli4_hba.MQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4588 len += scnprintf(pbuffer+len, LPFC_DRB_ACC_BUF_SIZE-len, in lpfc_idiag_drbacc_read_reg()
4589 "WQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4590 readl(phba->sli4_hba.WQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4593 len += scnprintf(pbuffer+len, LPFC_DRB_ACC_BUF_SIZE-len, in lpfc_idiag_drbacc_read_reg()
4594 "RQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4595 readl(phba->sli4_hba.RQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4605 * lpfc_idiag_drbacc_read - idiag debugfs read port doorbell
4625 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_drbacc_read()
4626 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_drbacc_read()
4632 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_drbacc_read()
4634 if (!debug->buffer) in lpfc_idiag_drbacc_read()
4635 debug->buffer = kmalloc(LPFC_DRB_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_drbacc_read()
4636 if (!debug->buffer) in lpfc_idiag_drbacc_read()
4638 pbuffer = debug->buffer; in lpfc_idiag_drbacc_read()
4660 * lpfc_idiag_drbacc_write - Syntax check and set up idiag drbacc commands
4681 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_drbacc_write()
4682 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_drbacc_write()
4688 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_drbacc_write()
4720 drb_reg = phba->sli4_hba.EQDBregaddr; in lpfc_idiag_drbacc_write()
4723 drb_reg = phba->sli4_hba.CQDBregaddr; in lpfc_idiag_drbacc_write()
4726 drb_reg = phba->sli4_hba.MQDBregaddr; in lpfc_idiag_drbacc_write()
4729 drb_reg = phba->sli4_hba.WQDBregaddr; in lpfc_idiag_drbacc_write()
4732 drb_reg = phba->sli4_hba.RQDBregaddr; in lpfc_idiag_drbacc_write()
4756 return -EINVAL; in lpfc_idiag_drbacc_write()
4760 * lpfc_idiag_ctlacc_read_reg - idiag debugfs read a control registers
4783 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4785 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4789 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4791 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4795 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4797 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4801 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4803 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4807 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4809 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4813 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4815 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4825 * lpfc_idiag_ctlacc_read - idiag debugfs read port and device control register
4843 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_ctlacc_read()
4844 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_ctlacc_read()
4850 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_ctlacc_read()
4852 if (!debug->buffer) in lpfc_idiag_ctlacc_read()
4853 debug->buffer = kmalloc(LPFC_CTL_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_ctlacc_read()
4854 if (!debug->buffer) in lpfc_idiag_ctlacc_read()
4856 pbuffer = debug->buffer; in lpfc_idiag_ctlacc_read()
4878 * lpfc_idiag_ctlacc_write - Syntax check and set up idiag ctlacc commands
4896 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_ctlacc_write()
4897 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_ctlacc_write()
4903 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_ctlacc_write()
4935 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4939 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + 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()
4980 return -EINVAL; in lpfc_idiag_ctlacc_write()
4984 * lpfc_idiag_mbxacc_get_setup - idiag debugfs get mailbox access setup
5006 len += scnprintf(pbuffer+len, LPFC_MBX_ACC_BUF_SIZE-len, in lpfc_idiag_mbxacc_get_setup()
5008 len += scnprintf(pbuffer+len, LPFC_MBX_ACC_BUF_SIZE-len, in lpfc_idiag_mbxacc_get_setup()
5010 len += scnprintf(pbuffer+len, LPFC_MBX_ACC_BUF_SIZE-len, in lpfc_idiag_mbxacc_get_setup()
5012 len += scnprintf(pbuffer+len, LPFC_MBX_ACC_BUF_SIZE-len, in lpfc_idiag_mbxacc_get_setup()
5019 * lpfc_idiag_mbxacc_read - idiag debugfs read on mailbox access
5037 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_mbxacc_read()
5038 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_mbxacc_read()
5043 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_mbxacc_read()
5045 if (!debug->buffer) in lpfc_idiag_mbxacc_read()
5046 debug->buffer = kmalloc(LPFC_MBX_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_mbxacc_read()
5047 if (!debug->buffer) in lpfc_idiag_mbxacc_read()
5049 pbuffer = debug->buffer; in lpfc_idiag_mbxacc_read()
5064 * lpfc_idiag_mbxacc_write - Syntax check and set up idiag mbxacc commands
5082 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_mbxacc_write()
5087 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_mbxacc_write()
5141 return -EINVAL; in lpfc_idiag_mbxacc_write()
5145 * lpfc_idiag_extacc_avail_get - get the available extents information
5161 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5164 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5168 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5171 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5175 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5178 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5182 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5185 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5189 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5196 * lpfc_idiag_extacc_alloc_get - get the allocated extents information
5213 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5216 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5221 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5223 phba->brd_no, ext_cnt, ext_size); in lpfc_idiag_extacc_alloc_get()
5225 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5228 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5233 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5235 phba->brd_no, ext_cnt, ext_size); in lpfc_idiag_extacc_alloc_get()
5237 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5240 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5245 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5247 phba->brd_no, ext_cnt, ext_size); in lpfc_idiag_extacc_alloc_get()
5249 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5252 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5257 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5259 phba->brd_no, ext_cnt, ext_size); in lpfc_idiag_extacc_alloc_get()
5261 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5268 * lpfc_idiag_extacc_drivr_get - get driver extent information
5285 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5288 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5291 list_for_each_entry(rsrc_blks, &phba->lpfc_vpi_blk_list, list) { in lpfc_idiag_extacc_drivr_get()
5292 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5294 index, rsrc_blks->rsrc_start, in lpfc_idiag_extacc_drivr_get()
5295 rsrc_blks->rsrc_size); in lpfc_idiag_extacc_drivr_get()
5298 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5301 list_for_each_entry(rsrc_blks, &phba->sli4_hba.lpfc_vfi_blk_list, in lpfc_idiag_extacc_drivr_get()
5303 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5305 index, rsrc_blks->rsrc_start, in lpfc_idiag_extacc_drivr_get()
5306 rsrc_blks->rsrc_size); in lpfc_idiag_extacc_drivr_get()
5310 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5313 list_for_each_entry(rsrc_blks, &phba->sli4_hba.lpfc_rpi_blk_list, in lpfc_idiag_extacc_drivr_get()
5315 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5317 index, rsrc_blks->rsrc_start, in lpfc_idiag_extacc_drivr_get()
5318 rsrc_blks->rsrc_size); in lpfc_idiag_extacc_drivr_get()
5322 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5325 list_for_each_entry(rsrc_blks, &phba->sli4_hba.lpfc_xri_blk_list, in lpfc_idiag_extacc_drivr_get()
5327 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5329 index, rsrc_blks->rsrc_start, in lpfc_idiag_extacc_drivr_get()
5330 rsrc_blks->rsrc_size); in lpfc_idiag_extacc_drivr_get()
5338 * lpfc_idiag_extacc_write - Syntax check and set up idiag extacc commands
5356 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_extacc_write()
5361 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_extacc_write()
5380 return -EINVAL; in lpfc_idiag_extacc_write()
5384 * lpfc_idiag_extacc_read - idiag debugfs read access to extent information
5402 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_extacc_read()
5403 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_extacc_read()
5409 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_extacc_read()
5411 if (!debug->buffer) in lpfc_idiag_extacc_read()
5412 debug->buffer = kmalloc(LPFC_EXT_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_extacc_read()
5413 if (!debug->buffer) in lpfc_idiag_extacc_read()
5415 pbuffer = debug->buffer; in lpfc_idiag_extacc_read()
5436 int rc = -ENOMEM; in lpfc_cgn_buffer_open()
5442 debug->buffer = vmalloc(LPFC_CGN_BUF_SIZE); in lpfc_cgn_buffer_open()
5443 if (!debug->buffer) { in lpfc_cgn_buffer_open()
5448 debug->i_private = inode->i_private; in lpfc_cgn_buffer_open()
5449 file->private_data = debug; in lpfc_cgn_buffer_open()
5460 struct lpfc_debug *debug = file->private_data; in lpfc_cgn_buffer_read()
5461 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_cgn_buffer_read()
5462 char *buffer = debug->buffer; in lpfc_cgn_buffer_read()
5466 if (!phba->sli4_hba.pc_sli4_params.mi_ver || !phba->cgn_i) { in lpfc_cgn_buffer_read()
5467 len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, in lpfc_cgn_buffer_read()
5471 ptr = (uint32_t *)phba->cgn_i->virt; in lpfc_cgn_buffer_read()
5472 len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, in lpfc_cgn_buffer_read()
5476 len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, in lpfc_cgn_buffer_read()
5481 len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, in lpfc_cgn_buffer_read()
5484 if (len > (LPFC_CGN_BUF_SIZE - LPFC_DEBUG_OUT_LINE_SZ)) { in lpfc_cgn_buffer_read()
5485 len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, in lpfc_cgn_buffer_read()
5489 len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, in lpfc_cgn_buffer_read()
5505 struct lpfc_debug *debug = file->private_data; in lpfc_cgn_buffer_release()
5507 vfree(debug->buffer); in lpfc_cgn_buffer_release()
5517 int rc = -ENOMEM; in lpfc_rx_monitor_open()
5523 debug->buffer = vmalloc(MAX_DEBUGFS_RX_TABLE_SIZE); in lpfc_rx_monitor_open()
5524 if (!debug->buffer) { in lpfc_rx_monitor_open()
5529 debug->i_private = inode->i_private; in lpfc_rx_monitor_open()
5530 file->private_data = debug; in lpfc_rx_monitor_open()
5541 struct lpfc_rx_monitor_debug *debug = file->private_data; in lpfc_rx_monitor_read()
5542 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_rx_monitor_read()
5543 char *buffer = debug->buffer; in lpfc_rx_monitor_read()
5547 head = atomic_read(&phba->rxtable_idx_head); in lpfc_rx_monitor_read()
5551 head = atomic_read(&phba->rxtable_idx_head); in lpfc_rx_monitor_read()
5554 tail = atomic_xchg(&phba->rxtable_idx_tail, head); in lpfc_rx_monitor_read()
5555 if (!phba->rxtable || head == tail) { in lpfc_rx_monitor_read()
5556 len += scnprintf(buffer + len, MAX_DEBUGFS_RX_TABLE_SIZE - len, in lpfc_rx_monitor_read()
5563 len += scnprintf(buffer + len, MAX_DEBUGFS_RX_TABLE_SIZE - len, in lpfc_rx_monitor_read()
5569 entry = &phba->rxtable[i]; in lpfc_rx_monitor_read()
5570 len += scnprintf(buffer + len, MAX_DEBUGFS_RX_TABLE_SIZE - len, in lpfc_rx_monitor_read()
5574 i, entry->max_bytes_per_interval, in lpfc_rx_monitor_read()
5575 entry->total_bytes, in lpfc_rx_monitor_read()
5576 entry->rcv_bytes, in lpfc_rx_monitor_read()
5577 entry->avg_io_latency, in lpfc_rx_monitor_read()
5578 entry->avg_io_size, in lpfc_rx_monitor_read()
5579 entry->max_read_cnt, in lpfc_rx_monitor_read()
5580 entry->io_cnt, in lpfc_rx_monitor_read()
5581 entry->cmf_info, in lpfc_rx_monitor_read()
5582 entry->timer_utilization, in lpfc_rx_monitor_read()
5583 entry->timer_interval); in lpfc_rx_monitor_read()
5598 struct lpfc_rx_monitor_debug *debug = file->private_data; in lpfc_rx_monitor_release()
5600 vfree(debug->buffer); in lpfc_rx_monitor_release()
5853 /* lpfc_idiag_mbxacc_dump_bsg_mbox - idiag debugfs dump bsg mailbox command
5858 * This routine dump a bsg pass-through non-embedded mailbox command with
5894 pr_err("\nRead mbox command (x%x), " in lpfc_idiag_mbxacc_dump_bsg_mbox()
5902 pr_err("\nRead mbox buffer (x%x), " in lpfc_idiag_mbxacc_dump_bsg_mbox()
5910 pr_err("\nWrite mbox command (x%x), " in lpfc_idiag_mbxacc_dump_bsg_mbox()
5918 pr_err("\nWrite mbox buffer (x%x), " in lpfc_idiag_mbxacc_dump_bsg_mbox()
5926 pword = (uint32_t *)dmabuf->virt; in lpfc_idiag_mbxacc_dump_bsg_mbox()
5933 LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_bsg_mbox()
5936 len += scnprintf(line_buf+len, LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_bsg_mbox()
5940 if ((i - 1) % 8) in lpfc_idiag_mbxacc_dump_bsg_mbox()
5942 (*mbx_dump_cnt)--; in lpfc_idiag_mbxacc_dump_bsg_mbox()
5952 /* lpfc_idiag_mbxacc_dump_issue_mbox - idiag debugfs dump issue mailbox command
5957 * This routine dump a pass-through non-embedded mailbox command from issue
5985 (*mbx_mbox_cmd != pmbox->mbxCommand)) in lpfc_idiag_mbxacc_dump_issue_mbox()
5991 pmbox->mbxCommand); in lpfc_idiag_mbxacc_dump_issue_mbox()
6000 LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_issue_mbox()
6003 len += scnprintf(line_buf+len, LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_issue_mbox()
6008 if ((i - 1) % 8) in lpfc_idiag_mbxacc_dump_issue_mbox()
6014 pmbox->mbxCommand); in lpfc_idiag_mbxacc_dump_issue_mbox()
6023 LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_issue_mbox()
6028 LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_issue_mbox()
6034 LPFC_MBX_ACC_LBUF_SZ-len, " "); in lpfc_idiag_mbxacc_dump_issue_mbox()
6036 if ((i - 1) % 8) in lpfc_idiag_mbxacc_dump_issue_mbox()
6040 (*mbx_dump_cnt)--; in lpfc_idiag_mbxacc_dump_issue_mbox()
6050 * lpfc_debugfs_initialize - Initialize debugfs for a vport
6063 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_initialize()
6065 uint32_t num, i; in lpfc_debugfs_initialize() local
6080 snprintf(name, sizeof(name), "fn%d", phba->brd_no); in lpfc_debugfs_initialize()
6081 if (!phba->hba_debugfs_root) { in lpfc_debugfs_initialize()
6083 phba->hba_debugfs_root = in lpfc_debugfs_initialize()
6086 atomic_set(&phba->debugfs_vport_count, 0); in lpfc_debugfs_initialize()
6088 /* Multi-XRI pools */ in lpfc_debugfs_initialize()
6090 phba->debug_multixri_pools = in lpfc_debugfs_initialize()
6092 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6095 if (!phba->debug_multixri_pools) { in lpfc_debugfs_initialize()
6103 phba->debug_cgn_buffer = in lpfc_debugfs_initialize()
6105 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6107 if (!phba->debug_cgn_buffer) { in lpfc_debugfs_initialize()
6116 phba->debug_rx_monitor = in lpfc_debugfs_initialize()
6118 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6120 if (!phba->debug_rx_monitor) { in lpfc_debugfs_initialize()
6129 phba->debug_ras_log = in lpfc_debugfs_initialize()
6131 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6133 if (!phba->debug_ras_log) { in lpfc_debugfs_initialize()
6142 phba->debug_hbqinfo = in lpfc_debugfs_initialize()
6144 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6150 phba->debug_lockstat = in lpfc_debugfs_initialize()
6152 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6154 if (!phba->debug_lockstat) { in lpfc_debugfs_initialize()
6162 if (phba->sli_rev < LPFC_SLI_REV4) { in lpfc_debugfs_initialize()
6164 phba->debug_dumpHBASlim = in lpfc_debugfs_initialize()
6167 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6170 phba->debug_dumpHBASlim = NULL; in lpfc_debugfs_initialize()
6173 if (phba->sli_rev < LPFC_SLI_REV4) { in lpfc_debugfs_initialize()
6175 phba->debug_dumpHostSlim = in lpfc_debugfs_initialize()
6178 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6181 phba->debug_dumpHostSlim = NULL; in lpfc_debugfs_initialize()
6185 phba->debug_InjErrLBA = in lpfc_debugfs_initialize()
6187 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6189 phba->lpfc_injerr_lba = LPFC_INJERR_LBA_OFF; in lpfc_debugfs_initialize()
6192 phba->debug_InjErrNPortID = in lpfc_debugfs_initialize()
6194 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6198 phba->debug_InjErrWWPN = in lpfc_debugfs_initialize()
6200 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6204 phba->debug_writeGuard = in lpfc_debugfs_initialize()
6206 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6210 phba->debug_writeApp = in lpfc_debugfs_initialize()
6212 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6216 phba->debug_writeRef = in lpfc_debugfs_initialize()
6218 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6222 phba->debug_readGuard = in lpfc_debugfs_initialize()
6224 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6228 phba->debug_readApp = in lpfc_debugfs_initialize()
6230 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6234 phba->debug_readRef = in lpfc_debugfs_initialize()
6236 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6241 num = lpfc_debugfs_max_slow_ring_trc - 1; in lpfc_debugfs_initialize()
6242 if (num & lpfc_debugfs_max_slow_ring_trc) { in lpfc_debugfs_initialize()
6244 num = lpfc_debugfs_max_slow_ring_trc; in lpfc_debugfs_initialize()
6246 while (num > 1) { in lpfc_debugfs_initialize()
6247 num = num >> 1; in lpfc_debugfs_initialize()
6257 phba->debug_slow_ring_trc = in lpfc_debugfs_initialize()
6259 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6261 if (!phba->slow_ring_trc) { in lpfc_debugfs_initialize()
6262 phba->slow_ring_trc = kmalloc( in lpfc_debugfs_initialize()
6266 if (!phba->slow_ring_trc) { in lpfc_debugfs_initialize()
6272 atomic_set(&phba->slow_ring_trc_cnt, 0); in lpfc_debugfs_initialize()
6273 memset(phba->slow_ring_trc, 0, in lpfc_debugfs_initialize()
6279 phba->debug_nvmeio_trc = in lpfc_debugfs_initialize()
6281 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6284 atomic_set(&phba->nvmeio_trc_cnt, 0); in lpfc_debugfs_initialize()
6286 num = lpfc_debugfs_max_nvmeio_trc - 1; in lpfc_debugfs_initialize()
6287 if (num & lpfc_debugfs_max_disc_trc) { in lpfc_debugfs_initialize()
6289 num = lpfc_debugfs_max_nvmeio_trc; in lpfc_debugfs_initialize()
6291 while (num > 1) { in lpfc_debugfs_initialize()
6292 num = num >> 1; in lpfc_debugfs_initialize()
6301 phba->nvmeio_trc_size = lpfc_debugfs_max_nvmeio_trc; in lpfc_debugfs_initialize()
6304 phba->nvmeio_trc = kzalloc( in lpfc_debugfs_initialize()
6306 phba->nvmeio_trc_size), GFP_KERNEL); in lpfc_debugfs_initialize()
6308 if (!phba->nvmeio_trc) { in lpfc_debugfs_initialize()
6314 phba->nvmeio_trc_on = 1; in lpfc_debugfs_initialize()
6315 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_initialize()
6316 phba->nvmeio_trc = NULL; in lpfc_debugfs_initialize()
6319 phba->nvmeio_trc_size = 0; in lpfc_debugfs_initialize()
6320 phba->nvmeio_trc_on = 0; in lpfc_debugfs_initialize()
6321 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_initialize()
6322 phba->nvmeio_trc = NULL; in lpfc_debugfs_initialize()
6326 snprintf(name, sizeof(name), "vport%d", vport->vpi); in lpfc_debugfs_initialize()
6327 if (!vport->vport_debugfs_root) { in lpfc_debugfs_initialize()
6328 vport->vport_debugfs_root = in lpfc_debugfs_initialize()
6329 debugfs_create_dir(name, phba->hba_debugfs_root); in lpfc_debugfs_initialize()
6330 atomic_inc(&phba->debugfs_vport_count); in lpfc_debugfs_initialize()
6334 num = lpfc_debugfs_max_disc_trc - 1; in lpfc_debugfs_initialize()
6335 if (num & lpfc_debugfs_max_disc_trc) { in lpfc_debugfs_initialize()
6337 num = lpfc_debugfs_max_disc_trc; in lpfc_debugfs_initialize()
6339 while (num > 1) { in lpfc_debugfs_initialize()
6340 num = num >> 1; in lpfc_debugfs_initialize()
6349 vport->disc_trc = kzalloc( in lpfc_debugfs_initialize()
6353 if (!vport->disc_trc) { in lpfc_debugfs_initialize()
6359 atomic_set(&vport->disc_trc_cnt, 0); in lpfc_debugfs_initialize()
6362 vport->debug_disc_trc = in lpfc_debugfs_initialize()
6364 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6367 vport->debug_nodelist = in lpfc_debugfs_initialize()
6369 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6373 vport->debug_nvmestat = in lpfc_debugfs_initialize()
6375 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6379 vport->debug_scsistat = in lpfc_debugfs_initialize()
6381 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6383 if (!vport->debug_scsistat) { in lpfc_debugfs_initialize()
6390 vport->debug_ioktime = in lpfc_debugfs_initialize()
6392 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6394 if (!vport->debug_ioktime) { in lpfc_debugfs_initialize()
6401 vport->debug_hdwqstat = in lpfc_debugfs_initialize()
6403 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6417 if (phba->sli_rev < LPFC_SLI_REV4) in lpfc_debugfs_initialize()
6421 if (!phba->idiag_root) { in lpfc_debugfs_initialize()
6422 phba->idiag_root = in lpfc_debugfs_initialize()
6423 debugfs_create_dir(name, phba->hba_debugfs_root); in lpfc_debugfs_initialize()
6430 if (!phba->idiag_pci_cfg) { in lpfc_debugfs_initialize()
6431 phba->idiag_pci_cfg = in lpfc_debugfs_initialize()
6433 phba->idiag_root, phba, &lpfc_idiag_op_pciCfg); in lpfc_debugfs_initialize()
6439 if (!phba->idiag_bar_acc) { in lpfc_debugfs_initialize()
6440 phba->idiag_bar_acc = in lpfc_debugfs_initialize()
6442 phba->idiag_root, phba, &lpfc_idiag_op_barAcc); in lpfc_debugfs_initialize()
6448 if (!phba->idiag_que_info) { in lpfc_debugfs_initialize()
6449 phba->idiag_que_info = in lpfc_debugfs_initialize()
6451 phba->idiag_root, phba, &lpfc_idiag_op_queInfo); in lpfc_debugfs_initialize()
6456 if (!phba->idiag_que_acc) { in lpfc_debugfs_initialize()
6457 phba->idiag_que_acc = in lpfc_debugfs_initialize()
6459 phba->idiag_root, phba, &lpfc_idiag_op_queAcc); in lpfc_debugfs_initialize()
6464 if (!phba->idiag_drb_acc) { in lpfc_debugfs_initialize()
6465 phba->idiag_drb_acc = in lpfc_debugfs_initialize()
6467 phba->idiag_root, phba, &lpfc_idiag_op_drbAcc); in lpfc_debugfs_initialize()
6472 if (!phba->idiag_ctl_acc) { in lpfc_debugfs_initialize()
6473 phba->idiag_ctl_acc = in lpfc_debugfs_initialize()
6475 phba->idiag_root, phba, &lpfc_idiag_op_ctlAcc); in lpfc_debugfs_initialize()
6478 /* iDiag access mbox commands */ in lpfc_debugfs_initialize()
6480 if (!phba->idiag_mbx_acc) { in lpfc_debugfs_initialize()
6481 phba->idiag_mbx_acc = in lpfc_debugfs_initialize()
6483 phba->idiag_root, phba, &lpfc_idiag_op_mbxAcc); in lpfc_debugfs_initialize()
6487 if (phba->sli4_hba.extents_in_use) { in lpfc_debugfs_initialize()
6489 if (!phba->idiag_ext_acc) { in lpfc_debugfs_initialize()
6490 phba->idiag_ext_acc = in lpfc_debugfs_initialize()
6493 phba->idiag_root, phba, in lpfc_debugfs_initialize()
6504 * lpfc_debugfs_terminate - Tear down debugfs infrastructure for this vport
6510 * users left for the debugfs directories associated with the HBA and driver. If
6518 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_terminate()
6520 kfree(vport->disc_trc); in lpfc_debugfs_terminate()
6521 vport->disc_trc = NULL; in lpfc_debugfs_terminate()
6523 debugfs_remove(vport->debug_disc_trc); /* discovery_trace */ in lpfc_debugfs_terminate()
6524 vport->debug_disc_trc = NULL; in lpfc_debugfs_terminate()
6526 debugfs_remove(vport->debug_nodelist); /* nodelist */ in lpfc_debugfs_terminate()
6527 vport->debug_nodelist = NULL; in lpfc_debugfs_terminate()
6529 debugfs_remove(vport->debug_nvmestat); /* nvmestat */ in lpfc_debugfs_terminate()
6530 vport->debug_nvmestat = NULL; in lpfc_debugfs_terminate()
6532 debugfs_remove(vport->debug_scsistat); /* scsistat */ in lpfc_debugfs_terminate()
6533 vport->debug_scsistat = NULL; in lpfc_debugfs_terminate()
6535 debugfs_remove(vport->debug_ioktime); /* ioktime */ in lpfc_debugfs_terminate()
6536 vport->debug_ioktime = NULL; in lpfc_debugfs_terminate()
6538 debugfs_remove(vport->debug_hdwqstat); /* hdwqstat */ in lpfc_debugfs_terminate()
6539 vport->debug_hdwqstat = NULL; in lpfc_debugfs_terminate()
6541 if (vport->vport_debugfs_root) { in lpfc_debugfs_terminate()
6542 debugfs_remove(vport->vport_debugfs_root); /* vportX */ in lpfc_debugfs_terminate()
6543 vport->vport_debugfs_root = NULL; in lpfc_debugfs_terminate()
6544 atomic_dec(&phba->debugfs_vport_count); in lpfc_debugfs_terminate()
6547 if (atomic_read(&phba->debugfs_vport_count) == 0) { in lpfc_debugfs_terminate()
6549 debugfs_remove(phba->debug_multixri_pools); /* multixripools*/ in lpfc_debugfs_terminate()
6550 phba->debug_multixri_pools = NULL; in lpfc_debugfs_terminate()
6552 debugfs_remove(phba->debug_hbqinfo); /* hbqinfo */ in lpfc_debugfs_terminate()
6553 phba->debug_hbqinfo = NULL; in lpfc_debugfs_terminate()
6555 debugfs_remove(phba->debug_cgn_buffer); in lpfc_debugfs_terminate()
6556 phba->debug_cgn_buffer = NULL; in lpfc_debugfs_terminate()
6558 debugfs_remove(phba->debug_rx_monitor); in lpfc_debugfs_terminate()
6559 phba->debug_rx_monitor = NULL; in lpfc_debugfs_terminate()
6561 debugfs_remove(phba->debug_ras_log); in lpfc_debugfs_terminate()
6562 phba->debug_ras_log = NULL; in lpfc_debugfs_terminate()
6565 debugfs_remove(phba->debug_lockstat); /* lockstat */ in lpfc_debugfs_terminate()
6566 phba->debug_lockstat = NULL; in lpfc_debugfs_terminate()
6568 debugfs_remove(phba->debug_dumpHBASlim); /* HBASlim */ in lpfc_debugfs_terminate()
6569 phba->debug_dumpHBASlim = NULL; in lpfc_debugfs_terminate()
6571 debugfs_remove(phba->debug_dumpHostSlim); /* HostSlim */ in lpfc_debugfs_terminate()
6572 phba->debug_dumpHostSlim = NULL; in lpfc_debugfs_terminate()
6574 debugfs_remove(phba->debug_InjErrLBA); /* InjErrLBA */ in lpfc_debugfs_terminate()
6575 phba->debug_InjErrLBA = NULL; in lpfc_debugfs_terminate()
6577 debugfs_remove(phba->debug_InjErrNPortID); in lpfc_debugfs_terminate()
6578 phba->debug_InjErrNPortID = NULL; in lpfc_debugfs_terminate()
6580 debugfs_remove(phba->debug_InjErrWWPN); /* InjErrWWPN */ in lpfc_debugfs_terminate()
6581 phba->debug_InjErrWWPN = NULL; in lpfc_debugfs_terminate()
6583 debugfs_remove(phba->debug_writeGuard); /* writeGuard */ in lpfc_debugfs_terminate()
6584 phba->debug_writeGuard = NULL; in lpfc_debugfs_terminate()
6586 debugfs_remove(phba->debug_writeApp); /* writeApp */ in lpfc_debugfs_terminate()
6587 phba->debug_writeApp = NULL; in lpfc_debugfs_terminate()
6589 debugfs_remove(phba->debug_writeRef); /* writeRef */ in lpfc_debugfs_terminate()
6590 phba->debug_writeRef = NULL; in lpfc_debugfs_terminate()
6592 debugfs_remove(phba->debug_readGuard); /* readGuard */ in lpfc_debugfs_terminate()
6593 phba->debug_readGuard = NULL; in lpfc_debugfs_terminate()
6595 debugfs_remove(phba->debug_readApp); /* readApp */ in lpfc_debugfs_terminate()
6596 phba->debug_readApp = NULL; in lpfc_debugfs_terminate()
6598 debugfs_remove(phba->debug_readRef); /* readRef */ in lpfc_debugfs_terminate()
6599 phba->debug_readRef = NULL; in lpfc_debugfs_terminate()
6601 kfree(phba->slow_ring_trc); in lpfc_debugfs_terminate()
6602 phba->slow_ring_trc = NULL; in lpfc_debugfs_terminate()
6605 debugfs_remove(phba->debug_slow_ring_trc); in lpfc_debugfs_terminate()
6606 phba->debug_slow_ring_trc = NULL; in lpfc_debugfs_terminate()
6608 debugfs_remove(phba->debug_nvmeio_trc); in lpfc_debugfs_terminate()
6609 phba->debug_nvmeio_trc = NULL; in lpfc_debugfs_terminate()
6611 kfree(phba->nvmeio_trc); in lpfc_debugfs_terminate()
6612 phba->nvmeio_trc = NULL; in lpfc_debugfs_terminate()
6617 if (phba->sli_rev == LPFC_SLI_REV4) { in lpfc_debugfs_terminate()
6619 debugfs_remove(phba->idiag_ext_acc); in lpfc_debugfs_terminate()
6620 phba->idiag_ext_acc = NULL; in lpfc_debugfs_terminate()
6623 debugfs_remove(phba->idiag_mbx_acc); in lpfc_debugfs_terminate()
6624 phba->idiag_mbx_acc = NULL; in lpfc_debugfs_terminate()
6627 debugfs_remove(phba->idiag_ctl_acc); in lpfc_debugfs_terminate()
6628 phba->idiag_ctl_acc = NULL; in lpfc_debugfs_terminate()
6631 debugfs_remove(phba->idiag_drb_acc); in lpfc_debugfs_terminate()
6632 phba->idiag_drb_acc = NULL; in lpfc_debugfs_terminate()
6635 debugfs_remove(phba->idiag_que_acc); in lpfc_debugfs_terminate()
6636 phba->idiag_que_acc = NULL; in lpfc_debugfs_terminate()
6639 debugfs_remove(phba->idiag_que_info); in lpfc_debugfs_terminate()
6640 phba->idiag_que_info = NULL; in lpfc_debugfs_terminate()
6643 debugfs_remove(phba->idiag_bar_acc); in lpfc_debugfs_terminate()
6644 phba->idiag_bar_acc = NULL; in lpfc_debugfs_terminate()
6647 debugfs_remove(phba->idiag_pci_cfg); in lpfc_debugfs_terminate()
6648 phba->idiag_pci_cfg = NULL; in lpfc_debugfs_terminate()
6651 debugfs_remove(phba->idiag_root); in lpfc_debugfs_terminate()
6652 phba->idiag_root = NULL; in lpfc_debugfs_terminate()
6655 if (phba->hba_debugfs_root) { in lpfc_debugfs_terminate()
6656 debugfs_remove(phba->hba_debugfs_root); /* fnX */ in lpfc_debugfs_terminate()
6657 phba->hba_debugfs_root = NULL; in lpfc_debugfs_terminate()
6677 * lpfc_debug_dump_all_queues - dump all the queues with a hba
6694 for (idx = 0; idx < phba->cfg_hdw_queue; idx++) in lpfc_debug_dump_all_queues()
6706 for (idx = 0; idx < phba->cfg_hdw_queue; idx++) in lpfc_debug_dump_all_queues()
6712 for (idx = 0; idx < phba->cfg_hdw_queue; idx++) in lpfc_debug_dump_all_queues()