[PATCH 7/8] nvme-fabrics: add option to disallow T10-PI offload
Israel Rukshin
israelr at nvidia.com
Thu Feb 1 02:40:42 PST 2024
On 1/23/2024 11:04 AM, Christoph Hellwig wrote:
> On Mon, Jan 22, 2024 at 04:28:53PM +0100, Daniel Wagner wrote:
>> On Mon, Jan 22, 2024 at 04:27:08PM +0100, Daniel Wagner wrote:
>>> On Mon, Jan 22, 2024 at 05:17:11PM +0200, Max Gurtovoy wrote:
>>>>> What about 'enable_pi' instead of the inverted boolean logic?
>>>> we can't change the default behavior (that is "enable" by default).
>>> But couldn't we just have
>>>
>>> enable_pi = true
>>>
>>> as default then? This should be the same as
>>>
>>> disallow_pi = false
>>>
>>> ?
>> Ah, I get it now. This interface doesn't work this way.
> The match_table_t infrastructure does allow checking for paramter
> values, including boolean ones. And this would indeed be a good
> use case for that. Extending the existing boolean only own
> flags to that would be nice as well.
Do you mean to do something like the bellow diff?
Regarding extending the existing boolean flags, are you talking about
hdr_digest, disable_sqflow, data_digest, discovery, duplicate_connect
and tls flags?
I will try to do it without breaking the existing nvmecli, but I am not
sure if it is possible.
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index aa88606a44c4..6467b32e5d50 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_ENABLE_PI, "enable_pi=%d" },
#endif
{ NVMF_OPT_ERR, NULL }
};
@@ -1020,6 +1024,13 @@ static int nvmf_parse_options(struct
nvmf_ctrl_options *opts,
}
opts->tls = true;
break;
+ case NVMF_OPT_ENABLE_PI:
+ if (match_int(args, &token)) {
+ ret = -EINVAL;
+ goto out;
+ }
+ opts->enable_pi = !!token;
+ break;
default:
pr_warn("unknown parameter or missing value
'%s' in ctrl creation request\n",
p);
--
More information about the Linux-nvme
mailing list