[PATCH nvmecli] fabrics: Add disallow_pi param to connect cmd

Max Gurtovoy mgurtovoy at nvidia.com
Mon Jan 22 07:33:40 PST 2024


From: Israel Rukshin <israelr at nvidia.com>

Add 'disallow_pi' to 'connect' command, so users can disallow
metadata offload support to save resources. When using the flag
on devices that support metadata offload, the NVMeOF driver
won't send metadata over the fabric (same behaviour as devices
that doesn't support T10-PI).

Usage examples:
nvme connect --disallow_pi --transport=rdma --traddr=10.0.1.1 --trsvcid=4420 --nqn=test-nvme
nvme connect -p -t rdma -a 10.0.1.1 -s 4420 -n test_nvme

Reviewed-by: Max Gurtovoy <mgurtovoy at nvidia.com>
Signed-off-by: Israel Rukshin <israelr at nvidia.com>
---

This patch is complementary to NVMe Kernel series:
"Enforce uniform metadata settings for ns head"

---
 fabrics.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fabrics.c b/fabrics.c
index dcae9aea..f3bfe09d 100644
--- a/fabrics.c
+++ b/fabrics.c
@@ -84,6 +84,7 @@ static const char *nvmf_disable_sqflow	= "disable controller sq flow control (de
 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_tls		= "enable TLS";
+static const char *nvmf_disallow_pi	= "disallow metadata (T10-PI) offload support";
 static const char *nvmf_config_file	= "Use specified JSON configuration file or 'none' to disable";
 static const char *nvmf_context		= "execution context identification string";
 
@@ -113,6 +114,7 @@ static const char *nvmf_context		= "execution context identification string";
 		OPT_FLAG("hdr-digest",        'g', &c.hdr_digest,         nvmf_hdr_digest),      \
 		OPT_FLAG("data-digest",       'G', &c.data_digest,        nvmf_data_digest),     \
 		OPT_FLAG("tls",                 0, &c.tls,                nvmf_tls),             \
+		OPT_FLAG("disallow_pi",       'p', &c.disallow_pi,        nvmf_disallow_pi),     \
 		__VA_ARGS__,                                                                     \
 		OPT_END()                                                                        \
 	}
-- 
2.18.2




More information about the Linux-nvme mailing list