From patchwork Tue Nov 19 14:27:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 179767 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp715389ilf; Tue, 19 Nov 2019 06:31:23 -0800 (PST) X-Google-Smtp-Source: APXvYqy/wT7MXSCHD9B/Sl3ugkobOWCbLeGHgFEn1NllrEOis3Rhs7fvEhwmg2D8uukkMoAEzU60 X-Received: by 2002:a05:6512:146:: with SMTP id m6mr4080670lfo.98.1574173883465; Tue, 19 Nov 2019 06:31:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574173883; cv=none; d=google.com; s=arc-20160816; b=0s9Q8BlWR1NIA3vAAwMbn3P1DI94uxWuFHrvHc8WZp8y6WwTmdHLxskqCikdPFp+B+ ply+egiHfKDMH49bHj15wBvEDKIRlFKxz/hHMVRazOSZ3OMialjwCTbgXoX91ZiHOsUZ iQHcR0YnB+KSm65G/Mbegns756jjzPptBtZJ9cah/C692GHldG5BNSPriI2QeFQqulKL 5bKlGbumWrHlMT11IPvLJSTqBsZme0zbJ7MgsfXlByDygz6dXgKBbRhijhKAIiUcntc6 5QsKueSkRnoVI/P3UXx1u8OhTw23R6mAdyO9mEG2C6i1q0EUcdyt/bMPhzoRlkzInDni mPbg== 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=VnGhRRzBLcnY7T0uhqJF0k8Y8V9UtLIdQ/C/jGhYAnE=; b=GmfV+dr+gV+Z8rpl9IA0Wr92QCc3w/+dS/yuFjum+jKRUsdGzasVy2OCKiWFtOe6P1 Bfi1KNOgEoJ5e2mdC8irEceUL+tc8YkL42NPh9RDcR0a+0eyxddw6ckNMmY/n7ZZCPzA BpxcV9HSb6qLv6afavYZyueddi/0FHuqlvV2sM+k0jbMj7Lab6DN1Ts6B7/oibp8t2I/ 9t9QCQCyLLWefbhz4JdJSeTR3yYUGBz8nVt4GVWyFv9LX2OyBkTDKCUZTN7w6Y9pYG8C oRqIYnFbCPyFHs8AiPmRj8/+WqsL8Cl/DOzIPf3PJGC/sro+zQIXB0B4jEhMTUUa7Oaz 4c4A== 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 f8si15918359edf.428.2019.11.19.06.31.23; Tue, 19 Nov 2019 06:31:23 -0800 (PST) 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 S1728190AbfKSObV (ORCPT + 26 others); Tue, 19 Nov 2019 09:31:21 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7145 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728106AbfKSObS (ORCPT ); Tue, 19 Nov 2019 09:31:18 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id AB283207C2B6DCE093D8; Tue, 19 Nov 2019 22:31:08 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Tue, 19 Nov 2019 22:30:59 +0800 From: John Garry To: , , CC: , , , , , , , John Garry Subject: [PATCH RFC V2 4/5] scsi: Add template flag 'host_tagset' Date: Tue, 19 Nov 2019 22:27:37 +0800 Message-ID: <1574173658-76818-5-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1574173658-76818-1-git-send-email-john.garry@huawei.com> References: <1574173658-76818-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 Signed-off-by: John Garry --- drivers/scsi/scsi_lib.c | 2 ++ include/scsi/scsi_host.h | 3 +++ 2 files changed, 5 insertions(+) -- 2.17.1 diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 5447738906ac..97c9352f2d16 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1901,6 +1901,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 31e0d6ca1eba..08299aeb822d 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. */