Commit c85a65ac authored by James Smart's avatar James Smart Committed by James Bottomley

[SCSI] lpfc 8.3.33: Fixed debugfs queInfo to include queue stats

Signed-off-by: default avatarJames Smart <james.smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent ba20c853
...@@ -2001,192 +2001,294 @@ lpfc_idiag_queinfo_read(struct file *file, char __user *buf, size_t nbytes, ...@@ -2001,192 +2001,294 @@ lpfc_idiag_queinfo_read(struct file *file, char __user *buf, size_t nbytes,
{ {
struct lpfc_debug *debug = file->private_data; struct lpfc_debug *debug = file->private_data;
struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private;
int len = 0, fcp_qidx; int len = 0;
char *pbuffer; char *pbuffer;
int x, cnt;
int max_cnt;
struct lpfc_queue *qp = NULL;
if (!debug->buffer) if (!debug->buffer)
debug->buffer = kmalloc(LPFC_QUE_INFO_GET_BUF_SIZE, GFP_KERNEL); debug->buffer = kmalloc(LPFC_QUE_INFO_GET_BUF_SIZE, GFP_KERNEL);
if (!debug->buffer) if (!debug->buffer)
return 0; return 0;
pbuffer = debug->buffer; pbuffer = debug->buffer;
max_cnt = LPFC_QUE_INFO_GET_BUF_SIZE - 128;
if (*ppos) if (*ppos)
return 0; return 0;
/* Get fast-path event queue information */ spin_lock_irq(&phba->hbalock);
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len,
"HBA EQ information:\n"); /* Fast-path event queue */
if (phba->sli4_hba.hba_eq) { if (phba->sli4_hba.hba_eq && phba->cfg_fcp_io_channel) {
for (fcp_qidx = 0; fcp_qidx < phba->cfg_fcp_io_channel; cnt = phba->cfg_fcp_io_channel;
fcp_qidx++) {
if (phba->sli4_hba.hba_eq[fcp_qidx]) { for (x = 0; x < cnt; x++) {
/* Fast-path EQ */
qp = phba->sli4_hba.hba_eq[x];
if (!qp)
goto proc_cq;
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len,
"\nHBA EQ info: "
"EQ-STAT[max:x%x noE:x%x "
"bs:x%x proc:x%llx]\n",
qp->q_cnt_1, qp->q_cnt_2,
qp->q_cnt_3, qp->q_cnt_4);
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len,
"EQID[%02d], "
"QE-CNT[%04d], QE-SIZE[%04d], "
"HOST-IDX[%04d], PORT-IDX[%04d]",
qp->queue_id,
qp->entry_count,
qp->entry_size,
qp->host_index,
qp->hba_index);
/* Reset max counter */
qp->EQ_max_eqe = 0;
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len, "\n");
if (len >= max_cnt)
goto too_big;
proc_cq:
/* Fast-path FCP CQ */
qp = phba->sli4_hba.fcp_cq[x];
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len,
"\tFCP CQ info: ");
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len,
"AssocEQID[%02d]: "
"CQ STAT[max:x%x relw:x%x "
"xabt:x%x wq:x%llx]\n",
qp->assoc_qid,
qp->q_cnt_1, qp->q_cnt_2,
qp->q_cnt_3, qp->q_cnt_4);
len += snprintf(pbuffer+len, len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len, LPFC_QUE_INFO_GET_BUF_SIZE-len,
"\tEQID[%02d], "
"QE-COUNT[%04d], QE-SIZE[%04d], "
"HOST-INDEX[%04d], PORT-INDEX[%04d]\n",
phba->sli4_hba.hba_eq[fcp_qidx]->queue_id,
phba->sli4_hba.hba_eq[fcp_qidx]->entry_count,
phba->sli4_hba.hba_eq[fcp_qidx]->entry_size,
phba->sli4_hba.hba_eq[fcp_qidx]->host_index,
phba->sli4_hba.hba_eq[fcp_qidx]->hba_index);
}
}
}
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len, "\n");
/* Get mailbox complete queue information */
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len,
"Slow-path MBX CQ information:\n");
if (phba->sli4_hba.mbx_cq) {
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len,
"Associated EQID[%02d]:\n",
phba->sli4_hba.mbx_cq->assoc_qid);
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len,
"\tCQID[%02d], " "\tCQID[%02d], "
"QE-COUNT[%04d], QE-SIZE[%04d], " "QE-CNT[%04d], QE-SIZE[%04d], "
"HOST-INDEX[%04d], PORT-INDEX[%04d]\n\n", "HOST-IDX[%04d], PORT-IDX[%04d]",
phba->sli4_hba.mbx_cq->queue_id, qp->queue_id, qp->entry_count,
phba->sli4_hba.mbx_cq->entry_count, qp->entry_size, qp->host_index,
phba->sli4_hba.mbx_cq->entry_size, qp->hba_index);
phba->sli4_hba.mbx_cq->host_index,
phba->sli4_hba.mbx_cq->hba_index);
} /* Reset max counter */
qp->CQ_max_cqe = 0;
/* Get slow-path complete queue information */
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len, len += snprintf(pbuffer+len,
"Slow-path ELS CQ information:\n"); LPFC_QUE_INFO_GET_BUF_SIZE-len, "\n");
if (phba->sli4_hba.els_cq) { if (len >= max_cnt)
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len, goto too_big;
"Associated EQID[%02d]:\n",
phba->sli4_hba.els_cq->assoc_qid); /* Fast-path FCP WQ */
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len, qp = phba->sli4_hba.fcp_wq[x];
"\tCQID [%02d], "
"QE-COUNT[%04d], QE-SIZE[%04d], " len += snprintf(pbuffer+len,
"HOST-INDEX[%04d], PORT-INDEX[%04d]\n\n", LPFC_QUE_INFO_GET_BUF_SIZE-len,
phba->sli4_hba.els_cq->queue_id, "\t\tFCP WQ info: ");
phba->sli4_hba.els_cq->entry_count, len += snprintf(pbuffer+len,
phba->sli4_hba.els_cq->entry_size, LPFC_QUE_INFO_GET_BUF_SIZE-len,
phba->sli4_hba.els_cq->host_index, "AssocCQID[%02d]: "
phba->sli4_hba.els_cq->hba_index); "WQ-STAT[oflow:x%x posted:x%llx]\n",
} qp->assoc_qid,
qp->q_cnt_1, qp->q_cnt_4);
/* Get fast-path complete queue information */
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len,
"Fast-path FCP CQ information:\n");
fcp_qidx = 0;
if (phba->sli4_hba.fcp_cq) {
do {
if (phba->sli4_hba.fcp_cq[fcp_qidx]) {
len += snprintf(pbuffer+len, len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len, LPFC_QUE_INFO_GET_BUF_SIZE-len,
"Associated EQID[%02d]:\n", "\t\tWQID[%02d], "
phba->sli4_hba.fcp_cq[fcp_qidx]->assoc_qid); "QE-CNT[%04d], QE-SIZE[%04d], "
"HOST-IDX[%04d], PORT-IDX[%04d]",
qp->queue_id,
qp->entry_count,
qp->entry_size,
qp->host_index,
qp->hba_index);
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len, "\n");
if (len >= max_cnt)
goto too_big;
if (x)
continue;
/* Only EQ 0 has slow path CQs configured */
/* Slow-path mailbox CQ */
qp = phba->sli4_hba.mbx_cq;
if (qp) {
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len,
"\tMBX CQ info: ");
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len,
"AssocEQID[%02d]: "
"CQ-STAT[mbox:x%x relw:x%x "
"xabt:x%x wq:x%llx]\n",
qp->assoc_qid,
qp->q_cnt_1, qp->q_cnt_2,
qp->q_cnt_3, qp->q_cnt_4);
len += snprintf(pbuffer+len, len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len, LPFC_QUE_INFO_GET_BUF_SIZE-len,
"\tCQID[%02d], " "\tCQID[%02d], "
"QE-COUNT[%04d], QE-SIZE[%04d], " "QE-CNT[%04d], QE-SIZE[%04d], "
"HOST-INDEX[%04d], PORT-INDEX[%04d]\n", "HOST-IDX[%04d], PORT-IDX[%04d]",
phba->sli4_hba.fcp_cq[fcp_qidx]->queue_id, qp->queue_id, qp->entry_count,
phba->sli4_hba.fcp_cq[fcp_qidx]->entry_count, qp->entry_size, qp->host_index,
phba->sli4_hba.fcp_cq[fcp_qidx]->entry_size, qp->hba_index);
phba->sli4_hba.fcp_cq[fcp_qidx]->host_index,
phba->sli4_hba.fcp_cq[fcp_qidx]->hba_index);
}
} while (++fcp_qidx < phba->cfg_fcp_io_channel);
len += snprintf(pbuffer+len, len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len, "\n"); LPFC_QUE_INFO_GET_BUF_SIZE-len, "\n");
if (len >= max_cnt)
goto too_big;
} }
/* Get mailbox queue information */ /* Slow-path MBOX MQ */
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len, qp = phba->sli4_hba.mbx_wq;
"Slow-path MBX MQ information:\n"); if (qp) {
if (phba->sli4_hba.mbx_wq) { len += snprintf(pbuffer+len,
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len, LPFC_QUE_INFO_GET_BUF_SIZE-len,
"Associated CQID[%02d]:\n", "\t\tMBX MQ info: ");
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len,
"AssocCQID[%02d]:\n",
phba->sli4_hba.mbx_wq->assoc_qid); phba->sli4_hba.mbx_wq->assoc_qid);
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len,
"\tWQID[%02d], "
"QE-COUNT[%04d], QE-SIZE[%04d], "
"HOST-INDEX[%04d], PORT-INDEX[%04d]\n\n",
phba->sli4_hba.mbx_wq->queue_id,
phba->sli4_hba.mbx_wq->entry_count,
phba->sli4_hba.mbx_wq->entry_size,
phba->sli4_hba.mbx_wq->host_index,
phba->sli4_hba.mbx_wq->hba_index);
}
/* Get slow-path work queue information */
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len,
"Slow-path ELS WQ information:\n");
if (phba->sli4_hba.els_wq) {
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len,
"Associated CQID[%02d]:\n",
phba->sli4_hba.els_wq->assoc_qid);
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len,
"\tWQID[%02d], "
"QE-COUNT[%04d], QE-SIZE[%04d], "
"HOST-INDEX[%04d], PORT-INDEX[%04d]\n\n",
phba->sli4_hba.els_wq->queue_id,
phba->sli4_hba.els_wq->entry_count,
phba->sli4_hba.els_wq->entry_size,
phba->sli4_hba.els_wq->host_index,
phba->sli4_hba.els_wq->hba_index);
}
/* Get fast-path work queue information */
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len,
"Fast-path FCP WQ information:\n");
if (phba->sli4_hba.fcp_wq) {
for (fcp_qidx = 0; fcp_qidx < phba->cfg_fcp_io_channel;
fcp_qidx++) {
if (!phba->sli4_hba.fcp_wq[fcp_qidx])
continue;
len += snprintf(pbuffer+len, len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len, LPFC_QUE_INFO_GET_BUF_SIZE-len,
"Associated CQID[%02d]:\n", "\t\tWQID[%02d], "
phba->sli4_hba.fcp_wq[fcp_qidx]->assoc_qid); "QE-CNT[%04d], QE-SIZE[%04d], "
"HOST-IDX[%04d], PORT-IDX[%04d]",
qp->queue_id, qp->entry_count,
qp->entry_size, qp->host_index,
qp->hba_index);
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len, "\n");
if (len >= max_cnt)
goto too_big;
}
/* Slow-path ELS response CQ */
qp = phba->sli4_hba.els_cq;
if (qp) {
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len,
"\tELS CQ info: ");
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len,
"AssocEQID[%02d]: "
"CQ-STAT[max:x%x relw:x%x "
"xabt:x%x wq:x%llx]\n",
qp->assoc_qid,
qp->q_cnt_1, qp->q_cnt_2,
qp->q_cnt_3, qp->q_cnt_4);
len += snprintf(pbuffer+len, len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len, LPFC_QUE_INFO_GET_BUF_SIZE-len,
"\tWQID[%02d], " "\tCQID [%02d], "
"QE-COUNT[%04d], WQE-SIZE[%04d], " "QE-CNT[%04d], QE-SIZE[%04d], "
"HOST-INDEX[%04d], PORT-INDEX[%04d]\n", "HOST-IDX[%04d], PORT-IDX[%04d]",
phba->sli4_hba.fcp_wq[fcp_qidx]->queue_id, qp->queue_id, qp->entry_count,
phba->sli4_hba.fcp_wq[fcp_qidx]->entry_count, qp->entry_size, qp->host_index,
phba->sli4_hba.fcp_wq[fcp_qidx]->entry_size, qp->hba_index);
phba->sli4_hba.fcp_wq[fcp_qidx]->host_index,
phba->sli4_hba.fcp_wq[fcp_qidx]->hba_index); /* Reset max counter */
qp->CQ_max_cqe = 0;
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len, "\n");
if (len >= max_cnt)
goto too_big;
} }
/* Slow-path ELS WQ */
qp = phba->sli4_hba.els_wq;
if (qp) {
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len,
"\t\tELS WQ info: ");
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len,
"AssocCQID[%02d]: "
" WQ-STAT[oflow:x%x "
"posted:x%llx]\n",
qp->assoc_qid,
qp->q_cnt_1, qp->q_cnt_4);
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len,
"\t\tWQID[%02d], "
"QE-CNT[%04d], QE-SIZE[%04d], "
"HOST-IDX[%04d], PORT-IDX[%04d]",
qp->queue_id, qp->entry_count,
qp->entry_size, qp->host_index,
qp->hba_index);
len += snprintf(pbuffer+len, len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len, "\n"); LPFC_QUE_INFO_GET_BUF_SIZE-len, "\n");
if (len >= max_cnt)
goto too_big;
} }
/* Get receive queue information */
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len,
"Slow-path RQ information:\n");
if (phba->sli4_hba.hdr_rq && phba->sli4_hba.dat_rq) { if (phba->sli4_hba.hdr_rq && phba->sli4_hba.dat_rq) {
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len, /* Slow-path RQ header */
"Associated CQID[%02d]:\n", qp = phba->sli4_hba.hdr_rq;
phba->sli4_hba.hdr_rq->assoc_qid);
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len, len += snprintf(pbuffer+len,
"\tHQID[%02d], " LPFC_QUE_INFO_GET_BUF_SIZE-len,
"QE-COUNT[%04d], QE-SIZE[%04d], " "\t\tRQ info: ");
"HOST-INDEX[%04d], PORT-INDEX[%04d]\n", len += snprintf(pbuffer+len,
phba->sli4_hba.hdr_rq->queue_id, LPFC_QUE_INFO_GET_BUF_SIZE-len,
phba->sli4_hba.hdr_rq->entry_count, "AssocCQID[%02d]: "
phba->sli4_hba.hdr_rq->entry_size, "RQ-STAT[nopost:x%x nobuf:x%x "
phba->sli4_hba.hdr_rq->host_index, "trunc:x%x rcv:x%llx]\n",
phba->sli4_hba.hdr_rq->hba_index); qp->assoc_qid,
len += snprintf(pbuffer+len, LPFC_QUE_INFO_GET_BUF_SIZE-len, qp->q_cnt_1, qp->q_cnt_2,
"\tDQID[%02d], " qp->q_cnt_3, qp->q_cnt_4);
"QE-COUNT[%04d], QE-SIZE[%04d], " len += snprintf(pbuffer+len,
"HOST-INDEX[%04d], PORT-INDEX[%04d]\n", LPFC_QUE_INFO_GET_BUF_SIZE-len,
phba->sli4_hba.dat_rq->queue_id, "\t\tHQID[%02d], "
phba->sli4_hba.dat_rq->entry_count, "QE-CNT[%04d], QE-SIZE[%04d], "
phba->sli4_hba.dat_rq->entry_size, "HOST-IDX[%04d], PORT-IDX[%04d]\n",
phba->sli4_hba.dat_rq->host_index, qp->queue_id,
phba->sli4_hba.dat_rq->hba_index); qp->entry_count,
qp->entry_size,
qp->host_index,
qp->hba_index);
/* Slow-path RQ data */
qp = phba->sli4_hba.dat_rq;
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len,
"\t\tDQID[%02d], "
"QE-CNT[%04d], QE-SIZE[%04d], "
"HOST-IDX[%04d], PORT-IDX[%04d]\n",
qp->queue_id,
qp->entry_count,
qp->entry_size,
qp->host_index,
qp->hba_index);
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len, "\n");
}
}
} }
spin_unlock_irq(&phba->hbalock);
return simple_read_from_buffer(buf, nbytes, ppos, pbuffer, len);
too_big:
len += snprintf(pbuffer+len,
LPFC_QUE_INFO_GET_BUF_SIZE-len, "Truncated ...\n");
spin_unlock_irq(&phba->hbalock);
return simple_read_from_buffer(buf, nbytes, ppos, pbuffer, len); return simple_read_from_buffer(buf, nbytes, ppos, pbuffer, len);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment