From patchwork Wed Nov 13 13:36:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 179305 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp9615055ilf; Wed, 13 Nov 2019 05:40:47 -0800 (PST) X-Google-Smtp-Source: APXvYqwWYaTcrWCRfHwpYEQlhzO+Pi4fLysf8CEuum3xC3jn5vHFAZctS+Av4mHcFSRz3zC3lzSd X-Received: by 2002:a17:906:4e94:: with SMTP id v20mr2854257eju.34.1573652447178; Wed, 13 Nov 2019 05:40:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573652447; cv=none; d=google.com; s=arc-20160816; b=y/jRk+3SczllfVw2r94HxROGbeNNMVOYoScERlD6XJgGSYWNqRbrLxWGDLUgionXdK 7xj8el9nY0CRphN6st3jqEZRq2tFAYgopH7VniWQg5cLBJr9zWJU7U/nE74xm8F+pdbr KBEL4cP+3lXPwQfKl7/j6+FG/vxlnUxPhivAgyW0l8hukHoCdmnLER5QbXw7S/mphFky dzfafEuljmF4Zu64qxXmXl3B5Lw5Efm27d7aVNR2tbBbP1A21TW+RR3lICXNOW9vRFsm OOzfZ5Pc9Bp/9qj6/XC3gM6GDKGRqVxhHdr55Uogzayl5pilulk7yW7sfElgDmzvmqWK Qnew== 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=pa+UojXsgOcnEvt+pwuVWt6ZpiCjbrlAnHh919AvFAo=; b=W18sadEIRMdCksibC1bkLUqc4gMwFANOK+OfDYFIeUEmZu5DA4BlN5hFxaEKOv+9xX yNpSug/hCSmfF+WEHeGSh35P5luegtbIqU9kQYanVdJ8qjPK3joz7mrqnyV+0vKR9TZR Sev340i3B5e5gXKd4+03GTvC+vui4j55itERjih8YtHiu5n4Hs/60b2t7l7SfEM8wG9L t0zdSXkSPRjaGdejKr+oDX8HWsL7HSBYHZ3pUEpVmxycIYyyDNId8QaRr8a+N8Wmg7hM aH5vI9Kq55tEa9ZxccqT7VD3deiz6kA/4710ItkGzsLAZ3rssZuzJu8cf09LwZc77dsT NhrA== 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 f10si1173263ejq.289.2019.11.13.05.40.46; Wed, 13 Nov 2019 05:40:47 -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 S1727506AbfKMNka (ORCPT + 26 others); Wed, 13 Nov 2019 08:40:30 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:6655 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727032AbfKMNk3 (ORCPT ); Wed, 13 Nov 2019 08:40:29 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 380F8FEA690509FB509C; Wed, 13 Nov 2019 21:40:24 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.439.0; Wed, 13 Nov 2019 21:40:16 +0800 From: John Garry To: , , CC: , , , , , , , John Garry Subject: [PATCH RFC 4/5] scsi: Add template flag 'host_tagset' Date: Wed, 13 Nov 2019 21:36:48 +0800 Message-ID: <1573652209-163505-5-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1573652209-163505-1-git-send-email-john.garry@huawei.com> References: <1573652209-163505-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 dc210b9d4896..4baa5c01a0bc 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1900,6 +1900,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 2c3f0c58869b..a90d7e38366b 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. */