public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Max Gurtovoy <mgurtovoy@nvidia.com>
To: <linux-nvme@lists.infradead.org>, <hch@lst.de>,
	<kbusch@kernel.org>, <sagi@grimberg.me>
Cc: <chaitanyak@nvidia.com>, <oren@nvidia.com>, <benishay@nvidia.com>,
	<borisp@nvidia.com>, <aviadye@nvidia.com>, <idanb@nvidia.com>,
	<jsmart2021@gmail.com>, Max Gurtovoy <mgurtovoy@nvidia.com>
Subject: [PATCH 1/1 nvmecli] fabrics: add new --skip-cid-gen flag to connect cmd
Date: Mon, 8 Nov 2021 16:46:58 +0200	[thread overview]
Message-ID: <20211108144703.7971-2-mgurtovoy@nvidia.com> (raw)
In-Reply-To: <20211108144703.7971-1-mgurtovoy@nvidia.com>

Setting this flag will enable NVME_QUIRK_SKIP_CID_GEN quirk and will
actually add the ability to ignore the command id generation for other
transport alongside PCI transport that is possible today.

Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
 Documentation/nvme-connect.html | 15 ++++++++++++++-
 fabrics.c                       | 10 ++++++----
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/Documentation/nvme-connect.html b/Documentation/nvme-connect.html
index 8e25db9..d0a53d6 100644
--- a/Documentation/nvme-connect.html
+++ b/Documentation/nvme-connect.html
@@ -767,7 +767,8 @@ nvme-connect(1) Manual Page
                 [--duplicate-connect      | -D]
                 [--disable-sqflow         | -d]
                 [--hdr-digest             | -g]
-                [--data-digest            | -G]</pre>
+                [--data-digest            | -G]
+                [--skip-cid-gen           | -p]</pre>
 <div class="attribution">
 </div></div>
 </div>
@@ -1028,6 +1029,18 @@ cellspacing="0" cellpadding="4">
         Generates/verifies data digest (TCP).
 </p>
 </dd>
+<dt class="hdlist1">
+-p
+</dt>
+<dt class="hdlist1">
+--skip-cid-gen
+</dt>
+<dd>
+<p>
+        Skip command id generation control that was added to protect against buggy
+	fabric controllers.
+</p>
+</dd>
 </dl></div>
 </div>
 </div>
diff --git a/fabrics.c b/fabrics.c
index 012bcb8..02a4108 100644
--- a/fabrics.c
+++ b/fabrics.c
@@ -72,6 +72,7 @@ static const char *nvmf_dup_connect	= "allow duplicate connections between same
 static const char *nvmf_disable_sqflow	= "disable controller sq flow control (default false)";
 static const char *nvmf_hdr_digest	= "enable transport protocol header digest (TCP transport)";
 static const char *nvmf_data_digest	= "enable transport protocol data digest (TCP transport)";
+static const char *nvmf_skip_cid_gen	= "skip command id generation control (default false)";
 static const char *nvmf_config_file	= "Use specified JSON configuration file or 'none' to disable";
 
 #define NVMF_OPTS(c)									\
@@ -93,7 +94,8 @@ static const char *nvmf_config_file	= "Use specified JSON configuration file or
 	OPT_FLAG("duplicate-connect", 'D', &c.duplicate_connect,  nvmf_dup_connect),	\
 	OPT_FLAG("disable-sqflow",    'd', &c.disable_sqflow,     nvmf_disable_sqflow),	\
 	OPT_FLAG("hdr-digest",        'g', &c.hdr_digest,         nvmf_hdr_digest),	\
-	OPT_FLAG("data-digest",       'G', &c.data_digest,        nvmf_data_digest)     \
+	OPT_FLAG("data-digest",       'G', &c.data_digest,        nvmf_data_digest),    \
+	OPT_FLAG("skip-cid-gen",      'p', &c.skip_cid_gen,       nvmf_skip_cid_gen)	\
 
 
 static void space_strip_len(int max, char *str)
@@ -363,7 +365,7 @@ static int discover_from_conf_file(nvme_host_t h, const char *desc,
 		if (!c)
 			goto next;
 		errno = 0;
-		ret = nvmf_add_ctrl(h, c, &cfg, false);
+		ret = nvmf_add_ctrl(h, c, &cfg, false, false);
 		if (!ret) {
 			__discover(c, &cfg, raw, connect,
 				   persistent, flags);
@@ -513,7 +515,7 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect)
 			ret = errno;
 			goto out_free;
 		}
-		ret = nvmf_add_ctrl(h, c, &cfg, false);
+		ret = nvmf_add_ctrl(h, c, &cfg, false, false);
 		if (ret) {
 			nvme_msg(LOG_ERR,
 				 "failed to add controller, error %d\n", errno);
@@ -626,7 +628,7 @@ int nvmf_connect(const char *desc, int argc, char **argv)
 	}
 
 	errno = 0;
-	ret = nvmf_add_ctrl(h, c, &cfg, cfg.disable_sqflow);
+	ret = nvmf_add_ctrl(h, c, &cfg, cfg.disable_sqflow, cfg.skip_cid_gen);
 	if (ret)
 		nvme_msg(LOG_ERR, "no controller found\n");
 out_free:
-- 
2.18.1



  reply	other threads:[~2021-11-08 14:47 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 14:46 [PATCH v1 0/4] Add command id quirk for fabrics Max Gurtovoy
2021-11-08 14:46 ` Max Gurtovoy [this message]
2021-11-08 14:46 ` [PATCH 1/1 libnvme] fabrics: add support for new cli --skip-cid-gen flag Max Gurtovoy
2021-11-08 14:47 ` [PATCH 1/4] nvme-fabrics: add command id quirk for fabrics controllers Max Gurtovoy
2021-11-08 14:47 ` [PATCH 2/4] nvme-rdma: add command id quirk for RDMA controllers Max Gurtovoy
2021-11-08 14:47 ` [PATCH 3/4] nvme-tcp: add command id quirk for TCP controllers Max Gurtovoy
2021-11-08 14:47 ` [PATCH 4/4] nvme-fc: add command id quirk for FC controllers Max Gurtovoy
2021-11-08 16:45 ` [PATCH v1 0/4] Add command id quirk for fabrics Keith Busch
2021-11-09  8:09   ` Christoph Hellwig
2021-11-09 12:08     ` Max Gurtovoy
2021-11-09 13:15       ` Christoph Hellwig
2021-11-09 14:23         ` Max Gurtovoy
2021-11-09 14:31           ` Christoph Hellwig
2021-11-09 16:15             ` Keith Busch
2021-11-09 16:59               ` Max Gurtovoy
2021-11-09 19:04                 ` Keith Busch
2021-11-10 19:45                   ` Sagi Grimberg
2021-11-11  9:29                     ` Max Gurtovoy
2021-11-11 17:36                       ` Keith Busch
2021-11-12 16:07                       ` Sagi Grimberg
2021-11-12 21:37                         ` Keith Busch
2021-11-18 11:19                         ` Max Gurtovoy
2021-11-21 10:05                           ` Sagi Grimberg
2021-11-10 10:32       ` Daniel Wagner
2021-11-10 10:56         ` Max Gurtovoy
2021-11-10 11:18           ` Daniel Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211108144703.7971-2-mgurtovoy@nvidia.com \
    --to=mgurtovoy@nvidia.com \
    --cc=aviadye@nvidia.com \
    --cc=benishay@nvidia.com \
    --cc=borisp@nvidia.com \
    --cc=chaitanyak@nvidia.com \
    --cc=hch@lst.de \
    --cc=idanb@nvidia.com \
    --cc=jsmart2021@gmail.com \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=oren@nvidia.com \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox