Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp858571ybh; Tue, 10 Mar 2020 09:33:07 -0700 (PDT) X-Google-Smtp-Source: ADFU+vst/xDjbZp2EfoI4SjMvVE8284jAVyTHVRXPpD/U9NXma8zDX2QQGR972kCd+0ots3jBD5h X-Received: by 2002:a9d:7d91:: with SMTP id j17mr17879022otn.218.1583857987409; Tue, 10 Mar 2020 09:33:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583857987; cv=none; d=google.com; s=arc-20160816; b=GETEm+cc8mJGfAvhbGGj7Bt+cCP/UIM3hoxHsIMF7zQ8OR8PzG3LXkrKuDoh2g5FVy NimFm9PISF+OOMQP7MB3bm3CBHzosqTfAV37bLwFM9DpR2XRzZ6gmhLn4gZAOMmAkMLz RvdAhjS7FWUi8RrGw9oNbrnvSoqf2d9RLQR3Be3Kn6G5GDUnOh2TjQk9jQkY5UDUJAvb tPwzM1yqdNNj2rU+RklFIkOUcLp/BF88UfzWI1kCd1XHNRyvbUgeVVAZNpsQAvlKWDqp kw/bVGHtSlRIc+0OdSI6rcitxT+slge7rTh0LohtEMuuI1jVn7qxVmdvdZyQGvzG1XiQ k1/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=u4ycKCFA0zIsYOOViq/n6PHn5/E+2wd/0LKAImE6c9k=; b=v4SaDGjBzmQGpYMdJMZT2RjJOokKfUIefwrXccjOYFfwq7L+mEn/iAdIXtYTATelGF StX1IX5urIKLiSBGULUrCyUPt3didm85NpKtoZQyc/NMJD1GfruwHJO7pGlwgDgGb0Yf Wnz8zAvuRz60lUuiej3Od+JjJxkpZz08iyFFeQljMgPH4kJZUBMk6MbDUzHqNmQFs1qO tEoxpuD+YGw5rpVilc/TZ9ud3QYGRrVnuddb8JjSbxR2WZcUMOTPAlyukfuFaG5heI7b D+f9e+3h3Xx0YesNj8SpRcVEEAL4WNrPK64YOVp8qcAc+Nrj2NdXUIwA8PNanE0sHDdy 9NSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si6087586otq.257.2020.03.10.09.32.55; Tue, 10 Mar 2020 09:33:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726898AbgCJQak (ORCPT + 99 others); Tue, 10 Mar 2020 12:30:40 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:35482 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726703AbgCJQaj (ORCPT ); Tue, 10 Mar 2020 12:30:39 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id B99CE405C853ED6677D0; Wed, 11 Mar 2020 00:30:33 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Wed, 11 Mar 2020 00:30:24 +0800 From: John Garry To: , , , , , , CC: , , , , , , Hannes Reinecke Subject: [PATCH RFC v2 01/24] scsi: add 'nr_reserved_cmds' field to the SCSI host template Date: Wed, 11 Mar 2020 00:25:27 +0800 Message-ID: <1583857550-12049-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1583857550-12049-1-git-send-email-john.garry@huawei.com> References: <1583857550-12049-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hannes Reinecke Add a new field 'nr_reserved_cmds' to the SCSI host template to instruct the block layer to set aside a tag space for reserved commands. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_lib.c | 1 + include/scsi/scsi_host.h | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 610ee41fa54c..2967325df7a0 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1896,6 +1896,7 @@ int scsi_mq_setup_tags(struct Scsi_Host *shost) shost->tag_set.ops = &scsi_mq_ops_no_commit; 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->nr_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; diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index f577647bf5f2..3f860c8ad623 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -599,6 +599,12 @@ struct Scsi_Host { * is nr_hw_queues * can_queue. */ unsigned nr_hw_queues; + + /* + * Number of reserved commands, if any. + */ + unsigned nr_reserved_cmds; + unsigned active_mode:2; unsigned unchecked_isa_dma:1; -- 2.17.1