From patchwork Tue Dec 11 23:35:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 10725259 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7C69417FE for ; Tue, 11 Dec 2018 23:35:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C7A02B5D7 for ; Tue, 11 Dec 2018 23:35:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5FAB02B737; Tue, 11 Dec 2018 23:35:31 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 EEFF12B5D7 for ; Tue, 11 Dec 2018 23:35:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726227AbeLKXfa (ORCPT ); Tue, 11 Dec 2018 18:35:30 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:56606 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726229AbeLKXf3 (ORCPT ); Tue, 11 Dec 2018 18:35:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=LL1dS1qTTUl9WO8m3Sk44J2lSK4k++Yl0Zt60QAejPo=; b=E8ydGBoSEDwJxWVlia7sjD9ev wkV5nAiA0obW7imtoo4WAG0JhQqxDzzCQ8j6WTsAnKhsCZ5uE6rxqx/nuR98DVUsrNkh1tm5S9paM KfC0hnG23HEqqV+La3QSCos2UGcJ0Fc2YZRVwVMUYIaf4INbHUBpUqGDPcUP0mFi0CyofpXfj8IWN jr72zBQKOqmEt45xYbdL33CGgvCV2ei+tWHU1nw1VHDlDzxPGeTEt/H+nBUoAy1Zsx4DkEeVppmGp yTCDc9/DCgPQg4fSD8t/zoOjPLwSlxeP7t18sALaNPCVcdrEdEPm6NMvj0XrnJdzE2JwwCOrZRMix dlLVeobIw==; Received: from [2600:1700:65a0:78e0:514:7862:1503:8e4d] (helo=sagi-Latitude-E7470.lbits) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWrYi-0002L4-5G; Tue, 11 Dec 2018 23:35:24 +0000 From: Sagi Grimberg To: linux-nvme@lists.infradead.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Keith Busch Subject: [PATCH v2 nvme-cli 6/5] fabrics: pass in number of write queues Date: Tue, 11 Dec 2018 15:35:19 -0800 Message-Id: <20181211233519.9350-7-sagi@grimberg.me> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181211233519.9350-1-sagi@grimberg.me> References: <20181211233519.9350-1-sagi@grimberg.me> 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 nr_write_queues specifies the number of additional queues that will be connected. These queues will host write I/O (host to target payload) while nr_io_queues will host read I/O (target to host payload). Signed-off-by: Sagi Grimberg --- Documentation/nvme-connect.txt | 5 +++++ fabrics.c | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/Documentation/nvme-connect.txt b/Documentation/nvme-connect.txt index af78b2a8238f..d4a0e6678475 100644 --- a/Documentation/nvme-connect.txt +++ b/Documentation/nvme-connect.txt @@ -16,6 +16,7 @@ SYNOPSIS [--host-traddr= | -w ] [--hostnqn= | -q ] [--nr-io-queues=<#> | -i <#>] + [--nr-write-queues=<#> | -W <#>] [--queue-size=<#> | -Q <#>] [--keep-alive-tmo=<#> | -k <#>] [--reconnect-delay=<#> | -c <#>] @@ -75,6 +76,10 @@ OPTIONS --nr-io-queues=<#>:: Overrides the default number of I/O queues create by the driver. +-W <#>:: +--nr-write-queues=<#>:: + Adds additional queues that will be used for write I/O. + -Q <#>:: --queue-size=<#>:: Overrides the default number of elements in the I/O queues created diff --git a/fabrics.c b/fabrics.c index 93f3410a1c72..bc6a0b7e4e21 100644 --- a/fabrics.c +++ b/fabrics.c @@ -53,6 +53,7 @@ static struct config { char *hostnqn; char *hostid; int nr_io_queues; + int nr_write_queues; int queue_size; int keep_alive_tmo; int reconnect_delay; @@ -621,6 +622,8 @@ static int build_options(char *argstr, int max_len) add_argument(&argstr, &max_len, "hostid", cfg.hostid)) || add_int_argument(&argstr, &max_len, "nr_io_queues", cfg.nr_io_queues) || + add_int_argument(&argstr, &max_len, "nr_write_queues", + cfg.nr_write_queues) || add_int_argument(&argstr, &max_len, "queue_size", cfg.queue_size) || add_int_argument(&argstr, &max_len, "keep_alive_tmo", cfg.keep_alive_tmo) || @@ -694,6 +697,13 @@ retry: p += len; } + if (cfg.nr_write_queues) { + len = sprintf(p, ",nr_write_queues=%d", cfg.nr_write_queues); + if (len < 0) + return -EINVAL; + p += len; + } + if (cfg.host_traddr) { len = sprintf(p, ",host_traddr=%s", cfg.host_traddr); if (len < 0) @@ -1009,6 +1019,7 @@ int connect(const char *desc, int argc, char **argv) {"hostnqn", 'q', "LIST", CFG_STRING, &cfg.hostnqn, required_argument, "user-defined hostnqn" }, {"hostid", 'I', "LIST", CFG_STRING, &cfg.hostid, required_argument, "user-defined hostid (if default not used)"}, {"nr-io-queues", 'i', "LIST", CFG_INT, &cfg.nr_io_queues, required_argument, "number of io queues to use (default is core count)" }, + {"nr-write-queues", 'W', "LIST", CFG_INT, &cfg.nr_write_queues, required_argument, "number of write queues to use (default 0)" }, {"queue-size", 'Q', "LIST", CFG_INT, &cfg.queue_size, required_argument, "number of io queue elements to use (default 128)" }, {"keep-alive-tmo", 'k', "LIST", CFG_INT, &cfg.keep_alive_tmo, required_argument, "keep alive timeout period in seconds" }, {"reconnect-delay", 'c', "LIST", CFG_INT, &cfg.reconnect_delay, required_argument, "reconnect timeout period in seconds" },