From patchwork Wed Jun 10 17:29:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 187765 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp688444ilo; Wed, 10 Jun 2020 10:33:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9wOInRcPke9ru9BvxLBbTYgaVb0Xw7G3GCV/VvyzEK8Z75eYmE9YUP9DIx7Jea5/m6aCJ X-Received: by 2002:a17:906:8253:: with SMTP id f19mr4590864ejx.470.1591810421564; Wed, 10 Jun 2020 10:33:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591810421; cv=none; d=google.com; s=arc-20160816; b=KwlVnCWExG9rHYWUl2Iah1I07u+/SFk5u8fSvbV4+EQzhySsSSuiyZC8LN8lBwgrfn Utrf9qIrWOOBavOY6VzDTj8u1UMkAT8R3JTrz7VeJt3FFzDKtWjEW/cuuYnERXwudiG3 ldfHQJcncV93j/KYphaaMxbfaI1IBQM2rr71f1CrMJsIgQ3RniAuN/S/lmfrMcTwTV6Y tfKTsM1onKuDX/ykESHSrJIsDPgMZC/2n9mmBiZnS/o3J/b7itn8nv44RetY3V67p5ck L77Oe4SLmcGV2gJ1SaXhpTHoIdP4J3ZJEszSC+ltjk7gUpzNxM295wL5/zuR0lGSon2S naAg== 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=tpkt9faVvgpXZAXhFZNIMDwfXwsxQkEKZNaZQuhWAgw=; b=mQJXJd0xt5O/tjOQ2TRz8KG5pYLYByEZ3zCVWwbPS7XKZzqQvZft693EUD9EQ4KNDa 39NZ6fYIaVt+zf/bn8IWSY7clj0/1kG3S+XOAOZAaMh+ppP3VSiheV7HCg+lkyLuALu1 yJQuS/oWSZE6lG3G72FM9Y0C4l4c5qdqfcXh+7uV73PQivA0OOYfjCVZyQ2iSD3AuNnp pxyQ7Dvxb17+Va4dwr83MbqUdUSxKIBqlku37HppDKsYXhZpchM0Sz0EVSZdL5GaJn+/ X1vmM+nMm6sVj1tnCui/JwLjKOKs5FYfXldiyiHjGW767KXX+xJ0wD/gnXktAH7ZSlK4 jzvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oz26si430501ejb.252.2020.06.10.10.33.41 for ; Wed, 10 Jun 2020 10:33:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727052AbgFJRdj (ORCPT ); Wed, 10 Jun 2020 13:33:39 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5814 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726794AbgFJRdg (ORCPT ); Wed, 10 Jun 2020 13:33:36 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 4331E5A829A4F59AED6D; Thu, 11 Jun 2020 01:33:27 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Thu, 11 Jun 2020 01:33:20 +0800 From: John Garry To: , , , , , , , , , , CC: , , , , , John Garry Subject: [PATCH RFC v7 08/12] scsi: Add template flag 'host_tagset' Date: Thu, 11 Jun 2020 01:29:15 +0800 Message-ID: <1591810159-240929-9-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1591810159-240929-1-git-send-email-john.garry@huawei.com> References: <1591810159-240929-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Hannes Reinecke 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 jpg: Update comment on can_queue Signed-off-by: John Garry --- drivers/scsi/scsi_lib.c | 2 ++ include/scsi/scsi_host.h | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) -- 2.26.2 diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 0ba7a65e7c8d..0652acdcec22 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1894,6 +1894,8 @@ int scsi_mq_setup_tags(struct Scsi_Host *shost) tag_set->flags |= BLK_ALLOC_POLICY_TO_MQ_FLAG(shost->hostt->tag_alloc_policy); tag_set->driver_data = shost; + if (shost->hostt->host_tagset) + tag_set->flags |= BLK_MQ_F_TAG_HCTX_SHARED; return blk_mq_alloc_tag_set(tag_set); } diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 46ef8cccc982..9b7e333a681d 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -436,6 +436,9 @@ struct scsi_host_template { /* True if the controller does not support WRITE SAME */ unsigned no_write_same:1; + /* True if the host uses host-wide tagspace */ + unsigned host_tagset:1; + /* * Countdown for host blocking with no commands outstanding. */ @@ -603,7 +606,8 @@ struct Scsi_Host { * * Note: it is assumed that each hardware queue has a queue depth of * can_queue. In other words, the total queue depth per host - * is nr_hw_queues * can_queue. + * is nr_hw_queues * can_queue. However, for when host_tagset is set, + * the total queue depth is can_queue. */ unsigned nr_hw_queues; unsigned active_mode:2;