/******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * * Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term * * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * * Copyright (C) 2007-2011 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. * * www.broadcom.com * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of version 2 of the GNU General * * Public License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful. * * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * * TO BE LEGALLY INVALID. See the GNU General Public License for * * more details, a copy of which can be found in the file COPYING * * included with this package. *
*******************************************************************/
#ifndef _H_LPFC_DEBUG_FS #define _H_LPFC_DEBUG_FS
#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
/* size of output line, for discovery_trace and slow_ring_trace */ #define LPFC_DEBUG_TRC_ENTRY_SIZE 100
/* * Driver debug utility routines outside of debugfs. The debug utility * routines implemented here is intended to be used in the instrumented * debug driver for debugging host or port issues.
*/
/** * lpfc_debug_dump_qe - dump an specific entry from a queue * @q: Pointer to the queue descriptor. * @idx: Index to the entry on the queue. * * This function dumps an entry indexed by @idx from a queue specified by the * queue descriptor @q.
**/ staticvoid
lpfc_debug_dump_qe(struct lpfc_queue *q, uint32_t idx)
{ char line_buf[LPFC_LBUF_SZ]; int i, esize, qe_word_cnt, len;
uint32_t *pword;
/* sanity checks */ if (!q) return; if (idx >= q->entry_count) return;
len = 0;
len += scnprintf(line_buf+len, LPFC_LBUF_SZ-len, "QE[%04d]: ", idx); if (qe_word_cnt > 8)
printk(KERN_ERR "%s\n", line_buf);
for (i = 0; i < qe_word_cnt; i++) { if (!(i % 8)) { if (i != 0)
printk(KERN_ERR "%s\n", line_buf); if (qe_word_cnt > 8) {
len = 0;
memset(line_buf, 0, LPFC_LBUF_SZ);
len += scnprintf(line_buf+len, LPFC_LBUF_SZ-len, "%03d: ", i);
}
}
len += scnprintf(line_buf+len, LPFC_LBUF_SZ-len, "%08x ",
((uint32_t)*pword) & 0xffffffff);
pword++;
} if (qe_word_cnt <= 8 || (i - 1) % 8)
printk(KERN_ERR "%s\n", line_buf);
}
/** * lpfc_debug_dump_q - dump all entries from an specific queue * @q: Pointer to the queue descriptor. * * This function dumps all entries from a queue specified by the queue * descriptor @q.
**/ staticinlinevoid
lpfc_debug_dump_q(struct lpfc_queue *q)
{ int idx, entry_count;
/** * lpfc_debug_dump_wq - dump all entries from the fcp or nvme work queue * @phba: Pointer to HBA context object. * @wqidx: Index to a FCP or NVME work queue. * * This function dumps all entries from a FCP or NVME work queue specified * by the wqidx.
**/ staticinlinevoid
lpfc_debug_dump_wq(struct lpfc_hba *phba, int qtype, int wqidx)
{ struct lpfc_queue *wq; char *qtypestr;
/** * lpfc_debug_dump_cq - dump all entries from a fcp or nvme work queue's * cmpl queue * @phba: Pointer to HBA context object. * @wqidx: Index to a FCP work queue. * * This function dumps all entries from a FCP or NVME completion queue * which is associated to the work queue specified by the @wqidx.
**/ staticinlinevoid
lpfc_debug_dump_cq(struct lpfc_hba *phba, int qtype, int wqidx)
{ struct lpfc_queue *wq, *cq, *eq; char *qtypestr; int eqidx;
/* io wq and cq are 1:1, thus same indexes */
eq = NULL;
/** * lpfc_debug_dump_hba_eq - dump all entries from a fcp work queue's evt queue * @phba: Pointer to HBA context object. * @fcp_wqidx: Index to a FCP work queue. * * This function dumps all entries from a FCP event queue which is * associated to the FCP work queue specified by the @fcp_wqidx.
**/ staticinlinevoid
lpfc_debug_dump_hba_eq(struct lpfc_hba *phba, int qidx)
{ struct lpfc_queue *qp;
/** * lpfc_debug_dump_dat_rq - dump all entries from the receive data queue * @phba: Pointer to HBA context object. * * This function dumps all entries from the receive data queue.
**/ staticinlinevoid
lpfc_debug_dump_dat_rq(struct lpfc_hba *phba)
{
printk(KERN_ERR "DAT RQ: RQ[Qid:%d]\n",
phba->sli4_hba.dat_rq->queue_id);
lpfc_debug_dump_q(phba->sli4_hba.dat_rq);
}
/** * lpfc_debug_dump_hdr_rq - dump all entries from the receive header queue * @phba: Pointer to HBA context object. * * This function dumps all entries from the receive header queue.
**/ staticinlinevoid
lpfc_debug_dump_hdr_rq(struct lpfc_hba *phba)
{
printk(KERN_ERR "HDR RQ: RQ[Qid:%d]\n",
phba->sli4_hba.hdr_rq->queue_id);
lpfc_debug_dump_q(phba->sli4_hba.hdr_rq);
}
/** * lpfc_debug_dump_wq_by_id - dump all entries from a work queue by queue id * @phba: Pointer to HBA context object. * @qid: Work queue identifier. * * This function dumps all entries from a work queue identified by the queue * identifier.
**/ staticinlinevoid
lpfc_debug_dump_wq_by_id(struct lpfc_hba *phba, int qid)
{ int wq_idx;
for (wq_idx = 0; wq_idx < phba->cfg_hdw_queue; wq_idx++) if (phba->sli4_hba.hdwq[wq_idx].io_wq->queue_id == qid) break; if (wq_idx < phba->cfg_hdw_queue) {
pr_err("IO WQ[Idx:%d|Qid:%d]\n", wq_idx, qid);
lpfc_debug_dump_q(phba->sli4_hba.hdwq[wq_idx].io_wq); return;
}
if (phba->sli4_hba.nvmels_wq->queue_id == qid) {
pr_err("NVME LS WQ[Qid:%d]\n", qid);
lpfc_debug_dump_q(phba->sli4_hba.nvmels_wq);
}
}
/** * lpfc_debug_dump_mq_by_id - dump all entries from a mbox queue by queue id * @phba: Pointer to HBA context object. * @qid: Mbox work queue identifier. * * This function dumps all entries from a mbox work queue identified by the * queue identifier.
**/ staticinlinevoid
lpfc_debug_dump_mq_by_id(struct lpfc_hba *phba, int qid)
{ if (phba->sli4_hba.mbx_wq->queue_id == qid) {
printk(KERN_ERR "MBX WQ[Qid:%d]\n", qid);
lpfc_debug_dump_q(phba->sli4_hba.mbx_wq);
}
}
/** * lpfc_debug_dump_rq_by_id - dump all entries from a receive queue by queue id * @phba: Pointer to HBA context object. * @qid: Receive queue identifier. * * This function dumps all entries from a receive queue identified by the * queue identifier.
**/ staticinlinevoid
lpfc_debug_dump_rq_by_id(struct lpfc_hba *phba, int qid)
{ if (phba->sli4_hba.hdr_rq->queue_id == qid) {
printk(KERN_ERR "HDR RQ[Qid:%d]\n", qid);
lpfc_debug_dump_q(phba->sli4_hba.hdr_rq); return;
} if (phba->sli4_hba.dat_rq->queue_id == qid) {
printk(KERN_ERR "DAT RQ[Qid:%d]\n", qid);
lpfc_debug_dump_q(phba->sli4_hba.dat_rq);
}
}
/** * lpfc_debug_dump_cq_by_id - dump all entries from a cmpl queue by queue id * @phba: Pointer to HBA context object. * @qid: Complete queue identifier. * * This function dumps all entries from a complete queue identified by the * queue identifier.
**/ staticinlinevoid
lpfc_debug_dump_cq_by_id(struct lpfc_hba *phba, int qid)
{ int cq_idx;
for (cq_idx = 0; cq_idx < phba->cfg_hdw_queue; cq_idx++) if (phba->sli4_hba.hdwq[cq_idx].io_cq->queue_id == qid) break;
/** * lpfc_debug_dump_eq_by_id - dump all entries from an event queue by queue id * @phba: Pointer to HBA context object. * @qid: Complete queue identifier. * * This function dumps all entries from an event queue identified by the * queue identifier.
**/ staticinlinevoid
lpfc_debug_dump_eq_by_id(struct lpfc_hba *phba, int qid)
{ int eq_idx;
for (eq_idx = 0; eq_idx < phba->cfg_hdw_queue; eq_idx++) if (phba->sli4_hba.hdwq[eq_idx].hba_eq->queue_id == qid) break;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.