Commit 2d9c5c20 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Martin K. Petersen

scsi: allow LLDDs to expose the queue mapping to blk-mq

Just hand through the blk-mq map_queues method in the host template.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 9e5a7e22
...@@ -1990,6 +1990,15 @@ static void scsi_exit_request(void *data, struct request *rq, ...@@ -1990,6 +1990,15 @@ static void scsi_exit_request(void *data, struct request *rq,
kfree(cmd->sense_buffer); kfree(cmd->sense_buffer);
} }
static int scsi_map_queues(struct blk_mq_tag_set *set)
{
struct Scsi_Host *shost = container_of(set, struct Scsi_Host, tag_set);
if (shost->hostt->map_queues)
return shost->hostt->map_queues(shost);
return blk_mq_map_queues(set);
}
static u64 scsi_calculate_bounce_limit(struct Scsi_Host *shost) static u64 scsi_calculate_bounce_limit(struct Scsi_Host *shost)
{ {
struct device *host_dev; struct device *host_dev;
...@@ -2082,6 +2091,7 @@ static struct blk_mq_ops scsi_mq_ops = { ...@@ -2082,6 +2091,7 @@ static struct blk_mq_ops scsi_mq_ops = {
.timeout = scsi_timeout, .timeout = scsi_timeout,
.init_request = scsi_init_request, .init_request = scsi_init_request,
.exit_request = scsi_exit_request, .exit_request = scsi_exit_request,
.map_queues = scsi_map_queues,
}; };
struct request_queue *scsi_mq_alloc_queue(struct scsi_device *sdev) struct request_queue *scsi_mq_alloc_queue(struct scsi_device *sdev)
......
...@@ -277,6 +277,14 @@ struct scsi_host_template { ...@@ -277,6 +277,14 @@ struct scsi_host_template {
*/ */
int (* change_queue_depth)(struct scsi_device *, int); int (* change_queue_depth)(struct scsi_device *, int);
/*
* This functions lets the driver expose the queue mapping
* to the block layer.
*
* Status: OPTIONAL
*/
int (* map_queues)(struct Scsi_Host *shost);
/* /*
* This function determines the BIOS parameters for a given * This function determines the BIOS parameters for a given
* harddisk. These tend to be numbers that are made up by * harddisk. These tend to be numbers that are made up by
......
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