scsi: always assign block layer tags if enabled

Allow a driver to ask for block layer tags by setting .use_blk_tags in the
host template, in which case it will always see a valid value in
request->tag, similar to the behavior when using blk-mq.  This means even
SCSI "untagged" commands will now have a tag, which is especially useful
when using a host-wide tag map.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
This commit is contained in:
Christoph Hellwig
2014-11-03 14:09:02 +01:00
parent e2eddf4d53
commit 2ecb204d07
33 changed files with 86 additions and 168 deletions

View File

@@ -2888,11 +2888,11 @@ static int ibmvfc_slave_configure(struct scsi_device *sdev)
if (sdev->type == TYPE_DISK)
sdev->allow_restart = 1;
if (sdev->tagged_supported) {
scsi_set_tag_type(sdev, MSG_SIMPLE_TAG);
scsi_activate_tcq(sdev, sdev->queue_depth);
} else
scsi_deactivate_tcq(sdev, sdev->queue_depth);
if (sdev->tagged_supported)
scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG,
sdev->queue_depth);
else
scsi_adjust_queue_depth(sdev, 0, sdev->queue_depth);
spin_unlock_irqrestore(shost->host_lock, flags);
return 0;
}
@@ -3108,6 +3108,7 @@ static struct scsi_host_template driver_template = {
.max_sectors = IBMVFC_MAX_SECTORS,
.use_clustering = ENABLE_CLUSTERING,
.shost_attrs = ibmvfc_attrs,
.use_blk_tags = 1,
};
/**