From patchwork Fri Mar 27 17:15:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Gurtovoy X-Patchwork-Id: 11462757 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6779E161F for ; Fri, 27 Mar 2020 17:15:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5098F2083E for ; Fri, 27 Mar 2020 17:15:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727393AbgC0RPx (ORCPT ); Fri, 27 Mar 2020 13:15:53 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:44749 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726275AbgC0RPw (ORCPT ); Fri, 27 Mar 2020 13:15:52 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from maxg@mellanox.com) with ESMTPS (AES256-SHA encrypted); 27 Mar 2020 20:15:46 +0300 Received: from mtr-vdi-031.wap.labs.mlnx. (mtr-vdi-031.wap.labs.mlnx [10.209.102.136]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 02RHFjj3004869; Fri, 27 Mar 2020 20:15:46 +0300 From: Max Gurtovoy To: linux-nvme@lists.infradead.org, kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, martin.petersen@oracle.com, jsmart2021@gmail.com, linux-rdma@vger.kernel.org Cc: idanb@mellanox.com, axboe@kernel.dk, maxg@mellanox.com, vladimirk@mellanox.com, oren@mellanox.com, shlomin@mellanox.com, israelr@mellanox.com, jgg@mellanox.com Subject: [PATCH 1/1] nvme-cli/fabrics: Add pi_enable param to connect cmd Date: Fri, 27 Mar 2020 20:15:28 +0300 Message-Id: <20200327171545.98970-2-maxg@mellanox.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200327171545.98970-1-maxg@mellanox.com> References: <20200327171545.98970-1-maxg@mellanox.com> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Israel Rukshin Added 'pi_enable' to 'connect' command so users can enable metadata support. usage examples: nvme connect --pi_enable --transport=rdma --traddr=10.0.1.1 --nqn=test-nvme nvme connect -p -t rdma -a 10.0.1.1 -n test_nvme Signed-off-by: Israel Rukshin Reviewed-by: Max Gurtovoy --- fabrics.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/fabrics.c b/fabrics.c index a112f76..1b5b3f7 100644 --- a/fabrics.c +++ b/fabrics.c @@ -78,6 +78,7 @@ static struct config { int disable_sqflow; int hdr_digest; int data_digest; + int pi_enable; bool persistent; bool quiet; } cfg = { NULL }; @@ -851,7 +852,9 @@ static int build_options(char *argstr, int max_len, bool discover) add_bool_argument(&argstr, &max_len, "disable_sqflow", cfg.disable_sqflow) || add_bool_argument(&argstr, &max_len, "hdr_digest", cfg.hdr_digest) || - add_bool_argument(&argstr, &max_len, "data_digest", cfg.data_digest)) + add_bool_argument(&argstr, &max_len, "data_digest", + cfg.data_digest) || + add_bool_argument(&argstr, &max_len, "pi_enable", cfg.pi_enable)) return -EINVAL; return 0; @@ -980,6 +983,13 @@ retry: p += len; } + if (cfg.pi_enable) { + len = sprintf(p, ",pi_enable"); + if (len < 0) + return -EINVAL; + p += len; + } + switch (e->trtype) { case NVMF_TRTYPE_RDMA: case NVMF_TRTYPE_TCP: @@ -1259,6 +1269,7 @@ int discover(const char *desc, int argc, char **argv, bool connect) OPT_INT("tos", 'T', &cfg.tos, "type of service"), OPT_FLAG("hdr_digest", 'g', &cfg.hdr_digest, "enable transport protocol header digest (TCP transport)"), OPT_FLAG("data_digest", 'G', &cfg.data_digest, "enable transport protocol data digest (TCP transport)"), + OPT_FLAG("pi_enable", 'p', &cfg.pi_enable, "enable metadata (T10-PI) support (default false)"), OPT_INT("nr-io-queues", 'i', &cfg.nr_io_queues, "number of io queues to use (default is core count)"), OPT_INT("nr-write-queues", 'W', &cfg.nr_write_queues, "number of write queues to use (default 0)"), OPT_INT("nr-poll-queues", 'P', &cfg.nr_poll_queues, "number of poll queues to use (default 0)"), @@ -1319,6 +1330,7 @@ int connect(const char *desc, int argc, char **argv) OPT_FLAG("disable-sqflow", 'd', &cfg.disable_sqflow, "disable controller sq flow control (default false)"), OPT_FLAG("hdr-digest", 'g', &cfg.hdr_digest, "enable transport protocol header digest (TCP transport)"), OPT_FLAG("data-digest", 'G', &cfg.data_digest, "enable transport protocol data digest (TCP transport)"), + OPT_FLAG("pi_enable", 'p', &cfg.pi_enable, "enable metadata (T10-PI) support (default false)"), OPT_END() };