From patchwork Tue Apr 4 12:07:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 9661457 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 601E7602B9 for ; Tue, 4 Apr 2017 12:08:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 516E528502 for ; Tue, 4 Apr 2017 12:08:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4612B28503; Tue, 4 Apr 2017 12:08:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03393284FA for ; Tue, 4 Apr 2017 12:08:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752204AbdDDMIP (ORCPT ); Tue, 4 Apr 2017 08:08:15 -0400 Received: from mx2.suse.de ([195.135.220.15]:50240 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752545AbdDDMIN (ORCPT ); Tue, 4 Apr 2017 08:08:13 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2ABC1ABA2; Tue, 4 Apr 2017 12:08:12 +0000 (UTC) From: Hannes Reinecke To: Jens Axboe Cc: Omar Sandoval , "Martin K. Petersen" , James Bottomley , Christoph Hellwig , Bart van Assche , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, Hannes Reinecke , Hannes Reinecke Subject: [PATCH 2/2] scsi: Add template flag 'host_tagset' Date: Tue, 4 Apr 2017 14:07:45 +0200 Message-Id: <1491307665-47656-3-git-send-email-hare@suse.de> X-Mailer: git-send-email 1.8.5.6 In-Reply-To: <1491307665-47656-1-git-send-email-hare@suse.de> References: <1491307665-47656-1-git-send-email-hare@suse.de> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a host template flag 'host_tagset' to enable the use of a global tagmap for block-mq. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_lib.c | 2 ++ include/scsi/scsi_host.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index ba22866..00036cb 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2193,6 +2193,8 @@ int scsi_mq_setup_tags(struct Scsi_Host *shost) 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; + if (shost->hostt->host_tagset) + shost->tag_set.flags |= BLK_MQ_F_GLOBAL_TAGS; shost->tag_set.flags |= BLK_ALLOC_POLICY_TO_MQ_FLAG(shost->hostt->tag_alloc_policy); shost->tag_set.driver_data = shost; diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 3cd8c3b..dff3ec1 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -457,6 +457,11 @@ struct scsi_host_template { unsigned no_async_abort:1; /* + * True if the host supports a host-wide tagspace + */ + unsigned host_tagset:1; + + /* * Countdown for host blocking with no commands outstanding. */ unsigned int max_host_blocked;