From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Ming Lei To: Jens Axboe , linux-block@vger.kernel.org, Christoph Hellwig , Mike Snitzer Cc: linux-scsi@vger.kernel.org, Hannes Reinecke , Arun Easi , Omar Sandoval , "Martin K . Petersen" , James Bottomley , Christoph Hellwig , Don Brace , Kashyap Desai , Peter Rivera , Paolo Bonzini , Laurence Oberman , Hannes Reinecke , Ming Lei Subject: [PATCH V2 3/8] scsi: Add template flag 'host_tagset' Date: Mon, 5 Feb 2018 23:20:30 +0800 Message-Id: <20180205152035.15016-4-ming.lei@redhat.com> In-Reply-To: <20180205152035.15016-1-ming.lei@redhat.com> References: <20180205152035.15016-1-ming.lei@redhat.com> List-ID: From: Hannes Reinecke Add a host template flag 'host_tagset' to enable the use of a global tagset for block-mq. Cc: Hannes Reinecke Cc: Arun Easi Cc: Omar Sandoval , Cc: "Martin K. Petersen" , Cc: James Bottomley , Cc: Christoph Hellwig , Cc: Don Brace Cc: Kashyap Desai Cc: Peter Rivera Cc: Paolo Bonzini Cc: Mike Snitzer Tested-by: Laurence Oberman Signed-off-by: Hannes Reinecke Signed-off-by: Ming Lei --- 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 55be2550c555..9ab74ac634ea 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2274,6 +2274,8 @@ int scsi_mq_setup_tags(struct Scsi_Host *shost) shost->tag_set.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_SG_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_GLOBAL_TAGS; 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 a8b7bf879ced..f6623f887ee4 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -457,6 +457,9 @@ struct scsi_host_template { */ unsigned int max_host_blocked; + /* True if the host supports a host-wide tagspace */ + unsigned host_tagset:1; + /* * Default value for the blocking. If the queue is empty, * host_blocked counts down in the request_fn until it restarts -- 2.9.5