From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hannes Reinecke Subject: [PATCHv2 10/11] scsi: allocate reserved commands Date: Fri, 17 Feb 2017 09:23:09 +0100 Message-ID: <1487319790-97340-11-git-send-email-hare@suse.de> References: <1487319790-97340-1-git-send-email-hare@suse.de> Return-path: Received: from mx2.suse.de ([195.135.220.15]:34708 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755389AbdBQIXX (ORCPT ); Fri, 17 Feb 2017 03:23:23 -0500 In-Reply-To: <1487319790-97340-1-git-send-email-hare@suse.de> Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: "Martin K. Petersen" Cc: Christoph Hellwig , James Bottomley , Sreekanth Reddy , Kashyap Desai , Sathya Prakash , linux-scsi@vger.kernel.org, Hannes Reinecke , Hannes Reinecke The block layer already has the notion of 'reserved' commands, so we should be enabling hosts to allocate them. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_lib.c | 1 + include/scsi/scsi_host.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index c35b6de..9d6aed5 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2129,6 +2129,7 @@ int scsi_mq_setup_tags(struct Scsi_Host *shost) shost->tag_set.ops = &scsi_mq_ops; shost->tag_set.nr_hw_queues = shost->nr_hw_queues ? : 1; shost->tag_set.queue_depth = shost->can_queue; + shost->tag_set.reserved_tags = shost->reserved_cmds; shost->tag_set.cmd_size = cmd_size; shost->tag_set.numa_node = NUMA_NO_NODE; shost->tag_set.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_SG_MERGE; diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 36680f1..cc83dd6 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -622,6 +622,7 @@ struct Scsi_Host { int this_id; int can_queue; + int reserved_cmds; short cmd_per_lun; short unsigned int sg_tablesize; short unsigned int sg_prot_tablesize; -- 1.8.5.6