diff options
author | Quinn Tran <quinn.tran@cavium.com> | 2018-09-04 23:19:14 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-09-12 02:28:08 +0200 |
commit | 8b4673ba3a1b992b757a32667d2d3adae80e11fd (patch) | |
tree | 4ed44894051dbf45b28977d3b4c3f9fec5096ec8 /drivers/scsi/qla2xxx/qla_attr.c | |
parent | scsi: qla2xxx: Fix out of order Termination and ABTS response (diff) | |
download | linux-8b4673ba3a1b992b757a32667d2d3adae80e11fd.tar.xz linux-8b4673ba3a1b992b757a32667d2d3adae80e11fd.zip |
scsi: qla2xxx: Add support for ZIO6 interrupt threshold
Add sysfs support to control zio6 interrupt threshold. Using this sysfs hook
user can set when to generate interrupts. This value will be used to tell
firmware to generate interrupt at a certain interval. If the number of
exchanges/commands fall below defined setting, then the interrupt will be
generated immediately by the firmware.
By default ZIO6 will coalesce interrupts to a specified interval
regardless of low traffic or high traffic.
[mkp: fixed several typos]
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 14c496bab280..e1ae880d5b68 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -1208,6 +1208,34 @@ qla2x00_zio_timer_store(struct device *dev, struct device_attribute *attr, } static ssize_t +qla_zio_threshold_show(struct device *dev, struct device_attribute *attr, + char *buf) +{ + scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); + + return scnprintf(buf, PAGE_SIZE, "%d exchanges\n", + vha->hw->last_zio_threshold); +} + +static ssize_t +qla_zio_threshold_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) +{ + scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); + int val = 0; + + if (vha->hw->zio_mode != QLA_ZIO_MODE_6) + return -EINVAL; + if (sscanf(buf, "%d", &val) != 1) + return -EINVAL; + if (val > 256) + return -ERANGE; + + atomic_set(&vha->hw->zio_threshold, val); + return strlen(buf); +} + +static ssize_t qla2x00_beacon_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -1651,6 +1679,9 @@ static DEVICE_ATTR(allow_cna_fw_dump, S_IRUGO | S_IWUSR, static DEVICE_ATTR(pep_version, S_IRUGO, qla2x00_pep_version_show, NULL); static DEVICE_ATTR(min_link_speed, S_IRUGO, qla2x00_min_link_speed_show, NULL); static DEVICE_ATTR(max_speed_sup, S_IRUGO, qla2x00_max_speed_sup_show, NULL); +static DEVICE_ATTR(zio_threshold, 0644, + qla_zio_threshold_show, + qla_zio_threshold_store); struct device_attribute *qla2x00_host_attrs[] = { &dev_attr_driver_version, @@ -1687,6 +1718,7 @@ struct device_attribute *qla2x00_host_attrs[] = { &dev_attr_pep_version, &dev_attr_min_link_speed, &dev_attr_max_speed_sup, + &dev_attr_zio_threshold, NULL, }; |