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

4  * Copyright (C) 2017-2023 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 bsize = min(nbytes, (sizeof(mybuf) - 1)); in lpfc_debugfs_lockstat_write()
2167 return -EFAULT; in lpfc_debugfs_lockstat_write()
2172 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_debugfs_lockstat_write()
2173 qp = &phba->sli4_hba.hdwq[i]; in lpfc_debugfs_lockstat_write()
2174 qp->lock_conflict.alloc_xri_get = 0; in lpfc_debugfs_lockstat_write()
2175 qp->lock_conflict.alloc_xri_put = 0; in lpfc_debugfs_lockstat_write()
2176 qp->lock_conflict.free_xri = 0; in lpfc_debugfs_lockstat_write()
2177 qp->lock_conflict.wq_access = 0; in lpfc_debugfs_lockstat_write()
2178 qp->lock_conflict.alloc_pvt_pool = 0; in lpfc_debugfs_lockstat_write()
2179 qp->lock_conflict.mv_from_pvt_pool = 0; in lpfc_debugfs_lockstat_write()
2180 qp->lock_conflict.mv_to_pub_pool = 0; in lpfc_debugfs_lockstat_write()
2181 qp->lock_conflict.mv_to_pvt_pool = 0; in lpfc_debugfs_lockstat_write()
2182 qp->lock_conflict.free_pvt_pool = 0; in lpfc_debugfs_lockstat_write()
2183 qp->lock_conflict.free_pub_pool = 0; in lpfc_debugfs_lockstat_write()
2184 qp->lock_conflict.wq_access = 0; in lpfc_debugfs_lockstat_write()
2199 spin_lock_irq(&phba->ras_fwlog_lock); in lpfc_debugfs_ras_log_data()
2200 if (phba->ras_fwlog.state != ACTIVE) { in lpfc_debugfs_ras_log_data()
2201 spin_unlock_irq(&phba->ras_fwlog_lock); in lpfc_debugfs_ras_log_data()
2202 return -EINVAL; in lpfc_debugfs_ras_log_data()
2204 spin_unlock_irq(&phba->ras_fwlog_lock); in lpfc_debugfs_ras_log_data()
2207 &phba->ras_fwlog.fwlog_buff_list, list) { in lpfc_debugfs_ras_log_data()
2209 if ((copied + LPFC_RAS_MAX_ENTRY_SIZE) >= (size - 1)) { in lpfc_debugfs_ras_log_data()
2210 memcpy(buffer + copied, dmabuf->virt, in lpfc_debugfs_ras_log_data()
2211 size - copied - 1); in lpfc_debugfs_ras_log_data()
2212 copied += size - copied - 1; in lpfc_debugfs_ras_log_data()
2215 memcpy(buffer + copied, dmabuf->virt, LPFC_RAS_MAX_ENTRY_SIZE); in lpfc_debugfs_ras_log_data()
2224 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_ras_log_release()
2226 vfree(debug->buffer); in lpfc_debugfs_ras_log_release()
2233 * lpfc_debugfs_ras_log_open - Open the RAS log debugfs buffer
2240 * for the log, fills the buffer from the in-memory log for this vport, and then
2250 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_ras_log_open()
2253 int rc = -ENOMEM; in lpfc_debugfs_ras_log_open()
2255 spin_lock_irq(&phba->ras_fwlog_lock); in lpfc_debugfs_ras_log_open()
2256 if (phba->ras_fwlog.state != ACTIVE) { in lpfc_debugfs_ras_log_open()
2257 spin_unlock_irq(&phba->ras_fwlog_lock); in lpfc_debugfs_ras_log_open()
2258 rc = -EINVAL; in lpfc_debugfs_ras_log_open()
2261 spin_unlock_irq(&phba->ras_fwlog_lock); in lpfc_debugfs_ras_log_open()
2264 phba->cfg_ras_fwlog_buffsize, &size)) in lpfc_debugfs_ras_log_open()
2271 debug->buffer = vmalloc(size); in lpfc_debugfs_ras_log_open()
2272 if (!debug->buffer) in lpfc_debugfs_ras_log_open()
2275 debug->len = lpfc_debugfs_ras_log_data(phba, debug->buffer, size); in lpfc_debugfs_ras_log_open()
2276 if (debug->len < 0) { in lpfc_debugfs_ras_log_open()
2277 rc = -EINVAL; in lpfc_debugfs_ras_log_open()
2280 file->private_data = debug; in lpfc_debugfs_ras_log_open()
2285 vfree(debug->buffer); in lpfc_debugfs_ras_log_open()
2293 * lpfc_debugfs_dumpHBASlim_open - Open the Dump HBA SLIM debugfs buffer
2300 * for the log, fills the buffer from the in-memory log for this vport, and then
2310 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_dumpHBASlim_open()
2312 int rc = -ENOMEM; in lpfc_debugfs_dumpHBASlim_open()
2319 debug->buffer = kmalloc(LPFC_DUMPHBASLIM_SIZE, GFP_KERNEL); in lpfc_debugfs_dumpHBASlim_open()
2320 if (!debug->buffer) { in lpfc_debugfs_dumpHBASlim_open()
2325 debug->len = lpfc_debugfs_dumpHBASlim_data(phba, debug->buffer, in lpfc_debugfs_dumpHBASlim_open()
2327 file->private_data = debug; in lpfc_debugfs_dumpHBASlim_open()
2335 * lpfc_debugfs_dumpHostSlim_open - Open the Dump Host SLIM debugfs buffer
2342 * for the log, fills the buffer from the in-memory log for this vport, and then
2352 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_dumpHostSlim_open()
2354 int rc = -ENOMEM; in lpfc_debugfs_dumpHostSlim_open()
2361 debug->buffer = kmalloc(LPFC_DUMPHOSTSLIM_SIZE, GFP_KERNEL); in lpfc_debugfs_dumpHostSlim_open()
2362 if (!debug->buffer) { in lpfc_debugfs_dumpHostSlim_open()
2367 debug->len = lpfc_debugfs_dumpHostSlim_data(phba, debug->buffer, in lpfc_debugfs_dumpHostSlim_open()
2369 file->private_data = debug; in lpfc_debugfs_dumpHostSlim_open()
2380 struct dentry *dent = file->f_path.dentry; in lpfc_debugfs_dif_err_read()
2381 struct lpfc_hba *phba = file->private_data; in lpfc_debugfs_dif_err_read()
2386 if (dent == phba->debug_writeGuard) in lpfc_debugfs_dif_err_read()
2387 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_wgrd_cnt); in lpfc_debugfs_dif_err_read()
2388 else if (dent == phba->debug_writeApp) in lpfc_debugfs_dif_err_read()
2389 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_wapp_cnt); in lpfc_debugfs_dif_err_read()
2390 else if (dent == phba->debug_writeRef) in lpfc_debugfs_dif_err_read()
2391 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_wref_cnt); in lpfc_debugfs_dif_err_read()
2392 else if (dent == phba->debug_readGuard) in lpfc_debugfs_dif_err_read()
2393 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_rgrd_cnt); in lpfc_debugfs_dif_err_read()
2394 else if (dent == phba->debug_readApp) in lpfc_debugfs_dif_err_read()
2395 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_rapp_cnt); in lpfc_debugfs_dif_err_read()
2396 else if (dent == phba->debug_readRef) in lpfc_debugfs_dif_err_read()
2397 cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_rref_cnt); in lpfc_debugfs_dif_err_read()
2398 else if (dent == phba->debug_InjErrNPortID) in lpfc_debugfs_dif_err_read()
2400 phba->lpfc_injerr_nportid); in lpfc_debugfs_dif_err_read()
2401 else if (dent == phba->debug_InjErrWWPN) { in lpfc_debugfs_dif_err_read()
2402 memcpy(&tmp, &phba->lpfc_injerr_wwpn, sizeof(struct lpfc_name)); in lpfc_debugfs_dif_err_read()
2405 } else if (dent == phba->debug_InjErrLBA) { in lpfc_debugfs_dif_err_read()
2406 if (phba->lpfc_injerr_lba == (sector_t)(-1)) in lpfc_debugfs_dif_err_read()
2410 (uint64_t) phba->lpfc_injerr_lba); in lpfc_debugfs_dif_err_read()
2422 struct dentry *dent = file->f_path.dentry; in lpfc_debugfs_dif_err_write()
2423 struct lpfc_hba *phba = file->private_data; in lpfc_debugfs_dif_err_write()
2431 return -EFAULT; in lpfc_debugfs_dif_err_write()
2433 if (dent == phba->debug_InjErrLBA) { in lpfc_debugfs_dif_err_write()
2436 tmp = (uint64_t)(-1); in lpfc_debugfs_dif_err_write()
2440 return -EINVAL; in lpfc_debugfs_dif_err_write()
2442 if (dent == phba->debug_writeGuard) in lpfc_debugfs_dif_err_write()
2443 phba->lpfc_injerr_wgrd_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2444 else if (dent == phba->debug_writeApp) in lpfc_debugfs_dif_err_write()
2445 phba->lpfc_injerr_wapp_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2446 else if (dent == phba->debug_writeRef) in lpfc_debugfs_dif_err_write()
2447 phba->lpfc_injerr_wref_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2448 else if (dent == phba->debug_readGuard) in lpfc_debugfs_dif_err_write()
2449 phba->lpfc_injerr_rgrd_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2450 else if (dent == phba->debug_readApp) in lpfc_debugfs_dif_err_write()
2451 phba->lpfc_injerr_rapp_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2452 else if (dent == phba->debug_readRef) in lpfc_debugfs_dif_err_write()
2453 phba->lpfc_injerr_rref_cnt = (uint32_t)tmp; in lpfc_debugfs_dif_err_write()
2454 else if (dent == phba->debug_InjErrLBA) in lpfc_debugfs_dif_err_write()
2455 phba->lpfc_injerr_lba = (sector_t)tmp; in lpfc_debugfs_dif_err_write()
2456 else if (dent == phba->debug_InjErrNPortID) in lpfc_debugfs_dif_err_write()
2457 phba->lpfc_injerr_nportid = (uint32_t)(tmp & Mask_DID); in lpfc_debugfs_dif_err_write()
2458 else if (dent == phba->debug_InjErrWWPN) { in lpfc_debugfs_dif_err_write()
2460 memcpy(&phba->lpfc_injerr_wwpn, &tmp, sizeof(struct lpfc_name)); in lpfc_debugfs_dif_err_write()
2475 * lpfc_debugfs_nodelist_open - Open the nodelist debugfs file
2482 * for the log, fills the buffer from the in-memory log for this vport, and then
2492 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_nodelist_open()
2494 int rc = -ENOMEM; in lpfc_debugfs_nodelist_open()
2501 debug->buffer = kmalloc(LPFC_NODELIST_SIZE, GFP_KERNEL); in lpfc_debugfs_nodelist_open()
2502 if (!debug->buffer) { in lpfc_debugfs_nodelist_open()
2507 debug->len = lpfc_debugfs_nodelist_data(vport, debug->buffer, in lpfc_debugfs_nodelist_open()
2509 file->private_data = debug; in lpfc_debugfs_nodelist_open()
2517 * lpfc_debugfs_lseek - Seek through a debugfs file
2536 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_lseek()
2537 return fixed_size_llseek(file, off, whence, debug->len); in lpfc_debugfs_lseek()
2541 * lpfc_debugfs_read - Read a debugfs file
2560 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_read()
2562 return simple_read_from_buffer(buf, nbytes, ppos, debug->buffer, in lpfc_debugfs_read()
2563 debug->len); in lpfc_debugfs_read()
2567 * lpfc_debugfs_release - Release the buffer used to store debugfs file data
2581 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_release()
2583 kfree(debug->buffer); in lpfc_debugfs_release()
2590 * lpfc_debugfs_multixripools_write - Clear multi-XRI pools statistics
2597 * This routine clears multi-XRI pools statistics when buf contains "clear".
2608 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_multixripools_write()
2609 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_debugfs_multixripools_write()
2617 if (nbytes > sizeof(mybuf) - 1) in lpfc_debugfs_multixripools_write()
2618 nbytes = sizeof(mybuf) - 1; in lpfc_debugfs_multixripools_write()
2623 return -EFAULT; in lpfc_debugfs_multixripools_write()
2627 hwq_count = phba->cfg_hdw_queue; in lpfc_debugfs_multixripools_write()
2629 qp = &phba->sli4_hba.hdwq[i]; in lpfc_debugfs_multixripools_write()
2630 multixri_pool = qp->p_multixri_pool; in lpfc_debugfs_multixripools_write()
2634 qp->empty_io_bufs = 0; in lpfc_debugfs_multixripools_write()
2635 multixri_pool->pbl_empty_count = 0; in lpfc_debugfs_multixripools_write()
2637 multixri_pool->above_limit_count = 0; in lpfc_debugfs_multixripools_write()
2638 multixri_pool->below_limit_count = 0; in lpfc_debugfs_multixripools_write()
2639 multixri_pool->stat_max_hwm = 0; in lpfc_debugfs_multixripools_write()
2640 multixri_pool->local_pbl_hit_count = 0; in lpfc_debugfs_multixripools_write()
2641 multixri_pool->other_pbl_hit_count = 0; in lpfc_debugfs_multixripools_write()
2643 multixri_pool->stat_pbl_count = 0; in lpfc_debugfs_multixripools_write()
2644 multixri_pool->stat_pvt_count = 0; in lpfc_debugfs_multixripools_write()
2645 multixri_pool->stat_busy_count = 0; in lpfc_debugfs_multixripools_write()
2646 multixri_pool->stat_snapshot_taken = 0; in lpfc_debugfs_multixripools_write()
2652 return -EINVAL; in lpfc_debugfs_multixripools_write()
2658 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_nvmestat_open()
2660 int rc = -ENOMEM; in lpfc_debugfs_nvmestat_open()
2667 debug->buffer = kmalloc(LPFC_NVMESTAT_SIZE, GFP_KERNEL); in lpfc_debugfs_nvmestat_open()
2668 if (!debug->buffer) { in lpfc_debugfs_nvmestat_open()
2673 debug->len = lpfc_debugfs_nvmestat_data(vport, debug->buffer, in lpfc_debugfs_nvmestat_open()
2676 debug->i_private = inode->i_private; in lpfc_debugfs_nvmestat_open()
2677 file->private_data = debug; in lpfc_debugfs_nvmestat_open()
2688 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_nvmestat_write()
2689 struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; in lpfc_debugfs_nvmestat_write()
2690 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_nvmestat_write()
2695 if (!phba->targetport) in lpfc_debugfs_nvmestat_write()
2696 return -ENXIO; in lpfc_debugfs_nvmestat_write()
2698 if (nbytes > sizeof(mybuf) - 1) in lpfc_debugfs_nvmestat_write()
2699 nbytes = sizeof(mybuf) - 1; in lpfc_debugfs_nvmestat_write()
2704 return -EFAULT; in lpfc_debugfs_nvmestat_write()
2707 tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private; in lpfc_debugfs_nvmestat_write()
2710 atomic_set(&tgtp->rcv_ls_req_in, 0); in lpfc_debugfs_nvmestat_write()
2711 atomic_set(&tgtp->rcv_ls_req_out, 0); in lpfc_debugfs_nvmestat_write()
2712 atomic_set(&tgtp->rcv_ls_req_drop, 0); in lpfc_debugfs_nvmestat_write()
2713 atomic_set(&tgtp->xmt_ls_abort, 0); in lpfc_debugfs_nvmestat_write()
2714 atomic_set(&tgtp->xmt_ls_abort_cmpl, 0); in lpfc_debugfs_nvmestat_write()
2715 atomic_set(&tgtp->xmt_ls_rsp, 0); in lpfc_debugfs_nvmestat_write()
2716 atomic_set(&tgtp->xmt_ls_drop, 0); in lpfc_debugfs_nvmestat_write()
2717 atomic_set(&tgtp->xmt_ls_rsp_error, 0); in lpfc_debugfs_nvmestat_write()
2718 atomic_set(&tgtp->xmt_ls_rsp_cmpl, 0); in lpfc_debugfs_nvmestat_write()
2720 atomic_set(&tgtp->rcv_fcp_cmd_in, 0); in lpfc_debugfs_nvmestat_write()
2721 atomic_set(&tgtp->rcv_fcp_cmd_out, 0); in lpfc_debugfs_nvmestat_write()
2722 atomic_set(&tgtp->rcv_fcp_cmd_drop, 0); in lpfc_debugfs_nvmestat_write()
2723 atomic_set(&tgtp->xmt_fcp_drop, 0); in lpfc_debugfs_nvmestat_write()
2724 atomic_set(&tgtp->xmt_fcp_read_rsp, 0); in lpfc_debugfs_nvmestat_write()
2725 atomic_set(&tgtp->xmt_fcp_read, 0); in lpfc_debugfs_nvmestat_write()
2726 atomic_set(&tgtp->xmt_fcp_write, 0); in lpfc_debugfs_nvmestat_write()
2727 atomic_set(&tgtp->xmt_fcp_rsp, 0); in lpfc_debugfs_nvmestat_write()
2728 atomic_set(&tgtp->xmt_fcp_release, 0); in lpfc_debugfs_nvmestat_write()
2729 atomic_set(&tgtp->xmt_fcp_rsp_cmpl, 0); in lpfc_debugfs_nvmestat_write()
2730 atomic_set(&tgtp->xmt_fcp_rsp_error, 0); in lpfc_debugfs_nvmestat_write()
2731 atomic_set(&tgtp->xmt_fcp_rsp_drop, 0); in lpfc_debugfs_nvmestat_write()
2733 atomic_set(&tgtp->xmt_fcp_abort, 0); in lpfc_debugfs_nvmestat_write()
2734 atomic_set(&tgtp->xmt_fcp_abort_cmpl, 0); in lpfc_debugfs_nvmestat_write()
2735 atomic_set(&tgtp->xmt_abort_sol, 0); in lpfc_debugfs_nvmestat_write()
2736 atomic_set(&tgtp->xmt_abort_unsol, 0); in lpfc_debugfs_nvmestat_write()
2737 atomic_set(&tgtp->xmt_abort_rsp, 0); in lpfc_debugfs_nvmestat_write()
2738 atomic_set(&tgtp->xmt_abort_rsp_error, 0); in lpfc_debugfs_nvmestat_write()
2746 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_scsistat_open()
2748 int rc = -ENOMEM; in lpfc_debugfs_scsistat_open()
2755 debug->buffer = kzalloc(LPFC_SCSISTAT_SIZE, GFP_KERNEL); in lpfc_debugfs_scsistat_open()
2756 if (!debug->buffer) { in lpfc_debugfs_scsistat_open()
2761 debug->len = lpfc_debugfs_scsistat_data(vport, debug->buffer, in lpfc_debugfs_scsistat_open()
2764 debug->i_private = inode->i_private; in lpfc_debugfs_scsistat_open()
2765 file->private_data = debug; in lpfc_debugfs_scsistat_open()
2776 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_scsistat_write()
2777 struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; in lpfc_debugfs_scsistat_write()
2778 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_scsistat_write()
2783 (sizeof(mybuf) - 1) : nbytes)) in lpfc_debugfs_scsistat_write()
2784 return -EFAULT; in lpfc_debugfs_scsistat_write()
2788 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_debugfs_scsistat_write()
2789 memset(&phba->sli4_hba.hdwq[i].scsi_cstat, 0, in lpfc_debugfs_scsistat_write()
2790 sizeof(phba->sli4_hba.hdwq[i].scsi_cstat)); in lpfc_debugfs_scsistat_write()
2800 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_ioktime_open()
2802 int rc = -ENOMEM; in lpfc_debugfs_ioktime_open()
2809 debug->buffer = kmalloc(LPFC_IOKTIME_SIZE, GFP_KERNEL); in lpfc_debugfs_ioktime_open()
2810 if (!debug->buffer) { in lpfc_debugfs_ioktime_open()
2815 debug->len = lpfc_debugfs_ioktime_data(vport, debug->buffer, in lpfc_debugfs_ioktime_open()
2818 debug->i_private = inode->i_private; in lpfc_debugfs_ioktime_open()
2819 file->private_data = debug; in lpfc_debugfs_ioktime_open()
2830 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_ioktime_write()
2831 struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; in lpfc_debugfs_ioktime_write()
2832 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_ioktime_write()
2836 if (nbytes > sizeof(mybuf) - 1) in lpfc_debugfs_ioktime_write()
2837 nbytes = sizeof(mybuf) - 1; in lpfc_debugfs_ioktime_write()
2842 return -EFAULT; in lpfc_debugfs_ioktime_write()
2845 if ((strncmp(pbuf, "on", sizeof("on") - 1) == 0)) { in lpfc_debugfs_ioktime_write()
2846 phba->ktime_data_samples = 0; in lpfc_debugfs_ioktime_write()
2847 phba->ktime_status_samples = 0; in lpfc_debugfs_ioktime_write()
2848 phba->ktime_seg1_total = 0; in lpfc_debugfs_ioktime_write()
2849 phba->ktime_seg1_max = 0; in lpfc_debugfs_ioktime_write()
2850 phba->ktime_seg1_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2851 phba->ktime_seg2_total = 0; in lpfc_debugfs_ioktime_write()
2852 phba->ktime_seg2_max = 0; in lpfc_debugfs_ioktime_write()
2853 phba->ktime_seg2_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2854 phba->ktime_seg3_total = 0; in lpfc_debugfs_ioktime_write()
2855 phba->ktime_seg3_max = 0; in lpfc_debugfs_ioktime_write()
2856 phba->ktime_seg3_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2857 phba->ktime_seg4_total = 0; in lpfc_debugfs_ioktime_write()
2858 phba->ktime_seg4_max = 0; in lpfc_debugfs_ioktime_write()
2859 phba->ktime_seg4_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2860 phba->ktime_seg5_total = 0; in lpfc_debugfs_ioktime_write()
2861 phba->ktime_seg5_max = 0; in lpfc_debugfs_ioktime_write()
2862 phba->ktime_seg5_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2863 phba->ktime_seg6_total = 0; in lpfc_debugfs_ioktime_write()
2864 phba->ktime_seg6_max = 0; in lpfc_debugfs_ioktime_write()
2865 phba->ktime_seg6_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2866 phba->ktime_seg7_total = 0; in lpfc_debugfs_ioktime_write()
2867 phba->ktime_seg7_max = 0; in lpfc_debugfs_ioktime_write()
2868 phba->ktime_seg7_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2869 phba->ktime_seg8_total = 0; in lpfc_debugfs_ioktime_write()
2870 phba->ktime_seg8_max = 0; in lpfc_debugfs_ioktime_write()
2871 phba->ktime_seg8_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2872 phba->ktime_seg9_total = 0; in lpfc_debugfs_ioktime_write()
2873 phba->ktime_seg9_max = 0; in lpfc_debugfs_ioktime_write()
2874 phba->ktime_seg9_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2875 phba->ktime_seg10_total = 0; in lpfc_debugfs_ioktime_write()
2876 phba->ktime_seg10_max = 0; in lpfc_debugfs_ioktime_write()
2877 phba->ktime_seg10_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2879 phba->ktime_on = 1; in lpfc_debugfs_ioktime_write()
2882 sizeof("off") - 1) == 0)) { in lpfc_debugfs_ioktime_write()
2883 phba->ktime_on = 0; in lpfc_debugfs_ioktime_write()
2886 sizeof("zero") - 1) == 0)) { in lpfc_debugfs_ioktime_write()
2887 phba->ktime_data_samples = 0; in lpfc_debugfs_ioktime_write()
2888 phba->ktime_status_samples = 0; in lpfc_debugfs_ioktime_write()
2889 phba->ktime_seg1_total = 0; in lpfc_debugfs_ioktime_write()
2890 phba->ktime_seg1_max = 0; in lpfc_debugfs_ioktime_write()
2891 phba->ktime_seg1_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2892 phba->ktime_seg2_total = 0; in lpfc_debugfs_ioktime_write()
2893 phba->ktime_seg2_max = 0; in lpfc_debugfs_ioktime_write()
2894 phba->ktime_seg2_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2895 phba->ktime_seg3_total = 0; in lpfc_debugfs_ioktime_write()
2896 phba->ktime_seg3_max = 0; in lpfc_debugfs_ioktime_write()
2897 phba->ktime_seg3_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2898 phba->ktime_seg4_total = 0; in lpfc_debugfs_ioktime_write()
2899 phba->ktime_seg4_max = 0; in lpfc_debugfs_ioktime_write()
2900 phba->ktime_seg4_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2901 phba->ktime_seg5_total = 0; in lpfc_debugfs_ioktime_write()
2902 phba->ktime_seg5_max = 0; in lpfc_debugfs_ioktime_write()
2903 phba->ktime_seg5_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2904 phba->ktime_seg6_total = 0; in lpfc_debugfs_ioktime_write()
2905 phba->ktime_seg6_max = 0; in lpfc_debugfs_ioktime_write()
2906 phba->ktime_seg6_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2907 phba->ktime_seg7_total = 0; in lpfc_debugfs_ioktime_write()
2908 phba->ktime_seg7_max = 0; in lpfc_debugfs_ioktime_write()
2909 phba->ktime_seg7_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2910 phba->ktime_seg8_total = 0; in lpfc_debugfs_ioktime_write()
2911 phba->ktime_seg8_max = 0; in lpfc_debugfs_ioktime_write()
2912 phba->ktime_seg8_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2913 phba->ktime_seg9_total = 0; in lpfc_debugfs_ioktime_write()
2914 phba->ktime_seg9_max = 0; in lpfc_debugfs_ioktime_write()
2915 phba->ktime_seg9_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2916 phba->ktime_seg10_total = 0; in lpfc_debugfs_ioktime_write()
2917 phba->ktime_seg10_max = 0; in lpfc_debugfs_ioktime_write()
2918 phba->ktime_seg10_min = 0xffffffff; in lpfc_debugfs_ioktime_write()
2921 return -EINVAL; in lpfc_debugfs_ioktime_write()
2927 struct lpfc_hba *phba = inode->i_private; in lpfc_debugfs_nvmeio_trc_open()
2929 int rc = -ENOMEM; in lpfc_debugfs_nvmeio_trc_open()
2936 debug->buffer = kmalloc(LPFC_NVMEIO_TRC_SIZE, GFP_KERNEL); in lpfc_debugfs_nvmeio_trc_open()
2937 if (!debug->buffer) { in lpfc_debugfs_nvmeio_trc_open()
2942 debug->len = lpfc_debugfs_nvmeio_trc_data(phba, debug->buffer, in lpfc_debugfs_nvmeio_trc_open()
2945 debug->i_private = inode->i_private; in lpfc_debugfs_nvmeio_trc_open()
2946 file->private_data = debug; in lpfc_debugfs_nvmeio_trc_open()
2957 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_nvmeio_trc_write()
2958 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_debugfs_nvmeio_trc_write()
2964 if (nbytes > sizeof(mybuf) - 1) in lpfc_debugfs_nvmeio_trc_write()
2965 nbytes = sizeof(mybuf) - 1; in lpfc_debugfs_nvmeio_trc_write()
2970 return -EFAULT; in lpfc_debugfs_nvmeio_trc_write()
2973 if ((strncmp(pbuf, "off", sizeof("off") - 1) == 0)) { in lpfc_debugfs_nvmeio_trc_write()
2976 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_nvmeio_trc_write()
2977 phba->nvmeio_trc_on = 0; in lpfc_debugfs_nvmeio_trc_write()
2979 } else if ((strncmp(pbuf, "on", sizeof("on") - 1) == 0)) { in lpfc_debugfs_nvmeio_trc_write()
2982 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_nvmeio_trc_write()
2983 phba->nvmeio_trc_on = 1; in lpfc_debugfs_nvmeio_trc_write()
2988 if (phba->nvmeio_trc_on != 0) in lpfc_debugfs_nvmeio_trc_write()
2989 return -EINVAL; in lpfc_debugfs_nvmeio_trc_write()
2994 return -EINVAL; in lpfc_debugfs_nvmeio_trc_write()
2995 phba->nvmeio_trc_size = (uint32_t)sz; in lpfc_debugfs_nvmeio_trc_write()
2997 /* It must be a power of 2 - round down */ in lpfc_debugfs_nvmeio_trc_write()
3004 if (phba->nvmeio_trc_size != sz) in lpfc_debugfs_nvmeio_trc_write()
3008 phba->nvmeio_trc_size = (uint32_t)sz; in lpfc_debugfs_nvmeio_trc_write()
3011 kfree(phba->nvmeio_trc); in lpfc_debugfs_nvmeio_trc_write()
3014 phba->nvmeio_trc = kzalloc((sizeof(struct lpfc_debugfs_nvmeio_trc) * in lpfc_debugfs_nvmeio_trc_write()
3016 if (!phba->nvmeio_trc) { in lpfc_debugfs_nvmeio_trc_write()
3020 return -ENOMEM; in lpfc_debugfs_nvmeio_trc_write()
3022 atomic_set(&phba->nvmeio_trc_cnt, 0); in lpfc_debugfs_nvmeio_trc_write()
3023 phba->nvmeio_trc_on = 0; in lpfc_debugfs_nvmeio_trc_write()
3024 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_nvmeio_trc_write()
3032 struct lpfc_vport *vport = inode->i_private; in lpfc_debugfs_hdwqstat_open()
3034 int rc = -ENOMEM; in lpfc_debugfs_hdwqstat_open()
3041 debug->buffer = kcalloc(1, LPFC_SCSISTAT_SIZE, GFP_KERNEL); in lpfc_debugfs_hdwqstat_open()
3042 if (!debug->buffer) { in lpfc_debugfs_hdwqstat_open()
3047 debug->len = lpfc_debugfs_hdwqstat_data(vport, debug->buffer, in lpfc_debugfs_hdwqstat_open()
3050 debug->i_private = inode->i_private; in lpfc_debugfs_hdwqstat_open()
3051 file->private_data = debug; in lpfc_debugfs_hdwqstat_open()
3062 struct lpfc_debug *debug = file->private_data; in lpfc_debugfs_hdwqstat_write()
3063 struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; in lpfc_debugfs_hdwqstat_write()
3064 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_hdwqstat_write()
3070 if (nbytes > sizeof(mybuf) - 1) in lpfc_debugfs_hdwqstat_write()
3071 nbytes = sizeof(mybuf) - 1; in lpfc_debugfs_hdwqstat_write()
3076 return -EFAULT; in lpfc_debugfs_hdwqstat_write()
3079 if ((strncmp(pbuf, "on", sizeof("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()
3086 } else if ((strncmp(pbuf, "nvme_on", sizeof("nvme_on") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3087 if (phba->nvmet_support) in lpfc_debugfs_hdwqstat_write()
3088 phba->hdwqstat_on |= LPFC_CHECK_NVMET_IO; in lpfc_debugfs_hdwqstat_write()
3090 phba->hdwqstat_on |= LPFC_CHECK_NVME_IO; in lpfc_debugfs_hdwqstat_write()
3092 } else if ((strncmp(pbuf, "scsi_on", sizeof("scsi_on") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3093 if (!phba->nvmet_support) in lpfc_debugfs_hdwqstat_write()
3094 phba->hdwqstat_on |= LPFC_CHECK_SCSI_IO; in lpfc_debugfs_hdwqstat_write()
3096 } else if ((strncmp(pbuf, "nvme_off", sizeof("nvme_off") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3097 phba->hdwqstat_on &= ~(LPFC_CHECK_NVME_IO | in lpfc_debugfs_hdwqstat_write()
3100 } else if ((strncmp(pbuf, "scsi_off", sizeof("scsi_off") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3101 phba->hdwqstat_on &= ~LPFC_CHECK_SCSI_IO; in lpfc_debugfs_hdwqstat_write()
3104 sizeof("off") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3105 phba->hdwqstat_on = LPFC_CHECK_OFF; in lpfc_debugfs_hdwqstat_write()
3108 sizeof("zero") - 1) == 0)) { in lpfc_debugfs_hdwqstat_write()
3110 c_stat = per_cpu_ptr(phba->sli4_hba.c_stat, i); in lpfc_debugfs_hdwqstat_write()
3111 c_stat->xmt_io = 0; in lpfc_debugfs_hdwqstat_write()
3112 c_stat->cmpl_io = 0; in lpfc_debugfs_hdwqstat_write()
3113 c_stat->rcv_io = 0; in lpfc_debugfs_hdwqstat_write()
3117 return -EINVAL; in lpfc_debugfs_hdwqstat_write()
3121 * ---------------------------------
3123 * ---------------------------------
3132 * lpfc_idiag_cmd_get - Get and parse idiag debugfs comands from user space
3154 bsize = min(nbytes, (sizeof(mybuf)-1)); in lpfc_idiag_cmd_get()
3157 return -EFAULT; in lpfc_idiag_cmd_get()
3163 return -EINVAL; in lpfc_idiag_cmd_get()
3165 idiag_cmd->opcode = simple_strtol(step_str, NULL, 0); in lpfc_idiag_cmd_get()
3166 if (idiag_cmd->opcode == 0) in lpfc_idiag_cmd_get()
3167 return -EINVAL; in lpfc_idiag_cmd_get()
3173 idiag_cmd->data[i] = simple_strtol(step_str, NULL, 0); in lpfc_idiag_cmd_get()
3179 * lpfc_idiag_open - idiag open debugfs
3202 return -ENOMEM; in lpfc_idiag_open()
3204 debug->i_private = inode->i_private; in lpfc_idiag_open()
3205 debug->buffer = NULL; in lpfc_idiag_open()
3206 file->private_data = debug; in lpfc_idiag_open()
3212 * lpfc_idiag_release - Release idiag access file operation
3227 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_release()
3230 kfree(debug->buffer); in lpfc_idiag_release()
3237 * lpfc_idiag_cmd_release - Release idiag cmd access file operation
3252 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_cmd_release()
3254 if (debug->op == LPFC_IDIAG_OP_WR) { in lpfc_idiag_cmd_release()
3270 kfree(debug->buffer); in lpfc_idiag_cmd_release()
3277 * lpfc_idiag_pcicfg_read - idiag debugfs read pcicfg
3298 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_pcicfg_read()
3299 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_pcicfg_read()
3308 pdev = phba->pcidev; in lpfc_idiag_pcicfg_read()
3313 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_pcicfg_read()
3315 if (!debug->buffer) in lpfc_idiag_pcicfg_read()
3316 debug->buffer = kmalloc(LPFC_PCI_CFG_SIZE, GFP_KERNEL); in lpfc_idiag_pcicfg_read()
3317 if (!debug->buffer) in lpfc_idiag_pcicfg_read()
3319 pbuffer = debug->buffer; in lpfc_idiag_pcicfg_read()
3334 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3339 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3344 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3363 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3367 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3372 LPFC_PCI_CFG_SIZE-len, "\n"); in lpfc_idiag_pcicfg_read()
3375 index -= sizeof(uint32_t); in lpfc_idiag_pcicfg_read()
3377 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3381 len += scnprintf(pbuffer+len, LPFC_PCI_CFG_SIZE-len, in lpfc_idiag_pcicfg_read()
3398 * lpfc_idiag_pcicfg_write - Syntax check and set up idiag pcicfg commands
3419 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_pcicfg_write()
3420 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_pcicfg_write()
3428 pdev = phba->pcidev; in lpfc_idiag_pcicfg_write()
3430 return -EFAULT; in lpfc_idiag_pcicfg_write()
3433 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_pcicfg_write()
3456 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint8_t)) in lpfc_idiag_pcicfg_write()
3462 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint16_t)) in lpfc_idiag_pcicfg_write()
3468 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint32_t)) in lpfc_idiag_pcicfg_write()
3479 /* Write command to PCI config space, read-modify-write */ in lpfc_idiag_pcicfg_write()
3489 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint8_t)) in lpfc_idiag_pcicfg_write()
3514 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint16_t)) in lpfc_idiag_pcicfg_write()
3539 if (where > LPFC_PCI_CFG_SIZE - sizeof(uint32_t)) in lpfc_idiag_pcicfg_write()
3571 return -EINVAL; in lpfc_idiag_pcicfg_write()
3575 * lpfc_idiag_baracc_read - idiag debugfs pci bar access read
3593 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_baracc_read()
3594 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_baracc_read()
3603 pdev = phba->pcidev; in lpfc_idiag_baracc_read()
3608 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_baracc_read()
3610 if (!debug->buffer) in lpfc_idiag_baracc_read()
3611 debug->buffer = kmalloc(LPFC_PCI_BAR_RD_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_baracc_read()
3612 if (!debug->buffer) in lpfc_idiag_baracc_read()
3614 pbuffer = debug->buffer; in lpfc_idiag_baracc_read()
3630 if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf); in lpfc_idiag_baracc_read()
3633 mem_mapped_bar = phba->sli4_hba.conf_regs_memmap_p; in lpfc_idiag_baracc_read()
3635 mem_mapped_bar = phba->sli4_hba.ctrl_regs_memmap_p; in lpfc_idiag_baracc_read()
3637 mem_mapped_bar = phba->sli4_hba.drbl_regs_memmap_p; in lpfc_idiag_baracc_read()
3642 mem_mapped_bar = phba->sli4_hba.conf_regs_memmap_p; in lpfc_idiag_baracc_read()
3652 len += scnprintf(pbuffer+len, LPFC_PCI_BAR_RD_BUF_SIZE-len, in lpfc_idiag_baracc_read()
3666 len += scnprintf(pbuffer+len, LPFC_PCI_BAR_RD_BUF_SIZE-len, in lpfc_idiag_baracc_read()
3671 len += scnprintf(pbuffer+len, LPFC_PCI_BAR_RD_BUF_SIZE-len, in lpfc_idiag_baracc_read()
3677 LPFC_PCI_BAR_RD_BUF_SIZE-len, "\n"); in lpfc_idiag_baracc_read()
3684 LPFC_PCI_BAR_RD_BUF_SIZE-len, "\n"); in lpfc_idiag_baracc_read()
3688 index -= sizeof(uint32_t); in lpfc_idiag_baracc_read()
3691 LPFC_PCI_BAR_RD_BUF_SIZE-len, "\n"); in lpfc_idiag_baracc_read()
3695 LPFC_PCI_BAR_RD_BUF_SIZE-len, in lpfc_idiag_baracc_read()
3722 * lpfc_idiag_baracc_write - Syntax check and set up idiag bar access commands
3744 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_baracc_write()
3745 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_baracc_write()
3753 pdev = phba->pcidev; in lpfc_idiag_baracc_write()
3755 return -EFAULT; in lpfc_idiag_baracc_write()
3758 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_baracc_write()
3764 if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf); in lpfc_idiag_baracc_write()
3782 mem_mapped_bar = phba->sli4_hba.conf_regs_memmap_p; in lpfc_idiag_baracc_write()
3786 mem_mapped_bar = phba->sli4_hba.ctrl_regs_memmap_p; in lpfc_idiag_baracc_write()
3790 mem_mapped_bar = phba->sli4_hba.drbl_regs_memmap_p; in lpfc_idiag_baracc_write()
3797 mem_mapped_bar = phba->sli4_hba.conf_regs_memmap_p; in lpfc_idiag_baracc_write()
3814 if (offset > bar_size - sizeof(uint32_t)) in lpfc_idiag_baracc_write()
3831 /* Write command to PCI bar space, read-modify-write */ in lpfc_idiag_baracc_write()
3857 return -EINVAL; in lpfc_idiag_baracc_write()
3867 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_wq()
3869 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_wq()
3870 "AssocCQID[%04d]: WQ-STAT[oflow:x%x posted:x%llx]\n", in __lpfc_idiag_print_wq()
3871 qp->assoc_qid, qp->q_cnt_1, in __lpfc_idiag_print_wq()
3872 (unsigned long long)qp->q_cnt_4); in __lpfc_idiag_print_wq()
3873 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_wq()
3874 "\t\tWQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_wq()
3875 "HST-IDX[%04d], PRT-IDX[%04d], NTFI[%03d]", in __lpfc_idiag_print_wq()
3876 qp->queue_id, qp->entry_count, in __lpfc_idiag_print_wq()
3877 qp->entry_size, qp->host_index, in __lpfc_idiag_print_wq()
3878 qp->hba_index, qp->notify_interval); in __lpfc_idiag_print_wq()
3880 LPFC_QUE_INFO_GET_BUF_SIZE - len, "\n"); in __lpfc_idiag_print_wq()
3891 for (qidx = 0; qidx < phba->cfg_hdw_queue; qidx++) { in lpfc_idiag_wqs_for_cq()
3892 qp = phba->sli4_hba.hdwq[qidx].io_wq; in lpfc_idiag_wqs_for_cq()
3893 if (qp->assoc_qid != cq_id) in lpfc_idiag_wqs_for_cq()
3909 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_cq()
3911 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_cq()
3914 qp->assoc_qid, qp->q_cnt_1, qp->q_cnt_2, in __lpfc_idiag_print_cq()
3915 qp->q_cnt_3, (unsigned long long)qp->q_cnt_4); in __lpfc_idiag_print_cq()
3916 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_cq()
3917 "\tCQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_cq()
3918 "HST-IDX[%04d], NTFI[%03d], PLMT[%03d]", in __lpfc_idiag_print_cq()
3919 qp->queue_id, qp->entry_count, in __lpfc_idiag_print_cq()
3920 qp->entry_size, qp->host_index, in __lpfc_idiag_print_cq()
3921 qp->notify_interval, qp->max_proc_limit); in __lpfc_idiag_print_cq()
3923 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_cq()
3936 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_rqpair()
3938 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_rqpair()
3939 "AssocCQID[%02d]: RQ-STAT[nopost:x%x nobuf:x%x " in __lpfc_idiag_print_rqpair()
3941 qp->assoc_qid, qp->q_cnt_1, qp->q_cnt_2, in __lpfc_idiag_print_rqpair()
3942 qp->q_cnt_3, (unsigned long long)qp->q_cnt_4); in __lpfc_idiag_print_rqpair()
3943 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_rqpair()
3944 "\t\tHQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_rqpair()
3945 "HST-IDX[%04d], PRT-IDX[%04d], NTFI[%03d]\n", in __lpfc_idiag_print_rqpair()
3946 qp->queue_id, qp->entry_count, qp->entry_size, in __lpfc_idiag_print_rqpair()
3947 qp->host_index, qp->hba_index, qp->notify_interval); in __lpfc_idiag_print_rqpair()
3948 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_rqpair()
3949 "\t\tDQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_rqpair()
3950 "HST-IDX[%04d], PRT-IDX[%04d], NTFI[%03d]\n", in __lpfc_idiag_print_rqpair()
3951 datqp->queue_id, datqp->entry_count, in __lpfc_idiag_print_rqpair()
3952 datqp->entry_size, datqp->host_index, in __lpfc_idiag_print_rqpair()
3953 datqp->hba_index, datqp->notify_interval); in __lpfc_idiag_print_rqpair()
3964 qp = phba->sli4_hba.hdwq[eqidx].io_cq; in lpfc_idiag_cqs_for_eq()
3969 qp->CQ_max_cqe = 0; in lpfc_idiag_cqs_for_eq()
3975 max_cnt, qp->queue_id); in lpfc_idiag_cqs_for_eq()
3979 if ((eqidx < phba->cfg_nvmet_mrq) && phba->nvmet_support) { in lpfc_idiag_cqs_for_eq()
3981 qp = phba->sli4_hba.nvmet_cqset[eqidx]; in lpfc_idiag_cqs_for_eq()
3985 qp->CQ_max_cqe = 0; in lpfc_idiag_cqs_for_eq()
3991 qp = phba->sli4_hba.nvmet_mrq_hdr[eqidx]; in lpfc_idiag_cqs_for_eq()
3993 phba->sli4_hba.nvmet_mrq_data[eqidx], in lpfc_idiag_cqs_for_eq()
4010 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_eq()
4011 "\n%s EQ info: EQ-STAT[max:x%x noE:x%x " in __lpfc_idiag_print_eq()
4013 eqtype, qp->q_cnt_1, qp->q_cnt_2, qp->q_cnt_3, in __lpfc_idiag_print_eq()
4014 (unsigned long long)qp->q_cnt_4, qp->q_mode); in __lpfc_idiag_print_eq()
4015 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_eq()
4016 "EQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " in __lpfc_idiag_print_eq()
4017 "HST-IDX[%04d], NTFI[%03d], PLMT[%03d], AFFIN[%03d]", in __lpfc_idiag_print_eq()
4018 qp->queue_id, qp->entry_count, qp->entry_size, in __lpfc_idiag_print_eq()
4019 qp->host_index, qp->notify_interval, in __lpfc_idiag_print_eq()
4020 qp->max_proc_limit, qp->chann); in __lpfc_idiag_print_eq()
4021 len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, in __lpfc_idiag_print_eq()
4028 * lpfc_idiag_queinfo_read - idiag debugfs read queue information
4049 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_queinfo_read()
4050 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_queinfo_read()
4055 if (!debug->buffer) in lpfc_idiag_queinfo_read()
4056 debug->buffer = kmalloc(LPFC_QUE_INFO_GET_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_queinfo_read()
4057 if (!debug->buffer) in lpfc_idiag_queinfo_read()
4059 pbuffer = debug->buffer; in lpfc_idiag_queinfo_read()
4060 max_cnt = LPFC_QUE_INFO_GET_BUF_SIZE - 256; in lpfc_idiag_queinfo_read()
4065 spin_lock_irq(&phba->hbalock); in lpfc_idiag_queinfo_read()
4067 /* Fast-path event queue */ in lpfc_idiag_queinfo_read()
4068 if (phba->sli4_hba.hdwq && phba->cfg_hdw_queue) { in lpfc_idiag_queinfo_read()
4070 x = phba->lpfc_idiag_last_eq; in lpfc_idiag_queinfo_read()
4071 phba->lpfc_idiag_last_eq++; in lpfc_idiag_queinfo_read()
4072 if (phba->lpfc_idiag_last_eq >= phba->cfg_hdw_queue) in lpfc_idiag_queinfo_read()
4073 phba->lpfc_idiag_last_eq = 0; in lpfc_idiag_queinfo_read()
4076 LPFC_QUE_INFO_GET_BUF_SIZE - len, in lpfc_idiag_queinfo_read()
4078 x, phba->cfg_hdw_queue); in lpfc_idiag_queinfo_read()
4080 /* Fast-path EQ */ in lpfc_idiag_queinfo_read()
4081 qp = phba->sli4_hba.hdwq[x].hba_eq; in lpfc_idiag_queinfo_read()
4088 qp->EQ_max_eqe = 0; in lpfc_idiag_queinfo_read()
4095 max_cnt, x, qp->queue_id); in lpfc_idiag_queinfo_read()
4103 /* Slow-path mailbox CQ */ in lpfc_idiag_queinfo_read()
4104 qp = phba->sli4_hba.mbx_cq; in lpfc_idiag_queinfo_read()
4109 /* Slow-path MBOX MQ */ in lpfc_idiag_queinfo_read()
4110 qp = phba->sli4_hba.mbx_wq; in lpfc_idiag_queinfo_read()
4115 /* Slow-path ELS response CQ */ in lpfc_idiag_queinfo_read()
4116 qp = phba->sli4_hba.els_cq; in lpfc_idiag_queinfo_read()
4120 qp->CQ_max_cqe = 0; in lpfc_idiag_queinfo_read()
4124 /* Slow-path ELS WQ */ in lpfc_idiag_queinfo_read()
4125 qp = phba->sli4_hba.els_wq; in lpfc_idiag_queinfo_read()
4130 qp = phba->sli4_hba.hdr_rq; in lpfc_idiag_queinfo_read()
4131 len = __lpfc_idiag_print_rqpair(qp, phba->sli4_hba.dat_rq, in lpfc_idiag_queinfo_read()
4136 /* Slow-path NVME LS response CQ */ in lpfc_idiag_queinfo_read()
4137 qp = phba->sli4_hba.nvmels_cq; in lpfc_idiag_queinfo_read()
4142 qp->CQ_max_cqe = 0; in lpfc_idiag_queinfo_read()
4146 /* Slow-path NVME LS WQ */ in lpfc_idiag_queinfo_read()
4147 qp = phba->sli4_hba.nvmels_wq; in lpfc_idiag_queinfo_read()
4156 spin_unlock_irq(&phba->hbalock); in lpfc_idiag_queinfo_read()
4161 LPFC_QUE_INFO_GET_BUF_SIZE - len, "Truncated ...\n"); in lpfc_idiag_queinfo_read()
4163 spin_unlock_irq(&phba->hbalock); in lpfc_idiag_queinfo_read()
4168 * lpfc_idiag_que_param_check - queue access command parameter sanity check
4177 * This function returns -EINVAL when fails the sanity check, otherwise, it
4185 return -EINVAL; in lpfc_idiag_que_param_check()
4186 if (index > q->entry_count - 1) in lpfc_idiag_que_param_check()
4187 return -EINVAL; in lpfc_idiag_que_param_check()
4192 * lpfc_idiag_queacc_read_qe - read a single entry from the given queue index
4216 esize = pque->entry_size; in lpfc_idiag_queacc_read_qe()
4217 len += scnprintf(pbuffer+len, LPFC_QUE_ACC_BUF_SIZE-len, in lpfc_idiag_queacc_read_qe()
4218 "QE-INDEX[%04d]:\n", index); in lpfc_idiag_queacc_read_qe()
4223 len += scnprintf(pbuffer+len, LPFC_QUE_ACC_BUF_SIZE-len, in lpfc_idiag_queacc_read_qe()
4227 esize -= sizeof(uint32_t); in lpfc_idiag_queacc_read_qe()
4230 LPFC_QUE_ACC_BUF_SIZE-len, "\n"); in lpfc_idiag_queacc_read_qe()
4232 len += scnprintf(pbuffer+len, LPFC_QUE_ACC_BUF_SIZE-len, "\n"); in lpfc_idiag_queacc_read_qe()
4238 * lpfc_idiag_queacc_read - idiag debugfs read port queue
4258 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_queacc_read()
4265 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_queacc_read()
4267 if (!debug->buffer) in lpfc_idiag_queacc_read()
4268 debug->buffer = kmalloc(LPFC_QUE_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_queacc_read()
4269 if (!debug->buffer) in lpfc_idiag_queacc_read()
4271 pbuffer = debug->buffer; in lpfc_idiag_queacc_read()
4298 while (len < LPFC_QUE_ACC_SIZE - pque->entry_size) { in lpfc_idiag_queacc_read()
4301 if (index > pque->entry_count - 1) in lpfc_idiag_queacc_read()
4306 if (index > pque->entry_count - 1) in lpfc_idiag_queacc_read()
4314 * lpfc_idiag_queacc_write - Syntax check and set up idiag queacc commands
4335 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_queacc_write()
4336 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_queacc_write()
4343 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_queacc_write()
4374 if (phba->sli4_hba.hdwq) { in lpfc_idiag_queacc_write()
4375 for (qidx = 0; qidx < phba->cfg_hdw_queue; qidx++) { in lpfc_idiag_queacc_write()
4376 qp = phba->sli4_hba.hdwq[qidx].hba_eq; in lpfc_idiag_queacc_write()
4377 if (qp && qp->queue_id == queid) { in lpfc_idiag_queacc_write()
4392 if (phba->sli4_hba.mbx_cq && in lpfc_idiag_queacc_write()
4393 phba->sli4_hba.mbx_cq->queue_id == queid) { in lpfc_idiag_queacc_write()
4396 phba->sli4_hba.mbx_cq, index, count); in lpfc_idiag_queacc_write()
4399 idiag.ptr_private = phba->sli4_hba.mbx_cq; in lpfc_idiag_queacc_write()
4403 if (phba->sli4_hba.els_cq && in lpfc_idiag_queacc_write()
4404 phba->sli4_hba.els_cq->queue_id == queid) { in lpfc_idiag_queacc_write()
4407 phba->sli4_hba.els_cq, index, count); in lpfc_idiag_queacc_write()
4410 idiag.ptr_private = phba->sli4_hba.els_cq; in lpfc_idiag_queacc_write()
4414 if (phba->sli4_hba.nvmels_cq && in lpfc_idiag_queacc_write()
4415 phba->sli4_hba.nvmels_cq->queue_id == queid) { in lpfc_idiag_queacc_write()
4418 phba->sli4_hba.nvmels_cq, index, count); in lpfc_idiag_queacc_write()
4421 idiag.ptr_private = phba->sli4_hba.nvmels_cq; in lpfc_idiag_queacc_write()
4425 if (phba->sli4_hba.hdwq) { in lpfc_idiag_queacc_write()
4426 for (qidx = 0; qidx < phba->cfg_hdw_queue; in lpfc_idiag_queacc_write()
4428 qp = phba->sli4_hba.hdwq[qidx].io_cq; in lpfc_idiag_queacc_write()
4429 if (qp && qp->queue_id == queid) { in lpfc_idiag_queacc_write()
4444 if (phba->sli4_hba.mbx_wq && in lpfc_idiag_queacc_write()
4445 phba->sli4_hba.mbx_wq->queue_id == queid) { in lpfc_idiag_queacc_write()
4448 phba->sli4_hba.mbx_wq, index, count); in lpfc_idiag_queacc_write()
4451 idiag.ptr_private = phba->sli4_hba.mbx_wq; in lpfc_idiag_queacc_write()
4458 if (phba->sli4_hba.els_wq && in lpfc_idiag_queacc_write()
4459 phba->sli4_hba.els_wq->queue_id == queid) { in lpfc_idiag_queacc_write()
4462 phba->sli4_hba.els_wq, index, count); in lpfc_idiag_queacc_write()
4465 idiag.ptr_private = phba->sli4_hba.els_wq; in lpfc_idiag_queacc_write()
4469 if (phba->sli4_hba.nvmels_wq && in lpfc_idiag_queacc_write()
4470 phba->sli4_hba.nvmels_wq->queue_id == queid) { in lpfc_idiag_queacc_write()
4473 phba->sli4_hba.nvmels_wq, index, count); in lpfc_idiag_queacc_write()
4476 idiag.ptr_private = phba->sli4_hba.nvmels_wq; in lpfc_idiag_queacc_write()
4480 if (phba->sli4_hba.hdwq) { in lpfc_idiag_queacc_write()
4482 for (qidx = 0; qidx < phba->cfg_hdw_queue; qidx++) { in lpfc_idiag_queacc_write()
4483 qp = phba->sli4_hba.hdwq[qidx].io_wq; in lpfc_idiag_queacc_write()
4484 if (qp && qp->queue_id == queid) { in lpfc_idiag_queacc_write()
4499 if (phba->sli4_hba.hdr_rq && in lpfc_idiag_queacc_write()
4500 phba->sli4_hba.hdr_rq->queue_id == queid) { in lpfc_idiag_queacc_write()
4503 phba->sli4_hba.hdr_rq, index, count); in lpfc_idiag_queacc_write()
4506 idiag.ptr_private = phba->sli4_hba.hdr_rq; in lpfc_idiag_queacc_write()
4510 if (phba->sli4_hba.dat_rq && in lpfc_idiag_queacc_write()
4511 phba->sli4_hba.dat_rq->queue_id == queid) { in lpfc_idiag_queacc_write()
4514 phba->sli4_hba.dat_rq, index, count); in lpfc_idiag_queacc_write()
4517 idiag.ptr_private = phba->sli4_hba.dat_rq; in lpfc_idiag_queacc_write()
4537 if (offset > pque->entry_size/sizeof(uint32_t) - 1) in lpfc_idiag_queacc_write()
4553 return -EINVAL; in lpfc_idiag_queacc_write()
4557 * lpfc_idiag_drbacc_read_reg - idiag debugfs read a doorbell register
4580 len += scnprintf(pbuffer + len, LPFC_DRB_ACC_BUF_SIZE-len, in lpfc_idiag_drbacc_read_reg()
4581 "EQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4582 readl(phba->sli4_hba.EQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4585 len += scnprintf(pbuffer + len, LPFC_DRB_ACC_BUF_SIZE - len, in lpfc_idiag_drbacc_read_reg()
4586 "CQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4587 readl(phba->sli4_hba.CQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4590 len += scnprintf(pbuffer+len, LPFC_DRB_ACC_BUF_SIZE-len, in lpfc_idiag_drbacc_read_reg()
4591 "MQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4592 readl(phba->sli4_hba.MQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4595 len += scnprintf(pbuffer+len, LPFC_DRB_ACC_BUF_SIZE-len, in lpfc_idiag_drbacc_read_reg()
4596 "WQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4597 readl(phba->sli4_hba.WQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4600 len += scnprintf(pbuffer+len, LPFC_DRB_ACC_BUF_SIZE-len, in lpfc_idiag_drbacc_read_reg()
4601 "RQ-DRB-REG: 0x%08x\n", in lpfc_idiag_drbacc_read_reg()
4602 readl(phba->sli4_hba.RQDBregaddr)); in lpfc_idiag_drbacc_read_reg()
4612 * lpfc_idiag_drbacc_read - idiag debugfs read port doorbell
4632 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_drbacc_read()
4633 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_drbacc_read()
4639 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_drbacc_read()
4641 if (!debug->buffer) in lpfc_idiag_drbacc_read()
4642 debug->buffer = kmalloc(LPFC_DRB_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_drbacc_read()
4643 if (!debug->buffer) in lpfc_idiag_drbacc_read()
4645 pbuffer = debug->buffer; in lpfc_idiag_drbacc_read()
4667 * lpfc_idiag_drbacc_write - Syntax check and set up idiag drbacc commands
4688 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_drbacc_write()
4689 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_drbacc_write()
4695 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_drbacc_write()
4727 drb_reg = phba->sli4_hba.EQDBregaddr; in lpfc_idiag_drbacc_write()
4730 drb_reg = phba->sli4_hba.CQDBregaddr; in lpfc_idiag_drbacc_write()
4733 drb_reg = phba->sli4_hba.MQDBregaddr; in lpfc_idiag_drbacc_write()
4736 drb_reg = phba->sli4_hba.WQDBregaddr; in lpfc_idiag_drbacc_write()
4739 drb_reg = phba->sli4_hba.RQDBregaddr; in lpfc_idiag_drbacc_write()
4763 return -EINVAL; in lpfc_idiag_drbacc_write()
4767 * lpfc_idiag_ctlacc_read_reg - idiag debugfs read a control registers
4790 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4792 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4796 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4798 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4802 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4804 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4808 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4810 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4814 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4816 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4820 len += scnprintf(pbuffer+len, LPFC_CTL_ACC_BUF_SIZE-len, in lpfc_idiag_ctlacc_read_reg()
4822 readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_read_reg()
4832 * lpfc_idiag_ctlacc_read - idiag debugfs read port and device control register
4850 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_ctlacc_read()
4851 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_ctlacc_read()
4857 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_ctlacc_read()
4859 if (!debug->buffer) in lpfc_idiag_ctlacc_read()
4860 debug->buffer = kmalloc(LPFC_CTL_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_ctlacc_read()
4861 if (!debug->buffer) in lpfc_idiag_ctlacc_read()
4863 pbuffer = debug->buffer; in lpfc_idiag_ctlacc_read()
4885 * lpfc_idiag_ctlacc_write - Syntax check and set up idiag ctlacc commands
4903 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_ctlacc_write()
4904 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_ctlacc_write()
4910 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_ctlacc_write()
4942 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4946 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4950 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4954 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4958 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4962 ctl_reg = phba->sli4_hba.conf_regs_memmap_p + in lpfc_idiag_ctlacc_write()
4987 return -EINVAL; in lpfc_idiag_ctlacc_write()
4991 * lpfc_idiag_mbxacc_get_setup - idiag debugfs get mailbox access setup
5013 len += scnprintf(pbuffer+len, LPFC_MBX_ACC_BUF_SIZE-len, in lpfc_idiag_mbxacc_get_setup()
5015 len += scnprintf(pbuffer+len, LPFC_MBX_ACC_BUF_SIZE-len, in lpfc_idiag_mbxacc_get_setup()
5017 len += scnprintf(pbuffer+len, LPFC_MBX_ACC_BUF_SIZE-len, in lpfc_idiag_mbxacc_get_setup()
5019 len += scnprintf(pbuffer+len, LPFC_MBX_ACC_BUF_SIZE-len, in lpfc_idiag_mbxacc_get_setup()
5026 * lpfc_idiag_mbxacc_read - idiag debugfs read on mailbox access
5044 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_mbxacc_read()
5045 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_mbxacc_read()
5050 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_mbxacc_read()
5052 if (!debug->buffer) in lpfc_idiag_mbxacc_read()
5053 debug->buffer = kmalloc(LPFC_MBX_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_mbxacc_read()
5054 if (!debug->buffer) in lpfc_idiag_mbxacc_read()
5056 pbuffer = debug->buffer; in lpfc_idiag_mbxacc_read()
5071 * lpfc_idiag_mbxacc_write - Syntax check and set up idiag mbxacc commands
5089 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_mbxacc_write()
5094 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_mbxacc_write()
5148 return -EINVAL; in lpfc_idiag_mbxacc_write()
5152 * lpfc_idiag_extacc_avail_get - get the available extents information
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()
5192 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5196 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_avail_get()
5203 * lpfc_idiag_extacc_alloc_get - get the allocated extents information
5220 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5223 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()
5230 phba->brd_no, ext_cnt, ext_size); in lpfc_idiag_extacc_alloc_get()
5232 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5235 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()
5242 phba->brd_no, ext_cnt, ext_size); in lpfc_idiag_extacc_alloc_get()
5244 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5247 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()
5254 phba->brd_no, ext_cnt, ext_size); in lpfc_idiag_extacc_alloc_get()
5256 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5259 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5264 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5266 phba->brd_no, ext_cnt, ext_size); in lpfc_idiag_extacc_alloc_get()
5268 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_alloc_get()
5275 * lpfc_idiag_extacc_drivr_get - get driver extent information
5292 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5295 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5298 list_for_each_entry(rsrc_blks, &phba->lpfc_vpi_blk_list, list) { in lpfc_idiag_extacc_drivr_get()
5299 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5301 index, rsrc_blks->rsrc_start, in lpfc_idiag_extacc_drivr_get()
5302 rsrc_blks->rsrc_size); in lpfc_idiag_extacc_drivr_get()
5305 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5308 list_for_each_entry(rsrc_blks, &phba->sli4_hba.lpfc_vfi_blk_list, in lpfc_idiag_extacc_drivr_get()
5310 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5312 index, rsrc_blks->rsrc_start, in lpfc_idiag_extacc_drivr_get()
5313 rsrc_blks->rsrc_size); in lpfc_idiag_extacc_drivr_get()
5317 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5320 list_for_each_entry(rsrc_blks, &phba->sli4_hba.lpfc_rpi_blk_list, in lpfc_idiag_extacc_drivr_get()
5322 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5324 index, rsrc_blks->rsrc_start, in lpfc_idiag_extacc_drivr_get()
5325 rsrc_blks->rsrc_size); in lpfc_idiag_extacc_drivr_get()
5329 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5332 list_for_each_entry(rsrc_blks, &phba->sli4_hba.lpfc_xri_blk_list, in lpfc_idiag_extacc_drivr_get()
5334 len += scnprintf(pbuffer+len, LPFC_EXT_ACC_BUF_SIZE-len, in lpfc_idiag_extacc_drivr_get()
5336 index, rsrc_blks->rsrc_start, in lpfc_idiag_extacc_drivr_get()
5337 rsrc_blks->rsrc_size); in lpfc_idiag_extacc_drivr_get()
5345 * lpfc_idiag_extacc_write - Syntax check and set up idiag extacc commands
5363 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_extacc_write()
5368 debug->op = LPFC_IDIAG_OP_WR; in lpfc_idiag_extacc_write()
5387 return -EINVAL; in lpfc_idiag_extacc_write()
5391 * lpfc_idiag_extacc_read - idiag debugfs read access to extent information
5409 struct lpfc_debug *debug = file->private_data; in lpfc_idiag_extacc_read()
5410 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_idiag_extacc_read()
5416 debug->op = LPFC_IDIAG_OP_RD; in lpfc_idiag_extacc_read()
5418 if (!debug->buffer) in lpfc_idiag_extacc_read()
5419 debug->buffer = kmalloc(LPFC_EXT_ACC_BUF_SIZE, GFP_KERNEL); in lpfc_idiag_extacc_read()
5420 if (!debug->buffer) in lpfc_idiag_extacc_read()
5422 pbuffer = debug->buffer; in lpfc_idiag_extacc_read()
5443 int rc = -ENOMEM; in lpfc_cgn_buffer_open()
5449 debug->buffer = vmalloc(LPFC_CGN_BUF_SIZE); in lpfc_cgn_buffer_open()
5450 if (!debug->buffer) { in lpfc_cgn_buffer_open()
5455 debug->i_private = inode->i_private; in lpfc_cgn_buffer_open()
5456 file->private_data = debug; in lpfc_cgn_buffer_open()
5467 struct lpfc_debug *debug = file->private_data; in lpfc_cgn_buffer_read()
5468 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_cgn_buffer_read()
5469 char *buffer = debug->buffer; in lpfc_cgn_buffer_read()
5473 if (!phba->sli4_hba.pc_sli4_params.mi_ver || !phba->cgn_i) { in lpfc_cgn_buffer_read()
5474 len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, in lpfc_cgn_buffer_read()
5478 ptr = (uint32_t *)phba->cgn_i->virt; in lpfc_cgn_buffer_read()
5479 len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, in lpfc_cgn_buffer_read()
5483 len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, in lpfc_cgn_buffer_read()
5488 len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, in lpfc_cgn_buffer_read()
5491 if (len > (LPFC_CGN_BUF_SIZE - LPFC_DEBUG_OUT_LINE_SZ)) { in lpfc_cgn_buffer_read()
5492 len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, in lpfc_cgn_buffer_read()
5496 len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, in lpfc_cgn_buffer_read()
5505 if (len > (LPFC_CGN_BUF_SIZE - LPFC_DEBUG_OUT_LINE_SZ)) { in lpfc_cgn_buffer_read()
5506 len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, in lpfc_cgn_buffer_read()
5510 len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, in lpfc_cgn_buffer_read()
5512 ptr = (uint32_t *)&phba->cgn_p; in lpfc_cgn_buffer_read()
5513 len += scnprintf(buffer + len, LPFC_CGN_BUF_SIZE - len, in lpfc_cgn_buffer_read()
5523 struct lpfc_debug *debug = file->private_data; in lpfc_cgn_buffer_release()
5525 vfree(debug->buffer); in lpfc_cgn_buffer_release()
5535 int rc = -ENOMEM; in lpfc_rx_monitor_open()
5541 debug->buffer = vmalloc(MAX_DEBUGFS_RX_INFO_SIZE); in lpfc_rx_monitor_open()
5542 if (!debug->buffer) { in lpfc_rx_monitor_open()
5547 debug->i_private = inode->i_private; in lpfc_rx_monitor_open()
5548 file->private_data = debug; in lpfc_rx_monitor_open()
5559 struct lpfc_rx_monitor_debug *debug = file->private_data; in lpfc_rx_monitor_read()
5560 struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; in lpfc_rx_monitor_read()
5561 char *buffer = debug->buffer; in lpfc_rx_monitor_read()
5563 if (!phba->rx_monitor) { in lpfc_rx_monitor_read()
5567 lpfc_rx_monitor_report(phba, phba->rx_monitor, buffer, in lpfc_rx_monitor_read()
5579 struct lpfc_rx_monitor_debug *debug = file->private_data; in lpfc_rx_monitor_release()
5581 vfree(debug->buffer); in lpfc_rx_monitor_release()
5834 /* lpfc_idiag_mbxacc_dump_bsg_mbox - idiag debugfs dump bsg mailbox command
5836 * @dmabuf: Pointer to a DMA buffer descriptor.
5839 * This routine dump a bsg pass-through non-embedded mailbox command with
5907 pword = (uint32_t *)dmabuf->virt; in lpfc_idiag_mbxacc_dump_bsg_mbox()
5914 LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_bsg_mbox()
5917 len += scnprintf(line_buf+len, LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_bsg_mbox()
5921 if ((i - 1) % 8) in lpfc_idiag_mbxacc_dump_bsg_mbox()
5923 (*mbx_dump_cnt)--; in lpfc_idiag_mbxacc_dump_bsg_mbox()
5933 /* lpfc_idiag_mbxacc_dump_issue_mbox - idiag debugfs dump issue mailbox command
5935 * @dmabuf: Pointer to a DMA buffer descriptor.
5938 * This routine dump a pass-through non-embedded mailbox command from issue
5966 (*mbx_mbox_cmd != pmbox->mbxCommand)) in lpfc_idiag_mbxacc_dump_issue_mbox()
5972 pmbox->mbxCommand); in lpfc_idiag_mbxacc_dump_issue_mbox()
5981 LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_issue_mbox()
5984 len += scnprintf(line_buf+len, LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_issue_mbox()
5989 if ((i - 1) % 8) in lpfc_idiag_mbxacc_dump_issue_mbox()
5995 pmbox->mbxCommand); in lpfc_idiag_mbxacc_dump_issue_mbox()
6004 LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_issue_mbox()
6009 LPFC_MBX_ACC_LBUF_SZ-len, in lpfc_idiag_mbxacc_dump_issue_mbox()
6015 LPFC_MBX_ACC_LBUF_SZ-len, " "); in lpfc_idiag_mbxacc_dump_issue_mbox()
6017 if ((i - 1) % 8) in lpfc_idiag_mbxacc_dump_issue_mbox()
6021 (*mbx_dump_cnt)--; in lpfc_idiag_mbxacc_dump_issue_mbox()
6031 * lpfc_debugfs_initialize - Initialize debugfs for a vport
6044 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_initialize()
6061 snprintf(name, sizeof(name), "fn%d", phba->brd_no); in lpfc_debugfs_initialize()
6062 if (!phba->hba_debugfs_root) { in lpfc_debugfs_initialize()
6064 phba->hba_debugfs_root = in lpfc_debugfs_initialize()
6067 atomic_set(&phba->debugfs_vport_count, 0); in lpfc_debugfs_initialize()
6069 /* Multi-XRI pools */ in lpfc_debugfs_initialize()
6071 phba->debug_multixri_pools = in lpfc_debugfs_initialize()
6073 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6076 if (IS_ERR(phba->debug_multixri_pools)) { in lpfc_debugfs_initialize()
6084 phba->debug_cgn_buffer = in lpfc_debugfs_initialize()
6086 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6088 if (IS_ERR(phba->debug_cgn_buffer)) { in lpfc_debugfs_initialize()
6097 phba->debug_rx_monitor = in lpfc_debugfs_initialize()
6099 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6101 if (IS_ERR(phba->debug_rx_monitor)) { in lpfc_debugfs_initialize()
6110 phba->debug_ras_log = in lpfc_debugfs_initialize()
6112 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6114 if (IS_ERR(phba->debug_ras_log)) { in lpfc_debugfs_initialize()
6123 phba->debug_hbqinfo = in lpfc_debugfs_initialize()
6125 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6131 phba->debug_lockstat = in lpfc_debugfs_initialize()
6133 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6135 if (IS_ERR(phba->debug_lockstat)) { in lpfc_debugfs_initialize()
6143 if (phba->sli_rev < LPFC_SLI_REV4) { in lpfc_debugfs_initialize()
6145 phba->debug_dumpHBASlim = in lpfc_debugfs_initialize()
6148 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6151 phba->debug_dumpHBASlim = NULL; in lpfc_debugfs_initialize()
6154 if (phba->sli_rev < LPFC_SLI_REV4) { in lpfc_debugfs_initialize()
6156 phba->debug_dumpHostSlim = in lpfc_debugfs_initialize()
6159 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6162 phba->debug_dumpHostSlim = NULL; in lpfc_debugfs_initialize()
6166 phba->debug_InjErrLBA = in lpfc_debugfs_initialize()
6168 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6170 phba->lpfc_injerr_lba = LPFC_INJERR_LBA_OFF; in lpfc_debugfs_initialize()
6173 phba->debug_InjErrNPortID = in lpfc_debugfs_initialize()
6175 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6179 phba->debug_InjErrWWPN = in lpfc_debugfs_initialize()
6181 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6185 phba->debug_writeGuard = in lpfc_debugfs_initialize()
6187 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6191 phba->debug_writeApp = in lpfc_debugfs_initialize()
6193 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6197 phba->debug_writeRef = in lpfc_debugfs_initialize()
6199 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6203 phba->debug_readGuard = in lpfc_debugfs_initialize()
6205 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6209 phba->debug_readApp = in lpfc_debugfs_initialize()
6211 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6215 phba->debug_readRef = in lpfc_debugfs_initialize()
6217 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6222 num = lpfc_debugfs_max_slow_ring_trc - 1; in lpfc_debugfs_initialize()
6238 phba->debug_slow_ring_trc = in lpfc_debugfs_initialize()
6240 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6242 if (!phba->slow_ring_trc) { in lpfc_debugfs_initialize()
6243 phba->slow_ring_trc = kcalloc( in lpfc_debugfs_initialize()
6247 if (!phba->slow_ring_trc) { in lpfc_debugfs_initialize()
6253 atomic_set(&phba->slow_ring_trc_cnt, 0); in lpfc_debugfs_initialize()
6257 phba->debug_nvmeio_trc = in lpfc_debugfs_initialize()
6259 phba->hba_debugfs_root, in lpfc_debugfs_initialize()
6262 atomic_set(&phba->nvmeio_trc_cnt, 0); in lpfc_debugfs_initialize()
6264 num = lpfc_debugfs_max_nvmeio_trc - 1; in lpfc_debugfs_initialize()
6279 phba->nvmeio_trc_size = lpfc_debugfs_max_nvmeio_trc; in lpfc_debugfs_initialize()
6282 phba->nvmeio_trc = kzalloc( in lpfc_debugfs_initialize()
6284 phba->nvmeio_trc_size), GFP_KERNEL); in lpfc_debugfs_initialize()
6286 if (!phba->nvmeio_trc) { in lpfc_debugfs_initialize()
6292 phba->nvmeio_trc_on = 1; in lpfc_debugfs_initialize()
6293 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_initialize()
6294 phba->nvmeio_trc = NULL; in lpfc_debugfs_initialize()
6297 phba->nvmeio_trc_size = 0; in lpfc_debugfs_initialize()
6298 phba->nvmeio_trc_on = 0; in lpfc_debugfs_initialize()
6299 phba->nvmeio_trc_output_idx = 0; in lpfc_debugfs_initialize()
6300 phba->nvmeio_trc = NULL; in lpfc_debugfs_initialize()
6304 snprintf(name, sizeof(name), "vport%d", vport->vpi); in lpfc_debugfs_initialize()
6305 if (!vport->vport_debugfs_root) { in lpfc_debugfs_initialize()
6306 vport->vport_debugfs_root = in lpfc_debugfs_initialize()
6307 debugfs_create_dir(name, phba->hba_debugfs_root); in lpfc_debugfs_initialize()
6308 atomic_inc(&phba->debugfs_vport_count); in lpfc_debugfs_initialize()
6312 num = lpfc_debugfs_max_disc_trc - 1; in lpfc_debugfs_initialize()
6327 vport->disc_trc = kzalloc( in lpfc_debugfs_initialize()
6331 if (!vport->disc_trc) { in lpfc_debugfs_initialize()
6337 atomic_set(&vport->disc_trc_cnt, 0); in lpfc_debugfs_initialize()
6340 vport->debug_disc_trc = in lpfc_debugfs_initialize()
6342 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6345 vport->debug_nodelist = in lpfc_debugfs_initialize()
6347 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6351 vport->debug_nvmestat = in lpfc_debugfs_initialize()
6353 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6357 vport->debug_scsistat = in lpfc_debugfs_initialize()
6359 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6361 if (IS_ERR(vport->debug_scsistat)) { in lpfc_debugfs_initialize()
6368 vport->debug_ioktime = in lpfc_debugfs_initialize()
6370 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6372 if (IS_ERR(vport->debug_ioktime)) { in lpfc_debugfs_initialize()
6379 vport->debug_hdwqstat = in lpfc_debugfs_initialize()
6381 vport->vport_debugfs_root, in lpfc_debugfs_initialize()
6395 if (phba->sli_rev < LPFC_SLI_REV4) in lpfc_debugfs_initialize()
6399 if (!phba->idiag_root) { in lpfc_debugfs_initialize()
6400 phba->idiag_root = in lpfc_debugfs_initialize()
6401 debugfs_create_dir(name, phba->hba_debugfs_root); in lpfc_debugfs_initialize()
6408 if (!phba->idiag_pci_cfg) { in lpfc_debugfs_initialize()
6409 phba->idiag_pci_cfg = in lpfc_debugfs_initialize()
6411 phba->idiag_root, phba, &lpfc_idiag_op_pciCfg); in lpfc_debugfs_initialize()
6417 if (!phba->idiag_bar_acc) { in lpfc_debugfs_initialize()
6418 phba->idiag_bar_acc = in lpfc_debugfs_initialize()
6420 phba->idiag_root, phba, &lpfc_idiag_op_barAcc); in lpfc_debugfs_initialize()
6426 if (!phba->idiag_que_info) { in lpfc_debugfs_initialize()
6427 phba->idiag_que_info = in lpfc_debugfs_initialize()
6429 phba->idiag_root, phba, &lpfc_idiag_op_queInfo); in lpfc_debugfs_initialize()
6434 if (!phba->idiag_que_acc) { in lpfc_debugfs_initialize()
6435 phba->idiag_que_acc = in lpfc_debugfs_initialize()
6437 phba->idiag_root, phba, &lpfc_idiag_op_queAcc); in lpfc_debugfs_initialize()
6442 if (!phba->idiag_drb_acc) { in lpfc_debugfs_initialize()
6443 phba->idiag_drb_acc = in lpfc_debugfs_initialize()
6445 phba->idiag_root, phba, &lpfc_idiag_op_drbAcc); in lpfc_debugfs_initialize()
6450 if (!phba->idiag_ctl_acc) { in lpfc_debugfs_initialize()
6451 phba->idiag_ctl_acc = in lpfc_debugfs_initialize()
6453 phba->idiag_root, phba, &lpfc_idiag_op_ctlAcc); in lpfc_debugfs_initialize()
6458 if (!phba->idiag_mbx_acc) { in lpfc_debugfs_initialize()
6459 phba->idiag_mbx_acc = in lpfc_debugfs_initialize()
6461 phba->idiag_root, phba, &lpfc_idiag_op_mbxAcc); in lpfc_debugfs_initialize()
6465 if (phba->sli4_hba.extents_in_use) { in lpfc_debugfs_initialize()
6467 if (!phba->idiag_ext_acc) { in lpfc_debugfs_initialize()
6468 phba->idiag_ext_acc = in lpfc_debugfs_initialize()
6471 phba->idiag_root, phba, in lpfc_debugfs_initialize()
6482 * lpfc_debugfs_terminate - Tear down debugfs infrastructure for this vport
6496 struct lpfc_hba *phba = vport->phba; in lpfc_debugfs_terminate()
6498 kfree(vport->disc_trc); in lpfc_debugfs_terminate()
6499 vport->disc_trc = NULL; in lpfc_debugfs_terminate()
6501 debugfs_remove(vport->debug_disc_trc); /* discovery_trace */ in lpfc_debugfs_terminate()
6502 vport->debug_disc_trc = NULL; in lpfc_debugfs_terminate()
6504 debugfs_remove(vport->debug_nodelist); /* nodelist */ in lpfc_debugfs_terminate()
6505 vport->debug_nodelist = NULL; in lpfc_debugfs_terminate()
6507 debugfs_remove(vport->debug_nvmestat); /* nvmestat */ in lpfc_debugfs_terminate()
6508 vport->debug_nvmestat = NULL; in lpfc_debugfs_terminate()
6510 debugfs_remove(vport->debug_scsistat); /* scsistat */ in lpfc_debugfs_terminate()
6511 vport->debug_scsistat = NULL; in lpfc_debugfs_terminate()
6513 debugfs_remove(vport->debug_ioktime); /* ioktime */ in lpfc_debugfs_terminate()
6514 vport->debug_ioktime = NULL; in lpfc_debugfs_terminate()
6516 debugfs_remove(vport->debug_hdwqstat); /* hdwqstat */ in lpfc_debugfs_terminate()
6517 vport->debug_hdwqstat = NULL; in lpfc_debugfs_terminate()
6519 if (vport->vport_debugfs_root) { in lpfc_debugfs_terminate()
6520 debugfs_remove(vport->vport_debugfs_root); /* vportX */ in lpfc_debugfs_terminate()
6521 vport->vport_debugfs_root = NULL; in lpfc_debugfs_terminate()
6522 atomic_dec(&phba->debugfs_vport_count); in lpfc_debugfs_terminate()
6525 if (atomic_read(&phba->debugfs_vport_count) == 0) { in lpfc_debugfs_terminate()
6527 debugfs_remove(phba->debug_multixri_pools); /* multixripools*/ in lpfc_debugfs_terminate()
6528 phba->debug_multixri_pools = NULL; in lpfc_debugfs_terminate()
6530 debugfs_remove(phba->debug_hbqinfo); /* hbqinfo */ in lpfc_debugfs_terminate()
6531 phba->debug_hbqinfo = NULL; in lpfc_debugfs_terminate()
6533 debugfs_remove(phba->debug_cgn_buffer); in lpfc_debugfs_terminate()
6534 phba->debug_cgn_buffer = NULL; in lpfc_debugfs_terminate()
6536 debugfs_remove(phba->debug_rx_monitor); in lpfc_debugfs_terminate()
6537 phba->debug_rx_monitor = NULL; in lpfc_debugfs_terminate()
6539 debugfs_remove(phba->debug_ras_log); in lpfc_debugfs_terminate()
6540 phba->debug_ras_log = NULL; in lpfc_debugfs_terminate()
6543 debugfs_remove(phba->debug_lockstat); /* lockstat */ in lpfc_debugfs_terminate()
6544 phba->debug_lockstat = NULL; in lpfc_debugfs_terminate()
6546 debugfs_remove(phba->debug_dumpHBASlim); /* HBASlim */ in lpfc_debugfs_terminate()
6547 phba->debug_dumpHBASlim = NULL; in lpfc_debugfs_terminate()
6549 debugfs_remove(phba->debug_dumpHostSlim); /* HostSlim */ in lpfc_debugfs_terminate()
6550 phba->debug_dumpHostSlim = NULL; in lpfc_debugfs_terminate()
6552 debugfs_remove(phba->debug_InjErrLBA); /* InjErrLBA */ in lpfc_debugfs_terminate()
6553 phba->debug_InjErrLBA = NULL; in lpfc_debugfs_terminate()
6555 debugfs_remove(phba->debug_InjErrNPortID); in lpfc_debugfs_terminate()
6556 phba->debug_InjErrNPortID = NULL; in lpfc_debugfs_terminate()
6558 debugfs_remove(phba->debug_InjErrWWPN); /* InjErrWWPN */ in lpfc_debugfs_terminate()
6559 phba->debug_InjErrWWPN = NULL; in lpfc_debugfs_terminate()
6561 debugfs_remove(phba->debug_writeGuard); /* writeGuard */ in lpfc_debugfs_terminate()
6562 phba->debug_writeGuard = NULL; in lpfc_debugfs_terminate()
6564 debugfs_remove(phba->debug_writeApp); /* writeApp */ in lpfc_debugfs_terminate()
6565 phba->debug_writeApp = NULL; in lpfc_debugfs_terminate()
6567 debugfs_remove(phba->debug_writeRef); /* writeRef */ in lpfc_debugfs_terminate()
6568 phba->debug_writeRef = NULL; in lpfc_debugfs_terminate()
6570 debugfs_remove(phba->debug_readGuard); /* readGuard */ in lpfc_debugfs_terminate()
6571 phba->debug_readGuard = NULL; in lpfc_debugfs_terminate()
6573 debugfs_remove(phba->debug_readApp); /* readApp */ in lpfc_debugfs_terminate()
6574 phba->debug_readApp = NULL; in lpfc_debugfs_terminate()
6576 debugfs_remove(phba->debug_readRef); /* readRef */ in lpfc_debugfs_terminate()
6577 phba->debug_readRef = NULL; in lpfc_debugfs_terminate()
6579 kfree(phba->slow_ring_trc); in lpfc_debugfs_terminate()
6580 phba->slow_ring_trc = NULL; in lpfc_debugfs_terminate()
6583 debugfs_remove(phba->debug_slow_ring_trc); in lpfc_debugfs_terminate()
6584 phba->debug_slow_ring_trc = NULL; in lpfc_debugfs_terminate()
6586 debugfs_remove(phba->debug_nvmeio_trc); in lpfc_debugfs_terminate()
6587 phba->debug_nvmeio_trc = NULL; in lpfc_debugfs_terminate()
6589 kfree(phba->nvmeio_trc); in lpfc_debugfs_terminate()
6590 phba->nvmeio_trc = NULL; in lpfc_debugfs_terminate()
6595 if (phba->sli_rev == LPFC_SLI_REV4) { in lpfc_debugfs_terminate()
6597 debugfs_remove(phba->idiag_ext_acc); in lpfc_debugfs_terminate()
6598 phba->idiag_ext_acc = NULL; in lpfc_debugfs_terminate()
6601 debugfs_remove(phba->idiag_mbx_acc); in lpfc_debugfs_terminate()
6602 phba->idiag_mbx_acc = NULL; in lpfc_debugfs_terminate()
6605 debugfs_remove(phba->idiag_ctl_acc); in lpfc_debugfs_terminate()
6606 phba->idiag_ctl_acc = NULL; in lpfc_debugfs_terminate()
6609 debugfs_remove(phba->idiag_drb_acc); in lpfc_debugfs_terminate()
6610 phba->idiag_drb_acc = NULL; in lpfc_debugfs_terminate()
6613 debugfs_remove(phba->idiag_que_acc); in lpfc_debugfs_terminate()
6614 phba->idiag_que_acc = NULL; in lpfc_debugfs_terminate()
6617 debugfs_remove(phba->idiag_que_info); in lpfc_debugfs_terminate()
6618 phba->idiag_que_info = NULL; in lpfc_debugfs_terminate()
6621 debugfs_remove(phba->idiag_bar_acc); in lpfc_debugfs_terminate()
6622 phba->idiag_bar_acc = NULL; in lpfc_debugfs_terminate()
6625 debugfs_remove(phba->idiag_pci_cfg); in lpfc_debugfs_terminate()
6626 phba->idiag_pci_cfg = NULL; in lpfc_debugfs_terminate()
6629 debugfs_remove(phba->idiag_root); in lpfc_debugfs_terminate()
6630 phba->idiag_root = NULL; in lpfc_debugfs_terminate()
6633 if (phba->hba_debugfs_root) { in lpfc_debugfs_terminate()
6634 debugfs_remove(phba->hba_debugfs_root); /* fnX */ in lpfc_debugfs_terminate()
6635 phba->hba_debugfs_root = NULL; in lpfc_debugfs_terminate()
6655 * lpfc_debug_dump_all_queues - dump all the queues with a hba
6672 for (idx = 0; idx < phba->cfg_hdw_queue; idx++) in lpfc_debug_dump_all_queues()
6684 for (idx = 0; idx < phba->cfg_hdw_queue; idx++) in lpfc_debug_dump_all_queues()
6690 for (idx = 0; idx < phba->cfg_hdw_queue; idx++) in lpfc_debug_dump_all_queues()