提交 e5f5f6f7 编写于 作者: H Harish Zunjarrao 提交者: James Bottomley

[SCSI] qla2xxx: Track total number of ISP aborts.

This parameter counts the total number of ISP aborts during
driver execution.  The value is exported through a DEVICE_ATTR()
off the scsi_host.
Signed-off-by: NAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
上级 85821c90
...@@ -809,6 +809,16 @@ qla2x00_optrom_fw_version_show(struct device *dev, ...@@ -809,6 +809,16 @@ qla2x00_optrom_fw_version_show(struct device *dev,
ha->fw_revision[3]); ha->fw_revision[3]);
} }
static ssize_t
qla2x00_total_isp_aborts_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
return snprintf(buf, PAGE_SIZE, "%d\n",
ha->qla_stats.total_isp_aborts);
}
static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL); static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL);
static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL); static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL);
static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL); static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL);
...@@ -831,6 +841,8 @@ static DEVICE_ATTR(optrom_fcode_version, S_IRUGO, ...@@ -831,6 +841,8 @@ static DEVICE_ATTR(optrom_fcode_version, S_IRUGO,
qla2x00_optrom_fcode_version_show, NULL); qla2x00_optrom_fcode_version_show, NULL);
static DEVICE_ATTR(optrom_fw_version, S_IRUGO, qla2x00_optrom_fw_version_show, static DEVICE_ATTR(optrom_fw_version, S_IRUGO, qla2x00_optrom_fw_version_show,
NULL); NULL);
static DEVICE_ATTR(total_isp_aborts, S_IRUGO, qla2x00_total_isp_aborts_show,
NULL);
struct device_attribute *qla2x00_host_attrs[] = { struct device_attribute *qla2x00_host_attrs[] = {
&dev_attr_driver_version, &dev_attr_driver_version,
...@@ -849,6 +861,7 @@ struct device_attribute *qla2x00_host_attrs[] = { ...@@ -849,6 +861,7 @@ struct device_attribute *qla2x00_host_attrs[] = {
&dev_attr_optrom_efi_version, &dev_attr_optrom_efi_version,
&dev_attr_optrom_fcode_version, &dev_attr_optrom_fcode_version,
&dev_attr_optrom_fw_version, &dev_attr_optrom_fw_version,
&dev_attr_total_isp_aborts,
NULL, NULL,
}; };
......
...@@ -2154,6 +2154,10 @@ struct qla_chip_state_84xx { ...@@ -2154,6 +2154,10 @@ struct qla_chip_state_84xx {
uint32_t gold_fw_version; uint32_t gold_fw_version;
}; };
struct qla_statistics {
uint32_t total_isp_aborts;
};
/* /*
* Linux Host Adapter structure * Linux Host Adapter structure
*/ */
...@@ -2595,6 +2599,7 @@ typedef struct scsi_qla_host { ...@@ -2595,6 +2599,7 @@ typedef struct scsi_qla_host {
int cur_vport_count; int cur_vport_count;
struct qla_chip_state_84xx *cs84xx; struct qla_chip_state_84xx *cs84xx;
struct qla_statistics qla_stats;
} scsi_qla_host_t; } scsi_qla_host_t;
......
...@@ -3237,6 +3237,7 @@ qla2x00_abort_isp(scsi_qla_host_t *ha) ...@@ -3237,6 +3237,7 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
if (ha->flags.online) { if (ha->flags.online) {
ha->flags.online = 0; ha->flags.online = 0;
clear_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); clear_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
ha->qla_stats.total_isp_aborts++;
qla_printk(KERN_INFO, ha, qla_printk(KERN_INFO, ha,
"Performing ISP error recovery - ha= %p.\n", ha); "Performing ISP error recovery - ha= %p.\n", ha);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册