scsi: qedf: Improve firmware debug dump handling

Get all firmware debug data instead of just a grc dump.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Chad Dupuis 2018-04-25 06:08:58 -07:00 committed by Martin K. Petersen
parent f9a4a7f2c0
commit 4b9b7fabb3
3 changed files with 15 additions and 2 deletions

View File

@ -367,6 +367,7 @@ struct qedf_ctx {
#define QEDF_IO_WORK_MIN 64
mempool_t *io_mempool;
struct workqueue_struct *dpc_wq;
struct delayed_work grcdump_work;
u32 slow_sge_ios;
u32 fast_sge_ios;
@ -499,6 +500,7 @@ extern void qedf_process_seq_cleanup_compl(struct qedf_ctx *qedf,
struct fcoe_cqe *cqe, struct qedf_ioreq *io_req);
extern int qedf_send_flogi(struct qedf_ctx *qedf);
extern void qedf_fp_io_handler(struct work_struct *work);
extern void qedf_wq_grcdump(struct work_struct *work);
#define FCOE_WORD_TO_BYTE 4
#define QEDF_MAX_TASK_NUM 0xFFFF

View File

@ -147,7 +147,7 @@ qedf_get_grc_dump(struct qed_dev *cdev, const struct qed_common_ops *common,
if (!*buf)
return -EINVAL;
return common->dbg_grc(cdev, *buf, grcsize);
return common->dbg_all_data(cdev, *buf);
}
void

View File

@ -3008,6 +3008,7 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
qedf->link_update_wq = create_workqueue(host_buf);
INIT_DELAYED_WORK(&qedf->link_update, qedf_handle_link_update);
INIT_DELAYED_WORK(&qedf->link_recovery, qedf_link_recovery);
INIT_DELAYED_WORK(&qedf->grcdump_work, qedf_wq_grcdump);
qedf->fipvlan_retries = qedf_fipvlan_retries;
/* Set a default prio in case DCBX doesn't converge */
qedf->prio = QEDF_DEFAULT_PRIO;
@ -3240,7 +3241,8 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
* unload process.
*/
if (mode != QEDF_MODE_RECOVERY) {
qedf->grcdump_size = qed_ops->common->dbg_grc_size(qedf->cdev);
qedf->grcdump_size =
qed_ops->common->dbg_all_data_size(qedf->cdev);
if (qedf->grcdump_size) {
rc = qedf_alloc_grc_dump_buf(&qedf->grcdump,
qedf->grcdump_size);
@ -3424,6 +3426,15 @@ static void qedf_remove(struct pci_dev *pdev)
__qedf_remove(pdev, QEDF_MODE_NORMAL);
}
void qedf_wq_grcdump(struct work_struct *work)
{
struct qedf_ctx *qedf =
container_of(work, struct qedf_ctx, grcdump_work.work);
QEDF_ERR(&(qedf->dbg_ctx), "Collecting GRC dump.\n");
qedf_capture_grc_dump(qedf);
}
/*
* Module Init/Remove
*/