Commit 97a1420d authored by Dan Williams's avatar Dan Williams Committed by James Bottomley

[SCSI] libsas: dynamic queue depth

The queue-depth for libsas-attached devices initializes to 32 and can
only be increased manually via sysfs to a max of 64, while mpt2sas
attached devices initialize to 254 and dynamically float via the
midlayer ->change_queue_depth interface.

No performance regression was observed with this change on the isci
driver.
Tested-by: default avatarDave Jiang <dave.jiang@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent f6e67035
...@@ -761,8 +761,7 @@ int sas_target_alloc(struct scsi_target *starget) ...@@ -761,8 +761,7 @@ int sas_target_alloc(struct scsi_target *starget)
return 0; return 0;
} }
#define SAS_DEF_QD 32 #define SAS_DEF_QD 256
#define SAS_MAX_QD 64
int sas_slave_configure(struct scsi_device *scsi_dev) int sas_slave_configure(struct scsi_device *scsi_dev)
{ {
...@@ -805,31 +804,29 @@ void sas_slave_destroy(struct scsi_device *scsi_dev) ...@@ -805,31 +804,29 @@ void sas_slave_destroy(struct scsi_device *scsi_dev)
dev->sata_dev.ap->link.device[0].class = ATA_DEV_NONE; dev->sata_dev.ap->link.device[0].class = ATA_DEV_NONE;
} }
int sas_change_queue_depth(struct scsi_device *scsi_dev, int new_depth, int sas_change_queue_depth(struct scsi_device *sdev, int depth, int reason)
int reason)
{ {
struct domain_device *dev = sdev_to_domain_dev(scsi_dev); struct domain_device *dev = sdev_to_domain_dev(sdev);
int res = min(new_depth, SAS_MAX_QD);
if (dev_is_sata(dev)) if (dev_is_sata(dev))
return __ata_change_queue_depth(dev->sata_dev.ap, scsi_dev, return __ata_change_queue_depth(dev->sata_dev.ap, sdev, depth,
new_depth, reason); reason);
if (reason != SCSI_QDEPTH_DEFAULT) switch (reason) {
case SCSI_QDEPTH_DEFAULT:
case SCSI_QDEPTH_RAMP_UP:
if (!sdev->tagged_supported)
depth = 1;
scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth);
break;
case SCSI_QDEPTH_QFULL:
scsi_track_queue_full(sdev, depth);
break;
default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (scsi_dev->tagged_supported)
scsi_adjust_queue_depth(scsi_dev, scsi_get_tag_type(scsi_dev),
res);
else {
sas_printk("device %llx LUN %x queue depth changed to 1\n",
SAS_ADDR(dev->sas_addr),
scsi_dev->lun);
scsi_adjust_queue_depth(scsi_dev, 0, 1);
res = 1;
} }
return res; return depth;
} }
int sas_change_queue_type(struct scsi_device *scsi_dev, int qt) int sas_change_queue_type(struct scsi_device *scsi_dev, int qt)
......
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