[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1573652209-163505-5-git-send-email-john.garry@huawei.com>
Date: Wed, 13 Nov 2019 21:36:48 +0800
From: John Garry <john.garry@...wei.com>
To: <axboe@...nel.dk>, <jejb@...ux.ibm.com>,
<martin.petersen@...cle.com>
CC: <linux-block@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-scsi@...r.kernel.org>, <ming.lei@...hat.com>,
<hare@...e.com>, <bvanassche@....org>, <chenxiang66@...ilicon.com>,
John Garry <john.garry@...wei.com>
Subject: [PATCH RFC 4/5] scsi: Add template flag 'host_tagset'
From: Hannes Reinecke <hare@...e.com>
Add a host template flag 'host_tagset' so hostwide tagset can be
shared on multiple reply queues after the SCSI device's reply queue
is converted to blk-mq hw queue.
Signed-off-by: Hannes Reinecke <hare@...e.com>
Signed-off-by: John Garry <john.garry@...wei.com>
---
drivers/scsi/scsi_lib.c | 2 ++
include/scsi/scsi_host.h | 3 +++
2 files changed, 5 insertions(+)
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index dc210b9d4896..4baa5c01a0bc 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1900,6 +1900,8 @@ int scsi_mq_setup_tags(struct Scsi_Host *shost)
shost->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
shost->tag_set.flags |=
BLK_ALLOC_POLICY_TO_MQ_FLAG(shost->hostt->tag_alloc_policy);
+ if (shost->hostt->host_tagset)
+ shost->tag_set.flags |= BLK_MQ_F_TAG_HCTX_SHARED;
shost->tag_set.driver_data = shost;
return blk_mq_alloc_tag_set(&shost->tag_set);
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 2c3f0c58869b..a90d7e38366b 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -442,6 +442,9 @@ struct scsi_host_template {
/* True if the low-level driver supports blk-mq only */
unsigned force_blk_mq:1;
+ /* True if the host uses host-wide tagspace */
+ unsigned host_tagset:1;
+
/*
* Countdown for host blocking with no commands outstanding.
*/
--
2.17.1
Powered by blists - more mailing lists