[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: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

authored by

Harish Zunjarrao and committed by
James Bottomley
e5f5f6f7 85821c90

+19
+13
drivers/scsi/qla2xxx/qla_attr.c
··· 809 809 ha->fw_revision[3]); 810 810 } 811 811 812 + static ssize_t 813 + qla2x00_total_isp_aborts_show(struct device *dev, 814 + struct device_attribute *attr, char *buf) 815 + { 816 + scsi_qla_host_t *ha = shost_priv(class_to_shost(dev)); 817 + 818 + return snprintf(buf, PAGE_SIZE, "%d\n", 819 + ha->qla_stats.total_isp_aborts); 820 + } 821 + 812 822 static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL); 813 823 static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL); 814 824 static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL); ··· 841 831 qla2x00_optrom_fcode_version_show, NULL); 842 832 static DEVICE_ATTR(optrom_fw_version, S_IRUGO, qla2x00_optrom_fw_version_show, 843 833 NULL); 834 + static DEVICE_ATTR(total_isp_aborts, S_IRUGO, qla2x00_total_isp_aborts_show, 835 + NULL); 844 836 845 837 struct device_attribute *qla2x00_host_attrs[] = { 846 838 &dev_attr_driver_version, ··· 861 849 &dev_attr_optrom_efi_version, 862 850 &dev_attr_optrom_fcode_version, 863 851 &dev_attr_optrom_fw_version, 852 + &dev_attr_total_isp_aborts, 864 853 NULL, 865 854 }; 866 855
+5
drivers/scsi/qla2xxx/qla_def.h
··· 2154 2154 uint32_t gold_fw_version; 2155 2155 }; 2156 2156 2157 + struct qla_statistics { 2158 + uint32_t total_isp_aborts; 2159 + }; 2160 + 2157 2161 /* 2158 2162 * Linux Host Adapter structure 2159 2163 */ ··· 2599 2595 int cur_vport_count; 2600 2596 2601 2597 struct qla_chip_state_84xx *cs84xx; 2598 + struct qla_statistics qla_stats; 2602 2599 } scsi_qla_host_t; 2603 2600 2604 2601
+1
drivers/scsi/qla2xxx/qla_init.c
··· 3237 3237 if (ha->flags.online) { 3238 3238 ha->flags.online = 0; 3239 3239 clear_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); 3240 + ha->qla_stats.total_isp_aborts++; 3240 3241 3241 3242 qla_printk(KERN_INFO, ha, 3242 3243 "Performing ISP error recovery - ha= %p.\n", ha);