public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Max Gurtovoy <mgurtovoy@nvidia.com>
To: <kbusch@kernel.org>, <hch@lst.de>, <sagi@grimberg.me>,
	<linux-nvme@lists.infradead.org>
Cc: <oren@nvidia.com>, <israelr@nvidia.com>, <dwagner@suse.de>,
	<oevron@nvidia.com>
Subject: [PATCH 7/8] nvme-fabrics: add option to disallow T10-PI offload
Date: Mon, 22 Jan 2024 16:56:58 +0200	[thread overview]
Message-ID: <20240122145659.5574-8-mgurtovoy@nvidia.com> (raw)
In-Reply-To: <20240122145659.5574-1-mgurtovoy@nvidia.com>

From: Israel Rukshin <israelr@nvidia.com>

Today, T10-PI offload is supported only by nvme-rdma, but nothing
prevents other transports reusing the concept, so do not associate
with rdma transport solely. The flag disallows T10-PI offload, so
users can save system resources and allow a more flexible
configuration.

Signed-off-by: Israel Rukshin <israelr@nvidia.com>
Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
 drivers/nvme/host/fabrics.c | 7 +++++++
 drivers/nvme/host/fabrics.h | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index aa88606a44c4..046f5a466576 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -673,6 +673,9 @@ static const match_table_t opt_tokens = {
 #endif
 #ifdef CONFIG_NVME_TCP_TLS
 	{ NVMF_OPT_TLS,			"tls"			},
+#endif
+#ifdef CONFIG_BLK_DEV_INTEGRITY
+	{ NVMF_OPT_DISALLOW_PI,		"disallow_pi"		},
 #endif
 	{ NVMF_OPT_ERR,			NULL			}
 };
@@ -702,6 +705,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
 	opts->tls = false;
 	opts->tls_key = NULL;
 	opts->keyring = NULL;
+	opts->disallow_pi = false;
 
 	options = o = kstrdup(buf, GFP_KERNEL);
 	if (!options)
@@ -915,6 +919,9 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
 		case NVMF_OPT_DATA_DIGEST:
 			opts->data_digest = true;
 			break;
+		case NVMF_OPT_DISALLOW_PI:
+			opts->disallow_pi = true;
+			break;
 		case NVMF_OPT_NR_WRITE_QUEUES:
 			if (match_int(args, &token)) {
 				ret = -EINVAL;
diff --git a/drivers/nvme/host/fabrics.h b/drivers/nvme/host/fabrics.h
index fbaee5a7be19..cd0140a2abe7 100644
--- a/drivers/nvme/host/fabrics.h
+++ b/drivers/nvme/host/fabrics.h
@@ -73,6 +73,7 @@ enum {
 	NVMF_OPT_TLS		= 1 << 25,
 	NVMF_OPT_KEYRING	= 1 << 26,
 	NVMF_OPT_TLS_KEY	= 1 << 27,
+	NVMF_OPT_DISALLOW_PI	= 1 << 28,
 };
 
 /**
@@ -115,6 +116,7 @@ enum {
  * @nr_poll_queues: number of queues for polling I/O
  * @tos: type of service
  * @fast_io_fail_tmo: Fast I/O fail timeout in seconds
+ * @disallow_pi: Disallow metadata (T10-PI) offload support
  */
 struct nvmf_ctrl_options {
 	unsigned		mask;
@@ -140,6 +142,7 @@ struct nvmf_ctrl_options {
 	bool			disable_sqflow;
 	bool			hdr_digest;
 	bool			data_digest;
+	bool			disallow_pi;
 	unsigned int		nr_write_queues;
 	unsigned int		nr_poll_queues;
 	int			tos;
-- 
2.18.1



  parent reply	other threads:[~2024-01-22 14:58 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22 14:56 [PATCH v1 0/8] Enforce uniform metadata settings for ns head Max Gurtovoy
2024-01-22 14:56 ` [PATCH 1/8] nvme: use Independent ID-NS only for unknown cmd sets Max Gurtovoy
2024-01-23  8:58   ` Christoph Hellwig
2024-01-22 14:56 ` [PATCH 2/8] nvme: set uniform metadata settings for ns head Max Gurtovoy
2024-01-23  9:01   ` Christoph Hellwig
2024-01-22 14:56 ` [PATCH 3/8] nvme: allocate a new namespace if validation fail Max Gurtovoy
2024-01-23  9:02   ` Christoph Hellwig
2024-01-22 14:56 ` [PATCH 4/8] nvme: add nvme_queue_scan_sync helper Max Gurtovoy
2024-01-22 14:56 ` [PATCH 5/8] nvme: sync the namespace scanning during ctrl start Max Gurtovoy
2024-01-23  9:02   ` Christoph Hellwig
2024-01-24  0:47     ` Max Gurtovoy
2024-01-24  9:48       ` Christoph Hellwig
2024-01-24 10:23         ` Max Gurtovoy
2024-01-25 14:41           ` Christoph Hellwig
2024-01-25 15:55             ` Max Gurtovoy
2024-01-29 10:48               ` Sagi Grimberg
2024-01-29 12:37                 ` Max Gurtovoy
2024-01-31 12:40                   ` Sagi Grimberg
2024-01-31 13:10                     ` Christoph Hellwig
2024-01-24 12:58   ` Sagi Grimberg
2024-01-24 13:04     ` Max Gurtovoy
2024-01-24 13:10       ` Sagi Grimberg
2024-01-24 13:17         ` Max Gurtovoy
2024-01-24 13:54           ` Sagi Grimberg
2024-01-24 14:15             ` Max Gurtovoy
2024-01-22 14:56 ` [PATCH 6/8] nvme-rdma: Fix transfer length when write_generate/read_verify are 0 Max Gurtovoy
2024-01-23  9:02   ` Christoph Hellwig
2024-01-22 14:56 ` Max Gurtovoy [this message]
2024-01-22 15:13   ` [PATCH 7/8] nvme-fabrics: add option to disallow T10-PI offload Daniel Wagner
2024-01-22 15:17     ` Max Gurtovoy
2024-01-22 15:27       ` Daniel Wagner
2024-01-22 15:28         ` Daniel Wagner
2024-01-23  9:04           ` Christoph Hellwig
2024-02-01 10:40             ` Israel Rukshin
     [not found]             ` <fdd1c81f-caf3-4f34-96e8-f4d8ffc26203@nvidia.com>
2024-02-13  7:16               ` Christoph Hellwig
2024-01-22 14:56 ` [PATCH 8/8] nvme-rdma: enable user " Max Gurtovoy

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=20240122145659.5574-8-mgurtovoy@nvidia.com \
    --to=mgurtovoy@nvidia.com \
    --cc=dwagner@suse.de \
    --cc=hch@lst.de \
    --cc=israelr@nvidia.com \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=oevron@nvidia.com \
    --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